filemanager/src/filemanager/src/fmmainwindow.cpp
changeset 48 1bebd60c0f00
parent 41 fc4654ce4fcb
child 49 81668a704644
equal deleted inserted replaced
44:22e202702210 48:1bebd60c0f00
    18 
    18 
    19 #include "fmmainwindow.h"
    19 #include "fmmainwindow.h"
    20 #include "fmcommon.h"
    20 #include "fmcommon.h"
    21 
    21 
    22 #include <hbaction.h>
    22 #include <hbaction.h>
       
    23 #include <QTimer>
    23 
    24 
       
    25 /*!
       
    26     \fn void applicationReady()
       
    27     This signal is emitted when application is launched and ready to use
       
    28 */
       
    29 
       
    30 
       
    31 /*!
       
    32     constructor
       
    33 */
    24 FmMainWindow::FmMainWindow() : mViewManager( 0 ), mFirstViewLoaded( false )
    34 FmMainWindow::FmMainWindow() : mViewManager( 0 ), mFirstViewLoaded( false )
    25 {
    35 {
    26    // connect(this, SIGNAL(viewReady()), this, SLOT(delayedLoading()));
    36     // delayedLoading is not used currently but reserved for future
       
    37     // connect(this, SIGNAL(viewReady()), this, SLOT(delayedLoading()));
    27     init();
    38     init();
    28 }
    39 }
    29 
    40 
    30 FmMainWindow::~FmMainWindow()
    41 FmMainWindow::~FmMainWindow()
    31 {
    42 {
    32    //save file manager activity to activity manager.
    43    //save file manager activity to activity manager.
    33     mViewManager->saveActivity();   
    44     mViewManager->saveActivity();   
    34     FmViewManager::RemoveViewManager();
    45     FmViewManager::RemoveViewManager();
    35 }
    46 }
    36 
    47 
       
    48 /*
       
    49     handle orientation change event. not used yet as views can handle such event by themself
       
    50 */
    37 void FmMainWindow::onOrientationChanged( Qt::Orientation orientation )
    51 void FmMainWindow::onOrientationChanged( Qt::Orientation orientation )
    38 {
    52 {
    39 	Q_UNUSED( orientation );
    53 	Q_UNUSED( orientation );
    40 	/*
       
    41     if ( orientation == Qt::Vertical ) {
       
    42         activateDriverView();
       
    43     } else {
       
    44         activateSplitView();
       
    45     }
       
    46 	*/
       
    47 }
    54 }
    48 
    55 
       
    56 /*
       
    57     init main window
       
    58 */
    49 void FmMainWindow::init()
    59 void FmMainWindow::init()
    50 {
    60 {
    51     FM_LOG("FmMainWindow::init start");
    61     FM_LOG("FmMainWindow::init start");
       
    62 
    52     mViewManager = FmViewManager::CreateViewManager( this );
    63     mViewManager = FmViewManager::CreateViewManager( this );
    53     mViewManager->createDriverView();
    64     mViewManager->createDriverView();
    54     connect(this, SIGNAL(aboutToChangeView(HbView *, HbView *)), 
    65     connect(this, SIGNAL(aboutToChangeView(HbView *, HbView *)), 
    55             mViewManager, SLOT(onAboutToChangeView(HbView *, HbView *)));
    66             mViewManager, SLOT(onAboutToChangeView(HbView *, HbView *)));
    56     connect( this, SIGNAL( orientationChanged( Qt::Orientation ) ),
    67     connect( this, SIGNAL( orientationChanged( Qt::Orientation ) ),
    57              this, SLOT( onOrientationChanged( Qt::Orientation ) ) );
    68              this, SLOT( onOrientationChanged( Qt::Orientation ) ) );
    58     
    69     
       
    70 
       
    71     connect(&mShowTimer, SIGNAL(timeout()), this, SLOT(onApplicationReady()));
       
    72     mShowTimer.start();
       
    73 
    59     FM_LOG("FmMainWindow::init end");
    74     FM_LOG("FmMainWindow::init end");
    60 //    if ( orientation() == Qt::Vertical ) {
       
    61 //        createDriverView();
       
    62 //    } else {
       
    63 //        createSplitView();
       
    64 //    }
       
    65 }
    75 }
    66 
    76 
       
    77 
       
    78 /*
       
    79     delayedLoading is not used currently but reserved for future
       
    80 */
    67 void FmMainWindow::delayedLoading()
    81 void FmMainWindow::delayedLoading()
    68 {
    82 {
    69     FM_LOG("FmMainWindow::delayedLoading start");
    83     FM_LOG("FmMainWindow::delayedLoading start");
    70     if( mFirstViewLoaded ) {
    84     if( mFirstViewLoaded ) {
    71         return;
    85         return;
    73     init();
    87     init();
    74     mFirstViewLoaded = true;
    88     mFirstViewLoaded = true;
    75     FM_LOG("FmMainWindow::delayedLoading end");
    89     FM_LOG("FmMainWindow::delayedLoading end");
    76 }
    90 }
    77 
    91 
       
    92 /*
       
    93     Slot to receive timer event after application started and emit applicationReady signal
       
    94 */
       
    95 void FmMainWindow::onApplicationReady()
       
    96 {
       
    97     mShowTimer.stop();
       
    98     emit applicationReady();
       
    99 }