52 int main(int argc, char *argv[]) |
52 int main(int argc, char *argv[]) |
53 { |
53 { |
54 TX_STATIC_ENTRY |
54 TX_STATIC_ENTRY |
55 |
55 |
56 // Initialization |
56 // Initialization |
57 HbApplication app(argc, argv, Hb::NoSplash); |
57 HbApplication app( argc, argv, XQServiceUtil::isService(argc, argv) ? Hb::NoSplash : Hb::DefaultApplicationFlags ); |
58 if ( !XQServiceUtil::isService() ) { |
58 |
59 HbSplashScreen::start( ); |
|
60 } |
|
61 QVariantHash params = app.activateParams(); |
|
62 HbTranslator translator; |
59 HbTranslator translator; |
63 translator.loadCommon(); |
60 translator.loadCommon(); |
64 MpMainWindow::ActivityMode mode; |
|
65 |
|
66 if ( !params.value( "activityname" ).toString().compare( "MusicNowPlayingView" ) ) { |
|
67 mode = MpMainWindow::MusicNowPlayingView; |
|
68 } |
|
69 else { |
|
70 mode = MpMainWindow::MusicMainView; |
|
71 } |
|
72 |
61 |
73 // Main window widget. |
62 // Main window widget. |
74 // Includes decorators such as signal strength and battery life indicator. |
63 // Includes decorators such as signal strength and battery life indicator. |
75 MpMainWindow mainWindow; |
64 MpMainWindow mainWindow; |
76 mainWindow.viewport()->grabGesture(Qt::SwipeGesture); |
65 mainWindow.viewport()->grabGesture(Qt::SwipeGesture); |
77 mainWindow.viewport()->grabGesture(Qt::PanGesture); |
66 mainWindow.viewport()->grabGesture(Qt::PanGesture); |
78 mainWindow.viewport()->grabGesture(Qt::TapGesture); |
67 mainWindow.viewport()->grabGesture(Qt::TapGesture); |
79 mainWindow.viewport()->grabGesture(Qt::TapAndHoldGesture); |
68 mainWindow.viewport()->grabGesture(Qt::TapAndHoldGesture); |
80 mainWindow.initialize( mode ); |
69 mainWindow.initialize(); |
81 mainWindow.show(); |
70 mainWindow.show(); |
82 |
71 |
83 // Enter event loop |
72 // Enter event loop |
84 TX_EXIT |
73 TX_EXIT |
85 return app.exec(); |
74 return app.exec(); |