|
1 /* |
|
2 * Copyright (c) 2010 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 // System includes |
|
19 |
|
20 #include <QLocale> |
|
21 #include <QCoreApplication> |
|
22 #include <cpitemdatahelper.h> |
|
23 #include <cpsettingformitemdata.h> |
|
24 |
|
25 // User includes |
|
26 |
|
27 #include "cpwlansettingsplugin.h" |
|
28 #include "cpwlansettingsgroupitemdata.h" |
|
29 |
|
30 #include "OstTraceDefinitions.h" |
|
31 #ifdef OST_TRACE_COMPILER_IN_USE |
|
32 #include "cpwlansettingspluginTraces.h" |
|
33 #endif |
|
34 |
|
35 /*! |
|
36 \class CpWlanSettingsPlugin |
|
37 \brief CpWlanSettingsPlugin implements the WLAN Settings Control Panel Plugin |
|
38 which will allow viewing/editing of Manage WLAN Settings. |
|
39 */ |
|
40 |
|
41 // External function prototypes |
|
42 |
|
43 // Local constants |
|
44 |
|
45 // ======== MEMBER FUNCTIONS ======== |
|
46 |
|
47 /*! |
|
48 Constructor. |
|
49 */ |
|
50 |
|
51 CpWlanSettingsPlugin::CpWlanSettingsPlugin() : |
|
52 QObject() |
|
53 { |
|
54 OstTraceFunctionEntry1(CPWLANSETTINGSPLUGIN_CPWLANSETTINGSPLUGIN_ENTRY, this); |
|
55 |
|
56 translator = new QTranslator(this); |
|
57 |
|
58 OstTraceFunctionExit1(CPWLANSETTINGSPLUGIN_CPWLANSETTINGSPLUGIN_EXIT, this); |
|
59 } |
|
60 |
|
61 /*! |
|
62 Destructor. |
|
63 */ |
|
64 |
|
65 CpWlanSettingsPlugin::~CpWlanSettingsPlugin() |
|
66 { |
|
67 |
|
68 OstTraceFunctionEntry1(DUP1_CPWLANSETTINGSPLUGIN_CPWLANSETTINGSPLUGIN_ENTRY, this); |
|
69 OstTraceFunctionExit1(DUP1_CPWLANSETTINGSPLUGIN_CPWLANSETTINGSPLUGIN_EXIT, this); |
|
70 } |
|
71 |
|
72 /*! |
|
73 Plugin function for creating the WLAN Settings form item data. |
|
74 */ |
|
75 |
|
76 QList<CpSettingFormItemData*> CpWlanSettingsPlugin::createSettingFormItemData( |
|
77 CpItemDataHelper &itemDataHelper) const |
|
78 { |
|
79 OstTraceFunctionEntry1(CPWLANSETTINGSPLUGIN_CREATESETTINGFORMITEMDATA_ENTRY, this); |
|
80 |
|
81 // Locale |
|
82 QString lang = QLocale::system().name(); |
|
83 QString path = "Z:/resource/qt/translations/"; |
|
84 translator->load("cpwlansettingsplugin_" + lang, path); |
|
85 qApp->installTranslator(translator); |
|
86 |
|
87 QList<CpSettingFormItemData*> settingFormData; |
|
88 settingFormData.append(new CpWlanSettingsGroupItemData(itemDataHelper)); |
|
89 |
|
90 OstTraceFunctionExit1(CPWLANSETTINGSPLUGIN_CREATESETTINGFORMITEMDATA_EXIT, this); |
|
91 return settingFormData; |
|
92 |
|
93 } |
|
94 |
|
95 Q_EXPORT_PLUGIN2(cpwlansettingsplugin, CpWlanSettingsPlugin); |