# HG changeset patch # User hgs # Date 1285834553 -28800 # Node ID ab04909829435bd81314395974615bcce92e8e6b # Parent 2fee987ebaff3ffe3137b649146df6d188b992b2 201039 diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/aboutplugin/aboutplugin.pro --- a/controlpanelplugins/aboutplugin/aboutplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelplugins/aboutplugin/aboutplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -83,4 +83,6 @@ qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" -} \ No newline at end of file +} +symbian:MMP_RULES += SMPSAFE +# End of file --Don't remove this. diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/aboutplugin/t_aboutplugin/t_aboutplugin.pro --- a/controlpanelplugins/aboutplugin/t_aboutplugin/t_aboutplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelplugins/aboutplugin/t_aboutplugin/t_aboutplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -50,5 +50,5 @@ TARGET.UID3 = 0x2002BCD5 TARGET.CAPABILITY = CAP_APPLICATION AllFiles } - +symbian:MMP_RULES += SMPSAFE include(t_aboutplugin.pri) diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/data/cplanguagepluginlog.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/data/cplanguagepluginlog.conf Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,7 @@ +[CpLanguagePlugin] +logdatetime = 1 +logloggername = 1 +datetimeformat = hh:mm:ss +output = debugoutput fileoutput +fileoutput/logfile = C:/data/logs/cplanguageplugin.log +fileoutput/truncate = 0 diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/languageplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/languageplugin.pri Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,25 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: controlpanel project - common qmake settings +# + +HEADERS += src/cplanguageview.h \ + src/cplanguageplugin.h \ + src/cplanguagepluginutil.h \ + src/extendedlocaleutil.h + +SOURCES += src/cplanguageview.cpp \ + src/cplanguageplugin.cpp \ + src/cplanguagepluginutil.cpp \ + src/extendedlocaleutil.cpp diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/languageplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/languageplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,99 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = cplanguageplugin + +CONFIG += hb plugin + +include ( languageplugin.pri ) +include (rom/languageplugin_rom.pri) + +LIBS += -lcpframework +LIBS += -lstarterclient + +TRANSLATIONS = control_panel.ts + +CONFIG += debug_and_release + + +MOC_DIR = moc +OBJECT_DIR = obj +RCC_DIR = rcc + +# On win32 and mac, debug and release libraries are named differently. +# We must follow the debug and release settings Qt was compiled with: +# build debug iff Qt built debug, build release iff Qt built release. + +win32|mac { + !contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) { + CONFIG -= debug_and_release debug release + contains(QT_CONFIG,debug): CONFIG+=debug + contains(QT_CONFIG,release):CONFIG+=release + } +} + +CONFIG(debug, debug|release) { + SUBDIRPART = debug +} else { + SUBDIRPART = release +} + +win32 { + DESTDIR = C:/ControlPanel/$$SUBDIRPART/bin + OBJECTS_DIR = $$PWD/$$SUBDIRPART/tmp/$$TARGET + # add platfrom API for windows + INCLUDEPATH += $$PWD/../../../controlpanel_plat/inc +} + +# Add the output dirs to the link path too +LIBS += -L$$DESTDIR +LIBS += -lcplogger + +RESOURCES += languageplugin.qrc + +#DEFINES += ENABLE_CPLANG_LOG + +#For some reason the default include path doesn't include MOC_DIR on symbian +symbian { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger) + INCLUDEPATH += $$MOC_DIR + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.UID3 = 0X2002873C + + INCLUDEPATH += /sf/app/organizer/organizer_plat/clock_settingsview_plugin_api/inc +} + +symbian: plugin { # copy qtstub and manifest + + PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel + + deploy.path = C: + pluginstub.sources = $${TARGET}.dll + pluginstub.path = $$PLUGIN_STUB_PATH + DEPLOYMENT += pluginstub + + qtplugins.path = $$PLUGIN_STUB_PATH + qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin + + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" +} +symbian:MMP_RULES += SMPSAFE + +# End of file --Don't remove this. + diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/languageplugin.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/languageplugin.qrc Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,5 @@ + + + data/cplanguagepluginlog.conf + + \ No newline at end of file diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/layers.sysdef.xml Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,14 @@ + + +]> + + + + + + + + + + \ No newline at end of file diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/rom/languageplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/rom/languageplugin.iby Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __LANGUAGEPLUGIN_IBY__ +#define __LANGUAGEPLUGIN_IBY__ + +#include +#include + +file=ABI_DIR\BUILD_DIR\cplanguageplugin.dll SHARED_LIB_DIR\cplanguageplugin.dll + +data=\epoc32\data\c\resource\qt\plugins\controlpanel\cplanguageplugin.qtplugin resource\qt\plugins\controlpanel\cplanguageplugin.qtplugin + +#endif diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/rom/languageplugin_rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/rom/languageplugin_rom.pri Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,21 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +symbian { + BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include" \ + "rom/languageplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(languageplugin.iby)" +} \ No newline at end of file diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/cplanguageplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/cplanguageplugin.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "cplanguageplugin.h" +#include "cplanguageview.h" +#include +#include +#include +#include "cplanguagepluginlog.h" + + +#ifdef ENABLE_CPLANG_LOG + INIT_LOGGER (CPLANG_LOGGER_NAME,CPLANG_LOGGER_CONFIG_PATH) +#endif + +static QPointer g_pluginEntryItemData; + +/*! + * Constructor + */ +CpLanguagePlugin::CpLanguagePlugin() +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguagePlugin::CpLanguagePlugin") +} + +/*! + * Destructor + */ +CpLanguagePlugin::~CpLanguagePlugin() +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguagePlugin::~CpLanguagePlugin") +} + +/*! + * Overide CpPluginInterface::createSettingFormItemData + */ +QList CpLanguagePlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguagePlugin::createSettingFormItemData") + + g_pluginEntryItemData = new CpSettingFormEntryItemDataImpl( + CpSettingFormEntryItemData::ListEntryItem, + itemDataHelper, + hbTrId("txt_cp_dblist_language_and_region"), + QString(), + "qtg_large_language" ); + + updateEntryItem(); + + return QList() << g_pluginEntryItemData; +} + +/*! + * update the description of the entry item. + */ +void CpLanguagePlugin::updateEntryItem() +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguagePlugin::updateEntryItem") + + + if (g_pluginEntryItemData) { + QStringList allLanguages = HbLocaleUtil::supportedLanguages(); + QString currentLanguage = HbLocaleUtil::currentLanguage(); + + CPLANG_LOG(QLatin1String("Current language:") + currentLanguage); + + int index = allLanguages.indexOf(currentLanguage); + + CPLANG_LOG(QString("Index of current language: %1").arg(index)); + + QString localisedLanguage; + if (index >= 0) { + localisedLanguage = HbLocaleUtil::localisedLanguageName(currentLanguage); + CPLANG_LOG(QLatin1String("Localised Region:") + localisedLanguage); + } + g_pluginEntryItemData->setDescription(localisedLanguage); + } +} + +Q_EXPORT_PLUGIN2(cplanguageplugin, CpLanguagePlugin); + +//End of File diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/cplanguageplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/cplanguageplugin.h Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#ifndef CPLANGUAGEPLUGIN_H +#define CPLANGUAGEPLUGIN_H + +#include +#include +#include "cplanguageplugin_global.h" + +class CpLanguagePlugin : public QObject, public CpPluginInterface +{ + Q_OBJECT + Q_INTERFACES(CpPluginInterface) +public: + CpLanguagePlugin(); + virtual ~CpLanguagePlugin(); + virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; +public: + static void updateEntryItem(); +}; + +#endif // CPLANGUAGEPLUGIN_H + +//End of File diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/cplanguageplugin_global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/cplanguageplugin_global.h Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CPLANGUAGEPLUGIN_GLOBAL_H +#define CPLANGUAGEPLUGIN_GLOBAL_H + +#ifndef LANGUAGEPLUGIN_TEST + #define LANGUAGEPLUGIN_TEST_FRIEND_CLASS(aClassName) +#else + #define LANGUAGEPLUGIN_TEST_FRIEND_CLASS(aClassName) friend class aClassName; +#endif //LANGUAGEPLUGIN_TEST + +#endif // CPLANGUAGEPLUGIN_GLOBAL_H diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/cplanguagepluginlog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/cplanguagepluginlog.h Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CPLANGUAGEPLUGINLOG_H +#define CPLANGUAGEPLUGINLOG_H + +#include +#include + +#ifdef ENABLE_CPLANG_LOG + #define CPLANG_LOGGER_NAME QLatin1String("CpLanguagePlugin") + #define CPLANG_LOGGER_CONFIG_PATH QLatin1String(":/logconf/cplanguagepluginlog.conf") + + #define CPLANG_LOG(str) Logger::instance(CPLANG_LOGGER_NAME)->log(str); + #define CPLANG_LOG_FUNC_ENTRY(func) LogFunctionEntryHelper ___cplang_log_func_entry_helper(CPLANG_LOGGER_NAME,func); +#else + #define CPLANG_LOG(str) + #define CPLANG_LOG_FUNC_ENTRY(func) +#endif + +#endif + +//End of File + diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/cplanguagepluginutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/cplanguagepluginutil.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: utility class + * + */ +#include "cplanguagepluginutil.h" +#include +#include +#include "cplanguagepluginlog.h" +#include + +QStringList CpLanguagePluginUtil::localizedLanguageNames(const QStringList &languageNames) +{ + QStringList localizedLanguages; + + CPLANG_LOG("=================All languages======================="); + foreach(const QString &language,languageNames) { + CPLANG_LOG("Language: " + language + "\tLocalised:" + HbLocaleUtil::localisedLanguageName(language)); + localizedLanguages << HbLocaleUtil::localisedLanguageName(language); + } + CPLANG_LOG("======================================================"); + + return localizedLanguages; +} + +QStringList CpLanguagePluginUtil::localizedRegionNames(const QStringList ®ionNames) +{ + QStringList localizedRegions; + + CPLANG_LOG("=================All regions======================="); + foreach(const QString ®ion,regionNames) { + CPLANG_LOG("Region: " + region + "\tLocalised:" + HbLocaleUtil::localisedRegionName(region)); + localizedRegions << HbLocaleUtil::localisedRegionName(region); + } + CPLANG_LOG("==================================================="); + return localizedRegions; +} + +QStringList CpLanguagePluginUtil::localizedInputLanguageNames(const QList &inputLanguages) +{ + QStringList localizedInputLanguages; + + CPLANG_LOG("=================All Input languages======================="); + foreach (HbInputLanguage inputLanguage, inputLanguages) { + CPLANG_LOG("Input language:" + inputLanguage.asString() + "\tLocalised:" + inputLanguage.localisedName()); + if (inputLanguage == HbInputLanguage()) { + localizedInputLanguages << hbTrId("txt_cp_setlabel_secondary_writing_language_val_non"); + } + else { + localizedInputLanguages << inputLanguage.localisedName(); + } + } + CPLANG_LOG("============================================================"); + + return localizedInputLanguages; +} + +bool CpLanguagePluginUtil::isChineseVariant() +{ + QStringList supportedLanguages = HbLocaleUtil::supportedLanguages(); + foreach(const QString &language, supportedLanguages) { + if (QLocale(language).language() == QLocale::Chinese) { + CPLANG_LOG("Chinese Variant."); + return true; + } + } + return false; +} + +//End of File + diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/cplanguagepluginutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/cplanguagepluginutil.h Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: utility class + * + */ +#ifndef CPLANGUAGEPLUGINUTIL_H +#define CPLANGUAGEPLUGINUTIL_H + +#include +#include +#include + +class CpLanguagePluginUtil +{ +public: + static QStringList localizedLanguageNames(const QStringList &languageNames); + static QStringList localizedRegionNames(const QStringList ®ionNames); + static QStringList localizedInputLanguageNames(const QList &inputLanguages); + static bool isChineseVariant(); +private: + CpLanguagePluginUtil(); + Q_DISABLE_COPY(CpLanguagePluginUtil) +}; + +#endif + +//End of File diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/cplanguageview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/cplanguageview.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,558 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Language plugin view class + * + */ + +#include "cplanguageview.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "cplanguageplugin.h" +#include "cplanguagepluginlog.h" + +static int PRIMARY_INPUT_ITEM_INDEX = 0; +static int SECONDARY_INPUT_ITEM_INDEX = 1; +static int REGION_ITEM_INDEX = 2; + +/* + * Constructor + */ +CpLanguageView::CpLanguageView(QGraphicsItem *parent) : + CpBaseSettingView(0,parent), + mModel(0), + mCurrentLanguagePage(0), + mCurrentRegionItem(0), + mCurrentPrimaryInputLanguageItem(0), + mCurrentSecondaryInputLanguageItem(0), + mClockPluginLoader(0) +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::CpLanguageView") + + mChineseVariant = CpLanguagePluginUtil::isChineseVariant(); + if (mChineseVariant) { + PRIMARY_INPUT_ITEM_INDEX = 0; + SECONDARY_INPUT_ITEM_INDEX = -1; // no secondary writing language in Chinese variant + REGION_ITEM_INDEX = 1; + } + + HbDataForm *form = qobject_cast(widget()); + if (form) { + mModel = new HbDataFormModel; + + form->setHeading(hbTrId("txt_cp_subhead_display_language")); + form->setDescription(hbTrId("txt_cp_info_after_changign_deivce_language_device")); + + mLanguageRegionMapping = ExtendedLocaleUtil::localeMappings(true); + + mSupportedLanguages = HbLocaleUtil::supportedLanguages(); + QStringList localizedLanguages = CpLanguagePluginUtil::localizedLanguageNames(mSupportedLanguages); + + mSupportedRegions = HbLocaleUtil::supportedRegions(); + QStringList localizedRegions = CpLanguagePluginUtil::localizedRegionNames(mSupportedRegions); + + CPLANG_LOG ( QString("map count:%1").arg(mLanguageRegionMapping.count()) ); + CPLANG_LOG ( QString("support language count:%1").arg(mSupportedLanguages.count()) ); + CPLANG_LOG ( QString("support region count:%1").arg(mSupportedRegions.count()) ); + + HbInputUtils::listSupportedInputLanguages(mPrimaryInputLanguages); + QStringList localizedInputLanguages = CpLanguagePluginUtil::localizedInputLanguageNames(mPrimaryInputLanguages); + + QString currentLanguage = HbLocaleUtil::currentLanguage(); + + //prvious setting + mPreviousSetting.languageId = currentLanguage; + mPreviousSetting.regionId = HbLocaleUtil::currentRegion(); + mPreviousSetting.primaryWritingLan = HbInputSettingProxy::instance()->globalInputLanguage(); + mPreviousSetting.secondaryWritingLan = HbInputSettingProxy::instance()->globalSecondaryInputLanguage(); + + mCurrentSetting = mPreviousSetting; + + //update with current setting + if (LanguageRegionMapping *setting = languageRegionMapping(currentLanguage)) { + *setting = mCurrentSetting; + } + + for (int index = 0; index < mLanguageRegionMapping.count();index++) { + const LanguageRegionMapping &setting = mLanguageRegionMapping.at(index); + HbDataFormModelItem *languageAndRegionPage = mModel->appendDataFormPage( HbLocaleUtil::localisedLanguageName(setting.languageId) ); + mLanguagePages.append(languageAndRegionPage); + + /* + * Create primary writing language item. + */ + HbDataFormModelItem *primaryInputLanguageItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_cp_setlabel_primary_writing_language")); + + + int primaryInputLanguageIndex = mPrimaryInputLanguages.indexOf(setting.primaryWritingLan); + + CPLANG_LOG(QLatin1String("Primary input Language:") + setting.primaryWritingLan.asString()); + CPLANG_LOG(QString("Index of primary input language: %1").arg(primaryInputLanguageIndex)); + + fillDataFormComboBoxItem(primaryInputLanguageItem,localizedInputLanguages,primaryInputLanguageIndex); + + form->addConnection(primaryInputLanguageItem, SIGNAL(currentIndexChanged (int)), + this,SLOT(onPrimaryInputLanguageChanged(int))); + languageAndRegionPage->appendChild(primaryInputLanguageItem); + + /* + * Create secondary writing language item. + * (No secondary writing language for Chinese variant) + */ + if (!mChineseVariant) { + HbDataFormModelItem *secondaryInputLanguageItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_cp_setlabel_secondary_writing_language")); + + form->addConnection(secondaryInputLanguageItem, SIGNAL(currentIndexChanged (int)), + this,SLOT(onSecondaryInputLanguageChanged(int))); + languageAndRegionPage->appendChild(secondaryInputLanguageItem); + } + + /* + * Create region item. + */ + HbDataFormModelItem *regionItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, + hbTrId("Region")); + + int regionIndex = mSupportedRegions.indexOf(setting.regionId); + + CPLANG_LOG(QLatin1String("Current region:") + setting.regionId); + CPLANG_LOG(QString("Index of current region: %1").arg(regionIndex)); + + fillDataFormComboBoxItem(regionItem,localizedRegions,regionIndex); + + form->addConnection(regionItem, SIGNAL(currentIndexChanged (int)), + this,SLOT(onRegionChanged(int))); + languageAndRegionPage->appendChild(regionItem); + + if (mSupportedLanguages.at(index) == currentLanguage) { + mCurrentLanguagePage = languageAndRegionPage; + mCurrentRegionItem = mCurrentLanguagePage->childAt(REGION_ITEM_INDEX); + mCurrentPrimaryInputLanguageItem = mCurrentLanguagePage->childAt(PRIMARY_INPUT_ITEM_INDEX); + mCurrentSecondaryInputLanguageItem = mCurrentLanguagePage->childAt(SECONDARY_INPUT_ITEM_INDEX); + } + } + + // update secondary input language item according to primary input language + updateSecondaryInputLanguageItem(); + + /* + * Create region settings item. + */ + HbDataFormModelItem *regionalSettingsItem = new HbDataFormModelItem( + static_cast(CpSettingFormEntryItemData::ButtonEntryItem)); + regionalSettingsItem->setContentWidgetData("text",hbTrId("txt_cp_button_regional_settings")); + regionalSettingsItem->setContentWidgetData("textAlignment", + QVariant(Qt::AlignHCenter | Qt::AlignVCenter)); + form->addConnection(regionalSettingsItem,SIGNAL(clicked()), + this,SLOT(launchRegionalSettingsView())); + + mModel->appendDataFormItem(regionalSettingsItem); + + form->setModel(mModel); + // active current language page + form->setExpanded(mModel->indexFromItem(mCurrentLanguagePage),true); + + + /* + * observe input language changed event + */ + connect(HbInputSettingProxy::instance(), + SIGNAL(globalInputLanguageChanged(HbInputLanguage)), + this, + SLOT(onPrimaryInputLanguageChanged(HbInputLanguage))); + + connect(HbInputSettingProxy::instance(), + SIGNAL(globalSecondaryInputLanguageChanged(HbInputLanguage)), + this, + SLOT(onSecondaryInputLanguageChanged(HbInputLanguage))); + + connect(form, + SIGNAL(activated(QModelIndex)), + this, + SLOT(onDataFormItemActivated(QModelIndex))); + + } +} + +/* + * Destructor + */ +CpLanguageView::~CpLanguageView() +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::~CpLanguageView") + // Unload RegionalSettingsView plugin + if (mClockPluginLoader) { + mClockPluginLoader->unload(); + delete mClockPluginLoader; + } + delete mModel; +} + +/*! + * Handle region changed + */ +void CpLanguageView::onRegionChanged(int index) +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::onRegionChanged") + + CPLANG_LOG(QLatin1String("Before change region:") + HbLocaleUtil::currentRegion()); + + if (index >= 0 && index < mSupportedRegions.count()) { + HbLocaleUtil::changeRegion( mSupportedRegions.at(index) ); + mCurrentSetting.regionId = mSupportedRegions.at(index); + if (LanguageRegionMapping *setting = languageRegionMapping(mCurrentSetting.languageId)) { + setting->regionId = mCurrentSetting.regionId; + } + + CPLANG_LOG(QLatin1String("After change region:") + HbLocaleUtil::currentRegion()); + } +} + + +/* + * prompt user to restart device. + */ +bool CpLanguageView::promptRestart() +{ + HbDeviceMessageBox messageBox( + hbTrId("txt_cp_text_edit_device_will_be_restarted_to_chang"), + HbMessageBox::MessageTypeQuestion, this); + + QString okText = hbTrId("txt_cp_button_restart"); + QString cancelText = hbTrId("txt_cp_button_discard_changes"); + messageBox.setAction(new QAction(okText,&messageBox), + HbDeviceMessageBox::AcceptButtonRole); + messageBox.setAction(new QAction(cancelText,&messageBox), + HbDeviceMessageBox::RejectButtonRole); + messageBox.setIconVisible(false); + + return (messageBox.exec() + == messageBox.action(HbDeviceMessageBox::AcceptButtonRole) ); +} + +/*! + * Handle primary language changed. + */ +void CpLanguageView::onPrimaryInputLanguageChanged(int index) +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::onPrimaryInputLanguageChanged(int index)") + + CPLANG_LOG(QLatin1String("Before change primary input language:") + HbInputSettingProxy::instance()->globalInputLanguage().asString()); + + if (index >= 0 && index < mPrimaryInputLanguages.count()) { + HbInputLanguage inputLanguage = mPrimaryInputLanguages.at(index); + if (inputLanguage != HbInputSettingProxy::instance()->globalInputLanguage()) { + HbInputSettingProxy::instance()->setGlobalInputLanguage(inputLanguage); + mCurrentSetting.primaryWritingLan = inputLanguage; + if (LanguageRegionMapping *setting = languageRegionMapping(mCurrentSetting.languageId)) { + setting->primaryWritingLan = mCurrentSetting.primaryWritingLan; + } + + updateSecondaryInputLanguageItem(); + CPLANG_LOG(QLatin1String("After change primary input language:") + HbInputSettingProxy::instance()->globalInputLanguage().asString()); + } + } +} + +/*! + * Handle secondary language changed. + */ +void CpLanguageView::onSecondaryInputLanguageChanged(int index) +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::onSecondaryInputLanguageChanged(int index)") + + CPLANG_LOG(QLatin1String("Before change secondary input language:") + HbInputSettingProxy::instance()->globalSecondaryInputLanguage().asString()); + + if (index >= 0 && index < mSecondaryInputLanguages.count()) { + HbInputLanguage inputLanguage = mSecondaryInputLanguages.at(index); + if (inputLanguage != HbInputSettingProxy::instance()->globalSecondaryInputLanguage() ) { + HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(inputLanguage); + mCurrentSetting.secondaryWritingLan = inputLanguage; + if (LanguageRegionMapping *setting = languageRegionMapping(mCurrentSetting.languageId)) { + setting->secondaryWritingLan = mCurrentSetting.secondaryWritingLan; + } + + CPLANG_LOG(QLatin1String("After change secondary input language:") + HbInputSettingProxy::instance()->globalSecondaryInputLanguage().asString()); + } + } +} + +/*! + * Observe primary input language changed event and update the ui, if it is being changed from outside of this plugin + */ +void CpLanguageView::onPrimaryInputLanguageChanged(const HbInputLanguage &inputLanguage) +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::onPrimaryInputLanguageChanged(const HbInputLanguage &inputLanguage)") + if (mCurrentPrimaryInputLanguageItem) { + int index = mPrimaryInputLanguages.indexOf(inputLanguage); + if (index != mCurrentPrimaryInputLanguageItem->contentWidgetData("currentIndex").toInt() ) { + CPLANG_LOG( QString("New Index: %1").arg(index) ) + + mCurrentSetting.primaryWritingLan = inputLanguage; + mCurrentPrimaryInputLanguageItem->setContentWidgetData("currentIndex",index); + updateSecondaryInputLanguageItem(); + } + } +} + +/*! + * Observe secondary input language changed event and update the ui, if it is being changed from outside of this plugin + */ +void CpLanguageView::onSecondaryInputLanguageChanged(const HbInputLanguage &inputLanguage) +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::onSecondaryInputLanguageChanged(const HbInputLanguage &inputLanguage)") + + if (mCurrentSecondaryInputLanguageItem) { + int index = mSecondaryInputLanguages.indexOf(inputLanguage); + if (index != mCurrentSecondaryInputLanguageItem->contentWidgetData("currentIndex").toInt()) { + CPLANG_LOG( QString("New Index: %1").arg(index) ) + mCurrentSetting.secondaryWritingLan = inputLanguage; + mCurrentSecondaryInputLanguageItem->setContentWidgetData("currentIndex",index); + } + } +} + + +/*! + * Fill contents in the data form model items. + * \param comboBoxItem a data form model item whose type is HbDataFormModelItem::ComboBoxItem + * \param items items showing in the combobox + * \param currentIndex index of the selected item + */ +void CpLanguageView::fillDataFormComboBoxItem(HbDataFormModelItem *comboBoxItem, + const QStringList &items, + int currentIndex /*= -1*/) +{ + Q_ASSERT(comboBoxItem); + Q_ASSERT(comboBoxItem->type() == HbDataFormModelItem::ComboBoxItem); + + comboBoxItem->setContentWidgetData("items", items); + comboBoxItem->setContentWidgetData("currentIndex",currentIndex); +} + +/*! + * Update secondary input language item according to primary input language + */ +void CpLanguageView::updateSecondaryInputLanguageItem() +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::updateSecondaryInputLanguageItem") + + // no secondary writing language in Chinese variant. + if (mChineseVariant) { + return; + } + + HbInputLanguage primaryInputLanguage = HbInputSettingProxy::instance()->globalInputLanguage(); + + mSecondaryInputLanguages.clear(); + // append a "none set" item + mSecondaryInputLanguages.append(HbInputLanguage()); + + // Chinese input doesn't have secondary input language + if (primaryInputLanguage.language() == QLocale::Chinese) { + HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(HbInputLanguage()); + CPLANG_LOG("Primary input language: Chinese"); + } + else { + foreach(const HbInputLanguage &inputLanguage,mPrimaryInputLanguages) { + if ( inputLanguage != primaryInputLanguage // Secondary input language can't be set the same as primary input language + && inputLanguage.language() != QLocale::Chinese) { // Chinese input can't be set as secondary input language + mSecondaryInputLanguages.append(inputLanguage); + } + } + } + + QStringList localisedNames = CpLanguagePluginUtil::localizedInputLanguageNames(mSecondaryInputLanguages); + + // if the secondary input language is the same as primary input language, set it as "none set" + HbInputLanguage secondaryInputLanguage = HbInputSettingProxy::instance()->globalSecondaryInputLanguage(); + + if (secondaryInputLanguage == primaryInputLanguage) { + secondaryInputLanguage = HbInputLanguage(); + HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(HbInputLanguage()); + + CPLANG_LOG("secondary == primary, set secondary input as \"None\""); + } + + mCurrentSetting.secondaryWritingLan = secondaryInputLanguage; + if (LanguageRegionMapping *setting = languageRegionMapping(mCurrentSetting.languageId)) { + setting->secondaryWritingLan = mCurrentSetting.secondaryWritingLan; + } + + fillDataFormComboBoxItem(mCurrentSecondaryInputLanguageItem,localisedNames,mSecondaryInputLanguages.indexOf(secondaryInputLanguage)); +} + +/*! + * Restart the device. + */ +int CpLanguageView::restartDevice() +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::restartDevice") +#ifdef Q_OS_SYMBIAN + RStarterSession session; + TInt error = session.Connect(); + + if (error == KErrNone) { + session.Reset( RStarterSession::ELanguageSwitchReset ); + session.Close(); + } + + return error; +#else + return 0; +#endif +} + +/*! + Launch the regional settings view. + */ +void CpLanguageView::launchRegionalSettingsView() +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::launchRegionalSettingsView") + + //Load the clock settings view plugin if it is not loaded + if (!mClockPluginLoader) { + QDir dir(CLOCK_SETTINGSVIEW_PLUGIN_PATH); + QString pluginName = dir.absoluteFilePath(CLOCK_SETTINGSVIEW_PLUGIN_NAME); + mClockPluginLoader = new QPluginLoader(pluginName); + mClockPluginLoader->load(); + } + + //Launch the settings view + ClockSettingsViewInterface *clockSettingsViewInterface + = qobject_cast(mClockPluginLoader->instance()); + if (clockSettingsViewInterface) { + clockSettingsViewInterface->launchRegionalSettingsView(); + } + else { + CPLANG_LOG("Load clocksettingsviewplugin failed."); + } +} + +/*! + * handle data form page changed event + */ +void CpLanguageView::onDataFormItemActivated(const QModelIndex &modelIndex) +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::onDataFormItemActivated") + + mCurrentLanguagePage = mModel->itemFromIndex(modelIndex); + + mCurrentRegionItem = mCurrentLanguagePage->childAt(REGION_ITEM_INDEX); + mCurrentPrimaryInputLanguageItem = mCurrentLanguagePage->childAt(PRIMARY_INPUT_ITEM_INDEX); + mCurrentSecondaryInputLanguageItem = mCurrentLanguagePage->childAt(SECONDARY_INPUT_ITEM_INDEX); + + int index = mLanguagePages.indexOf(mCurrentLanguagePage); + + if (index >= 0) { + QString newLanguage = mSupportedLanguages.at(index); + LanguageRegionMapping *setting = languageRegionMapping(newLanguage); + if (setting) { + setting->secondaryWritingLan = HbInputSettingProxy::instance()->globalSecondaryInputLanguage(); + mCurrentSetting = *setting; + + HbLocaleUtil::changeRegion(mCurrentSetting.regionId); + HbInputSettingProxy::instance()->setGlobalInputLanguage(mCurrentSetting.primaryWritingLan); + + //update combobox + mCurrentPrimaryInputLanguageItem->setContentWidgetData("currentIndex",mPrimaryInputLanguages.indexOf(mCurrentSetting.primaryWritingLan)); + mCurrentRegionItem->setContentWidgetData("currentIndex",mSupportedRegions.indexOf(mCurrentSetting.regionId)); + + CPLANG_LOG(QString("Primary writing:") + HbInputSettingProxy::instance()->globalInputLanguage().asString()); + CPLANG_LOG(QString("Secondary writing:") + HbInputSettingProxy::instance()->globalSecondaryInputLanguage().asString()); + + updateSecondaryInputLanguageItem(); + } + } + +} + +/*! + * From CpBaseSettingView, prompt user to restart device before exiting the view + */ +void CpLanguageView::close() +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::close()") + + CPLANG_LOG( QString("mCurrentSetting.languageId :") + mCurrentSetting.languageId ) + CPLANG_LOG( QString("HbLocaleUtil::currentLanguage():") + HbLocaleUtil::currentLanguage() ) + + if (mCurrentSetting.languageId != HbLocaleUtil::currentLanguage()) { + // apply new settings + if (promptRestart()) { + HbLocaleUtil::changeLocale(mCurrentSetting.languageId); + + /* + * change other settings. + */ + if (mSupportedRegions.contains(mCurrentSetting.regionId,Qt::CaseInsensitive)) { + HbLocaleUtil::changeRegion(mCurrentSetting.regionId); + } + CpLanguagePlugin::updateEntryItem(); + HbInputSettingProxy::instance()->setGlobalInputLanguage(mCurrentSetting.primaryWritingLan); + HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(mCurrentSetting.secondaryWritingLan); + + restartDevice(); + } + // restore previous values + else { + if (mCurrentSetting.regionId != mPreviousSetting.regionId) { + HbLocaleUtil::changeRegion(mPreviousSetting.regionId); + } + if (mCurrentSetting.primaryWritingLan != mPreviousSetting.primaryWritingLan) { + HbInputSettingProxy::instance()->setGlobalInputLanguage(mPreviousSetting.primaryWritingLan); + } + if (mCurrentSetting.secondaryWritingLan != mPreviousSetting.secondaryWritingLan) { + HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(mPreviousSetting.secondaryWritingLan); + } + } + } + + CpBaseSettingView::close(); +} + +/*! + * get the language-region mapping table + */ +LanguageRegionMapping *CpLanguageView::languageRegionMapping(const QString &language) +{ + CPLANG_LOG_FUNC_ENTRY("CpLanguageView::languageRegionMapping(const QString &language)") + + foreach(const LanguageRegionMapping &setting,mLanguageRegionMapping) { + if (setting.languageId.compare(language,Qt::CaseInsensitive) == 0) { + return const_cast(&setting); + } + } + + CPLANG_LOG("Not found.") + + return 0; +} + +//End of File diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/cplanguageview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/cplanguageview.h Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Language plugin view class + * + */ +#ifndef CPLANGUAGEVIEW_H +#define CPLANGUAGEVIEW_H + +#include +#include +#include +#include +#include "cplanguagepluginutil.h" +#include "extendedlocaleutil.h" +#include "cplanguageplugin_global.h" + +class QStringList; +class QPluginLoader; +class HbDataFormModel; +class HbDataFormModelItem; +class HbInputLanguage; +class QModelIndex; + +class CpLanguageView : public CpBaseSettingView +{ + Q_OBJECT +public: + explicit CpLanguageView(QGraphicsItem *parent = 0); + virtual ~CpLanguageView(); + +private slots: + //handle combobox index changes + void onRegionChanged(int index); + void onPrimaryInputLanguageChanged(int index); + void onSecondaryInputLanguageChanged(int index); + + //observe input language changed event + void onPrimaryInputLanguageChanged(const HbInputLanguage &inputLanguage); + void onSecondaryInputLanguageChanged(const HbInputLanguage &inputLanguage); + + //launch regional setting view + void launchRegionalSettingsView(); + + //handle data form page changed event + void onDataFormItemActivated(const QModelIndex &modelIndex); +protected: + //From CpBaseSettingView + virtual void close(); +private: + void fillDataFormComboBoxItem(HbDataFormModelItem *comboBoxItem, + const QStringList &items, int currentIndex = -1); + void updateSecondaryInputLanguageItem(); + bool promptRestart(); + int restartDevice(); + LanguageRegionMapping *languageRegionMapping(const QString &language); +private: + QList mLanguageRegionMapping; + + LanguageRegionMapping mPreviousSetting; + LanguageRegionMapping mCurrentSetting; + + HbDataFormModel *mModel; + + QList mLanguagePages; + HbDataFormModelItem *mCurrentLanguagePage; + + //Current items + HbDataFormModelItem *mCurrentRegionItem; + HbDataFormModelItem *mCurrentPrimaryInputLanguageItem; + HbDataFormModelItem *mCurrentSecondaryInputLanguageItem; + + QList mPrimaryInputLanguages; + QList mSecondaryInputLanguages; + QStringList mSupportedLanguages; + QStringList mSupportedRegions; + + QPluginLoader *mClockPluginLoader; + + bool mChineseVariant; + + LANGUAGEPLUGIN_TEST_FRIEND_CLASS(TestLanguagePlugin) +}; +#endif //CPLANGUAGEVIEW_H diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/extendedlocaleutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/extendedlocaleutil.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,157 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#include "extendedlocaleutil.h" + +#if defined(Q_OS_SYMBIAN) +#include +#include +#include + +#define LANGUAGE_LIST_FILE "/resource/hbi18n/translations/language_list.txt" +#define LANGUAGE_MAPPINGS_FILE "/resource/hbi18n/translations/locale_mappings.txt" +#endif // Q_OS_SYMBIAN + +#include "cplanguagepluginlog.h" + +/*! + @beta + @hbcore + \class ExtendedLocaleUtil + \brief ExtendedLocaleUtil provides mappings needed for Control Panel plugin which are not available through HbLocaleUtil class. +*/ + + +/*! + \brief Return list of language, region, collation and writing language mappings. + + \attention Symbian specific API + + \return a list containing mapped locale properties +*/ + +//#define __TESTCODE__ + +QList ExtendedLocaleUtil::localeMappings(bool onlySupported) +{ + CPLANG_LOG_FUNC_ENTRY("ExtendedLocaleUtil::localeMappings") + + QList mps = allLocaleMappings(); + + if (!onlySupported) { + return mps; + } + + QList supportedmps; + + QStringList supportedLanguages = HbLocaleUtil::supportedLanguages(); + QStringList supportedRegions = HbLocaleUtil::supportedRegions(); + + foreach (const QString &language,supportedLanguages) { + LanguageRegionMapping *found = 0; + for (int i = 0; i < mps.count();i++) { + if (mps.at(i).languageId == language) { + found = const_cast(&mps.at(i)); + break; + } + } + if (found) { + supportedmps.append(*found); + } + else { + LanguageRegionMapping map; + map.languageId = language; + map.primaryWritingLan = HbInputLanguage(QLocale(language).language()); + } + + } + + return supportedmps; +} + +QList ExtendedLocaleUtil::allLocaleMappings() +{ + CPLANG_LOG_FUNC_ENTRY("ExtendedLocaleUtil::allLocaleMappings") + + QList mps; + +#if defined(Q_OS_SYMBIAN) + + QString path = "c:"; + path += QString(LANGUAGE_MAPPINGS_FILE); + QFile* file = new QFile(path); + if (!file->exists() ) { + path = "z:"; + path += QString(LANGUAGE_MAPPINGS_FILE); + delete file; + file = new QFile(path); + } + if (!file->open(QIODevice::ReadOnly | QIODevice::Text)) { + delete file; + return mps; + } + + QTextStream in(file); + while (!in.atEnd()) { + QString line = in.readLine(256); + if (!line.isEmpty()) { + QStringList list = line.split(',', QString::SkipEmptyParts); + if (list.count() < 7) { + continue; + } + + QString strCode = list[0]; + QString lanName = list[4]; + QString region = list[5]; + QString collation = list[6]; + + bool ok; + int code = strCode.toUInt(&ok); + if (!ok) { + continue; + } + + QString lanPart = (lanName.indexOf('_')>0) ? lanName.left(lanName.indexOf('_')) : lanName; + QString regPart = (region.indexOf('_')>0) ? region.left(region.indexOf('_')) : region; + QLocale loc = QLocale(QString(lanPart+'_'+regPart)); + HbInputLanguage primaryWriting = HbInputLanguage(loc.language(), loc.country()); + HbInputLanguage secondaryWriting = HbInputLanguage(QLocale::English, QLocale::UnitedKingdom); + + LanguageRegionMapping map; + map.languageId = lanName; + map.regionId = region; + map.collationId = collation; + map.primaryWritingLan = primaryWriting; + map.secondaryWritingLan = secondaryWriting; + mps.append(map); + + } + } + delete file; + +#endif // Q_OS_SYMBIAN + + + return mps; +} diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/src/extendedlocaleutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/extendedlocaleutil.h Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Language plugin view class + * + */ + +/* + * extendedlocaleutil.h + * + * Created on: 24.8.2010 + * Author: mhujanen + */ + +#ifndef EXTENDEDLOCALEUTIL_H_ +#define EXTENDEDLOCALEUTIL_H_ + +#include +#include + +/* + * Temporary class. + * will be replaced by function added in HbLocaleUtil in future. + * + * */ + +struct LanguageRegionMapping + { + QString languageId; + QString regionId; + QString collationId; + HbInputLanguage primaryWritingLan; + HbInputLanguage secondaryWritingLan; + }; + +class ExtendedLocaleUtil : public HbLocaleUtil + { + public: + static QList localeMappings(bool onlySupported); + private: + static QList allLocaleMappings(); + }; + +#endif /* EXTENDEDLOCALEUTIL_H_ */ diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/t_languageplugin/inc/t_languageplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/t_languageplugin/inc/t_languageplugin.h Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main test class for Control Panel's Language plugin +* +*/ + +#ifndef TESTLANGUAGEPLUGIN_H +#define TESTLANGUAGEPLUGIN_H + +#include +#include + +class CpLanguagePlugin; +class CpLanguageView; +class CpSettingFormEntryItemData; +class HbMainWindow; + +/** +* TestLanguagePlugin +*/ +class TestLanguagePlugin : public QObject +{ + Q_OBJECT + +private slots: + void init(); + void cleanup(); + // Test cases start from here + // CpLanguagePlugin + void test_CpLanguagePlugin_createSettingFormItemData(); + void test_CpLanguagePlugin_updateEntryItem(); + + void test_ExtendedLocaleUtil_localeMappings(); + + void test_CpLanguagePluginUtil_localizedLanguageNames(); + void test_CpLanguagePluginUtil_localizedRegionNames(); + void test_CpLanguagePluginUtil_localizedInputLanguageNames(); + void test_CpLanguagePluginUtil_isChineseVariant(); + + void test_CpLanguageView_new(); + void test_CpLanguageView_onRegionChanged(); + void test_CpLanguageView_onPrimaryInputLanguageChanged(); + void test_CpLanguageView_onSecondaryInputLanguageChanged(); + void test_CpLanguageView_onPrimaryInputLanguageChanged2(); + void test_CpLanguageView_onSecondaryInputLanguageChanged2(); + void test_CpLanguageView_launchRegionalSettingsView(); + void test_CpLanguageView_onDataFormItemActivated(); + void test_CpLanguageView_close(); + void test_CpLanguageView_fillDataFormComboBoxItem(); + void test_CpLanguageView_updateSecondaryInputLanguageItem(); + void test_CpLanguageView_promptRestart(); + void test_CpLanguageView_restartDevice(); + void test_CpLanguageView_languageRegionMapping(); + +private: + HbMainWindow *mMainWindow; + CpLanguagePlugin* mPlugin; + CpLanguageView* mView; + CpSettingFormEntryItemData *mEntryItemData; + +}; + +#endif // T_CPLANGUAGEPLUGIN_H diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/t_languageplugin/src/t_languageplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/t_languageplugin/src/t_languageplugin.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,389 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main test class for Control Panel's Language plugin. +* +*/ + +#include "t_languageplugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "cplanguageplugin.h" +#include "extendedlocaleutil.h" +#include "cplanguageview.h" +#include "cplanguagepluginutil.h" + +/*! + Initialize test case. + Called before each testfunction is executed. +*/ +void TestLanguagePlugin::init() +{ + mMainWindow = new HbMainWindow(); + QVERIFY(mMainWindow); + + mPlugin = new CpLanguagePlugin; + QVERIFY(mPlugin); + // Note: we get different values for condition coverage of CpLanguageView() + // depending on which values have been selected in Control Panel settings. + mView = new CpLanguageView(); + QVERIFY(mView); + + CpItemDataHelper itemDataHelper; + QList itemData = mPlugin->createSettingFormItemData(itemDataHelper); + mEntryItemData = qobject_cast(itemData.front()); +} + +/*! + Cleanup test case. + Called after every testfunction. +*/ +void TestLanguagePlugin::cleanup() +{ + delete mView; + mView = 0; + + delete mPlugin; + mPlugin = 0; + + delete mEntryItemData; + mEntryItemData = 0; + + delete mMainWindow; + mMainWindow = 0; +} + +/* --------------------------------------------------------------------------- + * Unit test cases + * ---------------------------------------------------------------------------*/ + +/*! + * test CpLanguagePlugin::createSettingFormItemData + */ +void TestLanguagePlugin::test_CpLanguagePlugin_createSettingFormItemData() +{ + CpItemDataHelper itemDataHelper; + QList itemData = mPlugin->createSettingFormItemData(itemDataHelper); + QVERIFY(itemData.count() == 1); + + CpSettingFormEntryItemData *entryItemData = qobject_cast(itemData.front()); + QVERIFY(entryItemData != 0); + QVERIFY(entryItemData->type() == static_cast(CpSettingFormEntryItemData::ListEntryItem) ); +} + +/*! + * test CpLanguagePlugin::updateEntryItem + */ +void TestLanguagePlugin::test_CpLanguagePlugin_updateEntryItem() +{ + CpLanguagePlugin::updateEntryItem(); + + QString localisedLanguage = HbLocaleUtil::localisedLanguageName(HbLocaleUtil::currentLanguage()); + + QVERIFY(mEntryItemData->description() == localisedLanguage); +} + +/*! + * test ExtendedLocaleUtil::localeMappings + */ +void TestLanguagePlugin::test_ExtendedLocaleUtil_localeMappings() +{ + QList allMaps = ExtendedLocaleUtil::localeMappings(false); + QVERIFY(allMaps.count() > 0); + + QList supportedMaps = ExtendedLocaleUtil::localeMappings(true); + QVERIFY(supportedMaps.count() > 0); + + QVERIFY(allMaps.count() >= supportedMaps.count()); +} + +/*! + * test CpLanguagePluginUtil::localizedLanguageNames + */ +void TestLanguagePlugin::test_CpLanguagePluginUtil_localizedLanguageNames() +{ + QStringList supportLanguages = HbLocaleUtil::supportedLanguages(); + QStringList localisedLanguages = CpLanguagePluginUtil::localizedLanguageNames(supportLanguages); + + QVERIFY (supportLanguages.count() == localisedLanguages.count()); +} + +/*! + * test CpLanguagePluginUtil::localizedRegionNames + */ +void TestLanguagePlugin::test_CpLanguagePluginUtil_localizedRegionNames() +{ + QStringList supportedRegions = HbLocaleUtil::supportedRegions(); + QStringList localisedRegions = CpLanguagePluginUtil::localizedRegionNames(supportedRegions); + + QVERIFY (supportedRegions.count() == localisedRegions.count()); +} + +/* + * test CpLanguagePluginUtil::localizedInputLanguageNames + */ +void TestLanguagePlugin::test_CpLanguagePluginUtil_localizedInputLanguageNames() +{ + QList supportedInputLanguages; + HbInputUtils::listSupportedInputLanguages(supportedInputLanguages); + + QStringList localisedInputLanguages = CpLanguagePluginUtil::localizedInputLanguageNames(supportedInputLanguages); + QVERIFY(supportedInputLanguages.count() == localisedInputLanguages.count()); +} + +/*! + * test CpLanguagePluginUtil::isChineseVariant + */ +void TestLanguagePlugin::test_CpLanguagePluginUtil_isChineseVariant() +{ + bool isChineseVariant = CpLanguagePluginUtil::isChineseVariant(); + + QStringList supportedLanguages = HbLocaleUtil::supportedLanguages(); + foreach(const QString &language, supportedLanguages) { + if (QLocale(language).language() == QLocale::Chinese) { + QVERIFY (isChineseVariant); + return; + } + } + + QVERIFY (!isChineseVariant); +} + +/*! + * test new CpLanguageView + */ +void TestLanguagePlugin::test_CpLanguageView_new() +{ + CpLanguageView* view = new CpLanguageView(); + QVERIFY(view != 0); + delete view; +} + +/*! + * test CpLanguageView::onRegionChanged(int index) + */ +void TestLanguagePlugin::test_CpLanguageView_onRegionChanged() +{ + QString oldRegion = HbLocaleUtil::currentRegion(); + + QStringList allRegions = mView->mSupportedRegions; + QVERIFY(allRegions.count() > 0); + + for(int i = 0; i < allRegions.count();i++) { + if (!allRegions.at(i).trimmed().isEmpty()) { + mView->onRegionChanged(i); + QVERIFY(HbLocaleUtil::currentRegion() == allRegions.at(i)); + } + } + + HbLocaleUtil::changeRegion(oldRegion); + QVERIFY(HbLocaleUtil::currentRegion() == oldRegion); + + mView->onRegionChanged(-1); + QVERIFY(HbLocaleUtil::currentRegion() == oldRegion); + + mView->onRegionChanged(allRegions.count()); + QVERIFY(HbLocaleUtil::currentRegion() == oldRegion); +} + +/*! + * test CpLanguageView::onPrimaryInputLanguageChanged(int index) + */ +void TestLanguagePlugin::test_CpLanguageView_onPrimaryInputLanguageChanged() +{ + HbInputLanguage oldPrimaryInputLanguage = HbInputSettingProxy::instance()->globalInputLanguage(); + + QList supportedInputLanguages = mView->mPrimaryInputLanguages; + + QVERIFY(supportedInputLanguages.count() > 0); + for (int i = 0; i < supportedInputLanguages.count();i++) { + mView->onPrimaryInputLanguageChanged(i); + QVERIFY(HbInputSettingProxy::instance()->globalInputLanguage() == supportedInputLanguages.at(i)); + } + + HbInputSettingProxy::instance()->setGlobalInputLanguage(oldPrimaryInputLanguage); + QVERIFY(HbInputSettingProxy::instance()->globalInputLanguage() == oldPrimaryInputLanguage); + + mView->onPrimaryInputLanguageChanged(-1); + QVERIFY(HbInputSettingProxy::instance()->globalInputLanguage() == oldPrimaryInputLanguage); + + mView->onPrimaryInputLanguageChanged(supportedInputLanguages.count()); + QVERIFY(HbInputSettingProxy::instance()->globalInputLanguage() == oldPrimaryInputLanguage); +} + +/*! + * test CpLanguageView::onSecondaryInputLanguageChanged(int index) + */ +void TestLanguagePlugin::test_CpLanguageView_onSecondaryInputLanguageChanged() +{ + HbInputLanguage primaryInputLanguage = HbInputSettingProxy::instance()->globalInputLanguage(); + HbInputLanguage oldSecondaryInputLanguage = HbInputSettingProxy::instance()->globalSecondaryInputLanguage(); + + QList supportedInputLanguages = mView->mSecondaryInputLanguages; + + QVERIFY(supportedInputLanguages.count() > 0); + for (int i = 0; i < supportedInputLanguages.count();i++) { + if ( supportedInputLanguages.at(i) != primaryInputLanguage) { + mView->onSecondaryInputLanguageChanged(i); + QVERIFY(HbInputSettingProxy::instance()->globalSecondaryInputLanguage() == supportedInputLanguages.at(i)); + } + } + + HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(oldSecondaryInputLanguage); + QVERIFY(HbInputSettingProxy::instance()->globalSecondaryInputLanguage() == oldSecondaryInputLanguage); + + mView->onSecondaryInputLanguageChanged(-1); + QVERIFY(HbInputSettingProxy::instance()->globalSecondaryInputLanguage() == oldSecondaryInputLanguage); + + mView->onSecondaryInputLanguageChanged(supportedInputLanguages.count()); + QVERIFY(HbInputSettingProxy::instance()->globalSecondaryInputLanguage() == oldSecondaryInputLanguage); +} + +/*! + * test CpLanguageView::onPrimaryInputLanguageChanged(const HbInputLanguage &inputLanguage) + */ +void TestLanguagePlugin::test_CpLanguageView_onPrimaryInputLanguageChanged2() +{ + int oldIndex = mView->mCurrentPrimaryInputLanguageItem->contentWidgetData("currentIndex").toInt(); + + QList supportedInputLanguages = mView->mPrimaryInputLanguages; + + QVERIFY(supportedInputLanguages.count() > 0); + for (int i = 0; i < supportedInputLanguages.count();i++) { + mView->onPrimaryInputLanguageChanged(supportedInputLanguages.at(i)); + QVERIFY( mView->mCurrentPrimaryInputLanguageItem->contentWidgetData("currentIndex").toInt() == i ); + } + + mView->mCurrentPrimaryInputLanguageItem->setContentWidgetData("currentIndex",oldIndex); + + QVERIFY(oldIndex == mView->mCurrentPrimaryInputLanguageItem->contentWidgetData("currentIndex").toInt()); +} + +/*! + * test CpLanguageView::onSecondaryInputLanguageChanged(const HbInputLanguage &inputLanguage) + */ +void TestLanguagePlugin::test_CpLanguageView_onSecondaryInputLanguageChanged2() +{ + int oldIndex = mView->mCurrentSecondaryInputLanguageItem->contentWidgetData("currentIndex").toInt(); + + QList supportedInputLanguages = mView->mSecondaryInputLanguages; + + QVERIFY(supportedInputLanguages.count() > 0); + for (int i = 0; i < supportedInputLanguages.count();i++) { + mView->onSecondaryInputLanguageChanged(supportedInputLanguages.at(i)); + QVERIFY( mView->mCurrentSecondaryInputLanguageItem->contentWidgetData("currentIndex").toInt() == i ); + } + + mView->mCurrentSecondaryInputLanguageItem->setContentWidgetData("currentIndex",oldIndex); + + QVERIFY(oldIndex == mView->mCurrentSecondaryInputLanguageItem->contentWidgetData("currentIndex").toInt()); +} + +/*! + * test CpLanguageView::launchRegionalSettingsView() + */ +void TestLanguagePlugin::test_CpLanguageView_launchRegionalSettingsView() +{ + mView->launchRegionalSettingsView(); + QVERIFY(mView->mClockPluginLoader != 0); +} + +/*! + * test CpLanguageView::onDataFormItemActivated(const QModelIndex &modelIndex) + */ +void TestLanguagePlugin::test_CpLanguageView_onDataFormItemActivated() +{ + QVERIFY(true); +} + +/*! + * test CpLanguageView::close() + */ +void TestLanguagePlugin::test_CpLanguageView_close() +{ + QVERIFY(true); +} + +/*! + * test CpLanguageView::fillDataFormComboBoxItem + */ +void TestLanguagePlugin::test_CpLanguageView_fillDataFormComboBoxItem() +{ + QStringList supportedRegions = HbLocaleUtil::supportedRegions(); + QStringList localizedRegions = CpLanguagePluginUtil::localizedRegionNames(supportedRegions); + + int regionIndex = supportedRegions.indexOf(HbLocaleUtil::currentRegion()); + + mView->fillDataFormComboBoxItem(mView->mCurrentRegionItem,localizedRegions,regionIndex); + + QVERIFY(mView->mCurrentRegionItem->contentWidgetData("currentIndex").toInt() == regionIndex); + QVERIFY(mView->mCurrentRegionItem->contentWidgetData("items").toStringList() == localizedRegions); +} + +/*! + * test CpLanguageView::updateSecondaryInputLanguageItem + */ +void TestLanguagePlugin::test_CpLanguageView_updateSecondaryInputLanguageItem() +{ + QList supportedInputLanguages; + HbInputUtils::listSupportedInputLanguages(supportedInputLanguages); + + HbInputLanguage primaryInputLanguage = HbInputSettingProxy::instance()->globalInputLanguage(); + HbInputLanguage secondaryInputLanguage = HbInputSettingProxy::instance()->globalSecondaryInputLanguage(); + + QVERIFY(supportedInputLanguages.count() > 0); + + HbInputSettingProxy::instance()->setGlobalInputLanguage(supportedInputLanguages.front()); + HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(supportedInputLanguages.front()); + + mView->updateSecondaryInputLanguageItem(); + + QVERIFY(mView->mCurrentSecondaryInputLanguageItem->contentWidgetData("currentIndex").toInt() == 0); + +} + +/*! + * test CpLanguageView::promptRestart + */ +void TestLanguagePlugin::test_CpLanguageView_promptRestart() +{ + QVERIFY(true); +} + +/*! + * test CpLanguageView::restartDevice + */ +void TestLanguagePlugin::test_CpLanguageView_restartDevice() +{ + QVERIFY(true); +} + +/*! + * test CpLanguageView::languageRegionMapping + */ +void TestLanguagePlugin::test_CpLanguageView_languageRegionMapping() +{ + QStringList supportedLanguages = HbLocaleUtil::supportedLanguages(); + foreach(const QString &language,supportedLanguages) { + LanguageRegionMapping *entry = mView->languageRegionMapping(language); + QVERIFY(entry != 0); + } +} + +QTEST_MAIN(TestLanguagePlugin) diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/t_languageplugin/t_languageplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/t_languageplugin/t_languageplugin.pri Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,27 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: tests for Language plugin +# + +HEADERS += ./inc/t_languageplugin.h \ + ../src/cplanguageview.h \ + ../src/cplanguageplugin.h \ + ../src/cplanguagepluginutil.h \ + ../src/extendedlocaleutil.h + +SOURCES += ./src/t_languageplugin.cpp \ + ../src/cplanguageview.cpp \ + ../src/cplanguageplugin.cpp \ + ../src/cplanguagepluginutil.cpp \ + ../src/extendedlocaleutil.cpp diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/langandregplugin/t_languageplugin/t_languageplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/t_languageplugin/t_languageplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,60 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: tests for Language plugin +# + +TEMPLATE = app + +CONFIG += debug_and_release +QT += testlib +CONFIG += hb qtestlib +CONFIG += symbian_test + +CONFIG(debug, debug|release) { + DESTDIR = ./debug +} else { + DESTDIR = ./release +} + +symbian: LIBS+=-lcpframework +LIBS += -lstarterclient + +CONFIG += hb + +INCLUDEPATH += ./inc \ + ../inc + + +DEPENDPATH += ./inc \ + ./src \ + ../inc \ + ../src + +DEFINES += LANGUAGEPLUGIN_TEST + + +symbian { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger) + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$MOC_DIR + + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.UID3 = 0x2002BCD6 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + PLUGIN_SUBDIR = c:/private/2002BCD6 +} +symbian:MMP_RULES += SMPSAFE +include( t_languageplugin.pri ) + diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/themeplugin/src/cpthemecontrol.cpp --- a/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -50,18 +50,6 @@ static const int KThemeChangeTimeOutMilliSeconds = 2000; /*! - Helper function to fetch the main window. -*/ -static HbMainWindow *mainWindow() -{ - QList< HbMainWindow* > mainWindows = hbInstance->allMainWindows(); - if (!mainWindows.isEmpty()) { - return mainWindows.front(); - } - return 0; -} - -/*! constructor. */ CpThemeControl::CpThemeControl(): mThemeListView(0), diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/themeplugin/src/cpthemelistview.cpp --- a/controlpanelplugins/themeplugin/src/cpthemelistview.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelplugins/themeplugin/src/cpthemelistview.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -71,7 +71,7 @@ //Create the toolbar for Ovi Store. HbToolBar* toolBar = new HbToolBar(this); - HbAction* oviAction = new HbAction(HbIcon("qtg_large_ovistore"), hbTrId("txt_cp_list_get_more_tones")); + HbAction* oviAction = new HbAction(HbIcon("qtg_large_ovistore"), hbTrId("txt_cp_list_get_more_themes")); QObject::connect( oviAction, SIGNAL(triggered()), this, SIGNAL(oviClicked())); diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/themeplugin/src/cpthemeplugin.cpp --- a/controlpanelplugins/themeplugin/src/cpthemeplugin.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelplugins/themeplugin/src/cpthemeplugin.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -50,7 +50,7 @@ itemDataHelper, hbTrId("txt_cp_dblist_theme"), QString(), - HbIcon()); + HbIcon("qtg_large_personalization")); return QList() << entryItem; } diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/themeplugin/src/cpthemepluginentryitemdata.cpp --- a/controlpanelplugins/themeplugin/src/cpthemepluginentryitemdata.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelplugins/themeplugin/src/cpthemepluginentryitemdata.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -47,8 +47,7 @@ //Create a CpThemeControl. the themeControl takes care of displaying the themes //and letting user select a theme and apply a theme change. mThemeControl = new CpThemeControl(); - - setEntryItemIcon(mThemeControl->currentThemeIcon()); + setDescription(mThemeControl->currentThemeName()); //connect to signal to update the current theme name and icon whenever the theme changes. @@ -71,7 +70,7 @@ */ void CpThemePluginEntryItemData::themeUpdated(const QString& themeName, const HbIcon& icon) { - setEntryItemIcon(icon); + Q_UNUSED(icon); setDescription(themeName); } diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/themeplugin/src/cpthemeutil.cpp --- a/controlpanelplugins/themeplugin/src/cpthemeutil.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelplugins/themeplugin/src/cpthemeutil.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -80,6 +80,7 @@ } if(name.isEmpty() || (hidden == "true") ||( hidden == "")) { + delete themeInfo; return NULL; } diff -r 2fee987ebaff -r ab0490982943 controlpanelplugins/themeplugin/themeplugin.pro --- a/controlpanelplugins/themeplugin/themeplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelplugins/themeplugin/themeplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -91,6 +91,7 @@ for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" } +symbian:MMP_RULES += SMPSAFE #symbian: INCLUDEPATH += /sf/mw/hb/include/hbservices \ # /sf/mw/hb/include/hbservices/private \ @@ -99,3 +100,4 @@ # # End of file --Don't remove this. + diff -r 2fee987ebaff -r ab0490982943 controlpanelui/examples/groupplugin/groupplugin.pro --- a/controlpanelui/examples/groupplugin/groupplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/examples/groupplugin/groupplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -26,3 +26,6 @@ } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/examples/pluginlauncherclient/pluginlauncherclient.pro --- a/controlpanelui/examples/pluginlauncherclient/pluginlauncherclient.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/examples/pluginlauncherclient/pluginlauncherclient.pro Thu Sep 30 16:15:53 2010 +0800 @@ -36,3 +36,6 @@ LIBS += -lxqservice -lcpframework symbian::TARGET::UID3 = 0X2002873A + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/examples/themeplugin/themeplugin.pro --- a/controlpanelui/examples/themeplugin/themeplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/examples/themeplugin/themeplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -27,3 +27,6 @@ symbian { TARGET.UID3 = 0X20025FDB } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/examples/viewplugin/viewplugin.pro --- a/controlpanelui/examples/viewplugin/viewplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/examples/viewplugin/viewplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -25,3 +25,6 @@ } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/rom/controlpanelui.iby --- a/controlpanelui/rom/controlpanelui.iby Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/rom/controlpanelui.iby Thu Sep 30 16:15:53 2010 +0800 @@ -40,7 +40,6 @@ file=ABI_DIR\BUILD_DIR\cpcommunicationplugin.dll SHARED_LIB_DIR\cpcommunicationplugin.dll file=ABI_DIR\BUILD_DIR\cpdeviceplugin.dll SHARED_LIB_DIR\cpdeviceplugin.dll file=ABI_DIR\BUILD_DIR\cpprivacyplugin.dll SHARED_LIB_DIR\cpprivacyplugin.dll -file=ABI_DIR\BUILD_DIR\cplookfeelplugin.dll SHARED_LIB_DIR\cplookfeelplugin.dll file=ABI_DIR\BUILD_DIR\cpkeytouchfdbkplugin.dll SHARED_LIB_DIR\cpkeytouchfdbkplugin.dll file=ABI_DIR\BUILD_DIR\cpprofileactivator.dll SHARED_LIB_DIR\cpprofileactivator.dll file=ABI_DIR\BUILD_DIR\cpvolumeplugin.dll SHARED_LIB_DIR\cpvolumeplugin.dll @@ -51,14 +50,12 @@ data=\epoc32\data\c\resource\qt\plugins\controlpanel\config\cpcommunicationplugin.cpcfg resource\qt\plugins\controlpanel\config\cpcommunicationplugin.cpcfg data=\epoc32\data\c\resource\qt\plugins\controlpanel\config\cpdeviceplugin.cpcfg resource\qt\plugins\controlpanel\config\cpdeviceplugin.cpcfg data=\epoc32\data\c\resource\qt\plugins\controlpanel\config\cpprivacyplugin.cpcfg resource\qt\plugins\controlpanel\config\cpprivacyplugin.cpcfg -data=\epoc32\data\c\resource\qt\plugins\controlpanel\config\cplookfeelplugin.cpcfg resource\qt\plugins\controlpanel\config\cplookfeelplugin.cpcfg data=\epoc32\data\c\resource\qt\plugins\controlpanel\cppersonalizationplugin.qtplugin resource\qt\plugins\controlpanel\cppersonalizationplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpcommunicationplugin.qtplugin resource\qt\plugins\controlpanel\cpcommunicationplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpdeviceplugin.qtplugin resource\qt\plugins\controlpanel\cpdeviceplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpprivacyplugin.qtplugin resource\qt\plugins\controlpanel\cpprivacyplugin.qtplugin -data=\epoc32\data\c\resource\qt\plugins\controlpanel\cplookfeelplugin.qtplugin resource\qt\plugins\controlpanel\cplookfeelplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpkeytouchfdbkplugin.qtplugin resource\qt\plugins\controlpanel\cpkeytouchfdbkplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpprofileactivator.qtplugin resource\qt\plugins\controlpanel\cpprofileactivator.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpvolumeplugin.qtplugin resource\qt\plugins\controlpanel\cpvolumeplugin.qtplugin diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpapplication/cpapplication.pro --- a/controlpanelui/src/cpapplication/cpapplication.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpapplication/cpapplication.pro Thu Sep 30 16:15:53 2010 +0800 @@ -41,4 +41,6 @@ DEPLOYMENT += exportheaders for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" -} \ No newline at end of file +} + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpapplication/src/cpmainview.cpp --- a/controlpanelui/src/cpapplication/src/cpmainview.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpapplication/src/cpmainview.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -142,11 +142,14 @@ void CpMainView::onDataFormItemActivated(const QModelIndex &index) { CPFW_LOG("CpMainView::onDataFormItemActivated"); - CpSettingFormItemData *itemData = static_cast(mMainModel->itemFromIndex(index)); - - if (CpCategorySettingFormItemData *categoryItemData = qobject_cast(itemData)) { - categoryItemData->initialize(*mItemDataHelper); - } + HbDataFormModelItem *modelItem = mMainModel->itemFromIndex(index); + if (modelItem != 0 && modelItem->type() == HbDataFormModelItem::GroupItem) { + CpSettingFormItemData *itemData = static_cast(modelItem); + if (CpCategorySettingFormItemData *categoryItemData = qobject_cast(itemData)) { + categoryItemData->initialize(*mItemDataHelper); + } + } + } void CpMainView::onAboutToChangeView(HbView * oldView, HbView *newView) { diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpapplication/src/cpmainwindow.cpp --- a/controlpanelui/src/cpapplication/src/cpmainwindow.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpapplication/src/cpmainwindow.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -21,20 +21,26 @@ #include #include #include - +#include //CpMainWindow implementation CpMainWindow::CpMainWindow(QWidget *parent /*= 0*/, Hb::WindowFlags windowFlags /*= Hb::WindowFlagNone*/) -: HbMainWindow(parent,windowFlags) +: HbMainWindow(parent,windowFlags),mStartupTimer(0) { + // start a zero interval timer to identify the startup of control panel is finished. + mStartupTimer = new QTimer(this); + connect(mStartupTimer, SIGNAL(timeout()), this, SLOT(onStartupFininshed())); + mStartupTimer->start(); } CpMainWindow::~CpMainWindow() { CpMainView *mainView = qobject_cast(views().first()); - if(mainView) - { + if(mainView != 0) { mainView->saveActivity(); - } + } + if(mStartupTimer != 0) { + delete mStartupTimer; + } } bool CpMainWindow::event(QEvent *e) @@ -47,6 +53,20 @@ return HbMainWindow::event(e); } +/** + * Emit applicationReady signal when start up process is finished. + */ +void CpMainWindow::onStartupFininshed() +{ + // emit applicationReady signal when the all initilizing event has been deal with. + // only emit it once + emit applicationReady(); + if (mStartupTimer != 0) { + mStartupTimer->stop(); + delete mStartupTimer; + mStartupTimer = 0; + } +} //End of File diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpapplication/src/cpmainwindow.h --- a/controlpanelui/src/cpapplication/src/cpmainwindow.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpapplication/src/cpmainwindow.h Thu Sep 30 16:15:53 2010 +0800 @@ -19,7 +19,7 @@ #define CPMAINWINDOW_H #include - +class QTimer; class CpMainWindow : public HbMainWindow { Q_OBJECT @@ -28,6 +28,16 @@ ~CpMainWindow(); public: virtual bool event(QEvent *e); +signals: + /** + * Emit when control panel's startup is finished + */ + void applicationReady(); +private slots: + void onStartupFininshed(); + +private: + QTimer *mStartupTimer; }; #endif // CPMAINWINDOW_H diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/cpcategorymodel.pro --- a/controlpanelui/src/cpcategorymodel/cpcategorymodel.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/cpcategorymodel.pro Thu Sep 30 16:15:53 2010 +0800 @@ -31,3 +31,6 @@ } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.cpp --- a/controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -212,9 +212,10 @@ if (entryItemData->description().isEmpty()) { entryItemData->setDescription(description); } - if (entryItemData->iconName().isEmpty()) { - entryItemData->setIconName( - QLatin1String(":/icon/qgn_prop_set_default_sub.svg") ); + + if (entryItemData->type() == static_cast(CpSettingFormEntryItemData::ListEntryItem) + && entryItemData->iconName().isEmpty()) { + entryItemData->setIconName(DEFAULT_ICON_LISTENTRYITEM); } return true; diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.h --- a/controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.h Thu Sep 30 16:15:53 2010 +0800 @@ -19,6 +19,8 @@ #include +#define DEFAULT_ICON_LISTENTRYITEM QLatin1String("qtg_large_non_default.nvg") + class HbDataFormModelItem; class CpItemDataHelper; class CpSettingFormItemData; diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/tsrc/testpluginsforcpcategorymodel/firstpluginforcpcategorymodel/firstpluginforcpcategorymodel.pro --- a/controlpanelui/src/cpcategorymodel/tsrc/testpluginsforcpcategorymodel/firstpluginforcpcategorymodel/firstpluginforcpcategorymodel.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/tsrc/testpluginsforcpcategorymodel/firstpluginforcpcategorymodel/firstpluginforcpcategorymodel.pro Thu Sep 30 16:15:53 2010 +0800 @@ -53,3 +53,6 @@ SOURCES += src/firstpluginforcpcategorymodel.cpp \ src/firstpluginviewforcpcategorymodel.cpp + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/tsrc/testpluginsforcpcategorymodel/secondpluginforcpcategorymodel/secondpluginforcpcategorymodel.pro --- a/controlpanelui/src/cpcategorymodel/tsrc/testpluginsforcpcategorymodel/secondpluginforcpcategorymodel/secondpluginforcpcategorymodel.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/tsrc/testpluginsforcpcategorymodel/secondpluginforcpcategorymodel/secondpluginforcpcategorymodel.pro Thu Sep 30 16:15:53 2010 +0800 @@ -53,3 +53,6 @@ SOURCES += src/secondpluginforcpcategorymodel.cpp \ src/secondpluginviewforcpcategorymodel.cpp + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/tsrc/ut_categorymodelitemdata/ut_categorymodelitemdata.pro --- a/controlpanelui/src/cpcategorymodel/tsrc/ut_categorymodelitemdata/ut_categorymodelitemdata.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/tsrc/ut_categorymodelitemdata/ut_categorymodelitemdata.pro Thu Sep 30 16:15:53 2010 +0800 @@ -51,4 +51,6 @@ DEPLOYMENT += testdll \ testqtplugin \ testqtcfgfile -} \ No newline at end of file +} + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/tsrc/ut_categorymodelutility/src/ut_categorymodelutility.cpp --- a/controlpanelui/src/cpcategorymodel/tsrc/ut_categorymodelutility/src/ut_categorymodelutility.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/tsrc/ut_categorymodelutility/src/ut_categorymodelutility.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -110,8 +110,7 @@ QVERIFY(itemData2->text() == newText); QVERIFY( itemData2->description() == newDes ); QString temp = itemData2->iconName(); - QString newIconName = QLatin1String(":/icon/qgn_prop_set_default_sub.svg"); - QVERIFY( itemData2->iconName() == newIconName ); + QVERIFY( itemData2->iconName() == DEFAULT_ICON_LISTENTRYITEM ); delete itemData2; delete pHelper; } diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/tsrc/ut_categorymodelutility/ut_categorymodelutility.pro --- a/controlpanelui/src/cpcategorymodel/tsrc/ut_categorymodelutility/ut_categorymodelutility.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/tsrc/ut_categorymodelutility/ut_categorymodelutility.pro Thu Sep 30 16:15:53 2010 +0800 @@ -57,4 +57,6 @@ testqtcfgfile } HEADERS += src/*.h -SOURCES += src/*.cpp \ No newline at end of file +SOURCES += src/*.cpp + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/tsrc/ut_cpcategorysettingformmodel/ut_cpcategorysettingformmodel.pro --- a/controlpanelui/src/cpcategorymodel/tsrc/ut_cpcategorysettingformmodel/ut_cpcategorysettingformmodel.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/tsrc/ut_cpcategorysettingformmodel/ut_cpcategorysettingformmodel.pro Thu Sep 30 16:15:53 2010 +0800 @@ -52,4 +52,6 @@ DEPLOYMENT += testdll \ testqtplugin \ testqtcfgfile -} \ No newline at end of file +} + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpcategorymodel/tsrc/ut_cppluginconfigreader/ut_cppluginconfigreader.pro --- a/controlpanelui/src/cpcategorymodel/tsrc/ut_cppluginconfigreader/ut_cppluginconfigreader.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/tsrc/ut_cppluginconfigreader/ut_cppluginconfigreader.pro Thu Sep 30 16:15:53 2010 +0800 @@ -52,4 +52,6 @@ } HEADERS += src/*.h -SOURCES += src/*.cpp \ No newline at end of file +SOURCES += src/*.cpp + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/communicationplugin/communicationplugin.pro --- a/controlpanelui/src/cpplugins/communicationplugin/communicationplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/communicationplugin/communicationplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -36,3 +36,6 @@ # This is for new exporting system coming in garden for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/deviceplugin/data/cpdeviceplugin.cpcfg --- a/controlpanelui/src/cpplugins/deviceplugin/data/cpdeviceplugin.cpcfg Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/deviceplugin/data/cpdeviceplugin.cpcfg Thu Sep 30 16:15:53 2010 +0800 @@ -3,7 +3,7 @@ - + diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/deviceplugin/deviceplugin.pro --- a/controlpanelui/src/cpplugins/deviceplugin/deviceplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/deviceplugin/deviceplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -35,4 +35,6 @@ # This is for new exporting system coming in garden for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" -} \ No newline at end of file +} + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/keytouchfdbkplugin.pro --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/keytouchfdbkplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/keytouchfdbkplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -16,23 +16,24 @@ TEMPLATE = lib TARGET = cpkeytouchfdbkplugin - -CONFIG += hb plugin - -LIBS += -lcpprofilewrapper +CONFIG += hb \ + plugin +RESOURCES = keytouchfdbkplugin.qrc include ( ../cpplugincommon.pri ) include ( keytouchfdbkplugin.pri ) - symbian { - INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ - $$MOC_DIR + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE HEADERS += src/cpkeyscreenmodel_p.h SOURCES += src/cpkeyscreenmodel_p.cpp - LIBS += -lcentralrepository \ - -lfeatmgr + -lfeatmgr TARGET.UID3 = 0X20025FDE - TARGET.CAPABILITY = All -TCB + TARGET.CAPABILITY = All -TCB TARGET.EPOCALLOWDLLDATA = 1 } +win32 { + HEADERS += src/cpkeyscreenmodel_p.h + SOURCES += src/cpkeyscreenmodel_win.cpp +} +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/keytouchfdbkplugin.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/keytouchfdbkplugin.qrc Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,5 @@ + + + resources/hbslider_color.css + + \ No newline at end of file diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/resources/hbslider_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/resources/hbslider_color.css Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,19 @@ + +HbSlider::increment-icon +{ + color: var(qtc_list_item_title_normal); +} + + +HbSlider::decrement-icon +{ + color: var(qtc_list_item_title_normal); +} + +HbSlider::icon-icon +{ + color: var(qtc_list_item_title_normal); +} + + + diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel.cpp --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -19,114 +19,119 @@ #include "cpkeyscreenmodel.h" #include -#ifdef Q_OS_SYMBIAN #include "cpkeyscreenmodel_p.h" -#endif +/* + * Constructor + */ CpKeyScreenModel::CpKeyScreenModel() { -#ifdef Q_OS_SYMBIAN ptr = new CpKeyScreenModelPrivate(); -#endif } +/* + * Desctructor + */ CpKeyScreenModel::~CpKeyScreenModel() { -#ifdef Q_OS_SYMBIAN delete ptr; ptr = 0; -#endif } +/* + * Feature check for key guard setting + */ bool CpKeyScreenModel::isKeyguardSupported() { -#ifdef Q_OS_SYMBIAN return ptr->isKeyguardSupported(); -#else - return 0; -#endif } -int CpKeyScreenModel::keyguard() +/* + * Feature check for screen saver setting + */ +bool CpKeyScreenModel::isScreensaverSupported() { -#ifdef Q_OS_SYMBIAN - return ptr->keyguard(); -#else - return 0; -#endif + return ptr->isScreensaverSupported(); } +/* + * Returen key guard setting value + */ +int CpKeyScreenModel::keyguard() +{ + return ptr->keyguard(); +} + +/* + * Set key guard setting value + */ void CpKeyScreenModel::setKeyguard(int value) { -#ifdef Q_OS_SYMBIAN ptr->setKeyguard(value); -#else - Q_UNUSED(value); -#endif -} - -bool CpKeyScreenModel::isRotateSupported() -{ -#ifdef Q_OS_SYMBIAN - return ptr->isRotateSupported(); -#else - return false; -#endif } +/* + * Feature check for rotate setting + */ +bool CpKeyScreenModel::isRotateSupported() +{ + return ptr->isRotateSupported(); +} + +/* + * Return rotate setting value + */ bool CpKeyScreenModel::rotate() { -#ifdef Q_OS_SYMBIAN return ptr->rotate(); -#else - return 0; -#endif } +/* + * Set rotate setting value + */ void CpKeyScreenModel::setRotate(bool value) { -#ifdef Q_OS_SYMBIAN ptr->setRotate(value); -#else - Q_UNUSED(value); -#endif } -bool CpKeyScreenModel::isBrightnessSupported() +/* + * Return screen saver setting + */ +bool CpKeyScreenModel::screensaver() { -#ifdef Q_OS_SYMBIAN - return ptr->isBrightnessSupported(); -#else - return false; -#endif + return ptr->screensaver(); } +/* + * Set screen saver setting + */ +void CpKeyScreenModel::setScreensaver(bool value) +{ + ptr->setScreensaver(value); +} + +/* + * Feature check for the bright setting + */ +bool CpKeyScreenModel::isBrightnessSupported() +{ + return ptr->isBrightnessSupported(); +} + +/* + * Return bright setting value + */ int CpKeyScreenModel::brightness() { -#ifdef Q_OS_SYMBIAN - return ptr->brightness(); -#else - return 0; -#endif + return ptr->brightness(); } +/* + * Set bright setting value + */ void CpKeyScreenModel::setBrightness(int value) { -#ifdef Q_OS_SYMBIAN ptr->setBrightness(value); -#else - Q_UNUSED(value); -#endif } - -bool CpKeyScreenModel::isCallibrationSupported() -{ -#ifdef Q_OS_SYMBIAN - return ptr->isCallibrationSupported(); -#else - return true; -#endif -} - // End of the file diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel.h --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel.h Thu Sep 30 16:15:53 2010 +0800 @@ -18,6 +18,7 @@ #ifndef CPKEYSCREENMODEL_H #define CPKEYSCREENMODEL_H + class CpKeyScreenModelPrivate; class CpKeyScreenModel @@ -36,8 +37,9 @@ bool isBrightnessSupported(); int brightness(); void setBrightness(int value); - bool isCallibrationSupported(); - + bool isScreensaverSupported(); + bool screensaver(); + void setScreensaver(bool value); private: CpKeyScreenModelPrivate* ptr; }; diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel_p.cpp --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel_p.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel_p.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -25,13 +25,17 @@ #include // KCRUidSecuritySettings #include // KCRUidLightSettings #include +#include // KCRUidScreensaverSettings + CpKeyScreenModelPrivate::CpKeyScreenModelPrivate() { TRAP_IGNORE( mLightCenRep = CRepository::NewL( KCRUidLightSettings ); mSecurityCenRep = CRepository::NewL( KCRUidSecuritySettings ); - mRotateSensor = CRepository::NewL(KHbSensorCenrepUid);); + mRotateSensor = CRepository::NewL(KHbSensorCenrepUid); + mScreenSaver = CRepository::NewL(KCRUidScreensaverSettings);) + } CpKeyScreenModelPrivate::~CpKeyScreenModelPrivate() @@ -39,6 +43,7 @@ delete mLightCenRep; delete mSecurityCenRep; delete mRotateSensor; + delete mScreenSaver; } bool CpKeyScreenModelPrivate::isKeyguardSupported() @@ -80,13 +85,25 @@ mRotateSensor->Set(KHbSensorCenrepKey, value); } +bool CpKeyScreenModelPrivate::screensaver() +{ + int screensaver = 0; + mScreenSaver->Get(KScreensaverStatus, screensaver); + return screensaver; +} + +void CpKeyScreenModelPrivate::setScreensaver(bool value) +{ + mScreenSaver->Set(KScreensaverStatus, value); +} +bool CpKeyScreenModelPrivate::isScreensaverSupported() +{ + return FeatureManager::FeatureSupported( KFeatureIdFfBigclockScreensaver ); +} + bool CpKeyScreenModelPrivate::isBrightnessSupported() { - if ( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl ) ){ - return true; - } else { - return false; - } + return FeatureManager::FeatureSupported( KFeatureIdBrightnessControl ); } int CpKeyScreenModelPrivate::brightness() @@ -98,12 +115,10 @@ void CpKeyScreenModelPrivate::setBrightness(int value) { - mLightCenRep->Set( KLightIntensity, value * 20 ); + if ((value >= 1) && (value <= 5)) { + mLightCenRep->Set( KLightIntensity, value * 20 ); + } } -bool CpKeyScreenModelPrivate::isCallibrationSupported() -{ - return true; -} // End of the file diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel_p.h --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel_p.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel_p.h Thu Sep 30 16:15:53 2010 +0800 @@ -18,6 +18,8 @@ #ifndef CPKEYSCREENMODEL_P_H #define CPKEYSCREENMODEL_P_H +#include + class CRepository; class CpKeyScreenModelPrivate @@ -25,7 +27,6 @@ public: CpKeyScreenModelPrivate(); ~CpKeyScreenModelPrivate(); - public: bool isKeyguardSupported(); int keyguard(); @@ -36,12 +37,16 @@ bool isBrightnessSupported(); int brightness(); void setBrightness(int value); - bool isCallibrationSupported(); - + bool isScreensaverSupported(); + bool screensaver(); + void setScreensaver(bool value); private: +#ifdef Q_OS_SYMBIAN CRepository* mLightCenRep; CRepository* mSecurityCenRep; CRepository* mRotateSensor; + CRepository* mScreenSaver; +#endif }; #endif diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel_win.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenmodel_win.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "cpkeyscreenmodel_p.h" + + +CpKeyScreenModelPrivate::CpKeyScreenModelPrivate() +{ + +} + +CpKeyScreenModelPrivate::~CpKeyScreenModelPrivate() +{ + +} + +bool CpKeyScreenModelPrivate::isKeyguardSupported() +{ + return true; +} + +int CpKeyScreenModelPrivate::keyguard() +{ + return 0; +} + +void CpKeyScreenModelPrivate::setKeyguard(int value) +{ + Q_UNUSED(value) +} + +bool CpKeyScreenModelPrivate::isRotateSupported() +{ + return true; +} + +bool CpKeyScreenModelPrivate::rotate() +{ + return false; +} + +void CpKeyScreenModelPrivate::setRotate(bool value) +{ + Q_UNUSED(value) +} + +bool CpKeyScreenModelPrivate::screensaver() +{ + return false; +} + +void CpKeyScreenModelPrivate::setScreensaver(bool value) +{ + Q_UNUSED(value) +} +bool CpKeyScreenModelPrivate::isScreensaverSupported() +{ + return true; +} + +bool CpKeyScreenModelPrivate::isBrightnessSupported() +{ + return true; +} + +int CpKeyScreenModelPrivate::brightness() +{ + return 0; +} + +void CpKeyScreenModelPrivate::setBrightness(int value) +{ + Q_UNUSED(value) +} + +// End of the file diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.cpp --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -26,16 +26,20 @@ #include #include #include +#include - +/* + * Contructor + */ CpKeyScreenView::CpKeyScreenView(QGraphicsItem *parent) : CpBaseSettingView(0,parent), mScreenComboButton(0), mRotateCheckbox(0), + mScreensaverCheckbox(0), mBrightSliderItem(0), - mCallibItem(0), mModel(0) { + HbStyleLoader::registerFilePath(":/resources/hbslider_color.css"); HbDataForm *form = qobject_cast ( widget() ); if (form) { // Valid range is: @@ -53,6 +57,9 @@ if ( mModel->isKeyguardSupported() ) { makeScreenItem(*model); } + if ( mModel->isScreensaverSupported() ) { + makeScreensaverItem(*model); + } if ( mModel->isRotateSupported() ) { makeRotateItem(*model); @@ -60,23 +67,23 @@ makeBrightnessItem(*model); - /* if ( mModel->isCallibrationSupported() ) { - makeCallibrationItem(*model); - }*/ - form->setModel(model); } } - +/* + * Create a key guard setting in setting form + */ void CpKeyScreenView::makeScreenItem(HbDataFormModel& model) { mScreenComboButton = new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem, hbTrId("txt_cp_setlabel_keys_screen_locked_after")); - qobject_cast ( widget() )->addConnection( + HbDataForm * form = qobject_cast ( widget() ); + if (form) { + form->addConnection( mScreenComboButton,SIGNAL(currentIndexChanged(QString)), - this,SLOT(screenValueChanged(QString))); - + this,SLOT(screenValueChanged(QString))); + } model.appendDataFormItem(mScreenComboButton, model.invisibleRootItem()); int period = mModel->keyguard(); @@ -103,10 +110,16 @@ mScreenComboButton->setContentWidgetData("objectName", "screenComboButton"); } +/* + * Create a rotate setting in setting form + */ void CpKeyScreenView::makeRotateItem(HbDataFormModel& model) { mRotateCheckbox = new CpSettingFormItemData(HbDataFormModelItem::CheckBoxItem, QString()); - qobject_cast ( widget() )->addConnection(mRotateCheckbox,SIGNAL(stateChanged(int)),this,SLOT(rotateValueChanged(int))); + HbDataForm * form = qobject_cast ( widget() ); + if (form) { + form->addConnection(mRotateCheckbox,SIGNAL(stateChanged(int)),this,SLOT(rotateValueChanged(int))); + } model.appendDataFormItem(mRotateCheckbox, model.invisibleRootItem()); mRotateCheckbox->setContentWidgetData( QString("text"), QVariant(hbTrId("txt_cp_list_autorotate_display")) ); @@ -121,10 +134,39 @@ mRotateCheckbox->setContentWidgetData("objectName", "rotateCheckbox"); } +/* + * Create a screen saver setting in setting form + */ +void CpKeyScreenView::makeScreensaverItem(HbDataFormModel& model) +{ + mScreensaverCheckbox = new CpSettingFormItemData(HbDataFormModelItem::CheckBoxItem, QString()); + HbDataForm * form = qobject_cast ( widget() ); + if (form) { + form->addConnection(mScreensaverCheckbox,SIGNAL(stateChanged(int)),this,SLOT(screensaverValueChanged(int))); + } + model.appendDataFormItem(mScreensaverCheckbox, model.invisibleRootItem()); + + mScreensaverCheckbox->setContentWidgetData( QString("text"), QVariant(hbTrId("txt_cp_list_screensaver")) ); + + Qt::CheckState state; + if ( mModel->screensaver() ){ + state = Qt::Checked; + } else { + state = Qt::Unchecked; + } + mScreensaverCheckbox->setContentWidgetData( QString("checkState"), state ); +} + +/* + * Create a brightness setting in setting form + */ void CpKeyScreenView::makeBrightnessItem(HbDataFormModel& model) { mBrightSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, hbTrId("txt_cp_setlabel_brightness")); - qobject_cast ( widget() )->addConnection(mBrightSliderItem,SIGNAL(valueChanged(int)),this,SLOT(brightValueChanged(int))); + HbDataForm * form = qobject_cast ( widget() ); + if (form) { + form->addConnection(mBrightSliderItem,SIGNAL(valueChanged(int)),this,SLOT(brightValueChanged(int))); + } model.appendDataFormItem(mBrightSliderItem, model.invisibleRootItem()); QList sliderElements; @@ -135,27 +177,24 @@ mBrightSliderItem->setContentWidgetData( QString("minimum"), 1 ); mBrightSliderItem->setContentWidgetData( QString("maximum"), 5 ); QMap< QString, QVariant > iconElements; - iconElements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg")); - iconElements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") ); + iconElements.insert(QString("IncreaseElement") , QVariant("qtg_mono_vol_up")); + iconElements.insert(QString("DecreaseElement"), QVariant("qtg_mono_vol_down") ); mBrightSliderItem->setContentWidgetData( QString( "elementIcons" ), iconElements ); mRotateCheckbox->setContentWidgetData("objectName", "brightSliderItem"); } -void CpKeyScreenView::makeCallibrationItem(HbDataFormModel& model) -{ - mCallibItem = new CpSettingFormItemData(HbDataFormModelItem::ToggleValueItem, - QString()); - qobject_cast ( widget() )->addConnection(mCallibItem,SIGNAL(pressed()),this,SLOT(launchCallib())); - model.appendDataFormItem(mCallibItem, model.invisibleRootItem()); - mCallibItem->setContentWidgetData( QString("text"), hbTrId("txt_cp_button_touch_screen_calibration")); -} - +/* + * Desctructor + */ CpKeyScreenView::~CpKeyScreenView() { delete mModel; mModel = 0; } +/* + * Private slots, invoke when screen key guard setting is changed + */ void CpKeyScreenView::screenValueChanged(const QString &value) { for (QMap::iterator it = mScreenLockValues.begin(); @@ -167,18 +206,29 @@ } } +/* + * Private slots, invoke when rotate setting is changed + */ void CpKeyScreenView::rotateValueChanged(int value) { mModel->setRotate( value ); } +/* + * Private slots, invoke when screen saver setting is changed + */ +void CpKeyScreenView::screensaverValueChanged(int value) +{ + mModel->setScreensaver( value ); +} + +/* + * Private slots. invoke when bright setting is changed. + */ void CpKeyScreenView::brightValueChanged(int value) { mModel->setBrightness(value); } -void CpKeyScreenView::launchCallib() -{ -} diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.h --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.h Thu Sep 30 16:15:53 2010 +0800 @@ -39,19 +39,19 @@ void makeScreenItem(HbDataFormModel& model); void makeRotateItem(HbDataFormModel& model); void makeBrightnessItem(HbDataFormModel& model); - void makeCallibrationItem(HbDataFormModel& model); + void makeScreensaverItem(HbDataFormModel& model); private slots: void screenValueChanged(const QString&); void rotateValueChanged(int value); + void screensaverValueChanged(int value); void brightValueChanged(int value); - void launchCallib(); private: CpSettingFormItemData *mScreenComboButton; CpSettingFormItemData *mRotateCheckbox; + CpSettingFormItemData *mScreensaverCheckbox; CpSettingFormItemData *mBrightSliderItem; - CpSettingFormItemData *mCallibItem; CpKeyScreenModel* mModel; QMap mScreenLockValues; diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/tsrc/ut_cpkeyscreen.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/tsrc/ut_cpkeyscreen.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + + +#include "ut_cpkeyscreen.h" +#include "cpkeyscreenmodel.h" +#include "cpkeyscreenconstants.h" +#include "cpkeyscreenplugin.h" +#include "cpkeyscreenview.h" +#include +#include +#include + +/*! + Initial test case's resource + */ +void TestCpKeyScreen::initTestCase() +{ + mModel = new CpKeyScreenModel(); + QVERIFY(mModel != 0); +} + +/*! + Cleanup test case's resource + */ +void TestCpKeyScreen::cleanupTestCase() +{ + delete mModel; +} + +/*! + 1. FunctionName: CpKeyScreenModel() \n + 2. Description: Test constructor of CpKeyScreenModel \n + */ +void TestCpKeyScreen::TestConstructorAndDestructor() +{ + CpKeyScreenModel *model = new CpKeyScreenModel(); + QVERIFY(model != 0); + delete model; + model = 0; +} +/*! + 1. FucntionName: bool isKeyguardSupported() \n + 2. Description: Test key guard supported function \n + */ +void TestCpKeyScreen::TestKeyguardSupported() +{ + // NULL testing, result is decided by feature flag + mModel->isKeyguardSupported(); +} + +/*! + 1. FucntionName: bool isScreensaverSupported() \n + 2. Description: Test screen saver supported function \n + */ +void TestCpKeyScreen::TestScreensaverSupported() +{ + // NULL testing, result is decided by feature flag + mModel->isScreensaverSupported(); +} + +/*! + 1. FucntionName: bool isBrightnessSupported() \n + 2. Description: Test brightness supported function \n + */ +void TestCpKeyScreen::TestBrightnessSupported() +{ + // NULL testing, result is decided by feature flag + mModel->isBrightnessSupported(); +} + +/*! + 1. FucntionName: bool isRotateSupported() \n + 2. Description: Test rotate supported function \n + */ +void TestCpKeyScreen::TestRotateSupported() +{ + // NULL testing, result is decided by feature flag + mModel->isRotateSupported(); +} + +/*! + 1. FunctionName: bool setKeyguard(int value) \n + int keyguard() \n + 2. Description: test KeyGuard settings set and get \n + 3. Input: 1. valid value of set function, and verify by get function \n + 4. ExpectedOutput: 1. same between set and get function + */ +void TestCpKeyScreen::TestSetAndGetKeyGuard() +{ + mModel->setKeyguard(KCpKeyscreenLock15s); + QVERIFY(mModel->keyguard() == KCpKeyscreenLock15s); + +} + +/*! + 1. FunctionName: bool setKeyguard(int value) \n + int keyguard() \n + 2. Description: test KeyGuard settings set and get \n + 3. Input: 1. invalid value of set function, for example "-1" and verify by get function \n + 2. invalid value of set function, for example "100" and verify by get function \n + 4. ExpectedOutput: 1. same with the previous one. + */ +void TestCpKeyScreen::TestSetAndGetKeyGuardWithInvalidInput() +{ + int oldValue = mModel->keyguard(); + + mModel->setKeyguard(-1); + int valueAfterSet = mModel->keyguard(); + + QVERIFY(oldValue == valueAfterSet); + + mModel->setKeyguard(100); + valueAfterSet = mModel->keyguard(); + + QVERIFY(oldValue == valueAfterSet); +} + +/*! + 1. FunctionName: bool setRotate(bool value) \n + bool rotate() \n + 2. Description: test rotate settings set and get \n + 3. Input: 1. "true" value of set function and verify by get function \n + 4. ExpectedOutput: 1. return true. + */ +void TestCpKeyScreen::TestSetAndGetRotateWithTrue() +{ + mModel->setRotate(true); + QVERIFY(mModel->rotate() == true); +} + +/*! + 1. FunctionName: bool setRotate(bool value) \n + bool rotate() \n + 2. Description: test rotate settings set and get \n + 3. Input: 1. "false" value of set function and verify by get function \n + 4. ExpectedOutput: 1. return false. + */ +void TestCpKeyScreen::TestSetAndGetRotateWithFalse() +{ + mModel->setRotate(false); + QVERIFY(mModel->rotate() == false); +} + +/*! + 1. FunctionName: bool setBrightness(int value) \n + int brightness() \n + 2. Description: test brightness settings set and get \n + 3. Input: 1. valid value of set function, and verify by get function \n + 4. ExpectedOutput: 1. same between set and get function + */ +void TestCpKeyScreen::TestSetAndGetBrightness() +{ + mModel->setBrightness(3); + QVERIFY(mModel->brightness() == 3); +} + +/*! + 1. FunctionName: bool setBrightness(int value) \n + int brightness() \n + 2. Description: test KeyGuard settings set and get \n + 3. Input: 1. invalid value of set function, for example "-1" and verify by get function \n + 2. invalid value of set function, for example "100" and verify by get function \n + 4. ExpectedOutput: 1. same with the previous one. + */ +void TestCpKeyScreen::TestSetAndGetBrightnessWithInvalidInput() +{ + int oldValue = mModel->brightness(); + + mModel->setBrightness(-1); + int valueAfterSet = mModel->brightness(); + + QVERIFY(oldValue == valueAfterSet); + + mModel->setBrightness(100); + valueAfterSet = mModel->brightness(); + + QVERIFY(oldValue == valueAfterSet); +} + +/*! + 1. FunctionName: bool setScreensaver(bool value) \n + bool screensaver() \n + 2. Description: test screen saver settings set and get \n + 3. Input: 1. "true" value of set function and verify by get function \n + 4. ExpectedOutput: 1. return true. + */ +void TestCpKeyScreen::TestSetAndGetScreenSaverWithTrue() +{ + mModel->setScreensaver(true); + QVERIFY(mModel->screensaver() == true); +} + +/*! + 1. FunctionName: bool setScreensaver(bool value) \n + bool screensaver() \n + 2. Description: test screen saver settings set and get \n + 3. Input: 1. "false" value of set function and verify by get function \n + 4. ExpectedOutput: 1. return false. + */ +void TestCpKeyScreen::TestSetAndGetScreenSaverWithFalse() +{ + mModel->setScreensaver(false); + QVERIFY(mModel->screensaver() == false); +} +/*! + 1. FunctionName: CpKeyScreenPlugin(); + 2. Description: test CpKeyScreenPlugin's constructor and destructor + */ +void TestCpKeyScreen::TestPluginConstructorAndDestructor() +{ + CpKeyScreenPlugin *plugin = new CpKeyScreenPlugin(); + QVERIFY(plugin != 0); + delete plugin; + plugin = 0; +} + +/*! + 1. FunctionName: virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; + 2. Description: interface of cpkeyscreen plugin + 3. Input: instance of itemDataHelper + 4. Expected Output: QList + */ +void TestCpKeyScreen::TestPluginInterface() +{ + CpKeyScreenPlugin *plugin = new CpKeyScreenPlugin(); + QVERIFY(plugin != 0); + CpItemDataHelper *helper = new CpItemDataHelper(); + QList itemList = plugin->createSettingFormItemData(*helper); + QVERIFY(itemList.count() == 1); + CpSettingFormEntryItemData *entryItem = qobject_cast(itemList.at(0)); + QVERIFY(entryItem != 0); + + delete plugin; + plugin = 0; + delete helper; + helper = 0; + + qDeleteAll(itemList.begin(),itemList.end()); + itemList.clear(); +} + +/*! + 1. FunctionName CpKeyScreenView + 2. Description: ui of key and screen plugin + 3. Input: a null parent and a QObject + 4. Expected Output: a instance of cpkeyscreenview + */ +void TestCpKeyScreen::TestViewConstructorAndDestructor() +{ + CpKeyScreenView *view = new CpKeyScreenView(0); + QVERIFY(view != 0); + + CpKeyScreenView *view1 = new CpKeyScreenView(new HbWidget()); + QVERIFY(view1 != 0); + + delete view; + view = 0; + delete view1; + view = 0; +} +QTEST_MAIN(TestCpKeyScreen) diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/tsrc/ut_cpkeyscreen.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/tsrc/ut_cpkeyscreen.h Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef UT_CPKEYSCREENMODEL_H_ +#define UT_CPKEYSCREENMODEL_H_ + +/*! + \class TestCpKeyScreenModel \n + \brief + class name: CpKeyScreenModel \n + class's description: control key screen settings\n + type of test case: unit test\n + test cases' number totally: 13\n + */ +#include +class CpKeyScreenModel; + +class TestCpKeyScreen:public QObject +{ + Q_OBJECT +private slots: + // init function + void initTestCase(); + + // CpKeyScreenModel + void TestConstructorAndDestructor(); + + void TestKeyguardSupported(); + void TestScreensaverSupported(); + void TestBrightnessSupported(); + void TestRotateSupported(); + + void TestSetAndGetKeyGuard(); + void TestSetAndGetKeyGuardWithInvalidInput(); + + void TestSetAndGetRotateWithTrue(); + void TestSetAndGetRotateWithFalse(); + + void TestSetAndGetBrightness(); + void TestSetAndGetBrightnessWithInvalidInput(); + + void TestSetAndGetScreenSaverWithTrue(); + void TestSetAndGetScreenSaverWithFalse(); + + // CpKeyScreenPlugin + void TestPluginConstructorAndDestructor(); + void TestPluginInterface(); + + //CpKeyScreenView + void TestViewConstructorAndDestructor(); + + void cleanupTestCase(); +private: + CpKeyScreenModel *mModel; +}; +#endif /* UT_CPKEYSCREENMODEL_H_ */ diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/keytouchfdbkplugin/tsrc/ut_cpkeyscreen.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/tsrc/ut_cpkeyscreen.pro Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,59 @@ +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# Initial Contributors: +# Nokia Corporation - initial contribution. +# Contributors: +# Description: +TEMPLATE = app +TARGET = ut_cpkeyscreenmodel +QT += testlib +CONFIG += hb qtestlib +CONFIG += symbian_test +unix { + test.commands = /epoc32/RELEASE/WINSCW/udeb/$${TARGET}.exe + autotest.commands = /epoc32/RELEASE/WINSCW/udeb/$${TARGET}.exe \ + -xml -o c:/$${TARGET}.xml +} +else:win32 { + test.CONFIG += recursive + autotest.CONFIG += recursive + build_pass { + test.commands = /epoc32/RELEASE/WINSCW/udeb/$${TARGET}.exe + autotest.commands = /epoc32/RELEASE/WINSCW/udeb/$${TARGET}.exe \ + -xml -o c:/$${TARGET}.xml + } +} +QMAKE_EXTRA_TARGETS += test autotest +HEADERS += ut_cpkeyscreen.h \ + ../src/cpkeyscreenmodel_p.h \ + ../src/cpkeyscreenmodel.h \ + ../src/cpkeyscreenplugin.h \ + ../src/cpkeyscreenview.h \ + ../src/cpkeyscreenconstants.h + +SOURCES += ../src/cpkeyscreenmodel.cpp \ + ../src/cpkeyscreenplugin.cpp \ + ../src/cpkeyscreenview.cpp \ + ut_cpkeyscreen.cpp + +DEPENDPATH += . + +LIBS += -lcpframework + +symbian { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger) + + LIBS += -lcentralrepository -lfeatmgr + + SOURCES += ../src/cpkeyscreenmodel_p.cpp + TARGET.CAPABILITY = ALL \ + -TCB +} +win32:SOURCES += ../src/cpkeyscreenmodel_win.cpp +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/lookfeelplugin/data/cplookfeelplugin.cpcfg --- a/controlpanelui/src/cpplugins/lookfeelplugin/data/cplookfeelplugin.cpcfg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - Name of the WallPaper - - - - - - - - \ No newline at end of file diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/lookfeelplugin/lookfeelplugin.pri --- a/controlpanelui/src/cpplugins/lookfeelplugin/lookfeelplugin.pri Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: cpdeviceplugin source files -# - - -# Input -HEADERS += src/cplookfeelplugin.h -SOURCES += src/cplookfeelplugin.cpp \ No newline at end of file diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/lookfeelplugin/lookfeelplugin.pro --- a/controlpanelui/src/cpplugins/lookfeelplugin/lookfeelplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = cplookfeelplugin - -CONFIG += hb plugin - - -include ( ../cpplugincommon.pri ) -include ( lookfeelplugin.pri ) - -symbian { - TARGET.UID3 = 0X20025FE0 -} - -symbian { - deploy.path = C: - headers.sources = data/cplookfeelplugin.cpcfg - headers.path = /resource/qt/plugins/controlpanel/config - DEPLOYMENT += exportheaders - - # This is for new exporting system coming in garden - for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" -} \ No newline at end of file diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/lookfeelplugin/src/cplookfeelplugin.cpp --- a/controlpanelui/src/cpplugins/lookfeelplugin/src/cplookfeelplugin.cpp Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#include "cplookfeelplugin.h" -#include "cpcategorysettingformitemdata.h" - -CpLookFeelPlugin::CpLookFeelPlugin() -{ -} - -CpLookFeelPlugin::~CpLookFeelPlugin() -{ -} - -QList CpLookFeelPlugin::createSettingFormItemData(CpItemDataHelper &/*itemDataHelper*/) const -{ - CpCategorySettingFormItemData *itemData = - new CpCategorySettingFormItemData( - HbDataFormModelItem::GroupItem, - tr("Look&Feel"), - QString("cplookfeelplugin.cpcfg") ); - return QList() << itemData; -} - -Q_EXPORT_PLUGIN2(cplookfeelplugin, CpLookFeelPlugin); diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/lookfeelplugin/src/cplookfeelplugin.h --- a/controlpanelui/src/cpplugins/lookfeelplugin/src/cplookfeelplugin.h Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#ifndef CPLOOKFEELPLUGIN_H -#define CPLOOKFEELPLUGIN_H - - -#include -#include - -class CpLookFeelPlugin : public QObject, - public CpPluginInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) -public: - CpLookFeelPlugin(); - virtual ~CpLookFeelPlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; - - -#endif /* CPLOOKFEELPLUGIN_H */ diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_decrement.svg --- a/controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_decrement.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_decrement_pressed.svg --- a/controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_decrement_pressed.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_increment.svg --- a/controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_increment.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_increment_pressed.svg --- a/controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_increment_pressed.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_muted.svg --- a/controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_muted.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_unmuted.svg --- a/controlpanelui/src/cpplugins/personalizationplugin/icon/hb_vol_slider_unmuted.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - - - - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pro --- a/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -39,3 +39,6 @@ # This is for new exporting system coming in garden for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.qrc --- a/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.qrc Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.qrc Thu Sep 30 16:15:53 2010 +0800 @@ -1,10 +1,5 @@ - icon/hb_vol_slider_decrement.svg - icon/hb_vol_slider_decrement_pressed.svg - icon/hb_vol_slider_increment.svg - icon/hb_vol_slider_increment_pressed.svg - icon/hb_vol_slider_muted.svg - icon/hb_vol_slider_unmuted.svg + resources/hbslider_color.css \ No newline at end of file diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/resources/hbslider_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/personalizationplugin/resources/hbslider_color.css Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,19 @@ + +HbSlider::increment-icon +{ + color: var(qtc_list_item_title_normal); +} + + +HbSlider::decrement-icon +{ + color: var(qtc_list_item_title_normal); +} + +HbSlider::icon-icon +{ + color: var(qtc_list_item_title_normal); +} + + + diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -23,11 +23,12 @@ #include */ #include "cpprofilesettingform.h" -#include "cpprofilenameeditdialog.h" #include #include #include +#include + CpPersonalizationAdvanceView::CpPersonalizationAdvanceView(QGraphicsItem *parent /*=0*/): CpBaseSettingView(0,parent) { @@ -37,14 +38,14 @@ // 4.use cppersonalizationentryitemdata class to create ringtone, message tone... // 5.ignore cpmastervolumeslider class, please use default slideritem to create keyandscreen slider, new property added in slider, if any question, please contact me. // 6. don't forget the cfg file in data folder, you can try to add the profile activator plugin and ringtone plugin here - HbDataForm *form = new CpProfileSettingForm(); - setWidget( form ); - CpPluginUtility::addCpItemPrototype(form); + HbStyleLoader::registerFilePath(":/resources/hbslider_color.css"); + mDataForm = new CpProfileSettingForm(); + setWidget( mDataForm ); + CpPluginUtility::addCpItemPrototype(mDataForm); initMenu(); } CpPersonalizationAdvanceView::~CpPersonalizationAdvanceView() { - } void CpPersonalizationAdvanceView::initMenu() @@ -54,11 +55,7 @@ editNameAction->setText( hbTrId( "txt_cp_list_edit_name" ) ); menu()->addAction( editNameAction ); - connect( editNameAction, SIGNAL( triggered() ), this, SLOT( on_editNameAction_triggered() )); + connect( editNameAction, SIGNAL( triggered() ), mDataForm, SLOT( on_editNameAction_triggered() )); } -void CpPersonalizationAdvanceView::on_editNameAction_triggered() -{ - QString string = QString( "general" ); - bool ret = CpProfileNameEditDialog::launchProfileNameEditDialog( string ); -} + diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.h --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.h Thu Sep 30 16:15:53 2010 +0800 @@ -20,6 +20,7 @@ #include class CpItemDataHelper; +class CpProfileSettingForm; class CpPersonalizationAdvanceView: public CpBaseSettingView { @@ -28,10 +29,10 @@ explicit CpPersonalizationAdvanceView(QGraphicsItem *parent = 0); ~CpPersonalizationAdvanceView(); -private slots: - void on_editNameAction_triggered(); +private: + void initMenu(); private: - void initMenu(); + CpProfileSettingForm *mDataForm; }; #endif diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -41,7 +41,7 @@ { } -void CpPersonalizationGroupItemData::beforeLoadingConfigPlugins(CpItemDataHelper &itemDataHelper) +void CpPersonalizationGroupItemData::beforeLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/) { // keep this interface for development in the futrue diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -29,7 +29,7 @@ { } -QList CpPersonalizationPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +QList CpPersonalizationPlugin::createSettingFormItemData(CpItemDataHelper &/*itemDataHelper*/) const { CpPersonalizationGroupItemData *personalItemData = diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -24,8 +24,8 @@ #include #include -CpProfileNameEditDialog::CpProfileNameEditDialog( QGraphicsItem *parent ) - :HbDialog( parent ) +CpProfileNameEditDialog::CpProfileNameEditDialog(QGraphicsItem *parent) + : HbDialog(parent) { init(); } @@ -36,57 +36,48 @@ void CpProfileNameEditDialog::init() { - setDismissPolicy( HbPopup::NoDismiss ); - setHeadingWidget( new HbLabel( hbTrId( "txt_cp_title_edit_name" ), this )); + setDismissPolicy(HbPopup::NoDismiss); + setHeadingWidget(new HbLabel(hbTrId("txt_cp_title_edit_name"), this)); QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout(); - vLayout->setOrientation( Qt::Vertical ); - HbWidget *contentWidget = new HbWidget( this ); - mTextEdit = new HbLineEdit( this ); - mTextEdit->setFontSpec( HbFontSpec( HbFontSpec::Primary ) ); - vLayout->addItem( mTextEdit ); - contentWidget->setLayout( vLayout ); - setContentWidget( contentWidget ); + vLayout->setOrientation(Qt::Vertical); + HbWidget *contentWidget = new HbWidget(this); + HbLabel *label = new HbLabel(hbTrId("txt_cp_heading_profile_name")); + vLayout->addItem(label); + mLineEdit = new HbLineEdit(this); + mLineEdit->setFontSpec(HbFontSpec(HbFontSpec::Primary)); + vLayout->addItem(mLineEdit); + contentWidget->setLayout(vLayout); + setContentWidget(contentWidget); + connect(mLineEdit, SIGNAL(contentsChanged()), this, SLOT(checkPrimaryAction())); - connect( mTextEdit, SIGNAL( contentsChanged() ), this, SLOT( checkPrimaryAction() ) ); - - addAction( new HbAction( hbTrId( "txt_common_button_ok" ), this )); - addAction( new HbAction( hbTrId( "txt_common_button_cancel" ), this ) ); - - setTimeout( NoTimeout ); + setTimeout(NoTimeout); } -void CpProfileNameEditDialog::setLineEditText( const QString &text ) +void CpProfileNameEditDialog::setLineEditText(const QString &text) { - mTextEdit->setText( text ); - mTextEdit->setSelection( 0, text.length() ); + mLineEdit->setText(text); } -QString CpProfileNameEditDialog::getLineEditText() +QString CpProfileNameEditDialog::lineEditText() { - QString text = mTextEdit->text(); - return text; + return mLineEdit->text().trimmed(); } -bool CpProfileNameEditDialog::launchProfileNameEditDialog( QString &profileName ) +void CpProfileNameEditDialog::setLineEditMaxLength(int length) { - CpProfileNameEditDialog *profileEditNameDialog = new CpProfileNameEditDialog(); - - profileEditNameDialog->setLineEditText( profileName ); - profileEditNameDialog->checkPrimaryAction(); - profileEditNameDialog->show(); - return false; + mLineEdit->setMaxLength(length); } void CpProfileNameEditDialog::checkPrimaryAction() { - HbAction *const primaryAction = qobject_cast - (actions().at(0)); - if (primaryAction) { - if ( !mTextEdit->text().isEmpty() ) { - primaryAction->setEnabled(true); + //the first button(number 0) is Ok Button. + HbAction *const primaryAction = qobject_cast(actions().at(0)); + if (primaryAction) { + if (!mLineEdit->text().trimmed().isEmpty()) { + primaryAction->setEnabled(true); } else { primaryAction->setEnabled(false); - } + } } } diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.h --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.h Thu Sep 30 16:15:53 2010 +0800 @@ -30,20 +30,19 @@ public: CpProfileNameEditDialog( QGraphicsItem *parent = 0 ); virtual ~CpProfileNameEditDialog(); - - static bool launchProfileNameEditDialog( QString &profileName ); + void setLineEditText(const QString &text); + QString lineEditText(); + void setLineEditMaxLength(int length); private slots: void checkPrimaryAction(); private: void init(); - void setLineEditText( const QString &text ); - QString getLineEditText(); - -private: + +private: HbWidget *mContentWidget; - HbLineEdit *mTextEdit; + HbLineEdit *mLineEdit; }; #endif /* CPPROFILENAMEEDITDIALOG_H */ diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -17,12 +17,15 @@ #include "cpprofilesettingform.h" #include "cppersonalizationentryitemdata.h" +#include "cpprofilenameeditdialog.h" #include #include #include #include #include +#include #include +#include #include #include @@ -36,12 +39,15 @@ CpProfileSettingForm::CpProfileSettingForm() : mModel(0), mItemDataHelper(new CpItemDataHelper( this )), mProfileModel(new CpProfileModel()), mFileIconProvider(new QFileIconProvider), - mGeneralPage(0),mMeetingPage(0),mCurrentPage( 0 ), mSettingManager(0) + mGeneralPage(0),mMeetingPage(0), mSettingManager(0), + mCurrentProfileId(EProfileWrapperGeneralId), mEditProfileNameDialog(0), mOkButton(0), mCancelButton(0) { this->setHeading(hbTrId("txt_cp_button_advanced_settings")); - this->setDescription(hbTrId("txt_cp_info_select_tones_that_play_when_you_select")); - + this->setDescription(hbTrId("txt_cp_info_select_tones_that_play_when_you_select")); initModel(); + connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(onDataFormActivated(QModelIndex))); + mProfileMonitor = new CpProfileMonitor(); + connect(mProfileMonitor, SIGNAL(profileNameModified()), this, SLOT(onProfileNameChanged())); } CpProfileSettingForm::~CpProfileSettingForm() @@ -50,6 +56,32 @@ delete mProfileModel; delete mFileIconProvider; delete mSettingManager; + delete mProfileMonitor; + if (mEditProfileNameDialog) { + delete mEditProfileNameDialog; + } + if (mOkButton) { + delete mOkButton; + } + if (mCancelButton) { + delete mCancelButton; + } +} + +void CpProfileSettingForm::onDataFormActivated(const QModelIndex &index) +{ + HbDataFormModelItem *item = mModel->itemFromIndex(index); + if (item == mGeneralPage ) { + mCurrentProfileId = EProfileWrapperGeneralId; + } else if (item == mMeetingPage) { + mCurrentProfileId = EProfileWrapperMeetingId; + } +} + +void CpProfileSettingForm::onProfileNameChanged() +{ + mGeneralPage->setLabel(mProfileModel->profileName(EProfileWrapperGeneralId)); + mMeetingPage->setLabel(mProfileModel->profileName(EProfileWrapperMeetingId)); } void CpProfileSettingForm::initModel() @@ -165,13 +197,13 @@ modelItem->setContentWidgetData( QString( "maximum" ), 5 ); modelItem->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone ); QMap< QString, QVariant > elements; - elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg")); - elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") ); + elements.insert(QString("IncreaseElement") , QVariant("qtg_mono_vol_up")); + elements.insert(QString("DecreaseElement"), QVariant("qtg_mono_vol_down") ); if (profileSettings.mKeyTouchScreenTone != 0) { - elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg") ); + elements.insert(QString("IconElement"), QVariant("qtg_mono_speaker") ); } else { - elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") ); + elements.insert(QString("IconElement"), QVariant("qtg_mono_speaker_off") ); } modelItem->setContentWidgetData( QString( "elementIcons" ), elements ); @@ -198,8 +230,8 @@ modelItem->setContentWidgetData( QString( "maximum" ), 5 ); modelItem->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); QMap< QString, QVariant > iconElements; - iconElements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg")); - iconElements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") ); + iconElements.insert(QString("IncreaseElement") , QVariant("qtg_mono_vol_up")); + iconElements.insert(QString("DecreaseElement"), QVariant("qtg_mono_vol_down") ); modelItem->setContentWidgetData( QString( "elementIcons" ), iconElements ); if (profileId == EProfileWrapperGeneralId) { @@ -341,11 +373,39 @@ QMap elements = sliderItem->contentWidgetData("elementIcons").toMap(); if (isMute) { - elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg")); + elements.insert(QString("IconElement"), QVariant("qtg_mono_speaker_off")); } else { - elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg")); + elements.insert(QString("IconElement"), QVariant("qtg_mono_speaker")); } sliderItem->setContentWidgetData( QString( "elementIcons" ), elements ); } + +void CpProfileSettingForm::on_editNameAction_triggered() +{ + if (mEditProfileNameDialog) { + delete mEditProfileNameDialog; + delete mCancelButton; + delete mOkButton; + } + mProfileName = mProfileModel->profileName(mCurrentProfileId); + mCancelButton = new HbAction(hbTrId("txt_common_button_cancel")); + mOkButton = new HbAction(hbTrId("txt_common_button_ok")); + mEditProfileNameDialog = new CpProfileNameEditDialog(); + mEditProfileNameDialog->addAction(mOkButton); + mEditProfileNameDialog->addAction(mCancelButton); + mEditProfileNameDialog->setLineEditMaxLength(maxProfileNameLength); + mEditProfileNameDialog->setLineEditText(mProfileName); + mEditProfileNameDialog->open(this, SLOT(onEditNameDialogClosed(HbAction*))); +} + +void CpProfileSettingForm::onEditNameDialogClosed(HbAction *action) +{ + QString editText(mEditProfileNameDialog->lineEditText()); + if (action == mOkButton && mProfileName != editText) { + + mProfileModel->setProfileName(mCurrentProfileId, editText); + } +} + //End of File diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h Thu Sep 30 16:15:53 2010 +0800 @@ -20,15 +20,21 @@ #include #include +#include "cpprofilemodel.h" class HbDataFormModel; class HbDataFormModelItem; class CpItemDataHelper; -class CpProfileModel; +class CpProfileMonitor; class QFileIconProvider; class XQSettingsManager; class XQSettingsKey; class QVariant; +class HbAction; +class CpProfileNameEditDialog; + +//max profile name length is 64 bytes. +const int maxProfileNameLength = 64; class CpProfileSettingForm : public HbDataForm { @@ -46,7 +52,7 @@ }; CpProfileSettingForm(); - virtual ~CpProfileSettingForm(); + virtual ~CpProfileSettingForm(); private slots: @@ -64,6 +70,12 @@ void on_meeting_screenVibra_ValueChanged( int value ); void settingValueChanged(const XQSettingsKey &key, const QVariant &value); + + void onDataFormActivated(const QModelIndex &index); + void onProfileNameChanged(); + void on_editNameAction_triggered(); + void onEditNameDialogClosed(HbAction *action); + private: void initModel(); void initGeneralTonesGroup(); @@ -71,6 +83,7 @@ void initMeetingTonesGroup(); //void initMeetingVibraGroup(); bool checkBoxStateToBool( int state ); + // void initRingToneGroup(HbDataFormModelItem *parent); // void initMessageToneGroup(HbDataFormModelItem *parent); // void initAlertToneGroup(HbDataFormModelItem *parent); @@ -83,21 +96,24 @@ HbDataFormModel *mModel; CpItemDataHelper *mItemDataHelper; CpProfileModel *mProfileModel; + CpProfileMonitor *mProfileMonitor; QFileIconProvider *mFileIconProvider; HbDataFormModelItem *mGeneralPage; - HbDataFormModelItem *mMeetingPage; - - HbDataFormModelItem *mCurrentPage; - + HbDataFormModelItem *mMeetingPage; // HbDataFormModelItem *mGeneralKeysAndScreenToneSlider; // HbDataFormModelItem *mGeneralSreenVibra; // HbDataFormModelItem *mMeetingKeysAndScreenToneSlider; // HbDataFormModelItem *mMeetingSreenVibra; - XQSettingsManager *mSettingManager; - + XQSettingsManager *mSettingManager; QHash< int,QHash > mProfileModelItems; + ProfileWrapperProfileId mCurrentProfileId; + CpProfileNameEditDialog *mEditProfileNameDialog; + HbAction *mOkButton; + HbAction *mCancelButton; + QString mProfileName; + //QStringList mProfileNameList; }; diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/privacyplugin/privacyplugin.pro --- a/controlpanelui/src/cpplugins/privacyplugin/privacyplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/privacyplugin/privacyplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -37,4 +37,6 @@ # This is for new exporting system coming in garden for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" -} \ No newline at end of file +} + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/profileactivatorplugin/profileactivatorplugin.pro --- a/controlpanelui/src/cpplugins/profileactivatorplugin/profileactivatorplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/profileactivatorplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -29,3 +29,6 @@ TARGET.EPOCALLOWDLLDATA = 1 LIBS += -lprofileeng } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp --- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -36,7 +36,8 @@ int currentId = mProfileModel->activeProfileId(); QString currentName = mProfileModel->profileName(currentId); this->setDescription(currentName); - connect(mProfileMonitor, SIGNAL(profileActivated(int)), this, SLOT(onProfileChanged(int))); + connect(mProfileMonitor, SIGNAL(profileActivated(int)), this, SLOT(onProfileActivated(int))); + connect(mProfileMonitor, SIGNAL(profileNameModified()), this, SLOT(onProfileNameChanged())); } CpProfileActivatorEntryItem::~CpProfileActivatorEntryItem() @@ -55,29 +56,17 @@ } -void CpProfileActivatorEntryItem::onProfileChanged(int activeProfileId) -{ - QString profileName = mProfileModel->profileName(activeProfileId); - this->setDescription(profileName); -} -/*void CpPersonalizationEntryItemData::handleOk(const QVariant &result) +void CpProfileActivatorEntryItem::onProfileActivated(int profileId) { - if (!result.canConvert()) - { - setDescription( "Corrupt result" ); - } - else - { - setDescription( result.value() ); - } + QString profileName = mProfileModel->profileName(profileId); + this->setDescription(profileName); } -void CpPersonalizationEntryItemData::handleError(int errorCode, const QString& errorMessage) + +void CpProfileActivatorEntryItem::onProfileNameChanged() { - // - Q_UNUSED(errorCode); - Q_UNUSED(errorMessage); - setDescription("Error"); -}*/ + QString profileName = mProfileModel->profileName(mProfileModel->activeProfileId()); + this->setDescription(profileName); +} CpBaseSettingView *CpProfileActivatorEntryItem::createSettingView() const { diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.h --- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.h Thu Sep 30 16:15:53 2010 +0800 @@ -33,9 +33,8 @@ virtual ~CpProfileActivatorEntryItem(); private slots: void onLaunchView(); - void onProfileChanged(int activeProfileId); - //void handleOk(const QVariant &result); - //void handleError(int errorCode, const QString& errorMessage); + void onProfileActivated(int); + void onProfileNameChanged(); private: virtual CpBaseSettingView *createSettingView() const; private: diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/ringtoneplugin/ringtoneplugin.pro --- a/controlpanelui/src/cpplugins/ringtoneplugin/ringtoneplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/ringtoneplugin/ringtoneplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -27,3 +27,6 @@ TARGET.CAPABILITY = All -TCB TARGET.EPOCALLOWDLLDATA = 1 } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_decrement.svg --- a/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_decrement.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_decrement_pressed.svg --- a/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_decrement_pressed.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_increment.svg --- a/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_increment.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_increment_pressed.svg --- a/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_increment_pressed.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_muted.svg --- a/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_muted.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_unmuted.svg --- a/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_unmuted.svg Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - - - - - - - - - diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/resources/hbslider_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/resources/hbslider_color.css Thu Sep 30 16:15:53 2010 +0800 @@ -0,0 +1,19 @@ + +HbSlider::increment-icon +{ + color: var(qtc_list_item_title_normal); +} + + +HbSlider::decrement-icon +{ + color: var(qtc_list_item_title_normal); +} + +HbSlider::icon-icon +{ + color: var(qtc_list_item_title_normal); +} + + + diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.cpp --- a/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -118,19 +118,7 @@ HbDataFormModelItem *masterVolume = mItemList.at(CpVolumeGroupItemData::EVolumeMasterVolumeItem); if (masterVolume) { CPFW_LOG("::updateMasterVolumeValue(), Start using profile model."); - QMap iconMaps; - if (isSilenceMode) { - CPFW_LOG("::updateMasterVolumeValue(), Got silent state."); - iconMaps.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg")); - iconMaps.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg")); - iconMaps.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg")); - } - else { - iconMaps.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg")); - iconMaps.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg")); - iconMaps.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg")); - } - masterVolume->setContentWidgetData("elementIcons", iconMaps); + setSilderSpeakerIcon(isSilenceMode); masterVolume->setEnabled(!isSilenceMode); //masterVolume->setContentWidgetData("enabled",!isSilenceMode); masterVolume->setContentWidgetData("value",mProfileModel->masterVolume()); @@ -148,18 +136,7 @@ if (key.uid() == KCRUidProfileEngine.iUid && key.key() == KProEngSilenceMode) { HbDataFormModelItem *masterVolume = mItemList.at(CpVolumeGroupItemData::EVolumeMasterVolumeItem); if (masterVolume) { - QMap iconMaps; - if (value.toBool()) { - iconMaps.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg")); - iconMaps.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg")); - iconMaps.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg")); - } - else { - iconMaps.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg")); - iconMaps.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg")); - iconMaps.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg")); - } - masterVolume->setContentWidgetData("elementIcons", iconMaps); + setSilderSpeakerIcon(value.toBool()); masterVolume->setEnabled(!value.toBool()); } HbDataFormModelItem *silenceMode = mItemList.at(CpVolumeGroupItemData::EVolumeSilenceItem); @@ -180,5 +157,23 @@ } } } +/** + * set speaker icon for volume silder + */ +void CpVolumeController::setSilderSpeakerIcon(bool isSpeakerOff) +{ + HbDataFormModelItem *masterVolume = mItemList.at(CpVolumeGroupItemData::EVolumeMasterVolumeItem); + if (masterVolume != 0) { + QMap iconMaps; + iconMaps = masterVolume->contentWidgetData("elementIcons").toMap(); + if (isSpeakerOff) { + iconMaps.insert("IconElement", QVariant("qtg_mono_speaker_off")); + } + else { + iconMaps.insert("IconElement", QVariant("qtg_mono_speaker")); + } + masterVolume->setContentWidgetData("elementIcons", QVariant(iconMaps)); + } +} //End of File diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.h --- a/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.h Thu Sep 30 16:15:53 2010 +0800 @@ -44,7 +44,7 @@ private: void updateUi(); - + void setSilderSpeakerIcon(bool isSpeakerOff); private: CpProfileModel *mProfileModel; QList mItemList; diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp --- a/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -26,6 +26,7 @@ #include "cpvolumecontroller.h" #include "cppersonalizationcustomviewitem.h" #include +#include CpVolumeGroupItemData::CpVolumeGroupItemData(CpItemDataHelper &itemDataHelper) : CpSettingFormItemData(HbDataFormModelItem::GroupItem,hbTrId("txt_cp_subhead_volume")),//mSilenceIndicator(0), @@ -35,6 +36,7 @@ mProfileModel(0) { initItems(itemDataHelper); + HbStyleLoader::registerFilePath(":/resources/hbslider_color.css"); } CpVolumeGroupItemData::~CpVolumeGroupItemData() @@ -68,21 +70,14 @@ masterVolume->setContentWidgetData("objectName","masterVolumeSlider"); QMap iconMaps; - iconMaps.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg")); - iconMaps.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg")); - //iconMaps.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg")); + iconMaps.insert(QString("DecreaseElement"), QVariant("qtg_mono_vol_down")); + iconMaps.insert(QString("IncreaseElement"), QVariant("qtg_mono_vol_up")); masterVolume->setContentWidgetData("elementIcons", iconMaps); masterVolume->setContentWidgetData("minimum", 1); masterVolume->setContentWidgetData("maximum", 10); masterVolume->setContentWidgetData("majorTickInterval",1); masterVolume->setContentWidgetData("tickPosition",Hb::SliderTicksBelow); - - /*QStringList tickLabels; - tickLabels<setContentWidgetData("majorTickLabels",tickLabels);*/ masterVolume->setContentWidgetData("iconCheckable",false); this->appendChild(masterVolume); diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/volumeplugin.pro --- a/controlpanelui/src/cpplugins/volumeplugin/volumeplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/volumeplugin/volumeplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -27,3 +27,6 @@ symbian { TARGET.UID3 = 0X20028737 } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpplugins/volumeplugin/volumeplugin.qrc --- a/controlpanelui/src/cpplugins/volumeplugin/volumeplugin.qrc Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpplugins/volumeplugin/volumeplugin.qrc Thu Sep 30 16:15:53 2010 +0800 @@ -1,10 +1,5 @@ - icon/hb_vol_slider_decrement.svg - icon/hb_vol_slider_decrement_pressed.svg - icon/hb_vol_slider_increment.svg - icon/hb_vol_slider_increment_pressed.svg - icon/hb_vol_slider_muted.svg - icon/hb_vol_slider_unmuted.svg + resources/hbslider_color.css \ No newline at end of file diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/bwins/cpprofilewrapperu.def --- a/controlpanelui/src/cpprofilewrapper/bwins/cpprofilewrapperu.def Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/bwins/cpprofilewrapperu.def Thu Sep 30 16:15:53 2010 +0800 @@ -1,60 +1,63 @@ EXPORTS ?setKeyTouchScreenVibra@CpProfileModel@@QAEXHH@Z @ 1 NONAME ; void CpProfileModel::setKeyTouchScreenVibra(int, int) ?tr@CpProfileModel@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString CpProfileModel::tr(char const *, char const *, int) - ?masterVibra@CpProfileModel@@QBE_NXZ @ 3 NONAME ; bool CpProfileModel::masterVibra(void) const - ?ringTone@CpProfileModel@@QBE?AVQString@@XZ @ 4 NONAME ; class QString CpProfileModel::ringTone(void) const - ?setProfileSettings@CpProfileModel@@QAEXHAAVCpProfileSettings@@@Z @ 5 NONAME ; void CpProfileModel::setProfileSettings(int, class CpProfileSettings &) - ?qt_metacast@CpProfileModel@@UAEPAXPBD@Z @ 6 NONAME ; void * CpProfileModel::qt_metacast(char const *) - ?setRingTone@CpProfileModel@@QAEXABVQString@@@Z @ 7 NONAME ; void CpProfileModel::setRingTone(class QString const &) - ?setReminderTone@CpProfileModel@@QAEXHABVQString@@@Z @ 8 NONAME ; void CpProfileModel::setReminderTone(int, class QString const &) - ?trUtf8@CpProfileModel@@SA?AVQString@@PBD0@Z @ 9 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *) - ?silenceMode@CpProfileModel@@QBE_NXZ @ 10 NONAME ; bool CpProfileModel::silenceMode(void) const - ?setEmailTone@CpProfileModel@@QAEXHABVQString@@@Z @ 11 NONAME ; void CpProfileModel::setEmailTone(int, class QString const &) - ?emailTone@CpProfileModel@@QBE?AVQString@@H@Z @ 12 NONAME ; class QString CpProfileModel::emailTone(int) const - ?activeProfileId@CpProfileModel@@QBEHXZ @ 13 NONAME ; int CpProfileModel::activeProfileId(void) const - ?masterVolume@CpProfileModel@@QBEHXZ @ 14 NONAME ; int CpProfileModel::masterVolume(void) const - ?notificationTone@CpProfileModel@@QBE_NH@Z @ 15 NONAME ; bool CpProfileModel::notificationTone(int) const - ?tr@CpProfileModel@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString CpProfileModel::tr(char const *, char const *) - ?getStaticMetaObject@CpProfileModel@@SAABUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const & CpProfileModel::getStaticMetaObject(void) - ?keyTouchScreenTone@CpProfileModel@@QBEHH@Z @ 18 NONAME ; int CpProfileModel::keyTouchScreenTone(int) const - ?reminderTone@CpProfileModel@@QBE?AVQString@@H@Z @ 19 NONAME ; class QString CpProfileModel::reminderTone(int) const - ?profileName@CpProfileModel@@QBE?AVQString@@H@Z @ 20 NONAME ; class QString CpProfileModel::profileName(int) const - ?setRingTone@CpProfileModel@@QAEXHABVQString@@@Z @ 21 NONAME ; void CpProfileModel::setRingTone(int, class QString const &) - ?setKeyTouchScreenTone@CpProfileModel@@QAEXHH@Z @ 22 NONAME ; void CpProfileModel::setKeyTouchScreenTone(int, int) - ?setMasterVolume@CpProfileModel@@QAEXH@Z @ 23 NONAME ; void CpProfileModel::setMasterVolume(int) - ?staticMetaObject@CpProfileModel@@2UQMetaObject@@B @ 24 NONAME ; struct QMetaObject const CpProfileModel::staticMetaObject - ?profileNames@CpProfileModel@@QBE?AVQStringList@@XZ @ 25 NONAME ; class QStringList CpProfileModel::profileNames(void) const - ?activateProfile@CpProfileModel@@QAEHH@Z @ 26 NONAME ; int CpProfileModel::activateProfile(int) - ?setNotificationTone@CpProfileModel@@QAEXH_N@Z @ 27 NONAME ; void CpProfileModel::setNotificationTone(int, bool) - ?metaObject@CpProfileModel@@UBEPBUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const * CpProfileModel::metaObject(void) const - ??0CpProfileModel@@QAE@PAVQObject@@@Z @ 29 NONAME ; CpProfileModel::CpProfileModel(class QObject *) - ??1CpProfileModel@@UAE@XZ @ 30 NONAME ; CpProfileModel::~CpProfileModel(void) - ?qt_metacall@CpProfileModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 31 NONAME ; int CpProfileModel::qt_metacall(enum QMetaObject::Call, int, void * *) - ?profileSettings@CpProfileModel@@QAEXHAAVCpProfileSettings@@@Z @ 32 NONAME ; void CpProfileModel::profileSettings(int, class CpProfileSettings &) - ?messageTone@CpProfileModel@@QBE?AVQString@@H@Z @ 33 NONAME ; class QString CpProfileModel::messageTone(int) const - ?d_func@CpProfileModel@@ABEPBVCpProfileModelPrivate@@XZ @ 34 NONAME ; class CpProfileModelPrivate const * CpProfileModel::d_func(void) const - ?setSilenceMode@CpProfileModel@@QAEX_N@Z @ 35 NONAME ; void CpProfileModel::setSilenceMode(bool) - ?keyTouchScreenVibra@CpProfileModel@@QBEHH@Z @ 36 NONAME ; int CpProfileModel::keyTouchScreenVibra(int) const - ?d_func@CpProfileModel@@AAEPAVCpProfileModelPrivate@@XZ @ 37 NONAME ; class CpProfileModelPrivate * CpProfileModel::d_func(void) - ??_ECpProfileModel@@UAE@I@Z @ 38 NONAME ; CpProfileModel::~CpProfileModel(unsigned int) - ?ringTone@CpProfileModel@@QBE?AVQString@@H@Z @ 39 NONAME ; class QString CpProfileModel::ringTone(int) const - ?trUtf8@CpProfileModel@@SA?AVQString@@PBD0H@Z @ 40 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *, int) - ?setMessageTone@CpProfileModel@@QAEXHABVQString@@@Z @ 41 NONAME ; void CpProfileModel::setMessageTone(int, class QString const &) - ?setMasterVibra@CpProfileModel@@QAEX_N@Z @ 42 NONAME ; void CpProfileModel::setMasterVibra(bool) - ?trUtf8@CpProfileMonitor@@SA?AVQString@@PBD0H@Z @ 43 NONAME ; class QString CpProfileMonitor::trUtf8(char const *, char const *, int) - ??_ECpProfileMonitor@@UAE@I@Z @ 44 NONAME ; CpProfileMonitor::~CpProfileMonitor(unsigned int) - ?activeProfileModified@CpProfileMonitor@@IAEXH@Z @ 45 NONAME ; void CpProfileMonitor::activeProfileModified(int) - ?tr@CpProfileMonitor@@SA?AVQString@@PBD0H@Z @ 46 NONAME ; class QString CpProfileMonitor::tr(char const *, char const *, int) - ?trUtf8@CpProfileMonitor@@SA?AVQString@@PBD0@Z @ 47 NONAME ; class QString CpProfileMonitor::trUtf8(char const *, char const *) - ?staticMetaObject@CpProfileMonitor@@2UQMetaObject@@B @ 48 NONAME ; struct QMetaObject const CpProfileMonitor::staticMetaObject - ??0CpProfileMonitor@@QAE@PAVQObject@@@Z @ 49 NONAME ; CpProfileMonitor::CpProfileMonitor(class QObject *) - ?metaObject@CpProfileMonitor@@UBEPBUQMetaObject@@XZ @ 50 NONAME ; struct QMetaObject const * CpProfileMonitor::metaObject(void) const - ?d_func@CpProfileMonitor@@ABEPBVCpProfileMonitorPrivate@@XZ @ 51 NONAME ; class CpProfileMonitorPrivate const * CpProfileMonitor::d_func(void) const - ?d_func@CpProfileMonitor@@AAEPAVCpProfileMonitorPrivate@@XZ @ 52 NONAME ; class CpProfileMonitorPrivate * CpProfileMonitor::d_func(void) - ?profileActivated@CpProfileMonitor@@IAEXH@Z @ 53 NONAME ; void CpProfileMonitor::profileActivated(int) - ?tr@CpProfileMonitor@@SA?AVQString@@PBD0@Z @ 54 NONAME ; class QString CpProfileMonitor::tr(char const *, char const *) - ?getStaticMetaObject@CpProfileMonitor@@SAABUQMetaObject@@XZ @ 55 NONAME ; struct QMetaObject const & CpProfileMonitor::getStaticMetaObject(void) - ?qt_metacast@CpProfileMonitor@@UAEPAXPBD@Z @ 56 NONAME ; void * CpProfileMonitor::qt_metacast(char const *) - ??1CpProfileMonitor@@UAE@XZ @ 57 NONAME ; CpProfileMonitor::~CpProfileMonitor(void) - ?qt_metacall@CpProfileMonitor@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 58 NONAME ; int CpProfileMonitor::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@CpProfileMonitor@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString CpProfileMonitor::trUtf8(char const *, char const *, int) + ?masterVibra@CpProfileModel@@QBE_NXZ @ 4 NONAME ; bool CpProfileModel::masterVibra(void) const + ?ringTone@CpProfileModel@@QBE?AVQString@@XZ @ 5 NONAME ; class QString CpProfileModel::ringTone(void) const + ?setProfileSettings@CpProfileModel@@QAEXHAAVCpProfileSettings@@@Z @ 6 NONAME ; void CpProfileModel::setProfileSettings(int, class CpProfileSettings &) + ?qt_metacast@CpProfileModel@@UAEPAXPBD@Z @ 7 NONAME ; void * CpProfileModel::qt_metacast(char const *) + ?setRingTone@CpProfileModel@@QAEXABVQString@@@Z @ 8 NONAME ; void CpProfileModel::setRingTone(class QString const &) + ?setReminderTone@CpProfileModel@@QAEXHABVQString@@@Z @ 9 NONAME ; void CpProfileModel::setReminderTone(int, class QString const &) + ?profileNameModified@CpProfileMonitor@@IAEXXZ @ 10 NONAME ; void CpProfileMonitor::profileNameModified(void) + ??_ECpProfileMonitor@@UAE@I@Z @ 11 NONAME ; CpProfileMonitor::~CpProfileMonitor(unsigned int) + ?trUtf8@CpProfileModel@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *) + ?silenceMode@CpProfileModel@@QBE_NXZ @ 13 NONAME ; bool CpProfileModel::silenceMode(void) const + ?setEmailTone@CpProfileModel@@QAEXHABVQString@@@Z @ 14 NONAME ; void CpProfileModel::setEmailTone(int, class QString const &) + ?emailTone@CpProfileModel@@QBE?AVQString@@H@Z @ 15 NONAME ; class QString CpProfileModel::emailTone(int) const + ?activeProfileId@CpProfileModel@@QBEHXZ @ 16 NONAME ; int CpProfileModel::activeProfileId(void) const + ?masterVolume@CpProfileModel@@QBEHXZ @ 17 NONAME ; int CpProfileModel::masterVolume(void) const + ?notificationTone@CpProfileModel@@QBE_NH@Z @ 18 NONAME ; bool CpProfileModel::notificationTone(int) const + ?tr@CpProfileModel@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString CpProfileModel::tr(char const *, char const *) + ?keyTouchScreenTone@CpProfileModel@@QBEHH@Z @ 20 NONAME ; int CpProfileModel::keyTouchScreenTone(int) const + ?getStaticMetaObject@CpProfileModel@@SAABUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const & CpProfileModel::getStaticMetaObject(void) + ?tr@CpProfileMonitor@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString CpProfileMonitor::tr(char const *, char const *, int) + ?setRingTone@CpProfileModel@@QAEXHABVQString@@@Z @ 23 NONAME ; void CpProfileModel::setRingTone(int, class QString const &) + ?reminderTone@CpProfileModel@@QBE?AVQString@@H@Z @ 24 NONAME ; class QString CpProfileModel::reminderTone(int) const + ?profileName@CpProfileModel@@QBE?AVQString@@H@Z @ 25 NONAME ; class QString CpProfileModel::profileName(int) const + ?trUtf8@CpProfileMonitor@@SA?AVQString@@PBD0@Z @ 26 NONAME ; class QString CpProfileMonitor::trUtf8(char const *, char const *) + ?setKeyTouchScreenTone@CpProfileModel@@QAEXHH@Z @ 27 NONAME ; void CpProfileModel::setKeyTouchScreenTone(int, int) + ?setMasterVolume@CpProfileModel@@QAEXH@Z @ 28 NONAME ; void CpProfileModel::setMasterVolume(int) + ?staticMetaObject@CpProfileModel@@2UQMetaObject@@B @ 29 NONAME ; struct QMetaObject const CpProfileModel::staticMetaObject + ?profileNames@CpProfileModel@@QBE?AVQStringList@@XZ @ 30 NONAME ; class QStringList CpProfileModel::profileNames(void) const + ?activateProfile@CpProfileModel@@QAEHH@Z @ 31 NONAME ; int CpProfileModel::activateProfile(int) + ?staticMetaObject@CpProfileMonitor@@2UQMetaObject@@B @ 32 NONAME ; struct QMetaObject const CpProfileMonitor::staticMetaObject + ?setNotificationTone@CpProfileModel@@QAEXH_N@Z @ 33 NONAME ; void CpProfileModel::setNotificationTone(int, bool) + ?metaObject@CpProfileModel@@UBEPBUQMetaObject@@XZ @ 34 NONAME ; struct QMetaObject const * CpProfileModel::metaObject(void) const + ??0CpProfileModel@@QAE@PAVQObject@@@Z @ 35 NONAME ; CpProfileModel::CpProfileModel(class QObject *) + ?setProfileName@CpProfileModel@@QAEXHABVQString@@@Z @ 36 NONAME ; void CpProfileModel::setProfileName(int, class QString const &) + ??0CpProfileMonitor@@QAE@PAVQObject@@@Z @ 37 NONAME ; CpProfileMonitor::CpProfileMonitor(class QObject *) + ??1CpProfileModel@@UAE@XZ @ 38 NONAME ; CpProfileModel::~CpProfileModel(void) + ?metaObject@CpProfileMonitor@@UBEPBUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const * CpProfileMonitor::metaObject(void) const + ?d_func@CpProfileMonitor@@ABEPBVCpProfileMonitorPrivate@@XZ @ 40 NONAME ; class CpProfileMonitorPrivate const * CpProfileMonitor::d_func(void) const + ?qt_metacall@CpProfileModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 41 NONAME ; int CpProfileModel::qt_metacall(enum QMetaObject::Call, int, void * *) + ?messageTone@CpProfileModel@@QBE?AVQString@@H@Z @ 42 NONAME ; class QString CpProfileModel::messageTone(int) const + ?profileSettings@CpProfileModel@@QAEXHAAVCpProfileSettings@@@Z @ 43 NONAME ; void CpProfileModel::profileSettings(int, class CpProfileSettings &) + ?d_func@CpProfileMonitor@@AAEPAVCpProfileMonitorPrivate@@XZ @ 44 NONAME ; class CpProfileMonitorPrivate * CpProfileMonitor::d_func(void) + ?d_func@CpProfileModel@@ABEPBVCpProfileModelPrivate@@XZ @ 45 NONAME ; class CpProfileModelPrivate const * CpProfileModel::d_func(void) const + ?setSilenceMode@CpProfileModel@@QAEX_N@Z @ 46 NONAME ; void CpProfileModel::setSilenceMode(bool) + ?profileModified@CpProfileMonitor@@IAEXH@Z @ 47 NONAME ; void CpProfileMonitor::profileModified(int) + ?keyTouchScreenVibra@CpProfileModel@@QBEHH@Z @ 48 NONAME ; int CpProfileModel::keyTouchScreenVibra(int) const + ?d_func@CpProfileModel@@AAEPAVCpProfileModelPrivate@@XZ @ 49 NONAME ; class CpProfileModelPrivate * CpProfileModel::d_func(void) + ?profileActivated@CpProfileMonitor@@IAEXH@Z @ 50 NONAME ; void CpProfileMonitor::profileActivated(int) + ?tr@CpProfileMonitor@@SA?AVQString@@PBD0@Z @ 51 NONAME ; class QString CpProfileMonitor::tr(char const *, char const *) + ?getStaticMetaObject@CpProfileMonitor@@SAABUQMetaObject@@XZ @ 52 NONAME ; struct QMetaObject const & CpProfileMonitor::getStaticMetaObject(void) + ?qt_metacast@CpProfileMonitor@@UAEPAXPBD@Z @ 53 NONAME ; void * CpProfileMonitor::qt_metacast(char const *) + ?avtiveProfileModified@CpProfileMonitor@@IAEXXZ @ 54 NONAME ; void CpProfileMonitor::avtiveProfileModified(void) + ??1CpProfileMonitor@@UAE@XZ @ 55 NONAME ; CpProfileMonitor::~CpProfileMonitor(void) + ??_ECpProfileModel@@UAE@I@Z @ 56 NONAME ; CpProfileModel::~CpProfileModel(unsigned int) + ?ringTone@CpProfileModel@@QBE?AVQString@@H@Z @ 57 NONAME ; class QString CpProfileModel::ringTone(int) const + ?trUtf8@CpProfileModel@@SA?AVQString@@PBD0H@Z @ 58 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *, int) + ?setMessageTone@CpProfileModel@@QAEXHABVQString@@@Z @ 59 NONAME ; void CpProfileModel::setMessageTone(int, class QString const &) + ?setMasterVibra@CpProfileModel@@QAEX_N@Z @ 60 NONAME ; void CpProfileModel::setMasterVibra(bool) + ?qt_metacall@CpProfileMonitor@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 61 NONAME ; int CpProfileMonitor::qt_metacall(enum QMetaObject::Call, int, void * *) diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/cpprofilewrapper.pro --- a/controlpanelui/src/cpprofilewrapper/cpprofilewrapper.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/cpprofilewrapper.pro Thu Sep 30 16:15:53 2010 +0800 @@ -71,7 +71,8 @@ SOURCES += src/cpprofilemodel_p.cpp \ src/cpprofilemonitor_p.cpp - LIBS += -lprofileeng \ + LIBS += -lprofileeng \ + -lProfileEngine \ -lcentralrepository \ -lcharconv \ -lcplogger \ # For cplogger @@ -82,3 +83,6 @@ } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/eabi/cpprofilewrapperu.def --- a/controlpanelui/src/cpprofilewrapper/eabi/cpprofilewrapperu.def Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/eabi/cpprofilewrapperu.def Thu Sep 30 16:15:53 2010 +0800 @@ -6,51 +6,54 @@ _ZN14CpProfileModel12setEmailToneEiRK7QString @ 5 NONAME _ZN14CpProfileModel14setMasterVibraEb @ 6 NONAME _ZN14CpProfileModel14setMessageToneEiRK7QString @ 7 NONAME - _ZN14CpProfileModel14setSilenceModeEb @ 8 NONAME - _ZN14CpProfileModel15activateProfileEi @ 9 NONAME - _ZN14CpProfileModel15profileSettingsEiR17CpProfileSettings @ 10 NONAME - _ZN14CpProfileModel15setMasterVolumeEi @ 11 NONAME - _ZN14CpProfileModel15setReminderToneEiRK7QString @ 12 NONAME - _ZN14CpProfileModel16staticMetaObjectE @ 13 NONAME DATA 16 - _ZN14CpProfileModel18setProfileSettingsEiR17CpProfileSettings @ 14 NONAME - _ZN14CpProfileModel19getStaticMetaObjectEv @ 15 NONAME - _ZN14CpProfileModel19setNotificationToneEib @ 16 NONAME - _ZN14CpProfileModel21setKeyTouchScreenToneEii @ 17 NONAME - _ZN14CpProfileModel22setKeyTouchScreenVibraEii @ 18 NONAME - _ZN14CpProfileModelC1EP7QObject @ 19 NONAME - _ZN14CpProfileModelC2EP7QObject @ 20 NONAME - _ZN14CpProfileModelD0Ev @ 21 NONAME - _ZN14CpProfileModelD1Ev @ 22 NONAME - _ZN14CpProfileModelD2Ev @ 23 NONAME - _ZNK14CpProfileModel10metaObjectEv @ 24 NONAME - _ZNK14CpProfileModel11masterVibraEv @ 25 NONAME - _ZNK14CpProfileModel11messageToneEi @ 26 NONAME - _ZNK14CpProfileModel11profileNameEi @ 27 NONAME - _ZNK14CpProfileModel11silenceModeEv @ 28 NONAME - _ZNK14CpProfileModel12masterVolumeEv @ 29 NONAME - _ZNK14CpProfileModel12profileNamesEv @ 30 NONAME - _ZNK14CpProfileModel12reminderToneEi @ 31 NONAME - _ZNK14CpProfileModel15activeProfileIdEv @ 32 NONAME - _ZNK14CpProfileModel16notificationToneEi @ 33 NONAME - _ZNK14CpProfileModel18keyTouchScreenToneEi @ 34 NONAME - _ZNK14CpProfileModel19keyTouchScreenVibraEi @ 35 NONAME - _ZNK14CpProfileModel8ringToneEi @ 36 NONAME - _ZNK14CpProfileModel8ringToneEv @ 37 NONAME - _ZNK14CpProfileModel9emailToneEi @ 38 NONAME - _ZTI14CpProfileModel @ 39 NONAME - _ZTV14CpProfileModel @ 40 NONAME - _ZN16CpProfileMonitor11qt_metacallEN11QMetaObject4CallEiPPv @ 41 NONAME - _ZN16CpProfileMonitor11qt_metacastEPKc @ 42 NONAME - _ZN16CpProfileMonitor16profileActivatedEi @ 43 NONAME - _ZN16CpProfileMonitor16staticMetaObjectE @ 44 NONAME DATA 16 - _ZN16CpProfileMonitor19getStaticMetaObjectEv @ 45 NONAME - _ZN16CpProfileMonitor21activeProfileModifiedEi @ 46 NONAME - _ZN16CpProfileMonitorC1EP7QObject @ 47 NONAME - _ZN16CpProfileMonitorC2EP7QObject @ 48 NONAME - _ZN16CpProfileMonitorD0Ev @ 49 NONAME - _ZN16CpProfileMonitorD1Ev @ 50 NONAME - _ZN16CpProfileMonitorD2Ev @ 51 NONAME - _ZNK16CpProfileMonitor10metaObjectEv @ 52 NONAME - _ZTI16CpProfileMonitor @ 53 NONAME - _ZTV16CpProfileMonitor @ 54 NONAME + _ZN14CpProfileModel14setProfileNameEiRK7QString @ 8 NONAME + _ZN14CpProfileModel14setSilenceModeEb @ 9 NONAME + _ZN14CpProfileModel15activateProfileEi @ 10 NONAME + _ZN14CpProfileModel15profileSettingsEiR17CpProfileSettings @ 11 NONAME + _ZN14CpProfileModel15setMasterVolumeEi @ 12 NONAME + _ZN14CpProfileModel15setReminderToneEiRK7QString @ 13 NONAME + _ZN14CpProfileModel16staticMetaObjectE @ 14 NONAME DATA 16 + _ZN14CpProfileModel18setProfileSettingsEiR17CpProfileSettings @ 15 NONAME + _ZN14CpProfileModel19getStaticMetaObjectEv @ 16 NONAME + _ZN14CpProfileModel19setNotificationToneEib @ 17 NONAME + _ZN14CpProfileModel21setKeyTouchScreenToneEii @ 18 NONAME + _ZN14CpProfileModel22setKeyTouchScreenVibraEii @ 19 NONAME + _ZN14CpProfileModelC1EP7QObject @ 20 NONAME + _ZN14CpProfileModelC2EP7QObject @ 21 NONAME + _ZN14CpProfileModelD0Ev @ 22 NONAME + _ZN14CpProfileModelD1Ev @ 23 NONAME + _ZN14CpProfileModelD2Ev @ 24 NONAME + _ZN16CpProfileMonitor11qt_metacallEN11QMetaObject4CallEiPPv @ 25 NONAME + _ZN16CpProfileMonitor11qt_metacastEPKc @ 26 NONAME + _ZN16CpProfileMonitor15profileModifiedEi @ 27 NONAME + _ZN16CpProfileMonitor16profileActivatedEi @ 28 NONAME + _ZN16CpProfileMonitor16staticMetaObjectE @ 29 NONAME DATA 16 + _ZN16CpProfileMonitor19getStaticMetaObjectEv @ 30 NONAME + _ZN16CpProfileMonitor19profileNameModifiedEv @ 31 NONAME + _ZN16CpProfileMonitor21avtiveProfileModifiedEv @ 32 NONAME + _ZN16CpProfileMonitorC1EP7QObject @ 33 NONAME + _ZN16CpProfileMonitorC2EP7QObject @ 34 NONAME + _ZN16CpProfileMonitorD0Ev @ 35 NONAME + _ZN16CpProfileMonitorD1Ev @ 36 NONAME + _ZN16CpProfileMonitorD2Ev @ 37 NONAME + _ZNK14CpProfileModel10metaObjectEv @ 38 NONAME + _ZNK14CpProfileModel11masterVibraEv @ 39 NONAME + _ZNK14CpProfileModel11messageToneEi @ 40 NONAME + _ZNK14CpProfileModel11profileNameEi @ 41 NONAME + _ZNK14CpProfileModel11silenceModeEv @ 42 NONAME + _ZNK14CpProfileModel12masterVolumeEv @ 43 NONAME + _ZNK14CpProfileModel12profileNamesEv @ 44 NONAME + _ZNK14CpProfileModel12reminderToneEi @ 45 NONAME + _ZNK14CpProfileModel15activeProfileIdEv @ 46 NONAME + _ZNK14CpProfileModel16notificationToneEi @ 47 NONAME + _ZNK14CpProfileModel18keyTouchScreenToneEi @ 48 NONAME + _ZNK14CpProfileModel19keyTouchScreenVibraEi @ 49 NONAME + _ZNK14CpProfileModel8ringToneEi @ 50 NONAME + _ZNK14CpProfileModel8ringToneEv @ 51 NONAME + _ZNK14CpProfileModel9emailToneEi @ 52 NONAME + _ZNK16CpProfileMonitor10metaObjectEv @ 53 NONAME + _ZTI14CpProfileModel @ 54 NONAME + _ZTI16CpProfileMonitor @ 55 NONAME + _ZTV14CpProfileModel @ 56 NONAME + _ZTV16CpProfileMonitor @ 57 NONAME diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/src/cpprofilemodel.cpp --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -43,6 +43,15 @@ { return d_ptr->profileName(profileId); } + +/*! + Set profile id \a profileId 's name with \a name. +*/ +void CpProfileModel::setProfileName(int profileId, const QString &name) +{ + d_ptr->setProfileName(profileId, name); +} + /*! get profile name list */ diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -50,8 +51,7 @@ * Constructor */ CpProfileModelPrivate::CpProfileModelPrivate() - : mEngine(0), - mProfileNames(0), + : mEngine(0), q_ptr(0) { @@ -66,8 +66,6 @@ CPFW_LOG("CpProfileModelPrivate::CpProfileModelPrivate(), START."); TRAP_IGNORE( mEngine = CreateProfileEngineExtended2L(); - mProfileNames = mEngine->ProfilesNamesArrayLC(); - CleanupStack::Pop(); // pop the pointer of mProfileNames /* * Currently, engine part will return all previous version of profile * so some invalid profile will be added in the new list, to avoid this @@ -94,9 +92,6 @@ if (mEngine!=0) { mEngine->Release(); } - if (mProfileNames) { - delete mProfileNames; - } mProfileList.clear(); } @@ -110,14 +105,38 @@ if (!isValidProfile(profileId)) { return QString(); } + QString profileName; + QT_TRAP_THROWING( + MProfile *profile = mEngine->Profile2L(profileId); + const MProfileName &name = profile->ProfileName(); + if (name.Name().Length() > 0) { + profileName = XQConversions::s60DescToQString(name.Name()); + } + profile->Release(); + ) + return profileName; - const MProfileName* name = mProfileNames->ProfileName(profileId); - QString profileName; - if (name != 0) { - profileName = XQConversions::s60DescToQString(name->Name()); +} + +/* + * Set profile name with \a profileId. + */ +void CpProfileModelPrivate::setProfileName(int profileId, const QString &name) +{ + if(!isValidProfile(profileId)) { + return; } - CPFW_LOG("CpProfileModelPrivate::profileName(), END."); - return profileName; + HBufC *des = XQConversions::qStringToS60Desc( name ); + QT_TRAP_THROWING( + CleanupStack::PushL(des); + MProfileExtended *profileExtend = mEngine->Profile2L(profileId); + CleanupStack::PushL(profileExtend); + MProfileSetName &profileSetName = profileExtend->ProfileSetName(); + profileSetName.SetNameL(*des); + mEngine ->CommitChangeL(*profileExtend); + CleanupStack::Pop(2); // des, profileExtend + profileExtend->Release(); + ) } /* @@ -126,15 +145,17 @@ QStringList CpProfileModelPrivate::profileNames() const { CPFW_LOG("CpProfileModelPrivate::profileNames(), START."); - QStringList nameList; - - foreach(int profileId, mProfileList) { - const MProfileName *name = mProfileNames->ProfileName(profileId); - if (name != 0) { - nameList.append(XQConversions::s60DescToQString(name->Name())); - } + QStringList nameList; + foreach(int profileId, mProfileList) { + QT_TRAP_THROWING( + MProfile *profile = mEngine->Profile2L(profileId); + const MProfileName &name = profile->ProfileName(); + if (name.Name().Length() > 0) { + nameList.append(XQConversions::s60DescToQString(name.Name())); + } + profile->Release(); + ) } - CPFW_LOG("CpProfileModelPrivate::profileNames(), END."); return nameList; } @@ -228,15 +249,25 @@ MProfileSetFeedbackSettings &setFeedbackSettings = extraSettings.ProfileSetFeedbackSettings(); + HBufC *setting = XQConversions::qStringToS60Desc(profileSettings.mRingTone); + CleanupStack::PushL(setting); + setTones.SetRingingTone1L(*setting); + CleanupStack::PopAndDestroy(); - setTones.SetRingingTone1L(*XQConversions::qStringToS60Desc( - profileSettings.mRingTone)); - setTones.SetMessageAlertToneL(*XQConversions::qStringToS60Desc( - profileSettings.mMessageTone)); - setExtTones.SetEmailAlertToneL(*XQConversions::qStringToS60Desc( - profileSettings.mEmailTone)); - setExtTones.SetReminderToneL(*XQConversions::qStringToS60Desc( - profileSettings.mReminderTone)); + setting = XQConversions::qStringToS60Desc(profileSettings.mMessageTone); + CleanupStack::PushL(setting); + setTones.SetMessageAlertToneL(*setting); + CleanupStack::PopAndDestroy(); + + setting = XQConversions::qStringToS60Desc(profileSettings.mEmailTone); + CleanupStack::PushL(setting); + setExtTones.SetEmailAlertToneL(*setting); + CleanupStack::PopAndDestroy(); + + setting = XQConversions::qStringToS60Desc(profileSettings.mReminderTone); + CleanupStack::PushL(setting); + setExtTones.SetReminderToneL(*setting); + CleanupStack::PopAndDestroy(); toneSettings.iWarningAndGameTones = profileSettings.mNotificationTone; @@ -290,9 +321,11 @@ CleanupStack::PushL(profileExtend); MProfileSetTones &setTones = profileExtend->ProfileSetTones(); - - setTones.SetRingingTone1L( *XQConversions::qStringToS60Desc(filePath) ); + HBufC *ringTone = XQConversions::qStringToS60Desc(filePath); + CleanupStack::PushL(ringTone); + setTones.SetRingingTone1L( *ringTone ); mEngine ->CommitChangeL(*profileExtend); + CleanupStack::PopAndDestroy(); CleanupStack::Pop(); // profileExtend profileExtend->Release(); ) @@ -391,9 +424,11 @@ CleanupStack::PushL(profileExtend); MProfileSetTones &setTones = profileExtend->ProfileSetTones(); - - setTones.SetRingingTone1L(*XQConversions::qStringToS60Desc(filePath)); - mEngine->CommitChangeL(*profileExtend); + HBufC *ringTone = XQConversions::qStringToS60Desc(filePath); + CleanupStack::PushL(ringTone); + setTones.SetRingingTone1L(*ringTone); + mEngine->CommitChangeL(*profileExtend); + CleanupStack::PopAndDestroy(); //ringTone CleanupStack::Pop(); // profileExtend profileExtend->Release(); ) @@ -436,8 +471,11 @@ CleanupStack::PushL(profileExtend); MProfileSetTones &setTones = profileExtend->ProfileSetTones(); - setTones.SetMessageAlertToneL(*XQConversions::qStringToS60Desc(filePath)); + HBufC *messageTone = XQConversions::qStringToS60Desc(filePath); + CleanupStack::PushL(messageTone); + setTones.SetMessageAlertToneL(*messageTone); mEngine->CommitChangeL(*profileExtend); + CleanupStack::PopAndDestroy();//messageTone CleanupStack::Pop(); // profileExtend profileExtend->Release(); ) @@ -479,8 +517,11 @@ CleanupStack::PushL(profileExtend); MProfileSetExtraTones2 &setExtTones = profileExtend->ProfileSetExtraTones2(); - setExtTones.SetEmailAlertToneL(*XQConversions::qStringToS60Desc(filePath)); + HBufC *emailTone = XQConversions::qStringToS60Desc(filePath); + CleanupStack::PushL(emailTone); + setExtTones.SetEmailAlertToneL(*emailTone); mEngine->CommitChangeL(*profileExtend); + CleanupStack::PopAndDestroy();//emailtone; CleanupStack::Pop(); // profileExtend profileExtend->Release(); ) @@ -522,8 +563,11 @@ CleanupStack::PushL(profileExtend); MProfileSetExtraTones2 &setExtTones = profileExtend->ProfileSetExtraTones2(); - setExtTones.SetReminderToneL( *XQConversions::qStringToS60Desc(filePath) ); + HBufC *reminderTone = XQConversions::qStringToS60Desc(filePath); + CleanupStack::PushL(reminderTone); + setExtTones.SetReminderToneL( *reminderTone ); mEngine->CommitChangeL(*profileExtend); + CleanupStack::PopAndDestroy(); //reminderTone; CleanupStack::Pop(); // profileExtend profileExtend->Release(); ) diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.h --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.h Thu Sep 30 16:15:53 2010 +0800 @@ -40,6 +40,7 @@ public: QString profileName(int profileId) const; QStringList profileNames() const; + void setProfileName(int profileId, const QString &name); int activateProfile(int profileId); int activeProfileId() const; void profileSettings(int profileId, CpProfileSettings& profileSettings); diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_win_p.cpp --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_win_p.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_win_p.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -45,6 +45,16 @@ } /* + * Set profile name with \a profileId. + */ +int CpProfileModelPrivate::setProfileName(int profileId, const QString &name) +{ + Q_UNUSED(profileId); + Q_UNUSED(name); + return -1; +} + +/* * Activate a profile with its id, return the operation code. */ int CpProfileModelPrivate::activateProfile(int profileId) diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/src/cpprofilemonitor_p.cpp --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemonitor_p.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemonitor_p.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -17,7 +17,8 @@ #include "cpprofilemonitor_p.h" #include "cpprofilemonitor.h" - +#include "cpprofilemodel.h" +#include #include /* @@ -34,6 +35,7 @@ */ CpProfileMonitorPrivate::~CpProfileMonitorPrivate() { + delete mProfileModel; delete mProfileNotifier; } @@ -43,26 +45,46 @@ void CpProfileMonitorPrivate::initialize(CpProfileMonitor *parent) { q_ptr = parent; - TRAP_IGNORE(mProfileNotifier = CProfileChangeNotifyHandler::NewL(this)); + mProfileModel = new CpProfileModel(); + TRAP_IGNORE(mProfileNotifier = ProEngFactory::NewNotifyHandlerL()); + TRAP_IGNORE(mProfileNotifier->RequestProfileActivationNotificationsL(*this)); + TRAP_IGNORE(mProfileNotifier->RequestProfileNameArrayNotificationsL(*this)); + TRAP_IGNORE(mProfileNotifier->RequestProfileNotificationsL(*this, EProfileWrapperGeneralId)); + TRAP_IGNORE(mProfileNotifier->RequestProfileNotificationsL(*this, EProfileWrapperMeetingId)); +} + +/* + * From MProEngProfileObserver + */ +void CpProfileMonitorPrivate::HandleProfileModifiedL( TInt aProfileId ) +{ + if (aProfileId == mProfileModel->activeProfileId()) { + q_ptr->avtiveProfileModified(); + } else { + q_ptr->profileModified(aProfileId); + } } /* - * From MProfileChangeObserver, monitor the profile event + * From MProEngProfileActivationObserver */ -void CpProfileMonitorPrivate::HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId) +void CpProfileMonitorPrivate::HandleProfileActivatedL( TInt aProfileId ) { - switch (aProfileEvent) { - case EProfileNewActiveProfile: - { - q_ptr->profileActivated(aProfileId); - break; - } - case EProfileActiveProfileModified: - { - q_ptr->activeProfileModified(aProfileId); - break; - } - default: - break; - } + q_ptr->profileActivated( aProfileId ); } + +/* + * From MProEngProfileNameArrayObserver + */ +void CpProfileMonitorPrivate::HandleProfileNameArrayModificationL() +{ + q_ptr->profileNameModified(); +} + +/* + * Stop receiveing notification + */ +void CpProfileMonitorPrivate::stopMonitoring() +{ + mProfileNotifier->CancelAll(); +} diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/src/cpprofilemonitor_p.h --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemonitor_p.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemonitor_p.h Thu Sep 30 16:15:53 2010 +0800 @@ -17,26 +17,35 @@ #ifndef CPPROFILEMONITORPRIVATE_H #define CPPROFILEMONITORPRIVATE_H -#include +#include +#include +#include +#include #include -class CProfileChangeNotifyHandler; +class CpProfileModel; class CpProfileMonitor; -class CpProfileMonitorPrivate:public MProfileChangeObserver +class CpProfileMonitorPrivate:public MProEngProfileActivationObserver, + public MProEngProfileObserver, + public MProEngProfileNameArrayObserver { Q_DECLARE_PUBLIC(CpProfileMonitor) public: CpProfileMonitorPrivate(); ~CpProfileMonitorPrivate(); void initialize(CpProfileMonitor *parent); - -#ifdef Q_OS_SYMBIAN + void stopMonitoring(); private: - void HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId); + //from MProEngProfileObserver + void HandleProfileModifiedL( TInt aProfileId ); + //from MProEngProfileActivationObserver + void HandleProfileActivatedL( TInt aProfileId ); + //from MProEngProfileNameArrayObserver + void HandleProfileNameArrayModificationL(); private: - CProfileChangeNotifyHandler *mProfileNotifier; -#endif + CpProfileModel *mProfileModel; + MProEngNotifyHandler *mProfileNotifier; private: CpProfileMonitor *q_ptr; }; diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/tsrc/ut_cpprofilemodel/src/ut_cpprofilemodel.cpp --- a/controlpanelui/src/cpprofilewrapper/tsrc/ut_cpprofilemodel/src/ut_cpprofilemodel.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/tsrc/ut_cpprofilemodel/src/ut_cpprofilemodel.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -79,7 +79,7 @@ <1> return QString( "General" ) \n    <2> return QString( "Meeting" ) \n */ -void TestCpProfileModel::testProfileNameWithValidProfileID() +/*void TestCpProfileModel::testProfileNameWithValidProfileID() { CpProfileModel *profileModel = new CpProfileModel(); @@ -90,7 +90,7 @@ QVERIFY( profileName2 == QString("Meeting") ); delete profileModel; -} +}*/ /*! Test Case Description:\n 1. Fucntion Name: QString profileName(int profileId)const; \n @@ -134,7 +134,7 @@ 4. Expected result: \n    \n */ -void TestCpProfileModel::testProfileNames() +/*void TestCpProfileModel::testProfileNames() { CpProfileModel *profileModel = new CpProfileModel(); @@ -146,7 +146,7 @@ QVERIFY( profilesNames.contains("Meeting", Qt::CaseInsensitive)); delete profileModel; -} +}*/ /*! Test Case Description:\n diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/tsrc/ut_cpprofilemodel/src/ut_cpprofilemodel.h --- a/controlpanelui/src/cpprofilewrapper/tsrc/ut_cpprofilemodel/src/ut_cpprofilemodel.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/tsrc/ut_cpprofilemodel/src/ut_cpprofilemodel.h Thu Sep 30 16:15:53 2010 +0800 @@ -30,9 +30,9 @@ void testConstructor(); // test the constructor. - void testProfileNameWithValidProfileID(); // test the profileName() function with valid profile ID. + //void testProfileNameWithValidProfileID(); // test the profileName() function with valid profile ID. void testProfileNameWithInvalidProfileID(); // test the profileName() function with invalid profile ID. - void testProfileNames(); // test the profileNames() function. + //void testProfileNames(); // test the profileNames() function. void testActivateProfileWithInvalidID(); //test the activateProfile() function with invalid profile ID. void testActivateProfileWithValidID(); // test the activateProfile() function with valid profile ID. diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpprofilewrapper/tsrc/ut_cpprofilemodel/ut_cpprofilemodel.pro --- a/controlpanelui/src/cpprofilewrapper/tsrc/ut_cpprofilemodel/ut_cpprofilemodel.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpprofilewrapper/tsrc/ut_cpprofilemodel/ut_cpprofilemodel.pro Thu Sep 30 16:15:53 2010 +0800 @@ -47,4 +47,6 @@ # This is for new exporting system coming in garden for(soundfile, soundfiles.sources):BLD_INF_RULES.prj_exports += "./$$soundfile $$deploy.path$$soundfiles.path/$$basename(soundfile)" -} \ No newline at end of file +} + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpringtoneview/bwins/cpringtoneviewu.def --- a/controlpanelui/src/cpringtoneview/bwins/cpringtoneviewu.def Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpringtoneview/bwins/cpringtoneviewu.def Thu Sep 30 16:15:53 2010 +0800 @@ -4,15 +4,15 @@ ??1CpRingToneView@@UAE@XZ @ 3 NONAME ; CpRingToneView::~CpRingToneView(void) ?getStaticMetaObject@CpRingToneView@@SAABUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const & CpRingToneView::getStaticMetaObject(void) ?handleError@CpRingToneView@@AAEXHABVQString@@@Z @ 5 NONAME ; void CpRingToneView::handleError(int, class QString const &) - ?launchMediaFetcher@CpRingToneView@@AAEXABVQString@@0@Z @ 6 NONAME ; void CpRingToneView::launchMediaFetcher(class QString const &, class QString const &) - ?selError@CpRingToneView@@IAEXHABVQString@@@Z @ 7 NONAME ; void CpRingToneView::selError(int, class QString const &) - ?trUtf8@CpRingToneView@@SA?AVQString@@PBD0H@Z @ 8 NONAME ; class QString CpRingToneView::trUtf8(char const *, char const *, int) - ?qt_metacall@CpRingToneView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int CpRingToneView::qt_metacall(enum QMetaObject::Call, int, void * *) - ?staticMetaObject@CpRingToneView@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const CpRingToneView::staticMetaObject - ?metaObject@CpRingToneView@@UBEPBUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const * CpRingToneView::metaObject(void) const - ?tr@CpRingToneView@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString CpRingToneView::tr(char const *, char const *, int) - ??0CpRingToneView@@QAE@PAVQGraphicsItem@@@Z @ 13 NONAME ; CpRingToneView::CpRingToneView(class QGraphicsItem *) - ?itemActivated@CpRingToneView@@AAEXABVQModelIndex@@@Z @ 14 NONAME ; void CpRingToneView::itemActivated(class QModelIndex const &) + ?selError@CpRingToneView@@IAEXHABVQString@@@Z @ 6 NONAME ; void CpRingToneView::selError(int, class QString const &) + ?trUtf8@CpRingToneView@@SA?AVQString@@PBD0H@Z @ 7 NONAME ; class QString CpRingToneView::trUtf8(char const *, char const *, int) + ?qt_metacall@CpRingToneView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 8 NONAME ; int CpRingToneView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?staticMetaObject@CpRingToneView@@2UQMetaObject@@B @ 9 NONAME ; struct QMetaObject const CpRingToneView::staticMetaObject + ?metaObject@CpRingToneView@@UBEPBUQMetaObject@@XZ @ 10 NONAME ; struct QMetaObject const * CpRingToneView::metaObject(void) const + ?tr@CpRingToneView@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString CpRingToneView::tr(char const *, char const *, int) + ??0CpRingToneView@@QAE@PAVQGraphicsItem@@@Z @ 12 NONAME ; CpRingToneView::CpRingToneView(class QGraphicsItem *) + ?itemActivated@CpRingToneView@@AAEXABVQModelIndex@@@Z @ 13 NONAME ; void CpRingToneView::itemActivated(class QModelIndex const &) + ?launchMediaFetcher@CpRingToneView@@AAEXABVQString@@0ABV?$QList@VQVariant@@@@ABVXQRequestInfo@@@Z @ 14 NONAME ; void CpRingToneView::launchMediaFetcher(class QString const &, class QString const &, class QList const &, class XQRequestInfo const &) ??_ECpRingToneView@@UAE@I@Z @ 15 NONAME ; CpRingToneView::~CpRingToneView(unsigned int) ?trUtf8@CpRingToneView@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString CpRingToneView::trUtf8(char const *, char const *) ?handleOk@CpRingToneView@@AAEXABVQVariant@@@Z @ 17 NONAME ; void CpRingToneView::handleOk(class QVariant const &) diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpringtoneview/cpringtoneview.pro --- a/controlpanelui/src/cpringtoneview/cpringtoneview.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpringtoneview/cpringtoneview.pro Thu Sep 30 16:15:53 2010 +0800 @@ -26,3 +26,6 @@ TARGET.CAPABILITY = All -TCB TARGET.EPOCALLOWDLLDATA = 1 } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpringtoneview/eabi/cpringtoneviewu.def --- a/controlpanelui/src/cpringtoneview/eabi/cpringtoneviewu.def Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpringtoneview/eabi/cpringtoneviewu.def Thu Sep 30 16:15:53 2010 +0800 @@ -4,7 +4,7 @@ _ZN14CpRingToneView11qt_metacastEPKc @ 3 NONAME _ZN14CpRingToneView13itemActivatedERK11QModelIndex @ 4 NONAME _ZN14CpRingToneView16staticMetaObjectE @ 5 NONAME DATA 16 - _ZN14CpRingToneView18launchMediaFetcherERK7QStringS2_ @ 6 NONAME + _ZN14CpRingToneView18launchMediaFetcherERK7QStringS2_RK5QListI8QVariantERK13XQRequestInfo @ 6 NONAME _ZN14CpRingToneView19getStaticMetaObjectEv @ 7 NONAME _ZN14CpRingToneView5selOKERK7QString @ 8 NONAME _ZN14CpRingToneView8handleOkERK8QVariant @ 9 NONAME diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpringtoneview/src/cpringtoneview.cpp --- a/controlpanelui/src/cpringtoneview/src/cpringtoneview.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpringtoneview/src/cpringtoneview.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -30,6 +30,9 @@ #include #include #include +#include +//ovi ringtong address. +const QString oviUrl("http://lr.ovi.mobi/store/ringtones"); CpRingToneView::CpRingToneView( QGraphicsItem *parent ): CpBaseSettingView(0, parent), @@ -74,22 +77,29 @@ return; } mProcessing = true; - int nRow = index.row(); - + int nRow = index.row(); switch(nRow) { case 0: //no tone, set default no sound - emit selOK(QString("")); - emit aboutToClose(); - break; - case 1: //tone - launchMediaFetcher( "com.nokia.symbian.IToneFetch", "fetch()" ); - break; - case 2: //music - launchMediaFetcher("com.nokia.symbian.IMusicFetch", "fetch()" ); - break; - case 3: //get more tones - default: - break; + emit selOK(QString("")); + emit aboutToClose(); + break; + case 1: { //tone + launchMediaFetcher( "com.nokia.symbian.IToneFetch", "fetch()" ); + break; + } + case 2: { //music + XQRequestInfo requestInfo; + requestInfo.setInfo("WindowTitle", QVariant(hbTrId("txt_cp_title_control_panel"))); + launchMediaFetcher("com.nokia.symbian.IMusicFetch", "fetch()", QList(), requestInfo ); + break; + } + case 3: { //get more tones + // Launch the URL in the browser and + QDesktopServices::openUrl(QUrl(oviUrl, QUrl::TolerantMode)); + break; + } + default: + break; } } void CpRingToneView::handleOk(const QVariant &result) @@ -106,13 +116,21 @@ } -void CpRingToneView::handleError(int errorCode, const QString& errorMessage) +void CpRingToneView::handleError(int errorCode, const QString &errorMessage) { mProcessing = false; emit(selError( errorCode, errorMessage )); } -void CpRingToneView::launchMediaFetcher( const QString &strService, const QString &strItface ) +/*! + Launch media fetcher service. + \a strService, the service interface name. + \a srItface, the service operation name. + \a arguments, the request arguments, preserved. + \a info, the request info. +*/ +void CpRingToneView::launchMediaFetcher( const QString &strService, const QString &strItface,\ + const QList &arguments, const XQRequestInfo &info ) { CPFW_LOG("CpRingToneView::launchMediaFetcher, START"); if(mReq) @@ -133,10 +151,12 @@ connect(mReq, SIGNAL(requestOk(QVariant)), SLOT( handleOk(QVariant)), Qt::QueuedConnection); connect(mReq, SIGNAL(requestError(int, QString)), SLOT(handleError(int, QString))); } - - QList args; - args << QVariant(QString("")); - mReq->setArguments(args); + if (!arguments.isEmpty()) { + mReq->setArguments(arguments); + } + if (info.isValid()) { + mReq->setInfo(info); + } // Make the request if (!mReq->send()) { diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/cpserviceprovider/cpserviceprovider.pro --- a/controlpanelui/src/cpserviceprovider/cpserviceprovider.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/cpserviceprovider/cpserviceprovider.pro Thu Sep 30 16:15:53 2010 +0800 @@ -31,3 +31,6 @@ SERVICE.FILE = service_conf.xml SERVICE.OPTIONS = embeddable SERVICE.OPTIONS += hidden + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/inc/cpprofilemodel.h --- a/controlpanelui/src/inc/cpprofilemodel.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/inc/cpprofilemodel.h Thu Sep 30 16:15:53 2010 +0800 @@ -55,6 +55,7 @@ public: QString profileName(int profileId)const; + void setProfileName(int profileId, const QString &name); QStringList profileNames()const; int activateProfile(int profileId); int activeProfileId() const; diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/inc/cpprofilemonitor.h --- a/controlpanelui/src/inc/cpprofilemonitor.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/inc/cpprofilemonitor.h Thu Sep 30 16:15:53 2010 +0800 @@ -31,7 +31,9 @@ ~CpProfileMonitor(); signals: void profileActivated(int activeProfileId); - void activeProfileModified(int activeProfileId); + void avtiveProfileModified(); + void profileModified(int profileId); + void profileNameModified(); private: CpProfileMonitorPrivate *const d_ptr; diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/inc/cpringtoneview.h --- a/controlpanelui/src/inc/cpringtoneview.h Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/inc/cpringtoneview.h Thu Sep 30 16:15:53 2010 +0800 @@ -47,8 +47,9 @@ //used to mark if there is a request being processed bool mProcessing; -private: - void launchMediaFetcher( const QString &strService, const QString &strItface ); +private: + void launchMediaFetcher( const QString &strService, const QString &strItface, \ + const QList &arguments = QList(), const XQRequestInfo &info = XQRequestInfo() ); }; #endif // CPRINGTONEVIEW_H diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/silenceindicatorplugin/rom/cpsilenceindicatorplugin_resources.iby --- a/controlpanelui/src/silenceindicatorplugin/rom/cpsilenceindicatorplugin_resources.iby Thu Sep 02 17:11:27 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#ifndef SILENCEINDICATORPLUGIN_RESOURCES_IBY -#define SILENCEINDICATORPLUGIN_RESOURCES_IBY - -#include -#include - -data=DATAZ_/QT_TRANSLATIONS_DIR/cpsilenceindicatorplugin.qm QT_TRANSLATIONS_DIR/cpsilenceindicatorplugin.qm - -#endif // SILENCEINDICATORPLUGIN_RESOURCES_IBY diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/silenceindicatorplugin/silenceindicatorplugin.pro --- a/controlpanelui/src/silenceindicatorplugin/silenceindicatorplugin.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/silenceindicatorplugin/silenceindicatorplugin.pro Thu Sep 30 16:15:53 2010 +0800 @@ -18,19 +18,18 @@ HEADERS += src/cpsilenceindicatorplugin.h SOURCES += src/cpsilenceindicatorplugin.cpp -TRANSLATIONS = control_panel.ts symbian*::LIBS += -HbCore \ -HbWidgets symbian*: { TARGET.EPOCALLOWDLLDATA = 1 - TARGET.CAPABILITY = All -TCB + TARGET.CAPABILITY = ProtServ SwEvent TrustedUI ReadDeviceData + TARGET.UID3 = 0x2002C39F SYMBIAN_PLATFORMS = WINSCW \ ARMV5 LIBS += -lprofileeng BLD_INF_RULES.prj_exports += "rom/cpsilenceindicatorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(cpsilenceindicatorplugin.iby)" - BLD_INF_RULES.prj_exports += "rom/cpsilenceindicatorplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cpsilenceindicatorplugin_resources.iby)" pluginstub.sources = cpsilenceindicatorplugin.dll pluginstub.path = /resource/plugins/indicators DEPLOYMENT += pluginstub diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/silenceindicatorplugin/src/cpsilenceindicatorplugin.cpp --- a/controlpanelui/src/silenceindicatorplugin/src/cpsilenceindicatorplugin.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/silenceindicatorplugin/src/cpsilenceindicatorplugin.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -27,7 +27,6 @@ #include #include #include -#include #include "cpsilenceindicatorplugin.h" #include #include @@ -93,26 +92,20 @@ } /*! - The handleInteraction is used launch WLAN list view. + The handleInteraction is used to emit dataChange signal. */ bool CpSilenceIndicatorPlugin::handleInteraction(InteractionType type) { - bool handled = false; - switch (type) { - case InteractionActivated: - // set silence mode or disable silence mode - bool isSilence = false; - TRAP(mError, - isSilence = mEngine->SilenceModeL(); - mEngine->SetSilenceModeL(!isSilence); - ) - emit dataChanged(); - handled = true; - break; - default: - break; - } - return handled; + bool handled = false; + switch (type) { + case InteractionActivated: + emit dataChanged(); + handled = true; + break; + default: + break; + } + return handled; } /*! @@ -124,13 +117,7 @@ bool handled(false); switch (type) { case RequestActivate: - TRAP(mError, mEngine->SetSilenceModeL(true);) - handled = true; - emit dataChanged(); - break; - case RequestDeactivate: - TRAP(mError, mEngine->SetSilenceModeL(false);) handled = true; emit dataChanged(); break; @@ -151,9 +138,9 @@ // this is the statusbar icon, which is shown only when silence mode is on case MonoDecorationNameRole: if (mEngine->SilenceModeL()) { - variant = HbIcon("qtg_status_profile_silent"); + variant = QString("qtg_status_profile_silent"); } else { - variant = HbIcon(); + variant = QString(); } break; default: diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/tonefetcher/tonefetcher.pro --- a/controlpanelui/src/tonefetcher/tonefetcher.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/tonefetcher/tonefetcher.pro Thu Sep 30 16:15:53 2010 +0800 @@ -60,3 +60,6 @@ libFiles.sources = xqservice.dll libFiles.path = "!:\sys\bin" DEPLOYMENT += libFiles + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/tonefetcher/tonefetcherengine/private/CToneSelection.cpp --- a/controlpanelui/src/tonefetcher/tonefetcherengine/private/CToneSelection.cpp Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/CToneSelection.cpp Thu Sep 30 16:15:53 2010 +0800 @@ -257,9 +257,11 @@ if ( err != KErrNotFound && property ) { HBufC* songUri = HBufC::NewL( object->Uri().Length() ); + CleanupStack::PushL(songUri); TPtr ptr = songUri->Des(); ptr.Copy( object->Uri() ); iResultArray.AppendL( songUri ); + CleanupStack::Pop( songUri ); } CleanupStack::PopAndDestroy( object ); } diff -r 2fee987ebaff -r ab0490982943 controlpanelui/src/tonefetcher/tsrc/tonetestapp.pro --- a/controlpanelui/src/tonefetcher/tsrc/tonetestapp.pro Thu Sep 02 17:11:27 2010 +0800 +++ b/controlpanelui/src/tonefetcher/tsrc/tonetestapp.pro Thu Sep 30 16:15:53 2010 +0800 @@ -33,3 +33,6 @@ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } + + +symbian:MMP_RULES += SMPSAFE diff -r 2fee987ebaff -r ab0490982943 layers.sysdef.xml --- a/layers.sysdef.xml Thu Sep 02 17:11:27 2010 +0800 +++ b/layers.sysdef.xml Thu Sep 30 16:15:53 2010 +0800 @@ -9,6 +9,9 @@ + + + diff -r 2fee987ebaff -r ab0490982943 package_definition.xml --- a/package_definition.xml Thu Sep 02 17:11:27 2010 +0800 +++ b/package_definition.xml Thu Sep 30 16:15:53 2010 +0800 @@ -1,3 +1,4 @@ + @@ -7,12 +8,21 @@ + + + + + + + + +