Modified the dialog signaling to prevent idle screen coming from visible while dialog...
[qtmeetings] / src / BusinessLogic / UIManager.cpp
index be2f660..54ee865 100644 (file)
@@ -89,7 +89,11 @@ void UIManager::createSettingsView()
 
 void UIManager::createRoomStatusIndicator()
 {
-       iRoomStatusIndicator = new RoomStatusIndicatorWidget( iEngine->defaultRoom(), Room::FreeStatus, QTime::currentTime(), iEngine->iConfiguration->displaySettings()->dateFormat() );
+       iRoomStatusIndicator = new RoomStatusIndicatorWidget( iEngine->defaultRoom(), Room::FreeStatus, QTime::currentTime().addSecs(100000000), iEngine->iConfiguration->displaySettings()->timeFormat() );
+       
+       // Connect engine signals
+       connect( iEngine, SIGNAL( roomStatusChanged( Room::Status, QTime ) ), iRoomStatusIndicator, SLOT( statusChanged( Room::Status, QTime ) ) );
+       connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), iRoomStatusIndicator, SLOT( currentRoomChanged( Room * ) ) );
 }
 
 void UIManager::createPasswordDialog()
@@ -166,7 +170,6 @@ void UIManager::showMeetingProgressBar( Meeting *aMeeting )
                iProgressBar->update( tr( "Fetching meeting info..." ), tr( "Please wait" ) );
                iProgressBar->toggleCancellable( true );
                iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
-               iEngine->stopIdleTimeCounter();
        }
 }
 
@@ -179,8 +182,10 @@ void UIManager::meetingDetailsFetched(Meeting &aDetailedMeeting)
                {
                        iProgressBar->close(); // Close it in case it's visible
                }
+               iEngine->stopIdleTimeCounter(); // Timer restarted when the dialog is dismissed.
                MeetingInfoDialog *tmp = new MeetingInfoDialog( &aDetailedMeeting );
                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 ) );
@@ -206,7 +211,6 @@ void UIManager::progressBarCancelled()
        if ( iProgressBar != 0 )
        {
                iProgressBar->close();
-               iEngine->startIdleTimeCounter();
        }
 }
 
@@ -240,6 +244,10 @@ void UIManager::updateTime(QDateTime aDateTime)
        {
                iWeeklyView->setCurrentDateTime( aDateTime );
        }
+       if ( iRoomStatusIndicator != 0 )
+       {
+               iRoomStatusIndicator->setCurrentTime( aDateTime.time() );
+       }
 }
 
 void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus )
@@ -252,7 +260,7 @@ void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus )
                        {
                                iProgressBar->update( tr( "" ), tr( "Changing operation mode" ) );
                                iProgressBar->toggleCancellable( false );
-                               iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
+                               iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
                        }
                        // ... and initiate the mode changing
                        iEngine->changeDeviceMode( true );