# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277306018 -10800 # Node ID f5dfdd5e4a1bdea912a4a9e1d73a1b521a0e7e49 # Parent 4a9568303383e8c60ca87a03ca648538a5674c8a Revision: 201023 Kit: 2010125 diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/image/qgn_menu_note.svg --- a/controlpanelplugins/themeplugin/image/qgn_menu_note.svg Fri Jun 11 13:39:17 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/image/themePreview.nvg Binary file controlpanelplugins/themeplugin/image/themePreview.nvg has changed diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/image/themePreview.png Binary file controlpanelplugins/themeplugin/image/themePreview.png has changed diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/image/themePreview.svg --- a/controlpanelplugins/themeplugin/image/themePreview.svg Fri Jun 11 13:39:17 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp --- a/controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -37,12 +37,17 @@ static const char* KThemePathKey = "HB_THEMES_DIR"; #endif static const QString KDefaultTheme = "sfblacktheme"; - + static const QString KDefaultThemeIcon = ":/image/themePreview.nvg"; + static const QString KPreviewThumbnailNVG = "/scalable/qtg_graf_theme_preview_thumbnail.nvg"; static const QString KPreviewThumbnailSVG = "/scalable/qtg_graf_theme_preview_thumbnail.svg"; + static const QString KPreviewPrtNVG = "/scalable/qtg_graf_theme_preview_prt.nvg"; + static const QString KPreviewLscNVG = "/scalable/qtg_graf_theme_preview_lsc.nvg"; static const QString KPreviewPrtSVG = "/scalable/qtg_graf_theme_preview_prt.svg"; static const QString KPreviewLscSVG = "/scalable/qtg_graf_theme_preview_lsc.svg"; - + + static const QString KBackgroundPrtNVG = "/scalable/qtg_graf_screen_bg_prt.nvg"; + static const QString KBackgroundLscNVG = "/scalable/qtg_graf_screen_bg_lsc.nvg"; static const QString KBackgroundPrtSVG = "/scalable/qtg_graf_screen_bg_prt.svg"; static const QString KBackgroundLscSVG = "/scalable/qtg_graf_screen_bg_lsc.svg"; @@ -176,59 +181,69 @@ continue; } - QString fullPathToIcon(iconThemePath.path() + iconPath); - - if(iconPath.isEmpty()|| !QFileInfo(fullPathToIcon).exists()){ + QString fullPathToIcon(iconThemePath.path()); + + if(iconPath.isEmpty()|| !QFileInfo(fullPathToIcon + iconPath).exists()){ //Set thumbnail - if(QFileInfo(fullPathToIcon + KPreviewThumbnailSVG).exists()){ + if(QFileInfo(fullPathToIcon + KPreviewThumbnailNVG).exists()){ + nameIconPair.icon = HbIcon(fullPathToIcon + KPreviewThumbnailNVG); + }else if(QFileInfo(fullPathToIcon + KPreviewThumbnailSVG).exists()){ nameIconPair.icon = HbIcon(fullPathToIcon + KPreviewThumbnailSVG); - }else if(QFileInfo(fullPathToIcon + KBackgroundPrtSVG).exists()){ + }else if(QFileInfo(fullPathToIcon + KBackgroundPrtNVG).exists()){ + nameIconPair.icon = HbIcon(fullPathToIcon + KBackgroundPrtNVG); + } else if(QFileInfo(fullPathToIcon + KBackgroundPrtSVG).exists()){ nameIconPair.icon = HbIcon(fullPathToIcon + KBackgroundPrtSVG); } else if(QFileInfo(fullPathToIcon + KBackgroundPrtPNG).exists()){ - nameIconPair.icon = HbIcon(fullPathToIcon + KBackgroundPrtPNG); - } else{ - nameIconPair.icon = HbIcon(":/image/themePreview.svg"); + nameIconPair.icon = HbIcon(fullPathToIcon + KBackgroundPrtPNG); + }else{ + nameIconPair.icon = HbIcon(KDefaultThemeIcon); } + } else { - nameIconPair.icon = HbIcon(fullPathToIcon); + nameIconPair.icon = HbIcon(fullPathToIcon + iconPath); } //Portrait preview - QString fullPathToPreviewPrt = (iconThemePath.path() + previewPathPrt ); - if(previewPathPrt.isEmpty() || !QFileInfo(fullPathToPreviewPrt).exists()) { + if(previewPathPrt.isEmpty() || !QFileInfo(fullPathToIcon + previewPathPrt).exists()) { - if(QFileInfo(fullPathToPreviewPrt + KPreviewPrtSVG).exists()){ - nameIconPair.portraitPreviewIcon = HbIcon(fullPathToPreviewPrt + KPreviewPrtSVG); - }else if(QFileInfo(fullPathToPreviewPrt + KBackgroundPrtSVG).exists()){ - nameIconPair.portraitPreviewIcon = HbIcon(fullPathToPreviewPrt + KBackgroundPrtSVG); - } else if(QFileInfo(fullPathToPreviewPrt + KBackgroundPrtPNG).exists()){ - nameIconPair.portraitPreviewIcon = HbIcon(fullPathToPreviewPrt + KBackgroundPrtPNG); + if(QFileInfo(fullPathToIcon + KPreviewPrtNVG).exists()){ + nameIconPair.portraitPreviewIcon = HbIcon(fullPathToIcon + KPreviewPrtNVG); + }else if(QFileInfo(fullPathToIcon + KPreviewPrtSVG).exists()){ + nameIconPair.portraitPreviewIcon = HbIcon(fullPathToIcon + KPreviewPrtSVG); + }else if(QFileInfo(fullPathToIcon + KBackgroundPrtNVG).exists()){ + nameIconPair.portraitPreviewIcon = HbIcon(fullPathToIcon + KBackgroundPrtNVG); + } else if(QFileInfo(fullPathToIcon + KBackgroundPrtSVG).exists()){ + nameIconPair.portraitPreviewIcon = HbIcon(fullPathToIcon + KBackgroundPrtSVG); + } else if(QFileInfo(fullPathToIcon + KBackgroundPrtPNG).exists()){ + nameIconPair.portraitPreviewIcon = HbIcon(fullPathToIcon + KBackgroundPrtPNG); } else{ - nameIconPair.portraitPreviewIcon = HbIcon(":/image/themePreview.svg"); + nameIconPair.portraitPreviewIcon = HbIcon(KDefaultThemeIcon); } } else { - nameIconPair.portraitPreviewIcon = HbIcon(fullPathToPreviewPrt); + nameIconPair.portraitPreviewIcon = HbIcon(fullPathToIcon + previewPathPrt); } //Landscape preview - QString fullPathToPreviewLsc = (iconThemePath.path() + previewPathLsc ); - - if(previewPathLsc.isEmpty() || !QFileInfo(fullPathToPreviewLsc).exists()) { - - if(QFileInfo(fullPathToPreviewLsc + KPreviewLscSVG).exists()){ - nameIconPair.landscapePreviewIcon = HbIcon(fullPathToPreviewLsc + KPreviewLscSVG); - }else if(QFileInfo(fullPathToPreviewLsc + KBackgroundLscSVG).exists()){ - nameIconPair.landscapePreviewIcon = HbIcon(fullPathToPreviewLsc + KBackgroundLscSVG); - } else if(QFileInfo(fullPathToPreviewLsc + KBackgroundLscPNG).exists()){ - nameIconPair.landscapePreviewIcon = HbIcon(fullPathToPreviewLsc + KBackgroundLscPNG); + + if(previewPathLsc.isEmpty() || !QFileInfo(fullPathToIcon + previewPathLsc).exists()) { + if(QFileInfo(fullPathToIcon + KPreviewLscNVG).exists()){ + nameIconPair.landscapePreviewIcon = HbIcon(fullPathToIcon + KPreviewLscNVG); + }else if(QFileInfo(fullPathToIcon + KPreviewLscSVG).exists()){ + nameIconPair.landscapePreviewIcon = HbIcon(fullPathToIcon + KPreviewLscSVG); + }else if(QFileInfo(fullPathToIcon + KBackgroundLscNVG).exists()){ + nameIconPair.landscapePreviewIcon = HbIcon(fullPathToIcon + KBackgroundLscNVG); + } else if(QFileInfo(fullPathToIcon + KBackgroundLscSVG).exists()){ + nameIconPair.landscapePreviewIcon = HbIcon(fullPathToIcon + KBackgroundLscSVG); + } else if(QFileInfo(fullPathToIcon + KBackgroundLscPNG).exists()){ + nameIconPair.landscapePreviewIcon = HbIcon(fullPathToIcon + KBackgroundLscPNG); } else{ - nameIconPair.landscapePreviewIcon = HbIcon(":/image/themePreview.svg"); + nameIconPair.landscapePreviewIcon = HbIcon(KDefaultThemeIcon); } } else { - nameIconPair.landscapePreviewIcon = HbIcon(fullPathToPreviewLsc); + nameIconPair.landscapePreviewIcon = HbIcon(fullPathToIcon + previewPathLsc); } nameIconPair.name = name; @@ -261,7 +276,7 @@ // Include default CpThemeChanger::ThemeInfo def; def.name = KDefaultTheme; - def.icon = HbIcon(":/image/themePreview.svg"); + def.icon = HbIcon(KDefaultThemeIcon); mThemeList.append(def); mCurrentTheme = def; diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/src/cpthemecontrol.cpp --- a/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -42,7 +43,9 @@ #include "cpthemelistview.h" #include "cpthemepreview.h" -static const QString KPlaceholderPreview = ":/image/themePreview.svg"; +#include +#include + /*! Helper function to fetch the main window. @@ -65,10 +68,10 @@ mThemeChanger(0), mListModel(0), mSortModel(0), - mIdleTimer(0) + mThemeChangeFinished(false), + mWaitDialog(0) { mThemeChanger = new CpThemeChanger(); - QTranslator *translator = new QTranslator(this); QString lang = QLocale::system().name(); @@ -76,14 +79,11 @@ translator->load("control_panel_" + lang, path); qApp->installTranslator(translator); - mIdleTimer = new QTimer(this); - connect(mIdleTimer, SIGNAL(timeout()), this, SLOT(themeChangeTimeout())); connect(hbInstance->theme(),SIGNAL(changeFinished()), this, SLOT(themeChangeFinished())); } - /*! destorys the list view, preview and theme changer objects. */ @@ -97,6 +97,9 @@ delete mThemePreview; mThemePreview = 0; + + delete mWaitDialog; + mWaitDialog = 0; } /*! @@ -217,8 +220,7 @@ } else { mThemePreview->setThemeInfo(themeInfo); } - //TODO: use qtTrId(text_id). - mThemePreview->setTitle(tr("Control Panel")); + mThemePreview->setTitle(hbTrId("txt_cp_title_control_panel")); mWindow->setCurrentView(mThemePreview); @@ -238,13 +240,14 @@ mThemeChanger->changeTheme(theme); emit themeUpdated(mThemeChanger->currentTheme().name, mThemeChanger->currentTheme().icon); } - - //Go back to control panel view. Close theme preview. - previewClosed(); - //ask the themelistview to close. Control Panel will - //take care of removing it from window. - triggerThemeListClose(); - + + //Start a timer. If theme change takes more than 1 seconds, + //we will show a dialog (mWaitDialog) until theme change + //is done (themeChangeFinished is called). + QTimer::singleShot(1000, this, SLOT(themeWaitTimeout())); + + mThemeChangeFinished = false; + } /*! @@ -288,14 +291,49 @@ void CpThemeControl::themeChangeTimeout() { - mIdleTimer->stop(); + //Theme change is finished and idle timer has timed out, + //so revert back the application priority to normal + //and go back to control panel view. + if(mWaitDialog && mWaitDialog->isVisible()) { + mWaitDialog->hide(); + } + + previewClosed(); + //ask the themelistview to close. Control Panel will + //take care of removing it from window. + triggerThemeListClose(); + QThread::currentThread()->setPriority(QThread::NormalPriority); - +} + +void CpThemeControl::themeWaitTimeout() +{ + //If after this timeOut, theme change is still in progress, + //show a processing dialog. + if(!mThemeChangeFinished) + { + if(!mWaitDialog) { + mWaitDialog = new HbDialog(); + mWaitDialog->setModal(false); + mWaitDialog->setDismissPolicy(HbPopup::NoDismiss); + //TODO: need localized text for Hb Dialog + // Create and set HbLabel as content widget. + HbLabel *label = new HbLabel("Processing ..."); + label->setAlignment(Qt::AlignCenter); + mWaitDialog->setContentWidget(label); + } + // as we do not need any signals, calling show() instead of open() + mWaitDialog->show(); + } } void CpThemeControl::themeChangeFinished() { - mIdleTimer->start(0); + //Theme change is done. Start an idle timer to let the UI + //finish remaining tasks. + QTimer::singleShot(0, this, SLOT(themeChangeTimeout())); + mThemeChangeFinished = true; + } /*! diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/src/cpthemecontrol.h --- a/controlpanelplugins/themeplugin/src/cpthemecontrol.h Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.h Wed Jun 23 18:13:38 2010 +0300 @@ -20,7 +20,6 @@ #include #include -#include #include "cpthemechanger.h" #include @@ -31,6 +30,7 @@ class QSortFilterProxyModel; QT_END_NAMESPACE +class HbDialog; class CpThemeListView; class CpThemePreview; class CpBaseSettingView; @@ -57,6 +57,7 @@ void themeApplied(const QString& theme); void themeListClosed(); void themeChangeTimeout(); + void themeWaitTimeout(); void themeChangeFinished(); private: @@ -70,7 +71,8 @@ CpThemeChanger* mThemeChanger; QAbstractItemModel* mListModel; QSortFilterProxyModel* mSortModel; - QTimer* mIdleTimer; + bool mThemeChangeFinished; + HbDialog* mWaitDialog; }; #endif //CPTHEMECONTROL_H diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/src/cpthemelistview.cpp --- a/controlpanelplugins/themeplugin/src/cpthemelistview.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemelistview.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include +#include #include "cpthemelistview.h" @@ -45,17 +46,17 @@ //Create a layout with a heading "Select theme" at top and the list below it. HbWidget* contentWidget = new HbWidget(this); QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical); - - //setup the heading. - HbLabel* label = new HbLabel(hbTrId("txt_cp_title_select_theme"), contentWidget); - label->setFontSpec(HbFontSpec(HbFontSpec::Primary)); + HbLabel* label = new HbLabel(hbTrId("txt_cp_title_select_theme"), contentWidget);//txt_cp_title_select_theme layout->addItem(label); connect(mThemeList, SIGNAL(activated(const QModelIndex&)), this, SIGNAL(newThemeSelected(const QModelIndex&))); + HbListViewItem* listViewItem = mThemeList->listItemPrototype(); + listViewItem->setGraphicsSize(HbListViewItem::LargeIcon); + //add the list to layout. layout->addItem(mThemeList); diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/src/cpthemepreview.cpp --- a/controlpanelplugins/themeplugin/src/cpthemepreview.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemepreview.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -26,6 +26,7 @@ #include #include #include +#include #include "cpthemepreview.h" @@ -51,10 +52,8 @@ //setup the heading. - //TODO: translation of string hbTrId("txt_cp_title_preview_1") - QString themeHeading = tr("Preview: ") + mTheme.name; + QString themeHeading = HbParameterLengthLimiter("txt_cp_title_preview_1").arg(mTheme.name); HbLabel* label = new HbLabel(themeHeading, this); - label->setFontSpec(HbFontSpec(HbFontSpec::Primary)); layout->addItem(label); diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelplugins/themeplugin/themeplugin.qrc --- a/controlpanelplugins/themeplugin/themeplugin.qrc Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelplugins/themeplugin/themeplugin.qrc Wed Jun 23 18:13:38 2010 +0300 @@ -1,7 +1,5 @@ - image/qgn_menu_note.svg - image/themePreview.png - image/themePreview.svg + image/themePreview.nvg diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationgroupitemdata.cpp --- a/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationgroupitemdata.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationgroupitemdata.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -49,7 +49,8 @@ void CpCommunicationGroupItemData::beforeLoadingConfigPlugins(CpItemDataHelper &itemDataHelper) { mAirplaneModeItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem, - hbTrId("txt_cp_setlabel_offline_airplane_mode")); + hbTrId("txt_cp_setlabel_offline_airplane_mode")); + mAirplaneModeItem->setDescription(hbTrId("txt_cp_info_in_offline_mode_all_wireless_communica")); itemDataHelper.addConnection(mAirplaneModeItem, SIGNAL(clicked()), diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenconstants.h --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenconstants.h Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenconstants.h Wed Jun 23 18:13:38 2010 +0300 @@ -18,16 +18,6 @@ #ifndef CPKEYSCREENCONSTANTS_H #define CPKEYSCREENCONSTANTS_H -enum KeyscreenLockItems{ - EKeyScreenLockItem1, - EKeyScreenLockItem2, - EKeyScreenLockItem3, - EKeyScreenLockItem4, - EKeyScreenLockItem5 -}; - -const int KCpKeyscreenTimeCoeff = 15; - const int KCpKeyscreenLock15s = 15; const int KCpKeyscreenLock30s = 30; const int KCpKeyscreenLock45s = 45; diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.cpp --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -25,18 +25,27 @@ #include #include #include +#include CpKeyScreenView::CpKeyScreenView(QGraphicsItem *parent) : CpBaseSettingView(0,parent), - mScreenRadioButton(0), + mScreenComboButton(0), mRotateCheckbox(0), mBrightSliderItem(0), mCallibItem(0), mModel(0) -{ +{ HbDataForm *form = qobject_cast ( widget() ); if (form) { + // Valid range is: + // 15 secs, 30 secs, 45 secs, 1 min, 2 mins + mScreenLockValues.insert(KCpKeyscreenLock15s,hbTrId("txt_cp_setlabel_keys_screen_val_15_seconds")); + mScreenLockValues.insert(KCpKeyscreenLock30s,hbTrId("txt_cp_setlabel_keys_screen_val_30_seconds")); + mScreenLockValues.insert(KCpKeyscreenLock45s,hbTrId("txt_cp_setlabel_keys_screen_val_45_seconds")); + mScreenLockValues.insert(KCpKeyscreenLock60s,hbTrId("txt_cp_setlabel_keys_screen_val_1_minute")); + mScreenLockValues.insert(KCpKeyscreenLock120s,hbTrId("txt_cp_setlabel_keys_screen_val_2_minutes")); + form->setHeading(hbTrId("txt_cp_subhead_keys_screen")); mModel = new CpKeyScreenModel(); HbDataFormModel *model = new HbDataFormModel; @@ -61,30 +70,36 @@ void CpKeyScreenView::makeScreenItem(HbDataFormModel& model) { - mScreenRadioButton = new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, - hbTrId("txt_cp_setlabel_keys_screen_locked_after")); - qobject_cast ( widget() )->addConnection(mScreenRadioButton,SIGNAL(itemSelected(int)),this,SLOT(screenValueChanged(int))); - model.appendDataFormItem(mScreenRadioButton, model.invisibleRootItem()); + mScreenComboButton = new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_cp_setlabel_keys_screen_locked_after")); + + qobject_cast ( widget() )->addConnection( + mScreenComboButton,SIGNAL(currentIndexChanged(QString)), + this,SLOT(screenValueChanged(QString))); + + model.appendDataFormItem(mScreenComboButton, model.invisibleRootItem()); - // Valid range is: - // 15 secs, 30 secs, 45 secs, 1 min, 2 mins - QStringList sList; - sList<< hbTrId("txt_cp_setlabel_keys_screen_val_15_seconds")<< hbTrId("txt_cp_setlabel_keys_screen_val_30_seconds") - << hbTrId("txt_cp_setlabel_keys_screen_val_45_seconds")<< hbTrId("txt_cp_setlabel_keys_screen_val_1_minute") - << hbTrId("txt_cp_setlabel_keys_screen_val_2_minutes"); int period = mModel->keyguard(); - int selectedIndex = period/KCpKeyscreenTimeCoeff - 1; - if ( KCpKeyscreenLock120s == period ){ // 2 minutes - selectedIndex = EKeyScreenLockItem5; + + int selectedIndex(-1); + + QMap::iterator it = mScreenLockValues.find(period); + if (it == mScreenLockValues.end()) { + mModel->setKeyguard(KCpKeyscreenLockDefault30s); // Set keyguard and backlight period to default + selectedIndex = 1; } - if ( (KCpKeyscreenLock15s != period) && (KCpKeyscreenLock30s != period) && - (KCpKeyscreenLock45s != period) && (KCpKeyscreenLock60s != period) && - (KCpKeyscreenLock120s != period) ){ - mModel->setKeyguard(KCpKeyscreenLockDefault30s); // Set keyguard and backlight period to default - selectedIndex = EKeyScreenLockItem2; + else { + for (it = mScreenLockValues.begin();it != mScreenLockValues.end();++it) { + selectedIndex++; + if (it.key() == period) { + break; + } + } } - mScreenRadioButton->setContentWidgetData( QString("items"), sList ); - mScreenRadioButton->setContentWidgetData( QString("selected"), selectedIndex); + + QStringList items = mScreenLockValues.values(); + mScreenComboButton->setContentWidgetData( QString("items"), items ); + mScreenComboButton->setContentWidgetData( QString("currentIndex"), selectedIndex); } void CpKeyScreenView::makeRotateItem(HbDataFormModel& model) @@ -110,9 +125,17 @@ qobject_cast ( widget() )->addConnection(mBrightSliderItem,SIGNAL(valueChanged(int)),this,SLOT(brightValueChanged(int))); model.appendDataFormItem(mBrightSliderItem, model.invisibleRootItem()); + QList sliderElements; + sliderElements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement) + << QVariant(HbSlider::DecreaseElement); + mBrightSliderItem->setContentWidgetData("sliderElements",sliderElements); mBrightSliderItem->setContentWidgetData( QString("value"), mModel->brightness() ); 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") ); + mBrightSliderItem->setContentWidgetData( QString( "elementIcons" ), iconElements ); } void CpKeyScreenView::makeCallibrationItem(HbDataFormModel& model) @@ -130,13 +153,15 @@ mModel = 0; } -void CpKeyScreenView::screenValueChanged(int index) -{ - int period = (index + 1) * KCpKeyscreenTimeCoeff; - if (EKeyScreenLockItem5 == index){ - period = KCpKeyscreenLock120s; +void CpKeyScreenView::screenValueChanged(const QString &value) +{ + for (QMap::iterator it = mScreenLockValues.begin(); + it != mScreenLockValues.end();++it) { + if (it.value() == value) { + mModel->setKeyguard(it.key()); + break; + } } - mModel->setKeyguard(period); } void CpKeyScreenView::rotateValueChanged(int value) diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.h --- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.h Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.h Wed Jun 23 18:13:38 2010 +0300 @@ -17,6 +17,7 @@ #ifndef CPKEYSCREENVIEW_H #define CPKEYSCREENVIEW_H +#include #include #include @@ -24,6 +25,8 @@ class HbDataFormModel; class CpSettingFormItemData; class CpKeyScreenModel; +class QPersistentModelIndex; +class QVariant; class CpKeyScreenView : public CpBaseSettingView { @@ -39,17 +42,18 @@ void makeCallibrationItem(HbDataFormModel& model); private slots: - //need handling your member's value change - void screenValueChanged(int index); + void screenValueChanged(const QString&); void rotateValueChanged(int value); void brightValueChanged(int value); void launchCallib(); private: - CpSettingFormItemData *mScreenRadioButton; + CpSettingFormItemData *mScreenComboButton; CpSettingFormItemData *mRotateCheckbox; CpSettingFormItemData *mBrightSliderItem; CpSettingFormItemData *mCallibItem; CpKeyScreenModel* mModel; + + QMap mScreenLockValues; }; #endif// CPKEYSCREENVIEW_H diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -188,9 +188,18 @@ //Touch Screen Vibra item modelItem = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), parent ); //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 + sliderElements.clear(); + sliderElements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement) + << QVariant(HbSlider::DecreaseElement); + modelItem->setContentWidgetData("sliderElements",sliderElements); + modelItem->setContentWidgetData( QString( "minimum" ), 0 ); 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") ); + modelItem->setContentWidgetData( QString( "elementIcons" ), iconElements ); if (profileId == EProfileWrapperGeneralId) { addConnection( modelItem, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int ))); diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.cpp --- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -20,7 +20,11 @@ #include #include #include +#include #include "cpprofileactivatorentryitem.h" +#include +#include + CpProfileActivatorDialog::CpProfileActivatorDialog(CpSettingFormItemData *profileActivator, CpProfileModel &profileModel, QGraphicsItem *parent):HbDialog(parent), @@ -28,11 +32,19 @@ mProfileList(0), mProfileActivator(profileActivator) { + mTitleLabel = new HbLabel(this); + mTitleLabel->setPlainText(hbTrId("txt_cp_title_profile")); + mContentWidget = new QGraphicsWidget(this); + setContentWidget(mContentWidget); + mLayout = new QGraphicsLinearLayout(); + mLayout->setOrientation( Qt::Vertical ); mProfileIds << EProfileWrapperGeneralId << EProfileWrapperMeetingId; mProfileList = new HbRadioButtonList(); mProfileList->setItems(profileModel.profileNames()); - + mLayout->addItem(mTitleLabel); + mLayout->addItem(mProfileList); + int currentId = mProfileModel.activeProfileId(); mProfileList->setSelected(mProfileIds.indexOf(static_cast(currentId))); @@ -46,12 +58,11 @@ this->addAction(mConfirmProfile); - this->addAction(mCancelProfile); - - this->setContentWidget(mProfileList); + this->addAction(mCancelProfile); this->setModal(true); this->setDismissPolicy(HbPopup::NoDismiss); this->setTimeout(HbPopup::NoTimeout); + mContentWidget->setLayout( mLayout ); } CpProfileActivatorDialog::~CpProfileActivatorDialog() diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.h --- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.h Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.h Wed Jun 23 18:13:38 2010 +0300 @@ -24,6 +24,9 @@ class HbDataFormModelItem; class CpProfileActivatorEntryItem; class CpSettingFormItemData; +class QGraphicsLinearLayout; +class QGraphicsWidget; +class HbLabel; class CpProfileActivatorDialog: public HbDialog { @@ -44,5 +47,8 @@ QPointer mConfirmProfile; QPointer mCancelProfile; QList mProfileIds; + QGraphicsLinearLayout *mLayout; + QGraphicsWidget *mContentWidget; + HbLabel *mTitleLabel; }; #endif diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp --- a/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -28,7 +28,7 @@ #include CpVolumeGroupItemData::CpVolumeGroupItemData(CpItemDataHelper &itemDataHelper) -: CpSettingFormItemData(HbDataFormModelItem::GroupItem,tr("txt_cp_subhead_volume")),//mSilenceIndicator(0), +: CpSettingFormItemData(HbDataFormModelItem::GroupItem,hbTrId("txt_cp_subhead_volume")),//mSilenceIndicator(0), //mMasterVolume(0), //mMasterVibra(0), mVolumeController(0), diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -142,9 +142,9 @@ // so hard code here, wait for engine's correcting. switch (profileId) { case EProfileWrapperGeneralId: - return hbTrId("txt_cp_setlabel_active_profile_val_general"); + return hbTrId("txt_cp_list_general"); case EProfileWrapperMeetingId: - return hbTrId("txt_cp_setlabel_active_profile_val_meeting"); + return hbTrId("txt_cp_list_meeting"); default: return QString(""); } @@ -153,8 +153,8 @@ { //hard code, until engine part support qt localized name QStringList nameList; - nameList< +#include ToneFetcherWidget::ToneFetcherWidget( ToneFetcherView *serviceView ) : HbWidget(this), @@ -42,7 +43,8 @@ mLayout(0), mToneModel(0), mServiceView(serviceView), - mServiceEngine(0) + mServiceEngine(0), + mWaitNote(0) { mSelected = false; @@ -60,11 +62,18 @@ this, SLOT(previewEvent(ToneServiceEngine::TPreviewEvent, int))); connect( mServiceEngine, SIGNAL(notifyObjectChanged()), this, SLOT(onObjectChanged())); + connect( mServiceEngine, SIGNAL(notifyRefreshStart()), + this, SLOT(refreshStart())); + connect( mServiceEngine, SIGNAL(notifyRefreshFinish()), + this, SLOT(refreshFinish())); } ToneFetcherWidget::~ToneFetcherWidget() { - delete mToneModel; + delete mToneModel; + mToneModel = 0; + delete mWaitNote; + mWaitNote = 0; } void ToneFetcherWidget::on_list_activated(const QModelIndex &index) @@ -125,6 +134,12 @@ connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(on_list_activated(QModelIndex ))); + if( !mWaitNote ){ + mWaitNote = new HbProgressDialog( HbProgressDialog::WaitDialog ); + mWaitNote->setText( hbTrId( "Refreshing..." ) ); + QAction *action = mWaitNote->actions().at(0);//disable Cancel buttion. + action->setEnabled(false); + } } void ToneFetcherWidget::mdeSessionOpened() @@ -227,4 +242,18 @@ mToneModel->insertInOrder(fileName, filePath); } } + +void ToneFetcherWidget::refreshFinish() +{ + if (mWaitNote) { + mWaitNote->close(); + } +} + +void ToneFetcherWidget::refreshStart() +{ + if (mWaitNote) { + mWaitNote->open(); + } +} //End of File diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/tonefetcher/src/tonefetcherwidget.h --- a/controlpanelui/src/tonefetcher/src/tonefetcherwidget.h Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/tonefetcher/src/tonefetcherwidget.h Wed Jun 23 18:13:38 2010 +0300 @@ -32,6 +32,7 @@ class ToneFetcherView; class ToneFetcherModel; class HbLabel; +class HbProgressDialog; class ToneFetcherWidget : public HbWidget { @@ -55,6 +56,8 @@ void queryError(int error ); void previewEvent(ToneFetcherEngine::TPreviewEvent event, int errorId); void onObjectChanged(); + void refreshFinish(); + void refreshStart(); private: void init(); @@ -73,5 +76,6 @@ QFileInfoList mDigitalSoundList; bool mSelected; QModelIndex mOldSeletedItem; + HbProgressDialog *mWaitNote; }; #endif /* TONEFETCHERWIDGET_H_ */ diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.cpp --- a/controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -23,12 +23,69 @@ #include "tonefetcherengine.h" #include #include +#include + + +CTimeOutTimer* CTimeOutTimer::NewL(ToneSelectionEnginePrivate& aObserver) + { + CTimeOutTimer* self = CTimeOutTimer::NewLC(aObserver); + CleanupStack::Pop(self); + return self; + } + + + +CTimeOutTimer* CTimeOutTimer::NewLC(ToneSelectionEnginePrivate& aObserver) + { + CTimeOutTimer* self = new (ELeave) CTimeOutTimer(aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + + + +CTimeOutTimer::CTimeOutTimer(ToneSelectionEnginePrivate& aObserver) + : CTimer(EPriorityStandard), + iObserver( aObserver ) + { + + } + + + +CTimeOutTimer::~CTimeOutTimer() + { + Cancel(); + } + + + +void CTimeOutTimer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add(this); + } + + + +void CTimeOutTimer::RunL() + { + iObserver.ChangeObject(); + } ToneSelectionEnginePrivate::ToneSelectionEnginePrivate( ToneFetcherEngine *engine ) : mServiceEngine( engine ) { iSession = CMdESession::NewL( *this ); + iTimer = CTimeOutTimer::NewLC( *this ); + iContinue = EFalse; + iTimerStarted = EFalse; + iFreshing = EFalse; + CleanupStack::Pop(); + + } ToneSelectionEnginePrivate::~ToneSelectionEnginePrivate() @@ -78,11 +135,23 @@ void ToneSelectionEnginePrivate::HandleObjectNotification( CMdESession& /*aSession*/, TObserverNotificationType aType, - const RArray& /*aObjectIdArray*/ ) + const RArray& aObjectIdArray ) { - if ( aType == ENotifyAdd || aType == ENotifyModify || aType == ENotifyRemove ) + if ( aObjectIdArray.Count() > 0 && ( aType == ENotifyAdd || aType == ENotifyModify || aType == ENotifyRemove ) ) { - emit notifyObjectChanged(); + CPFW_LOG("ToneSelectionEnginePrivate::HandleObjectNotification count = " + QVariant(aObjectIdArray.Count()).toString() + " type = " + QVariant(aType).toString()); + const TInt KOneSecond = 1000*1000; + if ( !iFreshing ) + { + emit notifyRefreshStart(); + iFreshing = ETrue; + } + if ( !iTimerStarted ) + { + iTimer->After( 5 * KOneSecond ); + iTimerStarted = ETrue; + } + iContinue = ETrue; } } @@ -103,7 +172,18 @@ { if( aObjectIdArray.Count() > 0 ) { - emit notifyObjectChanged(); + const TInt KOneSecond = 1000*1000; + if ( !iFreshing ) + { + emit notifyRefreshStart(); + iFreshing = ETrue; + } + if ( !iTimerStarted ) + { + iTimer->After( 5 * KOneSecond ); + iTimerStarted = ETrue; + } + iContinue = ETrue; } } @@ -268,5 +348,29 @@ } } } + +void ToneSelectionEnginePrivate::ChangeObject() + { + if ( iTimerStarted ) + { + emit notifyObjectChanged(); + iTimerStarted = EFalse; + } + + if ( iContinue ) + { + iContinue = EFalse; + iTimer->After( 5000*1000 ); + iTimerStarted = ETrue; + } + else + { + if ( iFreshing ) + { + emit notifyRefreshFinish(); + iFreshing = EFalse; + } + } + } // End of File diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.h --- a/controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.h Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.h Wed Jun 23 18:13:38 2010 +0300 @@ -32,9 +32,30 @@ #include // FORWARD DECLARATIONS class ToneFetcherEngine; +class ToneSelectionEnginePrivate; // CONSTANTS _LIT( KMimeMp3, "mp3" ); +class CTimeOutTimer : public CTimer +{ +public: + static CTimeOutTimer* NewL(ToneSelectionEnginePrivate& aObserver); + static CTimeOutTimer* NewLC(ToneSelectionEnginePrivate& aObserver); + + ~CTimeOutTimer(); + +protected: + virtual void RunL(); + +private: + CTimeOutTimer(ToneSelectionEnginePrivate& aObserver); + void ConstructL(); + +private: + + ToneSelectionEnginePrivate& iObserver; +}; + // CLASS DECLARATION /** * This class is used for quering tones from mde. @@ -74,14 +95,15 @@ public: ToneSelectionEnginePrivate( ToneFetcherEngine *engine ); virtual ~ToneSelectionEnginePrivate(); - + void ChangeObject(); signals: void mdeSessionOpened(); void mdeSessionError( int error ); - void queryComplete( QStringList nameList, QStringList uriList ); + void queryComplete( const QStringList& nameList, const QStringList& uriList ); void queryError( int error ); void notifyObjectChanged(); - + void notifyRefreshStart(); + void notifyRefreshFinish(); public: static CMdEPropertyDef& PropertyDefL(CMdESession* aSession, TInt aAttr); @@ -137,6 +159,12 @@ // query error TInt iQueryError; + + // for refresh + CTimeOutTimer *iTimer; + TBool iContinue; + TBool iTimerStarted; + TBool iFreshing; }; #endif /* TONESELECTIONENGINE_H_ */ diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.cpp --- a/controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.cpp Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.cpp Wed Jun 23 18:13:38 2010 +0300 @@ -35,6 +35,10 @@ this, SIGNAL(queryError(int))); connect(d, SIGNAL(notifyObjectChanged()), this, SIGNAL(notifyObjectChanged())); + connect(d, SIGNAL(notifyRefreshStart()), + this, SIGNAL(notifyRefreshStart())); + connect(d, SIGNAL(notifyRefreshFinish()), + this, SIGNAL(notifyRefreshFinish())); connect(mAudioPlayer, SIGNAL(notifyPreviewEvent(ToneServiceEngine::TPreviewEvent, int)), this, SIGNAL(notifyPreviewEvent(ToneServiceEngine::TPreviewEvent, int))); } diff -r 4a9568303383 -r f5dfdd5e4a1b controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.h --- a/controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.h Fri Jun 11 13:39:17 2010 +0300 +++ b/controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.h Wed Jun 23 18:13:38 2010 +0300 @@ -94,6 +94,8 @@ void queryError(int error); void notifyPreviewEvent(ToneFetcherEngine::TPreviewEvent event, int errorId); void notifyObjectChanged(); + void notifyRefreshStart(); + void notifyRefreshFinish(); private: ToneSelectionEnginePrivate *d; TonePreviewPrivate *mAudioPlayer;