13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 #include "emailtrace.h" |
|
19 |
18 #include <cpsettingformentryitemdataimpl.h> |
20 #include <cpsettingformentryitemdataimpl.h> |
19 #include <HbApplication> |
21 #include <HbApplication> |
20 #include <QTranslator> |
22 #include <QTranslator> |
21 #include <QLocale> |
23 #include <QLocale> |
22 |
24 |
23 #include "nmsettingsplugin.h" |
25 #include "nmsettingsplugin.h" |
24 #include "nmsettingsviewfactory.h" |
26 #include "nmsettingsviewfactory.h" |
25 |
27 |
26 /*! |
28 /*! |
27 \class NmSettingsPlugin |
29 \class NmSettingsPlugin |
28 \brief The class implements CpPluginPlatInterface which is an interface |
30 \brief The class implements CpPluginInterface which is an interface |
29 for plug-ins that are displayed in the control panel application. |
31 for plug-ins that are displayed in the control panel application. |
30 The class works as an entry point for NMail settings. |
32 The class works as an entry point for NMail settings. |
31 |
33 |
32 */ |
34 */ |
33 |
35 |
37 Constructor of NmSettingsPlugin. |
39 Constructor of NmSettingsPlugin. |
38 */ |
40 */ |
39 NmSettingsPlugin::NmSettingsPlugin() |
41 NmSettingsPlugin::NmSettingsPlugin() |
40 : mTranslator(0) |
42 : mTranslator(0) |
41 { |
43 { |
|
44 NM_FUNCTION; |
|
45 |
42 mTranslator = new QTranslator(); |
46 mTranslator = new QTranslator(); |
43 QString lang = QLocale::system().name(); |
47 QString lang = QLocale::system().name(); |
44 QString appName = "mail_"; |
48 QString appName = "mail_"; |
45 QString path = "z:/resource/qt/translations/"; |
49 QString path = "z:/resource/qt/translations/"; |
46 mTranslator->load(appName + lang, path); |
50 mTranslator->load(appName + lang, path); |
50 /*! |
54 /*! |
51 Destructor of NmSettingsPlugin. |
55 Destructor of NmSettingsPlugin. |
52 */ |
56 */ |
53 NmSettingsPlugin::~NmSettingsPlugin() |
57 NmSettingsPlugin::~NmSettingsPlugin() |
54 { |
58 { |
|
59 NM_FUNCTION; |
|
60 |
55 delete mTranslator; |
61 delete mTranslator; |
56 } |
62 } |
57 |
63 |
58 /*! |
64 /*! |
59 Creates a data form model item, that is used by the control panel framework. |
65 Creates a data form model item, that is used by the control panel framework. |
60 |
66 |
61 \param itemDataHelper Helper class that helps control panel plug-ins to |
67 \param itemDataHelper Helper class that helps control panel plug-ins to |
62 connect slots to inner widgets of the setting items. |
68 connect slots to inner widgets of the setting items. |
63 |
69 |
64 \return Instance of CpSettingFormItemData. |
70 \return List of CpSettingFormItemData items. |
65 Caller is the owner of the returned instance. |
|
66 */ |
71 */ |
67 CpSettingFormItemData *NmSettingsPlugin::createSettingFormItemData( |
72 QList<CpSettingFormItemData*> NmSettingsPlugin::createSettingFormItemData( |
68 CpItemDataHelper &itemDataHelper) const |
73 CpItemDataHelper &itemDataHelper) const |
69 { |
74 { |
|
75 NM_FUNCTION; |
|
76 |
70 HbIcon icon("qtg_large_email"); |
77 HbIcon icon("qtg_large_email"); |
|
78 QList<CpSettingFormItemData*> list; |
71 |
79 |
72 return new NmSettingsViewFactory(itemDataHelper, |
80 CpSettingFormItemData* viewFactory = new NmSettingsViewFactory(itemDataHelper, |
73 hbTrId("txt_mail_title_control_panel"), "", |
81 hbTrId("txt_mail_title_control_panel"), "", icon); |
74 icon); |
82 list.append(viewFactory); |
|
83 return list; |
75 } |
84 } |
76 |
85 |
77 Q_EXPORT_PLUGIN2(nmsettingsplugin, NmSettingsPlugin); |
86 Q_EXPORT_PLUGIN2(nmsettingsplugin, NmSettingsPlugin); |