calendarui/application/src/main.cpp
changeset 18 c198609911f9
child 23 fd30d51f876b
equal deleted inserted replaced
0:f979ecb2b13e 18:c198609911f9
       
     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:  main implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <QtGui>
       
    20 #include <QTranslator>
       
    21 #include <xqserviceutil.h>
       
    22 #include <hbapplication.h> 
       
    23 #include <hbmainwindow.h>  
       
    24 #include "calencontroller.h"
       
    25 #include "calenserviceprovider.h"
       
    26 
       
    27 
       
    28  int main(int argc, char *argv[])
       
    29     {
       
    30     HbApplication app(argc, argv);
       
    31     
       
    32     // Main window for providing the scene context
       
    33 	HbMainWindow window;
       
    34 	window.setRenderHints(
       
    35 			QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
       
    36 	window.setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
       
    37 	
       
    38     //For translation, loading and installing translator
       
    39 	QTranslator translator;
       
    40     QString lang = QLocale::system().name();
       
    41     QString path = "Z:/resource/qt/translations/";
       
    42     // TODO: Load the appropriate .qm file based on locale
       
    43     //bool loaded = translator.load("calendar_" + lang, path);
       
    44     bool loaded = translator.load("calendar_en_GB",":/translations");
       
    45     app.installTranslator(&translator);
       
    46 
       
    47     //Backup and restore code  need to write here.
       
    48 	
       
    49     // Check if calendar is launched thru XQService framework
       
    50     bool isFromServiceFrmwrk = XQServiceUtil::isService();
       
    51     CCalenController *controller = new CCalenController(isFromServiceFrmwrk);
       
    52     
       
    53     // Create the Calendar service provider
       
    54     CalenServiceProvider service(controller);
       
    55     return app.exec();
       
    56     }
       
    57 
       
    58 
       
    59  //End of file