filemanager/src/filemanager/src/fmmainwindow.cpp
branchRCL_3
changeset 20 491b3ed49290
equal deleted inserted replaced
19:95243422089a 20:491b3ed49290
       
     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  *     Zhiqiang Yang <zhiqiang.yang@nokia.com>
       
    14  * 
       
    15  * Description:
       
    16  *     The source file of File Manager main window
       
    17  */
       
    18 
       
    19 #include "fmmainwindow.h"
       
    20 #include "fmcommon.h"
       
    21 
       
    22 #include <hbaction.h>
       
    23 
       
    24 FmMainWindow::FmMainWindow() : mViewManager( 0 ), mFirstViewLoaded( false )
       
    25 {
       
    26    // connect(this, SIGNAL(viewReady()), this, SLOT(delayedLoading()));
       
    27     init();
       
    28 }
       
    29 
       
    30 FmMainWindow::~FmMainWindow()
       
    31 {
       
    32    //save file manager activity to activity manager.
       
    33     mViewManager->saveActivity();   
       
    34     FmViewManager::RemoveViewManager();
       
    35 }
       
    36 
       
    37 void FmMainWindow::onOrientationChanged( Qt::Orientation orientation )
       
    38 {
       
    39 	Q_UNUSED( orientation );
       
    40 	/*
       
    41     if ( orientation == Qt::Vertical ) {
       
    42         activateDriverView();
       
    43     } else {
       
    44         activateSplitView();
       
    45     }
       
    46 	*/
       
    47 }
       
    48 
       
    49 void FmMainWindow::init()
       
    50 {
       
    51     FM_LOG("FmMainWindow::init start");
       
    52     mViewManager = FmViewManager::CreateViewManager( this );
       
    53     mViewManager->createDriverView();
       
    54     connect(this, SIGNAL(aboutToChangeView(HbView *, HbView *)), 
       
    55             mViewManager, SLOT(onAboutToChangeView(HbView *, HbView *)));
       
    56     connect( this, SIGNAL( orientationChanged( Qt::Orientation ) ),
       
    57              this, SLOT( onOrientationChanged( Qt::Orientation ) ) );
       
    58     
       
    59     FM_LOG("FmMainWindow::init end");
       
    60 //    if ( orientation() == Qt::Vertical ) {
       
    61 //        createDriverView();
       
    62 //    } else {
       
    63 //        createSplitView();
       
    64 //    }
       
    65 }
       
    66 
       
    67 void FmMainWindow::delayedLoading()
       
    68 {
       
    69     FM_LOG("FmMainWindow::delayedLoading start");
       
    70     if( mFirstViewLoaded ) {
       
    71         return;
       
    72     }
       
    73     init();
       
    74     mFirstViewLoaded = true;
       
    75     FM_LOG("FmMainWindow::delayedLoading end");
       
    76 }
       
    77