39
|
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 |
|
40
|
18 |
// Version : %version: 3 %
|
39
|
19 |
|
|
20 |
|
|
21 |
#include <QObject>
|
|
22 |
#include <QTranslator>
|
|
23 |
#include <QLocale>
|
|
24 |
#include <hbapplication.h>
|
|
25 |
#include <hbmainwindow.h>
|
|
26 |
#include <xqserviceutil.h>
|
40
|
27 |
#include <hbactivitymanager.h>
|
39
|
28 |
|
|
29 |
#include "videoplayerengine.h"
|
40
|
30 |
#include "videoactivitystate.h"
|
39
|
31 |
|
|
32 |
int main(int argc, char *argv[])
|
|
33 |
{
|
40
|
34 |
HbApplication app(argc, argv, Hb::SplashFixedVertical);
|
39
|
35 |
|
|
36 |
// Load the translation file.
|
|
37 |
QString lang = QLocale::system().name();
|
|
38 |
|
|
39 |
QTranslator translator;
|
|
40 |
|
|
41 |
bool loaded(false);
|
|
42 |
|
|
43 |
loaded = translator.load( "videos_" + lang, QString("c:/resource/qt/translations") );
|
|
44 |
|
|
45 |
if (!loaded)
|
|
46 |
{
|
|
47 |
translator.load("videos_" + lang, QString("z:/resource/qt/translations") );
|
|
48 |
}
|
|
49 |
|
|
50 |
// Install the translator
|
|
51 |
app.installTranslator(&translator);
|
|
52 |
|
|
53 |
QTranslator translatorCommon;
|
|
54 |
|
|
55 |
loaded = false;
|
|
56 |
|
|
57 |
loaded = translatorCommon.load( "common_" + lang, QString("c:/resource/qt/translations") );
|
|
58 |
|
|
59 |
if (!loaded)
|
|
60 |
{
|
|
61 |
translatorCommon.load("common_" + lang, QString("z:/resource/qt/translations") );
|
|
62 |
}
|
|
63 |
|
|
64 |
// Install the common translator
|
|
65 |
app.installTranslator(&translatorCommon);
|
|
66 |
|
|
67 |
// has the application been launched via XQ Service Framework
|
|
68 |
bool isService = XQServiceUtil::isService();
|
|
69 |
|
|
70 |
if (!isService)
|
|
71 |
{
|
|
72 |
app.setApplicationName(hbTrId("txt_videos_title_videos"));
|
40
|
73 |
|
|
74 |
HbActivityManager *actManager = app.activityManager();
|
|
75 |
// save activity data locally
|
|
76 |
VideoActivityState::instance().setActivityData(actManager->activityData(ACTIVITY_VIDEOPLAYER_MAINVIEW));
|
|
77 |
// remove from activitymanager
|
|
78 |
actManager->removeActivity(ACTIVITY_VIDEOPLAYER_MAINVIEW);
|
39
|
79 |
}
|
|
80 |
|
|
81 |
HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
|
|
82 |
mainWindow.setAttribute( Qt::WA_OpaquePaintEvent );
|
|
83 |
|
|
84 |
QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService);
|
|
85 |
engine->initialize();
|
|
86 |
mainWindow.show();
|
|
87 |
return app.exec();
|
|
88 |
}
|