--- 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;
};
--- 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<HbDataForm *>(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
--- 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;
};