|
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 <hbapplication.h> |
|
19 #include <hbmainwindow.h> |
|
20 #include <QTranslator> |
|
21 #include <cplogger.h> |
|
22 #include "cpmainview.h" |
|
23 |
|
24 int main(int argc, char **argv) |
|
25 { |
|
26 HbApplication app(argc, argv); |
|
27 |
|
28 //used by QSettings |
|
29 QCoreApplication::setOrganizationName("nokia"); |
|
30 QCoreApplication::setOrganizationDomain("Orbit"); |
|
31 QCoreApplication::setApplicationName("ControlPanel"); |
|
32 |
|
33 Logger::instance(CPFW_LOGGER_NAME)->configure( |
|
34 CP_LOGGER_CONFIG_PATH,QSettings::IniFormat); |
|
35 |
|
36 CPFW_LOG("Entering ControlPanel.exe..."); |
|
37 |
|
38 QTranslator translator; |
|
39 if (translator.load("controlpanel_" + QLocale::system().name())) |
|
40 { |
|
41 qApp->installTranslator(&translator); |
|
42 } |
|
43 |
|
44 HbMainWindow mainWindow; |
|
45 CpMainView *mainView = new CpMainView(); |
|
46 #ifdef WIN32 |
|
47 mainWindow.setOrientation(Qt::Vertical); |
|
48 #endif |
|
49 QObject::connect(mainView,SIGNAL(aboutToClose()),&app, SLOT(quit())); |
|
50 mainWindow.addView(mainView); |
|
51 mainWindow.show(); |
|
52 |
|
53 int ret = app.exec(); |
|
54 |
|
55 CPFW_LOG("Exiting ControlPanel.exe."); |
|
56 |
|
57 Logger::closeAll(); |
|
58 |
|
59 return ret; |
|
60 } |
|
61 |
|
62 // |