# HG changeset patch # User hgs # Date 1270063873 -28800 # Node ID 159cfcd3c1c59400046e83669b2237ad388f9bc1 # Parent 8844afdb7529a9e113087e4bbd6b0e52da8cf8ee 201009_01 diff -r 8844afdb7529 -r 159cfcd3c1c5 controlpanel/controlpanel_plat/inc/cpbasesettingview.h --- a/controlpanel/controlpanel_plat/inc/cpbasesettingview.h Thu Apr 01 03:28:45 2010 +0800 +++ b/controlpanel/controlpanel_plat/inc/cpbasesettingview.h Thu Apr 01 03:31:13 2010 +0800 @@ -39,7 +39,6 @@ Q_DISABLE_COPY(CpBaseSettingView) Q_DECLARE_PRIVATE_D(d_ptr, CpBaseSettingView) Q_PRIVATE_SLOT(d_func(), void _q_softkeyClicked()) - Q_PRIVATE_SLOT(d_func(), void _q_viewChanged(HbView *view)) private: CpBaseSettingViewPrivate *d_ptr; }; diff -r 8844afdb7529 -r 159cfcd3c1c5 controlpanel/src/cpframework/src/cpbasesettingview_p.cpp --- a/controlpanel/src/cpframework/src/cpbasesettingview_p.cpp Thu Apr 01 03:28:45 2010 +0800 +++ b/controlpanel/src/cpframework/src/cpbasesettingview_p.cpp Thu Apr 01 03:31:13 2010 +0800 @@ -28,27 +28,18 @@ #include "cpsettingformentryitemdata.h" #include "cppluginutility.h" -static HbMainWindow *mainWindow() -{ - QList< HbMainWindow* > mainWindows = hbInstance->allMainWindows(); - if (!mainWindows.isEmpty()) { - return mainWindows.front(); - } - return 0; -} - CpBaseSettingViewPrivate::CpBaseSettingViewPrivate() : mBaseSettingView(0), - mSoftKeyBackAction(0), - //mSettingForm(0), - mIsActiveView(false) + mSoftKeyBackAction(0) { } CpBaseSettingViewPrivate::~CpBaseSettingViewPrivate() { - clearSoftkey(); + if (mBaseSettingView) { + mBaseSettingView->setNavigationAction (0); + } delete mSoftKeyBackAction; mSoftKeyBackAction = 0; @@ -63,7 +54,6 @@ CpPluginUtility::addCpItemPrototype(qobject_cast(widget)); } - //setSettingForm(settingForm); mBaseSettingView->setWidget(widget); mBaseSettingView->setTitle("Control Panel"); //give a default title, sub classes need set it correctly @@ -74,14 +64,7 @@ mBaseSettingView, SLOT(_q_softkeyClicked()) ); - if (mainWindow()) { - QObject::connect(mainWindow(), - SIGNAL(currentViewChanged(HbView *)), - mBaseSettingView, - SLOT(_q_viewChanged(HbView *)) ); - } - - setSoftkey(); + mBaseSettingView->setNavigationAction (mSoftKeyBackAction); } void CpBaseSettingViewPrivate::setSettingForm(HbDataForm *settingForm) @@ -90,39 +73,11 @@ CpPluginUtility::addCpItemPrototype(settingForm); } -void CpBaseSettingViewPrivate::setSoftkey() -{ - if (mainWindow()) { - mainWindow()->addSoftKeyAction(Hb::SecondarySoftKey, - mSoftKeyBackAction); - } -} - -void CpBaseSettingViewPrivate::clearSoftkey() -{ - if (mainWindow()) - { - mainWindow()->removeSoftKeyAction(Hb::SecondarySoftKey, - mSoftKeyBackAction); - } -} - void CpBaseSettingViewPrivate::_q_softkeyClicked() { emit mBaseSettingView->aboutToClose(); } -void CpBaseSettingViewPrivate::_q_viewChanged(HbView *view) -{ - if (mIsActiveView && view != mBaseSettingView) { - mIsActiveView = false; - clearSoftkey(); - } - else if (!mIsActiveView && mBaseSettingView == view) { - mIsActiveView = true; - setSoftkey(); - } -} - #include "moc_cpbasesettingview.cpp" +//End of File diff -r 8844afdb7529 -r 159cfcd3c1c5 controlpanel/src/cpframework/src/cpbasesettingview_p.h --- a/controlpanel/src/cpframework/src/cpbasesettingview_p.h Thu Apr 01 03:28:45 2010 +0800 +++ b/controlpanel/src/cpframework/src/cpbasesettingview_p.h Thu Apr 01 03:31:13 2010 +0800 @@ -41,21 +41,13 @@ void init(QGraphicsWidget *widget,CpBaseSettingView *baseSettingView); void setSettingForm(HbDataForm *settingForm); - /* - softkey - */ - void setSoftkey(); - void clearSoftkey(); - //SLOTS void _q_softkeyClicked(); - void _q_viewChanged(HbView *view); private: //DATA CpBaseSettingView *mBaseSettingView; HbAction *mSoftKeyBackAction; HbDataForm *mSettingForm; - bool mIsActiveView; friend class CpBaseSettingView; };