videoplayerapp/videoplayer/src/main.cpp
changeset 62 0e1e938beb1a
parent 52 e3cecb93e76a
equal deleted inserted replaced
59:a76e86df7ccd 62:0e1e938beb1a
    13 *
    13 *
    14 * Description:  Implementation of main.cpp
    14 * Description:  Implementation of main.cpp
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 10 %
    18 // Version : %version: 11.1.3 %
    19 
    19 
    20 
    20 
    21 #include <QObject>
    21 #include <QObject>
    22 #include <hbapplication.h>
    22 #include <hbapplication.h>
    23 #include <hbmainwindow.h>
    23 #include <hbmainwindow.h>
    24 #include <xqserviceutil.h>
    24 #include <xqserviceutil.h>
    25 #include <hbactivitymanager.h>
       
    26 #include <hbtranslator.h> 
    25 #include <hbtranslator.h> 
    27 
    26 
    28 #include "videoplayerengine.h"
    27 #include "videoplayerengine.h"
    29 #include "videoactivitystate.h"
    28 #include "videoplayerapp.h"
    30 
    29 
    31 int main(int argc, char *argv[])
    30 int main(int argc, char *argv[])
    32 {
    31 {
    33     HbApplication app( argc, argv, Hb::SplashFixedVertical );
    32     //
       
    33     // has the application been launched via XQ Service Framework
       
    34     //
       
    35     bool isAservice(XQServiceUtil::isService(argc, argv));
       
    36 
       
    37     VideoPlayerApp app( argc, argv, isAservice ? Hb::NoSplash : Hb::SplashFixedVertical );
    34 
    38 
    35     // 
    39     // 
    36     // automatically loads & installs corresponding translation file
    40     // automatically loads & installs corresponding translation file
    37     //
    41     //
    38     HbTranslator translator("videos");
    42     HbTranslator translator("videos");
    39     translator.loadCommon();
    43     translator.loadCommon();
    40     
    44     
    41     //
    45     if ( !isAservice )
    42     // has the application been launched via XQ Service Framework
       
    43     //
       
    44     bool isService = XQServiceUtil::isService();
       
    45     
       
    46     if ( ! isService )
       
    47     {
    46     {
    48         app.setApplicationName( hbTrId("txt_videos_title_videos") );
    47         app.setApplicationName( hbTrId("txt_videos_title_videos") );
    49         
       
    50         HbActivityManager *actManager = app.activityManager();
       
    51         // save activity data locally
       
    52         VideoActivityState::instance().setActivityData( actManager->activityData( ACTIVITY_VIDEOPLAYER_MAINVIEW ) );
       
    53         // remove from activitymanager
       
    54         actManager->removeActivity( ACTIVITY_VIDEOPLAYER_MAINVIEW );
       
    55     }
    48     }
    56 
    49 
    57     HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
    50     HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
       
    51     QObject::connect(&mainWindow, SIGNAL(viewReady()), &app, SLOT(viewReadySlot()));
    58 
    52 
    59     VideoPlayerEngine *engine = new VideoPlayerEngine( isService );
    53     VideoPlayerEngine *engine = new VideoPlayerEngine( isAservice );
    60     QObject::connect(&mainWindow, SIGNAL(viewReady()), engine, SLOT(viewReadySlot()));
       
    61     engine->initialize();
    54     engine->initialize();
    62     mainWindow.show();
    55     mainWindow.show();
    63     return app.exec();
    56     return app.exec();
    64 }
    57 }