Still working
[qtmeetings] / src / UserInterface / Views / WeeklyViewWidget.cpp
index b33e517..5283354 100644 (file)
@@ -20,7 +20,7 @@
 #include <QtDebug>\r
 \r
 WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *aConfiguration, QWidget *aParent ) :\r
-               ObservedWidget( aParent ), iConfiguration( aConfiguration )\r
+               ViewBase( ViewBase::NormalView, aParent ), iConfiguration( aConfiguration )\r
 {\r
 \r
        // *****************************************\r
@@ -36,23 +36,21 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a
        iSettingsButton = new QPushButton;\r
        iSettingsButton->setIcon( QPixmap( ":button_settings" ) );\r
        iSettingsButton->setFixedWidth( 36 );\r
-       connect( iSettingsButton, SIGNAL( clicked() ), this, SIGNAL( showSettingsView() ) );\r
+       connect( iSettingsButton, SIGNAL( clicked() ), this, SIGNAL( settingsButtonClicked() ) );\r
 \r
        iCurrentDayLabel = ToolBox::createLabel( aCurrentDateTime.toString( iConfiguration->displaySettings()->dateFormat() ), regularTextFont );\r
        iCurrentWeekLabel = ToolBox::createLabel( tr( "Wk %1" ).arg( aCurrentDateTime.date().weekNumber() ), regularTextFont );\r
 \r
        iRoomsCombo = new MeetingRoomCombo( iConfiguration->rooms(), this );\r
        iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() );\r
-       connect( iRoomsCombo, SIGNAL( observedEventDetected() ), this, SIGNAL( observedEventDetected() ) );\r
+       connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), this, SIGNAL( currentRoomChanged( Room * ) ) );\r
 \r
        iTimeDisplay = new DigitalTimeDisplayWidget( aCurrentDateTime.time(), iConfiguration->displaySettings()->timeFormat(), this );\r
        iTimeDisplay->setFrameVisible( false );\r
        iTimeDisplay->setFont( regularTextFont );\r
-       connect( iTimeDisplay, SIGNAL( observedEventDetected() ), this, SIGNAL( observedEventDetected() ) );\r
 \r
        iSchedule = new ScheduleWidget( aCurrentDateTime, iConfiguration->displaySettings(), this );\r
        connect( iSchedule, SIGNAL( shownWeekChanged( QDate ) ), this, SIGNAL( shownWeekChanged( QDate ) ) );\r
-       connect( iSchedule, SIGNAL( observedEventDetected() ), this, SIGNAL( observedEventDetected() ) );\r
        connect( iSchedule, SIGNAL( meetingActivated( Meeting* ) ), this, SIGNAL( meetingActivated( Meeting* ) ) );\r
 \r
        iPreviousWeekButton = new QPushButton( this );\r
@@ -91,6 +89,16 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a
        mainLayout->addLayout( tableLayout );\r
        mainLayout->addLayout( bottomLayout );\r
        setLayout( mainLayout );\r
+       \r
+       // Set child observing\r
+       observeChild( iRoomsCombo );\r
+       observeChild( iTimeDisplay );\r
+       observeChild( iCurrentDayLabel );\r
+       observeChild( iCurrentWeekLabel );\r
+       observeChild( iPreviousWeekButton );\r
+       observeChild( iCurrentWeekButton );\r
+       observeChild( iNextWeekButton );\r
+       observeChild( iSettingsButton );\r
 \r
        QPalette palette;\r
        palette.setColor( QPalette::Window, Qt::white );\r
@@ -100,11 +108,11 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a
        // ******************************************\r
        //              Handle all the signal connections\r
        // TODO : this solution if interaction monitoring is not elegant enough\r
-       connect( iPreviousWeekButton, SIGNAL( clicked() ), this, SIGNAL( observedEventDetected() ) );\r
-       connect( iCurrentWeekButton, SIGNAL( clicked() ), this, SIGNAL( observedEventDetected() ) );\r
-       connect( iNextWeekButton, SIGNAL( clicked() ), this, SIGNAL( observedEventDetected() ) );\r
-       connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), this, SIGNAL( observedEventDetected() ) );\r
-       connect( iRoomsCombo, SIGNAL( currentIndexChanged( int ) ), this, SIGNAL( observedEventDetected() ) );\r
+//     connect( iPreviousWeekButton, SIGNAL( clicked() ), this, SIGNAL( observedEventDetected() ) );\r
+//     connect( iCurrentWeekButton, SIGNAL( clicked() ), this, SIGNAL( observedEventDetected() ) );\r
+//     connect( iNextWeekButton, SIGNAL( clicked() ), this, SIGNAL( observedEventDetected() ) );\r
+//     connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), this, SIGNAL( observedEventDetected() ) );\r
+//     connect( iRoomsCombo, SIGNAL( currentIndexChanged( int ) ), this, SIGNAL( observedEventDetected() ) );\r
        // TODO: connect RoomCombo signals to change meetings data.\r
        connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), iSchedule, SLOT( clear() ) );\r
        connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), this, SIGNAL( currentRoomChanged( Room * ) ) );\r