From: Zoltan Papp Date: Tue, 26 May 2009 11:50:09 +0000 (+0300) Subject: Merge branch 'master' into dev_local X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=100bffcd0e9a9a967be6da8e9977da3d94dc606a;hp=-c;p=qtmeetings Merge branch 'master' into dev_local Conflicts: src/BusinessLogic/Engine.cpp --- 100bffcd0e9a9a967be6da8e9977da3d94dc606a diff --combined src/BusinessLogic/Engine.cpp index 19f8250,25c3048..911b49b --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@@ -22,7 -22,6 +22,7 @@@ Engine::Engine() iClock( 0 ), iConfiguration( Configuration::instance() ), iCommunication( 0 ) { qDebug() << "Engine::Engine()"; + iCommunicationFailed = false; // if reading of configuration fails, signal that initialization failed if ( iConfiguration == 0 ) { @@@ -234,12 -233,6 +234,12 @@@ bool Engine::isMeetingInList( const QLi void Engine::meetingsFetched( const QList &aMeetings ) { qDebug() << "Engine::meetingsFetched( const QList & )"; + if( iCommunicationFailed ) + { + iCommunicationFailed = false; + //iWindowManager->connectionEstablished(); + } + // check if there is any new meeting in the list came from the server -> added for ( int i = 0; i < aMeetings.count(); i++ ) { @@@ -276,11 -269,6 +276,11 @@@ void Engine::meetingDetailsFetched( Mee { qDebug() << "Engine::meetingDetailsFetched( Meeting & )"; iWindowManager->closeProgressBar(); + if( iCommunicationFailed ) + { + iCommunicationFailed = false; + iWindowManager->connectionEstablished(); + } iWindowManager->showMeetingInfo( &aDetailedMeeting ); } @@@ -288,17 -276,11 +288,19 @@@ void Engine::errorHandler( int aCode, c { qDebug() << "Engine::ErrorHandler, aCode: " << aCode; // inform UI about the problem - if( aCode >= 100 && aCode <= 150 ) + if( aCode >= 100 && aCode <= 150 ) { //communication errors + { + //we don't want these to close operation changing qDebug() << "CommunicationManager signaled an error:" << aCode; + if( !iCommunicationFailed ) + { + // Only inform window manager when first error appears + iCommunicationFailed = true; + //iWindowManager->connectionLost(); + } + } - iWindowManager->closeProgressBar(); + iWindowManager->closeProgressBar(); + } iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) ); } @@@ -343,10 -325,11 +345,11 @@@ void Engine::passwordEntered( PasswordD { case PasswordDialog::Correct : { + iAutoRefresh->stop(); //we stop the metting updating iWindowManager->showProgressBar( "Changing current operation mode." ); - connect( iWindowManager, SIGNAL( progressBarCancelled() ), this, SLOT( progressBarCancelled() ) ); connect( iDevice, SIGNAL( changingMode( const QString & ) ), iWindowManager, SLOT( updateProgressBar( const QString & ) ) ); + connect( iDevice, SIGNAL( changeModeFailed() ), this, SLOT( changeModeFailed() ) ); iDevice->changeMode( true ); break; } @@@ -363,12 -346,11 +366,11 @@@ } } - void Engine::progressBarCancelled() + void Engine::changeModeFailed() { - qDebug() << "Engine::progressBarCancelled()"; - //TODO: cancel the on-going event + qDebug() << "Engine::changeModeFailed()"; iWindowManager->closeProgressBar(); - iDevice->changeMode( false ); + iAutoRefresh->start(); //we start the metting updating } void Engine::fetchMeetingDetailsCancelled() diff --combined src/BusinessLogic/Engine.h index ef489f1,5f99630..39e4c99 --- a/src/BusinessLogic/Engine.h +++ b/src/BusinessLogic/Engine.h @@@ -120,11 -120,11 +120,11 @@@ private slots * \param aPasswordStatus The status of the password. */ void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus ); - //! Slot for receiving the cancel event of the progress bar. + //! Slot for receiving the failure event of operation mode changing. /*! - * Slot. Receives the cancel event of the progress bar. + * Slot. Receives the failure event of operation mode changing. */ - void progressBarCancelled(); + void changeModeFailed(); //! Slot for receiving the cancel event of the progress bar. /*! * Receives the cancel event of the progress bar when meeting details requested. @@@ -180,8 -180,6 +180,8 @@@ private QTimer *iAutoRefresh; QList iMeetings; + + bool iCommunicationFailed; }; #endif /*ENGINE_H_*/ diff --combined src/UserInterface/WindowManager.cpp index ff5c8fd,dba36b3..ffe3b24 --- a/src/UserInterface/WindowManager.cpp +++ b/src/UserInterface/WindowManager.cpp @@@ -188,8 -188,10 +188,10 @@@ void WindowManager::showProgressBar( co qDebug() << "WindowManager::showProgressBar( const QString & )"; if( iProgressBar == 0 ) { iProgressBar = new ProgressBar( aText, aCancellable ); + iProgressBar->setFixedSize( 600, 125 ); iProgressBar->show(); - connect( iProgressBar, SIGNAL( cancel() ), this, SIGNAL( progressBarCancelled() ) ); + if( aCancellable ) + connect( iProgressBar, SIGNAL( cancel() ), this, SIGNAL( progressBarCancelled() ) ); } //TODO connect connect( iWeeklyView, SIGNAL( observedEventDetected() ), this, SIGNAL( observedEventDetected() ) ); @@@ -212,16 -214,3 +214,16 @@@ void WindowManager::updateProgressBar( if( iProgressBar != 0 ) iProgressBar->update( aMessage ); } + +void WindowManager::connectionLost() +{ + //TODO: Inform all views + qDebug() << "WindowManager::connectionLost()"; +} + +void WindowManager::connectionEstablished() +{ + //TODO: Inform all views + qDebug() << "WindowManager::connectionEstablished()"; +} +