iClock( 0 ), iConfiguration( Configuration::instance() ), iCommunication( 0 )
{
qDebug() << "Engine::Engine()";
+ iCommunicationFailed = false;
// if reading of configuration fails, signal that initialization failed
if ( iConfiguration == 0 )
{
void Engine::meetingsFetched( const QList<Meeting*> &aMeetings )
{
qDebug() << "Engine::meetingsFetched( const QList<Meeting*> & )";
+ 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++ )
{
{
qDebug() << "Engine::meetingDetailsFetched( Meeting & )";
iWindowManager->closeProgressBar();
+ if( iCommunicationFailed )
+ {
+ iCommunicationFailed = false;
+ iWindowManager->connectionEstablished();
+ }
iWindowManager->showMeetingInfo( &aDetailedMeeting );
}
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 ) );
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()";
+}
+
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.