ftuapplication/src/main.cpp
changeset 14 88ff81299c11
parent 12 624e91e1e029
child 15 4956c89a3c3f
equal deleted inserted replaced
12:624e91e1e029 14:88ff81299c11
    19 #include "ftufirsttimeuse.h"
    19 #include "ftufirsttimeuse.h"
    20 #include "ftutest_global.h"
    20 #include "ftutest_global.h"
    21 
    21 
    22 #include <QtGui>
    22 #include <QtGui>
    23 #include <hbapplication.h>
    23 #include <hbapplication.h>
    24 #include <QTranslator>
    24 #include <HbTranslator>
    25 #include <QLocale>
    25 #include <QLocale>
    26 #include <QTime>
    26 #include <QTime>
    27 #include <QDebug>
    27 #include <QDebug>
    28 
    28 
    29 // ---------------------------------------------------------------------------
    29 // ---------------------------------------------------------------------------
    35     QDEBUG(__FILE__<<__FUNCTION__<<"~~~~~~~"<<QTime::currentTime().toString("hh:mm:ss.zzz");)
    35     QDEBUG(__FILE__<<__FUNCTION__<<"~~~~~~~"<<QTime::currentTime().toString("hh:mm:ss.zzz");)
    36     FTUTEST_FUNC_ENTRY("FTU::FtuFirstTimeUse::main");
    36     FTUTEST_FUNC_ENTRY("FTU::FtuFirstTimeUse::main");
    37     
    37     
    38     HbApplication app(argc, argv);    
    38     HbApplication app(argc, argv);    
    39 
    39 
    40     QTranslator translator;
       
    41     
    40     
    42     QString translation = "ftu_";
    41     HbTranslator *translator = new HbTranslator("/resource/qt/translations/","firsttimesetup");
    43     if(argc > 1){
    42     
    44         translation.append(argv[1]);
       
    45     }
       
    46     else{
       
    47         // another option to load locale could be QLocale::system().language())
       
    48         translation.append(QLocale::system().name()); // this seems to be ftu_en_US in Windows and ftu_en_GB in WINSCW emulator and hardware
       
    49     }
       
    50     translator.load(translation, ":/translations" );
       
    51     app.installTranslator(&translator);
       
    52 
       
    53     QString exampleWizardsTranslation = "ftuexamplewizards_";
       
    54     if(argc > 1){
       
    55         exampleWizardsTranslation.append(argv[1]);
       
    56     }
       
    57     else{
       
    58         exampleWizardsTranslation.append(QLocale::system().name());
       
    59     }
       
    60     QTranslator exampleWizardsTranslator;
       
    61 
       
    62     exampleWizardsTranslator.load(exampleWizardsTranslation, ":/translations" );
       
    63     app.installTranslator(&exampleWizardsTranslator);
       
    64 
       
    65     FtuFirstTimeUse ftuFirstTimeUse;
    43     FtuFirstTimeUse ftuFirstTimeUse;
    66 #ifdef ROM
    44 #ifdef ROM
    67     QDir::setCurrent("Z:/");    
    45     QDir::setCurrent("Z:/");    
    68 #else
    46 #else
    69     QDir::setCurrent("C:/");
    47     QDir::setCurrent("C:/");
    74     ftuFirstTimeUse.start();
    52     ftuFirstTimeUse.start();
    75     int ret = app.exec();
    53     int ret = app.exec();
    76     QDEBUG("FTU::FtuFirstTimeUse::main");
    54     QDEBUG("FTU::FtuFirstTimeUse::main");
    77     //Work around to make sure that ftu exits
    55     //Work around to make sure that ftu exits
    78     User::Exit(0);
    56     User::Exit(0);
       
    57     delete translator;
    79     return ret;       
    58     return ret;       
    80 }
    59 }