From: Zoltan Papp Date: Wed, 27 May 2009 06:40:54 +0000 (+0300) Subject: Merge branch 'master' into dev_local X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=c573fb9449322aa2fd5902eb81ac192fc290070a;hp=56f763c68a2ff56d344ef150b7378ca417d08b36;p=qtmeetings Merge branch 'master' into dev_local Conflicts: src/BusinessLogic/Engine.cpp --- diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index 3f4597a..af3e342 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -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) { @@ -228,6 +229,12 @@ bool Engine::isMeetingInList(const QList &aList, const Meeting *aMeeti 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++) { @@ -264,6 +271,11 @@ void Engine::meetingDetailsFetched(Meeting &aDetailedMeeting) { qDebug() << "Engine::meetingDetailsFetched( Meeting & )"; iWindowManager->closeProgressBar(); + if( iCommunicationFailed ) + { + iCommunicationFailed = false; + iWindowManager->connectionEstablished(); + } iWindowManager->showMeetingInfo( &aDetailedMeeting); } @@ -272,8 +284,16 @@ void Engine::errorHandler(int aCode, const QString &aAddInfo) qDebug() << "Engine::ErrorHandler, aCode: " << aCode; // inform UI about the problem 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->error(ErrorMapper::codeToString(aCode, aAddInfo) ); diff --git a/src/BusinessLogic/Engine.h b/src/BusinessLogic/Engine.h index 22a1ea2..129992e 100644 --- a/src/BusinessLogic/Engine.h +++ b/src/BusinessLogic/Engine.h @@ -180,6 +180,8 @@ private: QTimer *iAutoRefresh; QList iMeetings; + + bool iCommunicationFailed; }; #endif /*ENGINE_H_*/ diff --git a/src/UserInterface/WindowManager.cpp b/src/UserInterface/WindowManager.cpp index feef534..3819076 100644 --- a/src/UserInterface/WindowManager.cpp +++ b/src/UserInterface/WindowManager.cpp @@ -214,3 +214,16 @@ void WindowManager::updateProgressBar( const QString &aMessage ) 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()"; +} + diff --git a/src/UserInterface/WindowManager.h b/src/UserInterface/WindowManager.h index f284192..b62517e 100644 --- a/src/UserInterface/WindowManager.h +++ b/src/UserInterface/WindowManager.h @@ -99,6 +99,12 @@ public: void insertMeeting( Meeting *aMeeting ); void deleteMeeting( Meeting *aMeeting ); + + //! Shows any view specific indicators for connection error + void connectionLost(); + + //! Removes any view specific indicators for connection error + void connectionEstablished(); signals: //! Request current status of the room.