if ( iEngine == 0 ) return;
if ( iWindowManager == 0 ) return;
- qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
-
createWeeklyView();
createSettingsView();
createRoomStatusIndicator();
createPasswordDialog();
createProgressBar();
createMeetingInfoDialog();
-
- qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
}
UIManager::~UIManager()
{
if ( iProgressBar != 0 )
{
- iProgressBar->update( tr("Changing current operation mode.") );
+ iProgressBar->update( aText );
iWindowManager->showDialog( iProgressBar );
}
}
// 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()
void UIManager::createProgressBar()
{
- iProgressBar = new ProgressBar( tr("CHANGE THIS") );
+ iProgressBar = new ProgressBar( tr("CHANGE THIS"), true );
// Connect to UIManager
connect( iProgressBar, SIGNAL( cancel() ), this, SLOT( progressBarCancelled() ) );
this, SLOT( changeModeOrdered( DeviceManager::OperationMode ) ) );
connect( aDeviceManager, SIGNAL( changingMode( const QString & ) ), this, SLOT( updateProgressBarText( const QString & ) ) );
+ connect( aDeviceManager, SIGNAL( changeModeFailed() ), this, SLOT( hideProgressBar() ) );
}
void UIManager::connectCommunicationManager( CommunicationManager *aCommunicationManager )
{
connect( aCommunicationManager, SIGNAL( meetingDetailsFetched( Meeting & ) ), this, SLOT( meetingDetailsFetched( Meeting & ) ) );
+ connect( aCommunicationManager, SIGNAL( meetingsFetched( const QList<Meeting *> & ) ), this, SLOT( meetingsFetched( const QList<Meeting *> & ) ) );
}
// ============================================
void UIManager::meetingsFetched( const QList<Meeting*> &aMeetings )
{
-
+ qDebug() << "[UIManager::meetingsFetched] <Change the weekly views method to slot so we don't need this>";
+ if ( iWeeklyView != 0 )
+ {
+ iWeeklyView->refreshMeetings( aMeetings );
+ }
}
void UIManager::showMeetingProgressBar( Meeting *aMeeting )
if ( iProgressBar != 0 )
{
iProgressBar->update( tr("Fetching meeting info...") );
- iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ) );
+ iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
+ iEngine->stopIdleTimeCounter();
}
}
void UIManager::meetingDetailsFetched(Meeting &aDetailedMeeting)
{
+ qDebug() << "[UIManager::meetingDetailsFetched] <Invoked>";
if ( iMeetingInfo != 0 )
{
- if ( iProgressBar != 0 )
+ if ( iProgressBar != 0 && iProgressBar->isVisible() )
{
iProgressBar->close(); // Close it in case it's visible
}
- iMeetingInfo->setMeeting( &aDetailedMeeting );
- iWindowManager->showDialog( static_cast<QDialog *>( iMeetingInfo ) );
+ 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 ) );
}
}
if ( iProgressBar != 0 )
{
iProgressBar->close();
+ iEngine->startIdleTimeCounter();
}
}
void UIManager::currentRoomChanged(Room *aRoom)
{
+ qDebug() << "[UIManager::currentRoomChanged] <Invoked>";
if ( iWeeklyView != 0 )
{
QDateTime from = QDateTime( iWeeklyView->beginnigOfShownWeek() );
// Show the progress bar..
if ( iProgressBar != 0 )
{
- iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ) );
+ iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
}
// ... and initiate the mode changing
iEngine->changeDeviceMode( true );
iProgressBar->update( aText );
}
}
+
+void UIManager::hideProgressBar()
+{
+ qDebug() << "[UIManager::hideProgressBar] <Invoked>";
+ if ( iProgressBar != 0 && iProgressBar->isVisible() )
+ {
+ iProgressBar->close();
+ }
+}