Moved the logicasl part of the progresbar/password dialog from WindowManager to Engin...
[qtmeetings] / src / UserInterface / WindowManager.cpp
index 8107fbb..3a593a9 100644 (file)
@@ -160,53 +160,34 @@ void WindowManager::error( const QString &aErrorMessage )
        PopUpMessageBox::error( 0, aErrorMessage );
 }
 
-void WindowManager::passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus )
-{
-       delete iPasswordDialog;
-       iPasswordDialog = 0;
-       
-       switch ( aPasswordStatus )
-       {
-               case PasswordDialog::Correct :
-               {
-                       progressBar( tr( "Changing operation mode" ), true );
-                       iProgressBar->show();
-                       while(1);
-                       break;
-               }
-               case PasswordDialog::Incorrect :
-               {
-                       error( tr( "Incorrect password." ) );
-                       break;
-               }
-               default : //case PasswordDialog::Canceled
-               {
-               }
-       }
-}
-
 void WindowManager::showPasswordDialog( QByteArray aAdminPassword, const QString &aMessage )
 {
        iPasswordDialog = new PasswordDialog( aAdminPassword, aMessage );
+       connect( iPasswordDialog, SIGNAL( passwordEntered( PasswordDialog::PasswordStatus ) ),
+                       this, SIGNAL( passwordEntered( PasswordDialog::PasswordStatus ) ) );
        iPasswordDialog->show();
 }
 
+void WindowManager::closePasswordDialog()
+{
+       iPasswordDialog->close();
+       delete iPasswordDialog;
+       iPasswordDialog = 0;
+}
 
-void WindowManager::progressBar( const QString &aText, bool aStart )
+void WindowManager::showProgressBar( const QString &aText )
 {
-       qDebug() << "WindowManager::progressBar( const QString &, bool)";
-       if( aStart ) {
-               if( iProgressBar == 0 ) {
-                       iProgressBar = new ProgressBar( aText );
-                       connect( iProgressBar, SIGNAL( cancel() ), this, SLOT( progressBar() ) );
-                       connect( iProgressBar, SIGNAL( started() ), this, SLOT( changeMode() ) );
-               }
-       }
-       else {
-               if( iProgressBar != 0 ) {
-                       delete iProgressBar;
-                       iProgressBar = 0;
-               }
+       qDebug() << "WindowManager::showProgressBar( const QString & )";
+       if( iProgressBar == 0 ) {
+               iProgressBar = new ProgressBar( aText );
+               iProgressBar->show();
+               connect( iProgressBar, SIGNAL( cancel() ), this, SIGNAL( progressBarCancelled() ) );
        }
 }
 
+void WindowManager::closeProgressBar()
+{
+       iProgressBar->close();
+       delete iProgressBar;
+       iProgressBar = 0;
+}