|
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: Implementation of main.cpp |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: 9 % |
|
19 |
|
20 |
|
21 #include <QObject> |
|
22 #include <QTranslator> |
|
23 #include <QLocale> |
|
24 #include <hbapplication.h> |
|
25 #include <hbmainwindow.h> |
|
26 #include <xqserviceutil.h> |
|
27 |
|
28 #include "videoplayerengine.h" |
|
29 |
|
30 int main(int argc, char *argv[]) |
|
31 { |
|
32 HbApplication app(argc, argv); |
|
33 |
|
34 // Load the translation file. |
|
35 QString lang = QLocale::system().name(); |
|
36 |
|
37 QTranslator translator; |
|
38 |
|
39 bool loaded(false); |
|
40 |
|
41 loaded = translator.load( "videos_" + lang, QString("c:/resource/qt/translations") ); |
|
42 |
|
43 if (!loaded) |
|
44 { |
|
45 translator.load("videos_" + lang, QString("z:/resource/qt/translations") ); |
|
46 } |
|
47 |
|
48 // Install the translator |
|
49 app.installTranslator(&translator); |
|
50 |
|
51 // has the application been launched via XQ Service Framework |
|
52 bool isService = XQServiceUtil::isService(); |
|
53 |
|
54 if (!isService) |
|
55 { |
|
56 app.setApplicationName(hbTrId("txt_videos_title_videos")); |
|
57 } |
|
58 |
|
59 HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent ); |
|
60 mainWindow.setAttribute( Qt::WA_OpaquePaintEvent ); |
|
61 |
|
62 QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService); |
|
63 engine->initialize(); |
|
64 mainWindow.show(); |
|
65 return app.exec(); |
|
66 } |