Merged
[qtmeetings] / src / BusinessLogic / Engine.cpp
index 0b68a03..0c76679 100644 (file)
@@ -191,6 +191,13 @@ void Engine::fetchMeetings()
 void Engine::fetchMeetingDetails( Meeting *aMeeting )
 {
        qDebug() << "Engine::fetchMeetingDetails( Meeting* )";
+       iWindowManager->showProgressBar( tr("Please Wait"), true );
+       iWindowManager->updateProgressBar( tr("Fetching Meeting Details...") );
+       connect( iWindowManager,
+                        SIGNAL( progressBarCancelled() ),
+                        this,
+                        SLOT( fetchMeetingDetailsCancelled() )
+                       );
        iCommunication->fetchMeetingDetails( *aMeeting );
 }
 
@@ -258,9 +265,10 @@ void Engine::errorHandler( int aCode, const QString &aAddInfo )
 {
        qDebug() << "Engine::ErrorHandler, aCode: " << aCode;
        // inform UI about the problem
-       if( aCode >= 100 && aCode <= 110 )
+       if( aCode >= 100 && aCode <= 150 )
                qDebug() << "CommunicationManager signaled an error:" << aCode;
-//     iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) );
+       // iWindowManager->closeProgressBar();
+       // iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) );
 }
 
 void Engine::currentRoomChanged( Room *aCurrentRoom )
@@ -309,6 +317,10 @@ void Engine::passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus )
 //                     connect( iWindowManager, SIGNAL( progressBarCancelled() ), this, SLOT( progressBarCancelled() ) );
 //                     connect( iDevice, SIGNAL( changingMode( const QString & ) ),
 //                                     iWindowManager, SLOT( updateProgressBar( const QString & ) ) );
+                       // TODO : Connect the signal directory to progress bar dialog which should be instance in engine
+//                     connect( iDevice, SIGNAL( changingMode( const QString & ) ),
+//                                     iWindowManager, SLOT( updateProgressBar( const QString & ) ) );
+                       connect( iDevice, SIGNAL( changingModeFailed() ), this, SLOT( progressBarCancelled() ) );
                        iDevice->changeMode( true );
                        break;
                }
@@ -467,4 +479,10 @@ void Engine::previousViewRestored()
        {
                iIdleTimeCounter->start();
        }
-}
\ No newline at end of file
+}
+
+void Engine::fetchMeetingDetailsCancelled()
+{
+       iCommunication->cancelFetchMeetingDetails();
+       iWindowManager->closeProgressBar();
+}