|
1 /* |
|
2 * Copyright (c) 2005 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: Application entry. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <hbinstance.h> |
|
19 #include <dmfotaview.h> |
|
20 #include <hbapplication.h> |
|
21 #include <qdebug.h> |
|
22 #include "nsmldmsyncprivatecrkeys.h" |
|
23 |
|
24 int main(int argc, char *argv[]) |
|
25 { |
|
26 |
|
27 HbApplication app(argc, argv); |
|
28 //HbView* newview= new HbView(); |
|
29 |
|
30 QTranslator *translator = new QTranslator(); |
|
31 QString lang = QLocale::system().name(); |
|
32 qDebug("OMADM Loading qm file"); |
|
33 qDebug()<<lang; |
|
34 QString path = "z:/resource/qt/translations/"; |
|
35 // bool fine = translator->load("deviceupdates_" + lang, path);/*finally required once localisation available*/ |
|
36 bool fine = translator->load("deviceupdates_en.qm", path); |
|
37 if(fine) |
|
38 qApp->installTranslator(translator); |
|
39 else |
|
40 qDebug("omadm translator loading failed"); |
|
41 |
|
42 QTranslator *commontranslator = new QTranslator(); |
|
43 |
|
44 fine = commontranslator->load("common_" + lang + ".qm", path);/*finally required once localisation available*/ |
|
45 //fine = commontranslator->load("common_en" , path); |
|
46 if(fine) |
|
47 qApp->installTranslator(translator); |
|
48 else |
|
49 qDebug("omadm common translator loading failed"); |
|
50 |
|
51 app.setApplicationName(hbTrId("txt_device_update_subhead_device_updates")); |
|
52 |
|
53 CRepository *cenrep = CRepository::NewL(KUidSmlSyncApp); |
|
54 TInt val(0); |
|
55 if(cenrep) |
|
56 { |
|
57 cenrep->Get(KNsmlDmUILaunch, val); |
|
58 { |
|
59 if(val==1) |
|
60 { |
|
61 QTranslator *tempTranslator = new QTranslator(); |
|
62 QString lang = QLocale::system().name(); |
|
63 tempTranslator->load("control_panel_" + lang, path); |
|
64 qApp->installTranslator(tempTranslator); |
|
65 app.setApplicationName(hbTrId("txt_applib_list_control_panel")); |
|
66 val=0; |
|
67 cenrep->Set(KNsmlDmUILaunch, val); |
|
68 delete cenrep; |
|
69 cenrep = NULL; |
|
70 } |
|
71 } |
|
72 } |
|
73 HbMainWindow window; |
|
74 |
|
75 DMFotaView* view = new DMFotaView(&window); |
|
76 bool loadingok = view->addFotaView(); |
|
77 |
|
78 window.show(); |
|
79 return app.exec(); |
|
80 } |
|
81 |