X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FUserInterface%2FViews%2FWeeklyViewWidget.cpp;fp=src%2FUserInterface%2FViews%2FWeeklyViewWidget.cpp;h=6c8b75c8401754483fa6c5145477b259b810e8a4;hb=663a2fc8ce3a0b8b987655fe709a831a3db9b315;hp=643732ef9730726ce2a2c701fc387a6ffb4043fb;hpb=59b4a9d85f3cd02e90c8efcecc66f9150f8a61f8;p=qtmeetings diff --git a/src/UserInterface/Views/WeeklyViewWidget.cpp b/src/UserInterface/Views/WeeklyViewWidget.cpp index 643732e..6c8b75c 100644 --- a/src/UserInterface/Views/WeeklyViewWidget.cpp +++ b/src/UserInterface/Views/WeeklyViewWidget.cpp @@ -16,6 +16,7 @@ #include "ScheduleWidget.h" #include "ToolBox.h" #include "MeetingInfoDialog.h" +#include "BorderedBarWidget.h" #include @@ -33,6 +34,20 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a regularTextFont.setBold( true ); regularTextFont.setPointSize( 12 ); + QFont clockFont; + clockFont.setStyleHint( QFont::Helvetica ); + clockFont.setBold( true ); + clockFont.setPixelSize( 36 ); + + QFont statusBarFont; + statusBarFont.setStyleHint( QFont::Helvetica ); + statusBarFont.setPixelSize( 12 ); + + QFont buttonFont; + buttonFont.setStyleHint( QFont::Helvetica ); + buttonFont.setBold( true ); + buttonFont.setPixelSize( 18 ); + iSettingsButton = new QPushButton; iSettingsButton->setIcon( QPixmap( ":button_settings" ) ); iSettingsButton->setFixedWidth( 36 ); @@ -41,57 +56,89 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a iCurrentDayLabel = ToolBox::createLabel( aCurrentDateTime.toString( iConfiguration->displaySettings()->dateFormat() ), regularTextFont ); iCurrentWeekLabel = ToolBox::createLabel( tr( "Wk %1" ).arg( aCurrentDateTime.date().weekNumber() ), regularTextFont ); + iTimeDisplay = new BorderedBarWidget( this ); + iTimeDisplay->setFaceColor( Qt::darkGray ); + iTimeDisplay->setBackgroundColor( Qt::white); + iTimeDisplay->setBorderWidth( 6 ); + iTimeDisplay->setFixedWidth( 170 ); + iTimeDisplay->setFixedHeight( 50 ); + iTimeDisplay->setFont( clockFont ); + iRoomsCombo = new MeetingRoomCombo( iConfiguration->rooms(), this ); iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() ); connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), this, SIGNAL( currentRoomChanged( Room * ) ) ); - iTimeDisplay = new DigitalTimeDisplayWidget( aCurrentDateTime.time(), iConfiguration->displaySettings()->timeFormat(), this ); - iTimeDisplay->setFrameVisible( false ); - iTimeDisplay->setFont( regularTextFont ); + iStatusBar = new BorderedBarWidget( this ); + iStatusBar->setFaceColor( Qt::darkGray ); + iStatusBar->setBackgroundColor( Qt::white ); + iStatusBar->setBorderWidth( 4 ); + iStatusBar->setFont(statusBarFont); + iStatusBar->setFixedHeight( 28 ); + QPixmap pixmap(":ixonos_logo"); + iStatusBar->setPixmap( pixmap ); iSchedule = new ScheduleWidget( aCurrentDateTime, iConfiguration->displaySettings(), this ); connect( iSchedule, SIGNAL( shownWeekChanged( QDate ) ), this, SIGNAL( shownWeekChanged( QDate ) ) ); connect( iSchedule, SIGNAL( meetingActivated( Meeting* ) ), this, SIGNAL( meetingActivated( Meeting* ) ) ); iPreviousWeekButton = new QPushButton( this ); - iPreviousWeekButton->setText( tr( "<<" ) ); - iPreviousWeekButton->setFixedWidth( 60 ); + iPreviousWeekButton->setText( tr( "<" ) ); + iPreviousWeekButton->setFixedWidth( 50 ); + iPreviousWeekButton->setFixedHeight( 100 ); + iPreviousWeekButton->setFont( buttonFont ); connect( iPreviousWeekButton, SIGNAL( clicked() ), iSchedule, SLOT( showPreviousWeek() ) ); iCurrentWeekButton = new QPushButton( this ); iCurrentWeekButton->setFixedWidth( 100 ); - iCurrentWeekButton->setText( tr( "Current" ) ); + iCurrentWeekButton->setFixedHeight( 46 ); + iCurrentWeekButton->setText( tr( "Today" ) ); + iCurrentWeekButton->setFont( buttonFont ); + connect( iCurrentWeekButton, SIGNAL( clicked() ), iSchedule, SLOT( showCurrentWeek() ) ); iNextWeekButton = new QPushButton( this ); - iNextWeekButton->setFixedWidth( 60 ); - iNextWeekButton->setText( tr( ">>" ) ); + iNextWeekButton->setFixedWidth( 50 ); + iNextWeekButton->setFixedHeight( 100 ); + iNextWeekButton->setText( tr( ">" ) ); + iNextWeekButton->setFont( buttonFont ); connect( iNextWeekButton, SIGNAL( clicked() ), iSchedule, SLOT( showNextWeek() ) ); // ********************************** // Create the view's layout + QVBoxLayout *leftLayout = new QVBoxLayout; + QVBoxLayout *centerLayout = new QVBoxLayout; + QVBoxLayout *rightLayout = new QVBoxLayout; + + leftLayout->addWidget( iPreviousWeekButton ); + rightLayout->addWidget( iNextWeekButton ); + QHBoxLayout *tableLayout = new QHBoxLayout; tableLayout->addWidget( iSchedule ); - QHBoxLayout *bottomLayout = new QHBoxLayout; - bottomLayout->addWidget( iRoomsCombo ); - bottomLayout->addWidget( iTimeDisplay ); - QVBoxLayout *dateLayout = new QVBoxLayout; - dateLayout->addWidget( iCurrentDayLabel ); - dateLayout->addWidget( iCurrentWeekLabel ); - bottomLayout->addLayout( dateLayout ); - bottomLayout->addWidget( iPreviousWeekButton ); - bottomLayout->addWidget( iCurrentWeekButton ); - bottomLayout->addWidget( iNextWeekButton ); - bottomLayout->addWidget( iSettingsButton ); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addLayout( tableLayout ); - mainLayout->addLayout( bottomLayout ); + QGridLayout *naviLayout = new QGridLayout; + naviLayout->addWidget( iCurrentWeekButton, 0, 0, Qt::AlignLeft ); + naviLayout->addWidget( iTimeDisplay, 0, 1, Qt::AlignCenter ); + naviLayout->addWidget( iRoomsCombo, 0, 2, Qt::AlignRight ); + +// QVBoxLayout *dateLayout = new QVBoxLayout; +// dateLayout->addWidget( iCurrentDayLabel ); +// dateLayout->addWidget( iCurrentWeekLabel ); +// bottomLayout->addLayout( dateLayout ); +// bottomLayout->addWidget( iSettingsButton ); + + centerLayout->addLayout( naviLayout ); + centerLayout->addLayout( tableLayout ); + centerLayout->addWidget( iStatusBar ); + + QHBoxLayout *mainLayout = new QHBoxLayout; + mainLayout->addLayout( leftLayout ); + mainLayout->addLayout( centerLayout ); + mainLayout->addLayout( rightLayout ); setLayout( mainLayout ); // Set child observing observeChild( iRoomsCombo ); + observeChild( iStatusBar ); observeChild( iTimeDisplay ); observeChild( iCurrentDayLabel ); observeChild( iCurrentWeekLabel ); @@ -102,7 +149,7 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a QPalette palette; palette.setColor( QPalette::Window, Qt::white ); - palette.setColor( QPalette::WindowText, Qt::darkGray ); + palette.setColor( QPalette::Foreground, Qt::darkGray ); setPalette( palette ); setAutoFillBackground( true ); @@ -132,6 +179,12 @@ WeeklyViewWidget::~WeeklyViewWidget() delete iTimeDisplay; iTimeDisplay = 0; } + if ( iStatusBar ) + { + delete iStatusBar; + iStatusBar = 0; + } + if ( iSchedule ) { delete iSchedule; @@ -180,7 +233,7 @@ void WeeklyViewWidget::setCurrentDateTime( QDateTime aCurrentDateTime ) iCurrentWeekLabel->setText( tr( "Wk %1" ).arg( aCurrentDateTime.date().weekNumber() ) ); - iTimeDisplay->setTime( aCurrentDateTime.time() ); + iTimeDisplay->setText( aCurrentDateTime.toString( iConfiguration->displaySettings()->timeFormat() ) ); iSchedule->setCurrentDateTime( aCurrentDateTime ); } @@ -205,3 +258,16 @@ void WeeklyViewWidget::setDefaultRoom() { iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() ); } + +void WeeklyViewWidget::connectionEstablished() +{ + ViewBase::connectionEstablished(); + qDebug() << "WeeklyViewWidget::connectionEstablished"; + iStatusBar->setText( tr("Connected"), BorderedBarWidget::LeftAlign ); +} + +void WeeklyViewWidget::connectionLost() +{ + ViewBase::connectionLost(); + iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign ); +}