1.0.6 candidate
[qtmeetings] / src / BusinessLogic / UIManager.cpp
index eb80616..1c58381 100644 (file)
@@ -37,8 +37,9 @@ UIManager::UIManager( Engine *aEngine, WindowManager *aWindowManager ) :
        if ( iEngine == 0 ) return;
        if ( iWindowManager == 0 ) return;
        
+       connect(iWindowManager, SIGNAL(showSettingsClicked()), this, SLOT(settingsViewRequest()));
+
        createWeeklyView();
-       createSettingsView();
        createRoomStatusIndicator();
        createPasswordDialog();
        createProgressBar();
@@ -74,6 +75,7 @@ void UIManager::createWeeklyView()
        connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), this, SLOT( currentRoomChanged( Room * ) ) );
        connect( iWeeklyView, SIGNAL( meetingActivated( Meeting * ) ), this, SLOT( showMeetingProgressBar( Meeting * ) ) );
        // Connect signals to engine
+       connect( iWeeklyView, SIGNAL( refreshButtonClicked() ), iEngine, SLOT( updateRoomInfo() ) );
        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 * ) ) );
@@ -134,12 +136,11 @@ void UIManager::connectCommunicationManager( CommunicationManager *aCommunicatio
 //             UIMANAGER SLOTS
 void UIManager::settingsViewRequest()
 {
+       createSettingsView();
+
        // Show the settings view and stop the idle timer
-       if ( iSettingsView != 0 )
-       {
-               iWindowManager->showView( static_cast<ViewBase *>( iSettingsView ) );
-               iEngine->stopIdleTimeCounter();
-       }
+       iWindowManager->showView( static_cast<ViewBase *>( iSettingsView ) );
+       iEngine->stopIdleTimeCounter();
 }
 
 void UIManager::settingsOkClicked()
@@ -148,7 +149,9 @@ void UIManager::settingsOkClicked()
        if ( iWeeklyView != 0 )
        {
                iWindowManager->showView( static_cast<ViewBase *>( iWeeklyView ) );
+               QT_DELETE(iSettingsView);
                iEngine->startIdleTimeCounter();
+               currentRoomChanged(iWeeklyView->currentRoom());
        }
 }
 
@@ -161,7 +164,7 @@ void UIManager::meetingsFetched( const QList<Meeting*> &aMeetings )
        }
 }
 
-void UIManager::showMeetingProgressBar( Meeting *aMeeting )
+void UIManager::showMeetingProgressBar( Meeting */*aMeeting*/ )
 {
        if ( iProgressBar != 0 )
        {
@@ -227,7 +230,6 @@ void UIManager::connectionLost()
 {
        qDebug() << "UIManager::connectionLost()";
        iWeeklyView->connectionLost();
-       iSettingsView->connectionLost();
        iRoomStatusIndicator->connectionLost();
 }
 
@@ -235,7 +237,6 @@ void UIManager::connectionEstablished()
 {
        qDebug() << "UIManager::connectionEstablished()";
        iWeeklyView->connectionEstablished();
-       iSettingsView->connectionEstablished();
        iRoomStatusIndicator->connectionEstablished();
 }
 
@@ -253,11 +254,11 @@ void UIManager::updateTime(QDateTime aDateTime)
 {
        if ( iWeeklyView != 0 )
        {
-               iWeeklyView->setCurrentDateTime( aDateTime );
+               iWeeklyView->setConnectionStatus( aDateTime, iEngine->connected(), iEngine->lastUpdated(), iEngine->errorMessage() );
        }
        if ( iRoomStatusIndicator != 0 )
        {
-               iRoomStatusIndicator->setCurrentTime( aDateTime.time() );
+               iRoomStatusIndicator->setConnectionStatus( aDateTime, iEngine->connected(), iEngine->lastUpdated(), iEngine->errorMessage() );
        }
 }
 
@@ -313,6 +314,7 @@ void UIManager::settingsCancelClicked()
        if ( iWeeklyView != 0 )
        {
                iWindowManager->showView( static_cast<ViewBase *>( iWeeklyView ) );
+               QT_DELETE(iSettingsView);
                iEngine->startIdleTimeCounter();
        }
-}
\ No newline at end of file
+}