perfmon/ui/hb/app/src/mainwindow.cpp
branchRCL_3
changeset 22 fad26422216a
parent 21 b3cee849fa46
child 23 f8280f3bfeb7
equal deleted inserted replaced
21:b3cee849fa46 22:fad26422216a
     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 <HbAction>
       
    19 
       
    20 #include "mainwindow.h"
       
    21 
       
    22 #include "enginewrapper.h"
       
    23 #include "mainview.h"
       
    24 #include "settingsview.h"
       
    25 
       
    26 MainWindow::MainWindow(EngineWrapper &engine, QWidget *parent)
       
    27     : HbMainWindow(parent)
       
    28     , mEngine(engine)
       
    29 {
       
    30     mMainView = new MainView(mEngine);
       
    31     connect(mMainView, SIGNAL(settingsCommandInvoked()), this, SLOT(showSettings()));
       
    32 
       
    33     addView(mMainView);
       
    34     
       
    35     mSettingsView = new SettingsView(mEngine);
       
    36     connect(mSettingsView, SIGNAL(finished(bool)), this, SLOT(showMainView()));
       
    37     
       
    38     HbAction *action = new HbAction(Hb::BackNaviAction, mSettingsView);        
       
    39     connect(action, SIGNAL(triggered()), mSettingsView, SLOT(reject()));
       
    40     mSettingsView->setNavigationAction(action);
       
    41 
       
    42     addView(mSettingsView);
       
    43     
       
    44     showMainView();
       
    45 }
       
    46 
       
    47 void MainWindow::showMainView()
       
    48 {
       
    49     setCurrentView( mMainView );
       
    50 }
       
    51 
       
    52 void MainWindow::showSettings()
       
    53 {
       
    54     setCurrentView( mSettingsView );
       
    55 }