utilityapps/screengrabber/src/main.cpp
changeset 55 2d9cac8919d3
parent 15 e11368ed4880
equal deleted inserted replaced
53:819e59dfc032 55:2d9cac8919d3
       
     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 #include <QtGui/QMessageBox>
       
    19 
       
    20 #include <hbmainwindow.h>
       
    21 #include <hbview.h>
       
    22 #include <hbmessagebox.h>
       
    23 #include <coecntrl.h>
       
    24 
       
    25 #include "mainview.h"
       
    26 #include "application.h"
       
    27 #include "enginewrapper.h"
       
    28 #include "settingsview.h"
       
    29 
       
    30 
       
    31 
       
    32 int main(int argc, char *argv[])
       
    33 {
       
    34     
       
    35     SGApplication app(argc, argv);
       
    36 	
       
    37     EngineWrapper engineWrapper;
       
    38 	app.SetEngineWrapper(&engineWrapper);
       
    39     if (!engineWrapper.init()) {
       
    40       return EXIT_FAILURE;
       
    41     }
       
    42 
       
    43 	
       
    44 	
       
    45     HbMainWindow mainWindow;
       
    46     
       
    47     //Create main view
       
    48     MainView* view = new MainView(mainWindow, engineWrapper);
       
    49     //initialize main view
       
    50     view->init(app);
       
    51 
       
    52 	
       
    53     SettingsView* settingsView = new SettingsView(*view, mainWindow, engineWrapper);
       
    54 	
       
    55 	view->setSettingsView(settingsView);
       
    56     
       
    57 	// Add Views to main window and reveal it.
       
    58     mainWindow.addView(view);
       
    59     mainWindow.addView(settingsView);
       
    60 
       
    61     
       
    62     mainWindow.show();
       
    63      
       
    64     int result = app.exec();
       
    65    
       
    66     return result;
       
    67 }
       
    68