1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "cpbasesettingview_p.h" |
|
19 #include "cpbasesettingview.h" |
|
20 #include <hbinstance.h> |
|
21 #include <hbaction.h> |
|
22 #include <hbmainwindow.h> |
|
23 #include <hbdataform.h> |
|
24 #include <hbdataformmodel.h> |
|
25 #include <QGraphicsLayout> |
|
26 #include "cpitemdatahelper.h" |
|
27 #include "cppluginutility.h" |
|
28 |
|
29 |
|
30 CpBaseSettingViewPrivate::CpBaseSettingViewPrivate() : |
|
31 mBaseSettingView(0), |
|
32 mSoftKeyBackAction(0) |
|
33 { |
|
34 } |
|
35 |
|
36 CpBaseSettingViewPrivate::~CpBaseSettingViewPrivate() |
|
37 { |
|
38 if (mBaseSettingView) { |
|
39 mBaseSettingView->setNavigationAction (0); |
|
40 } |
|
41 |
|
42 delete mSoftKeyBackAction; |
|
43 mSoftKeyBackAction = 0; |
|
44 } |
|
45 |
|
46 void CpBaseSettingViewPrivate::init(QGraphicsWidget *widget,CpBaseSettingView *baseSettingView) |
|
47 { |
|
48 mBaseSettingView = baseSettingView; |
|
49 |
|
50 if (!widget) { |
|
51 widget = new HbDataForm(); |
|
52 CpPluginUtility::addCpItemPrototype(qobject_cast<HbDataForm *>(widget)); |
|
53 } |
|
54 |
|
55 mBaseSettingView->setWidget(widget); |
|
56 |
|
57 mBaseSettingView->setTitle(hbTrId("txt_cp_title_control_panel")); //give a default title, sub classes need set it correctly |
|
58 |
|
59 mSoftKeyBackAction = new HbAction(Hb::BackNaviAction , mBaseSettingView); |
|
60 QObject::connect(mSoftKeyBackAction, |
|
61 SIGNAL(triggered()), |
|
62 mBaseSettingView, |
|
63 SLOT(_q_softkeyClicked()) ); |
|
64 |
|
65 mBaseSettingView->setNavigationAction (mSoftKeyBackAction); |
|
66 } |
|
67 |
|
68 void CpBaseSettingViewPrivate::_q_softkeyClicked() |
|
69 { |
|
70 mBaseSettingView->close(); |
|
71 } |
|
72 |
|
73 #include "moc_cpbasesettingview.cpp" |
|
74 |
|
75 //End of File |
|