Corrected the password dialog and progress bar related errors. Texts and titles of...
[qtmeetings] / src / BusinessLogic / UIManager.cpp
index 7e24d61..35f5da0 100644 (file)
@@ -67,15 +67,6 @@ void UIManager::showMainView()
        iWindowManager->showView( iWeeklyView );
 }
 
-void UIManager::showProgressBar( QString aText )
-{
-       if ( iProgressBar != 0 )
-       {
-               iProgressBar->update( aText );
-               iWindowManager->showDialog( iProgressBar );
-       }
-}
-
 // ===============================================
 //             INITIALIZE THE UIMANAGER
 void UIManager::createWeeklyView()
@@ -89,6 +80,7 @@ void UIManager::createWeeklyView()
        // Connect signals to engine
        connect( iWeeklyView, SIGNAL( meetingActivated( Meeting * ) ), iEngine, SLOT( fetchMeetingDetails( Meeting * ) ) );
        connect( iWeeklyView, SIGNAL( shownWeekChanged( QDate ) ), iEngine, SLOT( shownWeekChanged( QDate ) ) );
+       connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), iEngine, SLOT( currentRoomChanged( Room * ) ) );
 }
 
 void UIManager::createSettingsView()
@@ -106,8 +98,7 @@ void UIManager::createRoomStatusIndicator()
 
 void UIManager::createPasswordDialog()
 {
-       iPasswordDialog = new PasswordDialog( iEngine->iConfiguration->adminPassword(), tr("UIManager::createPasswordDialog"), tr("UIManager::createPasswordDialog") );
-       
+       iPasswordDialog = new PasswordDialog( iEngine->iConfiguration->adminPassword(), "", tr("Enter password") );
        connect( iPasswordDialog, SIGNAL( passwordEntered( PasswordDialog::PasswordStatus ) ), this, SLOT( passwordEntered( PasswordDialog::PasswordStatus ) ) );
 }
 
@@ -165,11 +156,10 @@ void UIManager::settingsOkClicked()
 
 void UIManager::meetingsFetched( const QList<Meeting*> &aMeetings )
 {
-       qDebug() << "[UIManager::meetingsFetched] <SHOULD NOT SIMPLY INSERT MEETINGS TO WEEKLYVIEW !!!>";
-       for ( int i = 0; i < aMeetings.count(); i++ )
+       qDebug() << "[UIManager::meetingsFetched] <Change the weekly views method to slot so we don't need this>";
+       if ( iWeeklyView != 0 )
        {
-               Meeting *m = new Meeting( *( aMeetings.at(i) ) );
-               iWeeklyView->insertMeeting( m );
+               iWeeklyView->refreshMeetings( aMeetings );
        }
 }
 
@@ -177,8 +167,10 @@ void UIManager::showMeetingProgressBar( Meeting *aMeeting )
 {
        if ( iProgressBar != 0 )
        {
-               iProgressBar->update( tr("Fetching meeting info...") );
-               iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
+               iProgressBar->update( tr( "Fetching meeting info..." ), tr( "Please wait" ) );
+               iProgressBar->toggleCancellable( true );
+               iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
+               iEngine->stopIdleTimeCounter();
        }
 }
 
@@ -191,9 +183,11 @@ void UIManager::meetingDetailsFetched(Meeting &aDetailedMeeting)
                {
                        iProgressBar->close(); // Close it in case it's visible
                }
-               // iMeetingInfo->setMeeting( &aDetailedMeeting );
                MeetingInfoDialog *tmp = new MeetingInfoDialog( &aDetailedMeeting );
-               iWindowManager->showDialog( static_cast<QDialog *>( tmp/*iMeetingInfo*/ ) );
+               iWindowManager->showDialog( static_cast<QDialog *>( tmp ) );
+// TODO : We should use the member variable and implement correctly the setMeeting() method !!!
+//             iMeetingInfo->setMeeting( &aDetailedMeeting );
+//             iWindowManager->showDialog( static_cast<QDialog *>( iMeetingInfo ) );
        }
 }
 
@@ -216,19 +210,19 @@ void UIManager::progressBarCancelled()
        if ( iProgressBar != 0 )
        {
                iProgressBar->close();
+               iEngine->startIdleTimeCounter();
        }
 }
 
 void UIManager::changeModeOrdered( DeviceManager::OperationMode aMode )
 {
        qDebug() << "[UIManager::changeModeOrdered] <Invoked>";
-       
-       QString message = tr( "You are about to change operation mode to %1." )
-                               .arg( iEngine->iDevice->operationModeToString( aMode ) );
 
        if ( iPasswordDialog != 0 )
        {
-               // TODO : Set the new text for password dialog
+               QString text = tr( "You are about to change operation mode to %1." )
+                                               .arg( iEngine->iDevice->operationModeToString( aMode ) );
+               iPasswordDialog->update( text );
                iWindowManager->showDialog( static_cast<QDialog *>( iPasswordDialog ) );
        }
 }
@@ -259,6 +253,8 @@ void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus )
                        // Show the progress bar..
                        if ( iProgressBar != 0 )
                        {
+                               iProgressBar->update( tr( "" ), tr( "Changing operation mode" ) );
+                               iProgressBar->toggleCancellable( false );
                                iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
                        }
                        // ... and initiate the mode changing