|
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 HbApplication app(argc, argv); |
|
27 //HbView* newview= new HbView(); |
|
28 |
|
29 QTranslator *translator = new QTranslator(); |
|
30 QString lang = QLocale::system().name(); |
|
31 qDebug("OMADM Loading qm file"); |
|
32 qDebug()<<lang; |
|
33 QString path = "z:/resource/qt/translations/"; |
|
34 |
|
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 if( argc == 2) // Launch via Control Panel |
|
52 { |
|
53 QTranslator *cptranslator = new QTranslator(); |
|
54 fine = cptranslator->load("control_panel_" + lang, path); |
|
55 if(fine) |
|
56 qApp->installTranslator(cptranslator); |
|
57 else |
|
58 qDebug("control panel translator loading failed"); |
|
59 app.setApplicationName(hbTrId("txt_cp_title_control_panel")); |
|
60 } |
|
61 else |
|
62 { |
|
63 app.setApplicationName(hbTrId("txt_device_update_subhead_device_updates")); |
|
64 } |
|
65 |
|
66 HbMainWindow window; |
|
67 |
|
68 DMFotaView* view = new DMFotaView(&window); |
|
69 bool loadingok = view->addFotaView(); |
|
70 |
|
71 window.show(); |
|
72 return app.exec(); |
|
73 } |
|
74 |