Merge branch 'master' of https://git.maemo.org/projects/qtmeetings
[qtmeetings] / src / BusinessLogic / Engine.cpp
index ad8e197..3f4597a 100644 (file)
@@ -271,9 +271,11 @@ void Engine::errorHandler(int aCode, const QString &aAddInfo)
 {
        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;
-       iWindowManager->closeProgressBar();
+               iWindowManager->closeProgressBar();
+       }
        iWindowManager->error(ErrorMapper::codeToString(aCode, aAddInfo) );
 }
 
@@ -320,10 +322,12 @@ void Engine::passwordEntered(PasswordDialog::PasswordStatus aPasswordStatus)
        {
                case PasswordDialog::Correct:
                {
-                       iWindowManager->showProgressBar("Changing current operation mode.", true);
-                       connect(iWindowManager, SIGNAL( progressBarCancelled() ), this, SLOT( progressBarCancelled() ));
+                       iAutoRefresh->stop(); //we stop the metting updating
+                       iWindowManager->showProgressBar( "Changing current operation mode." );
                        connect(iDevice, SIGNAL( changingMode( const QString & ) ), iWindowManager, SLOT( updateProgressBar( const QString & ) ));
-                       connect(iDevice, SIGNAL( changingModeFailed() ), 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;
                }
@@ -340,12 +344,11 @@ void Engine::passwordEntered(PasswordDialog::PasswordStatus aPasswordStatus)
        }
 }
 
-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()