#include "ScheduleWidget.h"\r
#include "ToolBox.h"\r
#include "MeetingInfoDialog.h"\r
+#include "BorderedBarWidget.h"\r
\r
#include <QtDebug>\r
\r
regularTextFont.setBold( true );\r
regularTextFont.setPointSize( 12 );\r
\r
+ QFont clockFont;\r
+ clockFont.setStyleHint( QFont::Helvetica );\r
+ clockFont.setBold( true );\r
+ clockFont.setPixelSize( 36 );\r
+\r
+ QFont statusBarFont;\r
+ statusBarFont.setStyleHint( QFont::Helvetica );\r
+ statusBarFont.setPixelSize( 12 );\r
+\r
+ QFont buttonFont;\r
+ buttonFont.setStyleHint( QFont::Helvetica );\r
+ buttonFont.setBold( true );\r
+ buttonFont.setPixelSize( 18 );\r
+\r
iSettingsButton = new QPushButton;\r
iSettingsButton->setIcon( QPixmap( ":button_settings" ) );\r
iSettingsButton->setFixedWidth( 36 );\r
iCurrentDayLabel = ToolBox::createLabel( aCurrentDateTime.toString( iConfiguration->displaySettings()->dateFormat() ), regularTextFont );\r
iCurrentWeekLabel = ToolBox::createLabel( tr( "Wk %1" ).arg( aCurrentDateTime.date().weekNumber() ), regularTextFont );\r
\r
+ iTimeDisplay = new BorderedBarWidget( this );\r
+ iTimeDisplay->setFaceColor( Qt::darkGray );\r
+ iTimeDisplay->setBackgroundColor( Qt::white);\r
+ iTimeDisplay->setBorderWidth( 6 );\r
+ iTimeDisplay->setFixedWidth( 170 );\r
+ iTimeDisplay->setFixedHeight( 50 );\r
+ iTimeDisplay->setFont( clockFont );\r
+\r
iRoomsCombo = new MeetingRoomCombo( iConfiguration->rooms(), this );\r
iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() );\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
+ iStatusBar = new BorderedBarWidget( this );\r
+ iStatusBar->setFaceColor( Qt::darkGray );\r
+ iStatusBar->setBackgroundColor( Qt::white );\r
+ iStatusBar->setBorderWidth( 4 );\r
+ iStatusBar->setFont(statusBarFont);\r
+ iStatusBar->setFixedHeight( 28 );\r
+ QPixmap pixmap(":ixonos_logo");\r
+ iStatusBar->setPixmap( pixmap );\r
\r
iSchedule = new ScheduleWidget( aCurrentDateTime, iConfiguration->displaySettings(), this );\r
connect( iSchedule, SIGNAL( shownWeekChanged( QDate ) ), this, SIGNAL( shownWeekChanged( QDate ) ) );\r
connect( iSchedule, SIGNAL( meetingActivated( Meeting* ) ), this, SIGNAL( meetingActivated( Meeting* ) ) );\r
\r
iPreviousWeekButton = new QPushButton( this );\r
- iPreviousWeekButton->setText( tr( "<<" ) );\r
- iPreviousWeekButton->setFixedWidth( 60 );\r
+ iPreviousWeekButton->setText( tr( "<" ) );\r
+ iPreviousWeekButton->setFixedWidth( 50 );\r
+ iPreviousWeekButton->setFixedHeight( 100 );\r
+ iPreviousWeekButton->setFont( buttonFont );\r
connect( iPreviousWeekButton, SIGNAL( clicked() ), iSchedule, SLOT( showPreviousWeek() ) );\r
\r
iCurrentWeekButton = new QPushButton( this );\r
iCurrentWeekButton->setFixedWidth( 100 );\r
- iCurrentWeekButton->setText( tr( "Current" ) );\r
+ iCurrentWeekButton->setFixedHeight( 46 );\r
+ iCurrentWeekButton->setText( tr( "Today" ) );\r
+ iCurrentWeekButton->setFont( buttonFont );\r
+\r
connect( iCurrentWeekButton, SIGNAL( clicked() ), iSchedule, SLOT( showCurrentWeek() ) );\r
\r
iNextWeekButton = new QPushButton( this );\r
- iNextWeekButton->setFixedWidth( 60 );\r
- iNextWeekButton->setText( tr( ">>" ) );\r
+ iNextWeekButton->setFixedWidth( 50 );\r
+ iNextWeekButton->setFixedHeight( 100 );\r
+ iNextWeekButton->setText( tr( ">" ) );\r
+ iNextWeekButton->setFont( buttonFont );\r
connect( iNextWeekButton, SIGNAL( clicked() ), iSchedule, SLOT( showNextWeek() ) );\r
\r
// **********************************\r
// Create the view's layout\r
+ QVBoxLayout *leftLayout = new QVBoxLayout;\r
+ QVBoxLayout *centerLayout = new QVBoxLayout;\r
+ QVBoxLayout *rightLayout = new QVBoxLayout;\r
+\r
+ leftLayout->addWidget( iPreviousWeekButton );\r
+ rightLayout->addWidget( iNextWeekButton );\r
+\r
QHBoxLayout *tableLayout = new QHBoxLayout;\r
tableLayout->addWidget( iSchedule );\r
\r
- QHBoxLayout *bottomLayout = new QHBoxLayout;\r
- bottomLayout->addWidget( iRoomsCombo );\r
- bottomLayout->addWidget( iTimeDisplay );\r
- QVBoxLayout *dateLayout = new QVBoxLayout;\r
- dateLayout->addWidget( iCurrentDayLabel );\r
- dateLayout->addWidget( iCurrentWeekLabel );\r
- bottomLayout->addLayout( dateLayout );\r
- bottomLayout->addWidget( iPreviousWeekButton );\r
- bottomLayout->addWidget( iCurrentWeekButton );\r
- bottomLayout->addWidget( iNextWeekButton );\r
- bottomLayout->addWidget( iSettingsButton );\r
-\r
- QVBoxLayout *mainLayout = new QVBoxLayout;\r
- mainLayout->addLayout( tableLayout );\r
- mainLayout->addLayout( bottomLayout );\r
+ QGridLayout *naviLayout = new QGridLayout;\r
+ naviLayout->addWidget( iCurrentWeekButton, 0, 0, Qt::AlignLeft );\r
+ naviLayout->addWidget( iTimeDisplay, 0, 1, Qt::AlignCenter );\r
+ naviLayout->addWidget( iRoomsCombo, 0, 2, Qt::AlignRight );\r
+\r
+// QVBoxLayout *dateLayout = new QVBoxLayout;\r
+// dateLayout->addWidget( iCurrentDayLabel );\r
+// dateLayout->addWidget( iCurrentWeekLabel );\r
+// bottomLayout->addLayout( dateLayout );\r
+// bottomLayout->addWidget( iSettingsButton );\r
+\r
+ centerLayout->addLayout( naviLayout );\r
+ centerLayout->addLayout( tableLayout );\r
+ centerLayout->addWidget( iStatusBar );\r
+\r
+ QHBoxLayout *mainLayout = new QHBoxLayout;\r
+ mainLayout->addLayout( leftLayout );\r
+ mainLayout->addLayout( centerLayout );\r
+ mainLayout->addLayout( rightLayout );\r
setLayout( mainLayout );\r
\r
// Set child observing\r
observeChild( iRoomsCombo );\r
+ observeChild( iStatusBar );\r
observeChild( iTimeDisplay );\r
observeChild( iCurrentDayLabel );\r
observeChild( iCurrentWeekLabel );\r
palette.setColor( QPalette::Foreground, Qt::darkGray );\r
setPalette( palette );\r
\r
+ setAutoFillBackground( true );\r
+\r
// ******************************************\r
// Handle all the signal connections\r
// TODO : this solution if interaction monitoring is not elegant enough\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
connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), iSchedule, SLOT( refresh() ) );\r
}\r
delete iTimeDisplay;\r
iTimeDisplay = 0;\r
}\r
+ if ( iStatusBar )\r
+ {\r
+ delete iStatusBar;\r
+ iStatusBar = 0;\r
+ }\r
+\r
if ( iSchedule )\r
{\r
delete iSchedule;\r
}\r
}\r
\r
-Meeting* WeeklyViewWidget::currentMeeting()\r
-{\r
- return iSchedule->currentMeeting();\r
-}\r
-\r
Room* WeeklyViewWidget::currentRoom()\r
{\r
return iRoomsCombo->currentRoom();\r
\r
iCurrentWeekLabel->setText( tr( "Wk %1" ).arg( aCurrentDateTime.date().weekNumber() ) );\r
\r
- iTimeDisplay->setTime( aCurrentDateTime.time() );\r
+ iTimeDisplay->setText( aCurrentDateTime.toString( iConfiguration->displaySettings()->timeFormat() ) );\r
\r
iSchedule->setCurrentDateTime( aCurrentDateTime );\r
}\r
\r
-void WeeklyViewWidget::insertMeeting( Meeting *aMeeting )\r
+QDate WeeklyViewWidget::beginnigOfShownWeek()\r
{\r
- iSchedule->insertMeeting( aMeeting );\r
+ return iSchedule->beginningOfShownWeek();\r
}\r
\r
-void WeeklyViewWidget::deleteMeeting( Meeting *aMeeting )\r
+void WeeklyViewWidget::refreshMeetings( const QList<Meeting*> &aMeetings )\r
{\r
- iSchedule->removeMeeting( aMeeting );\r
+ qDebug() << "WeeklyViewWidget::refreshMeetings()";\r
+ iSchedule->refreshMeetings( aMeetings );\r
}\r
\r
-void WeeklyViewWidget::updateMeeting( Meeting *aMeeting )\r
+void WeeklyViewWidget::showCurrentWeek()\r
{\r
- iSchedule->updateMeeting( aMeeting );\r
+ iSchedule->showCurrentWeek();\r
}\r
\r
-QDate WeeklyViewWidget::beginnigOfShownWeek()\r
+void WeeklyViewWidget::setDefaultRoom()\r
{\r
- return iSchedule->beginningOfShownWeek();\r
+ iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() );\r
}\r
\r
-void WeeklyViewWidget::showCurrentWeek()\r
+void WeeklyViewWidget::connectionEstablished()\r
{\r
- iSchedule->showCurrentWeek();\r
+ ViewBase::connectionEstablished();\r
+ qDebug() << "WeeklyViewWidget::connectionEstablished";\r
+ iStatusBar->setText( tr("Connected"), BorderedBarWidget::LeftAlign );\r
}\r
\r
-void WeeklyViewWidget::setDefaultRoom()\r
+void WeeklyViewWidget::connectionLost()\r
{\r
- iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() );\r
+ ViewBase::connectionLost();\r
+ iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign );\r
}\r