videoplayerapp/hbvideoplayer/src/main.cpp
changeset 34 bbb98528c666
parent 30 4f111d64a341
child 38 ff53afa8ad05
equal deleted inserted replaced
33:48e74db5d516 34:bbb98528c666
    13 *
    13 *
    14 * Description:  Implementation of main.cpp
    14 * Description:  Implementation of main.cpp
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 8 %
    18 // Version : %version: 9 %
    19 
    19 
    20 
    20 
    21 #include <QObject>
    21 #include <QObject>
       
    22 #include <QTranslator>
       
    23 #include <QLocale>
    22 #include <hbapplication.h>
    24 #include <hbapplication.h>
    23 #include <hbmainwindow.h>
    25 #include <hbmainwindow.h>
    24 #include <xqserviceutil.h>
    26 #include <xqserviceutil.h>
    25 
    27 
    26 #include "videoplayerengine.h"
    28 #include "videoplayerengine.h"
    27 
    29 
    28 int main(int argc, char *argv[])
    30 int main(int argc, char *argv[])
    29 {
    31 {
    30     HbApplication app(argc, argv);
    32     HbApplication app(argc, argv);
    31 
    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 
    32     // has the application been launched via XQ Service Framework
    51     // has the application been launched via XQ Service Framework
    33     bool isService = XQServiceUtil::isService(); 
    52     bool isService = XQServiceUtil::isService();
    34     
    53 
    35      if (!isService)
    54      if (!isService)
    36      {
    55      {
    37     	 app.setApplicationName( QObject::tr("Videos") );
    56         app.setApplicationName(hbTrId("txt_videos_title_videos"));
    38      }
    57      }
    39 
    58 
    40     HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
    59     HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
    41     mainWindow.setAttribute( Qt::WA_OpaquePaintEvent );
    60     mainWindow.setAttribute( Qt::WA_OpaquePaintEvent );
    42     
    61 
    43     QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService);
    62     QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService);
    44     engine->initialize();
    63     engine->initialize();
    45     mainWindow.show();
    64     mainWindow.show();
    46     return app.exec();
    65     return app.exec();
    47    
       
    48 }
    66 }