usbuis/usbuiqt/src/main.cpp
changeset 43 4712310216c0
child 46 0ffee699d6c7
equal deleted inserted replaced
3:47c263f7e521 43:4712310216c0
       
     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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <hbapplication.h>
       
    20 #include <hbmainwindow.h>
       
    21 #include <QTranslator>
       
    22 #include <eikenv.h>
       
    23 #include "usbviewmanager.h"
       
    24 
       
    25 int main(int argc, char *argv[])
       
    26 {
       
    27     HbApplication app(argc, argv);
       
    28 
       
    29     // add translator for application library
       
    30     QString locale = QLocale::system().name();
       
    31     QTranslator translator;
       
    32     QString filename = QString("usbapplication_") + locale;
       
    33 #ifdef Q_OS_SYMBIAN    
       
    34     // TRAP is must here, otherwise it crashes
       
    35 TRAP_IGNORE(
       
    36     bool loaded(false);
       
    37     loaded = translator.load( filename, QString("z:/resource") );
       
    38     if (!loaded)
       
    39         translator.load(filename, QString("c:/resource") );
       
    40 );
       
    41 #else
       
    42     translator.load(filename, QString("resource") );
       
    43 #endif //Q_OS_SYMBIAN    
       
    44     app.installTranslator(&translator);
       
    45     
       
    46     HbMainWindow mainWindow;
       
    47 
       
    48     // create the view manager, which handles 3 HbViews and add into mainWindow.
       
    49     UsbViewManager* mViewManager = new UsbViewManager( &mainWindow, &app );
       
    50     mViewManager->addView();
       
    51     
       
    52     mainWindow.show();
       
    53     return app.exec();
       
    54 }