phoneuis/ussdeditor/src/main.cpp
branchRCL_3
changeset 61 41a7f70b3818
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
       
     1 /*
       
     2 * Copyright (c) 2010 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 FILES
       
    20 #include <hbapplication.h>
       
    21 #include <hbmainwindow.h> 
       
    22 #include <hbview.h>
       
    23 #include <QTranslator>
       
    24 
       
    25 #include "ussdeditorquery.h"
       
    26 #include "ussdcomms.h"
       
    27 #include "tflogger.h"
       
    28 
       
    29 // ---------------------------------------------------------
       
    30 // main()
       
    31 // Entry point function
       
    32 // Returns: 0: success
       
    33 // ---------------------------------------------------------
       
    34 //
       
    35 int main(int argc, char *argv[])
       
    36 {
       
    37     TFLOGSTRING("USSDEDITOR: main IN")
       
    38 
       
    39     // Create application instance
       
    40     HbApplication application(argc, argv);
       
    41     TFLOGSTRING("USSDEDITOR: main app")
       
    42 
       
    43     QTranslator translator;
       
    44     QString path = "Z:/resource/qt/translations/";
       
    45     QString lang = QLocale::system().name();
       
    46     bool ok = translator.load("ussd_"+lang, path);
       
    47     TFLOGSTRING2("USSDEDITOR: main, translation %d (1=OK, 0=fail)", ok )
       
    48     application.installTranslator(&translator);
       
    49 
       
    50     // Create main widow
       
    51     HbMainWindow window;
       
    52     window.show();
       
    53     TFLOGSTRING("USSDEDITOR: main window")
       
    54 
       
    55     // Add a virtual view and hidden it
       
    56     HbView *view = new HbView();
       
    57     window.addView(view);
       
    58     TFLOGSTRING("USSDEDITOR: main addView")
       
    59 
       
    60     // Create CUssdComms - ussd client
       
    61     CUssdComms *ussdComms = new CUssdComms(view);
       
    62     TFLOGSTRING("USSDEDITOR: main ussdComms")
       
    63 
       
    64     // Create HbInputDialog
       
    65     UssdEditorQuery *query = new UssdEditorQuery(*ussdComms);
       
    66     query->show();
       
    67     TFLOGSTRING("USSDEDITOR: main query")
       
    68 
       
    69     // Execute application loop
       
    70     int result = application.exec();
       
    71     TFLOGSTRING2("USSDEDITOR: main application OUT %d", result)
       
    72     delete query;
       
    73     query = 0;
       
    74     return result;
       
    75 }
       
    76 
       
    77 // End of file