From: Risto Lintinen Date: Tue, 25 Aug 2009 07:27:15 +0000 (+0300) Subject: User interface and menu fixes X-Git-Url: http://vcs.maemo.org/git/?p=qtmeetings;a=commitdiff_plain;h=031dfbe58e5265dfff05b8ceb7ffae21be7c4868 User interface and menu fixes --- diff --git a/QtMeetings.conf b/QtMeetings.conf index 04cb472..9f1d726 100644 --- a/QtMeetings.conf +++ b/QtMeetings.conf @@ -2,11 +2,7 @@ - - - jklexch01.ixonos.com + @@ -14,7 +10,7 @@ - + diff --git a/debian/changelog b/debian/changelog index 08cf32a..ff20c47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +qtmeetings (1.0.6-1) unstable; urgency=low + + * Improved user interface + * Fix for settings read and write + + -- Risto Lintinen Mon, 24 May 2009 12:30:00 +0300 + qtmeetings (1.0.5-1) unstable; urgency=low * Improved communication module for getting a meeting secondary id and detailed information diff --git a/debian/qtmeetings.install b/debian/qtmeetings.install index e69de29..b004e68 100644 --- a/debian/qtmeetings.install +++ b/debian/qtmeetings.install @@ -0,0 +1 @@ +resources/QtMeetings.conf etc diff --git a/resources/UserInterface.qrc b/resources/UserInterface.qrc index 6f125d3..dc3301b 100644 --- a/resources/UserInterface.qrc +++ b/resources/UserInterface.qrc @@ -12,6 +12,5 @@ icons/popup_ok.png icons/popup_question.png icons/popup_warning.png - icons/ixonos_logo.png diff --git a/resources/icons/ixonos_logo.png b/resources/icons/ixonos_logo.png deleted file mode 100644 index d04b1bd..0000000 Binary files a/resources/icons/ixonos_logo.png and /dev/null differ diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index 6207440..9fd0c6c 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -58,6 +58,9 @@ Engine::Engine() : iAutoRefresh->start(); connect( iAutoRefresh, SIGNAL( timeout() ), iAutoRefresh, SLOT( start() ) ); connect( iAutoRefresh, SIGNAL( timeout() ), this, SLOT( updateRoomInfo() ) ); + + connect(iWindowManager, SIGNAL(closeClicked()), this, SLOT(closeApplication())); + // connect( iAutoRefresh, SIGNAL( timeout() ), this, SLOT( fetchMeetings() ) ); if( iDevice->currentOperationMode() == DeviceManager::KioskMode ) diff --git a/src/UserInterface/Components/ScheduleWidget.cpp b/src/UserInterface/Components/ScheduleWidget.cpp index 65ca353..181593e 100644 --- a/src/UserInterface/Components/ScheduleWidget.cpp +++ b/src/UserInterface/Components/ScheduleWidget.cpp @@ -12,6 +12,8 @@ const QColor ScheduleWidget::sFreeBackground = QColor( Qt::white ); const QColor ScheduleWidget::sBusyBackground = QColor( 238, 147, 17 ); const QColor ScheduleWidget::sBusyBackgroundStart = QColor( 254, 193, 104 ); +const QColor ScheduleWidget::sCurrentBackgroundStart = QColor( 237, 124, 125 ); +const QColor ScheduleWidget::sCurrentBackground = QColor( 161, 1, 1 ); const QColor ScheduleWidget::sHeaderBackground = QColor( Qt::white ); const QColor ScheduleWidget::sDayHighlightColor = QColor( 255, 235, 160 ); const QColor ScheduleWidget::sTimeHighlightColor = QColor( Qt::black ); @@ -104,8 +106,18 @@ void ScheduleTableWidget::paintEvent( QPaintEvent* aEvent ) for ( int i = 0; i < iMeetingsByDay[day].size(); ++i ) { QLinearGradient linearGrad( QPoint(iMeetingsByDay[day][i].rect.x(),iMeetingsByDay[day][i].rect.y()) , QPoint(iMeetingsByDay[day][i].rect.x(),iMeetingsByDay[day][i].rect.bottom()) ); - linearGrad.setColorAt(0, ScheduleWidget::sBusyBackgroundStart); - linearGrad.setColorAt(1, ScheduleWidget::sBusyBackground); + // draw meeting with red if it is ongoing + if ( iMeetingsByDay[day][i].meeting->startsAt() <= QDateTime::currentDateTime() && + iMeetingsByDay[day][i].meeting->endsAt() >= QDateTime::currentDateTime() ) + { + linearGrad.setColorAt(0, ScheduleWidget::sCurrentBackgroundStart); + linearGrad.setColorAt(1, ScheduleWidget::sCurrentBackground); + } + else + { + linearGrad.setColorAt(0, ScheduleWidget::sBusyBackgroundStart); + linearGrad.setColorAt(1, ScheduleWidget::sBusyBackground); + } painter.setBrush(linearGrad); painter.drawRoundRect( iMeetingsByDay[day][i].rect, 20, 20 ); @@ -299,7 +311,9 @@ ScheduleWidget::ScheduleWidget( QDateTime aCurrentDateTime, DisplaySettings *aSe iScheduleTable->setShowGrid( false ); QFont font; - font.setPointSize( 10 ); + font.setStyleHint( QFont::Helvetica ); + font.setBold( true ); + font.setPixelSize( 20 ); // add empty item to top-left corner, this will be updated in refresh() QTableWidgetItem *weekItem = new QTableWidgetItem(); @@ -374,7 +388,7 @@ void ScheduleWidget::refresh() item->setText( tr( "Wk %1" ).arg( iShownDate.weekNumber() ) ); continue; } - item->setText( iShownDate.addDays( i - 1 ).toString( tr( "ddd d MMM" ) ) ); + item->setText( iShownDate.addDays( i - 1 ).toString( tr( "ddd d/M" ) ) ); if ( iCurrentDateTime.date() == iShownDate.addDays( i - 1 ) ) { @@ -454,10 +468,10 @@ int ScheduleWidget::weekLengthAsDays() void ScheduleWidget::resizeEvent( QResizeEvent* /* aEvent */ ) { QRect rect = iScheduleTable->contentsRect(); - int rowHeight = ( int )( rect.height() / ( float )iScheduleTable->rowCount() ); - int headerRowHeight = rowHeight; - int columnWidth = ( int )( rect.width() / ( iScheduleTable->columnCount() - 0.5f ) ); - int headerColumnWidth = columnWidth / 2; + int rowHeight = ( int )( rect.height() / ( float )( iScheduleTable->rowCount() + 1 ) ); + int headerRowHeight = ( int )rowHeight*2; + int headerColumnWidth = rect.width() * 0.15f; + int columnWidth = ( rect.width() - headerColumnWidth ) / ( iScheduleTable->columnCount() - 1 ); iScheduleTable->setRowHeight( 0, headerRowHeight ); for ( int i = 1; i < iScheduleTable->rowCount(); ++i ) @@ -474,6 +488,7 @@ void ScheduleWidget::resizeEvent( QResizeEvent* /* aEvent */ ) // resize table so that frame size matches exactly int leftMargin = 0, topMargin = 0, rightMargin = 0, bottomMargin = 0; iScheduleTable->getContentsMargins( &leftMargin, &topMargin, &rightMargin, &bottomMargin ); - iScheduleTable->resize( columnWidth * iScheduleTable->columnCount() - headerColumnWidth + leftMargin + rightMargin, - rowHeight * iScheduleTable->rowCount() + topMargin + bottomMargin ); + iScheduleTable->resize( columnWidth * ( iScheduleTable->columnCount() - 1 ) + + headerColumnWidth + leftMargin + rightMargin, + rowHeight * ( iScheduleTable->rowCount() + 1 ) + topMargin + bottomMargin ); } diff --git a/src/UserInterface/Components/ScheduleWidget.h b/src/UserInterface/Components/ScheduleWidget.h index c0269dd..27c7f11 100644 --- a/src/UserInterface/Components/ScheduleWidget.h +++ b/src/UserInterface/Components/ScheduleWidget.h @@ -266,6 +266,12 @@ private: //! Color for a busy cell. static const QColor sBusyBackground; + //! Color for a busy cell. + static const QColor sCurrentBackgroundStart; + + //! Color for a busy cell. + static const QColor sCurrentBackground; + //! Color for headers. static const QColor sHeaderBackground; diff --git a/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp b/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp index d71fcb1..be37768 100644 --- a/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp +++ b/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp @@ -28,7 +28,7 @@ RoomStatusIndicatorWidget::RoomStatusIndicatorWidget(Room *aDefaultRoom, Room::S QFont statusBarFont; statusBarFont.setStyleHint( QFont::Helvetica ); - statusBarFont.setPixelSize( 12 ); + statusBarFont.setPixelSize( 18 ); // display for current time // Note: the time display receives current time info from Engine::clock() @@ -45,9 +45,7 @@ RoomStatusIndicatorWidget::RoomStatusIndicatorWidget(Room *aDefaultRoom, Room::S iStatusBar->setBackgroundColor( Qt::white ); iStatusBar->setBorderWidth( 4 ); iStatusBar->setFont(statusBarFont); - iStatusBar->setFixedHeight( 28 ); - QPixmap pixmap(":ixonos_logo"); - iStatusBar->setPixmap( pixmap ); + iStatusBar->setFixedHeight( 36 ); iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign ); // Pegasus diff --git a/src/UserInterface/Views/WeeklyViewWidget.cpp b/src/UserInterface/Views/WeeklyViewWidget.cpp index 0c9b61f..82d18c2 100644 --- a/src/UserInterface/Views/WeeklyViewWidget.cpp +++ b/src/UserInterface/Views/WeeklyViewWidget.cpp @@ -41,7 +41,7 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a QFont statusBarFont; statusBarFont.setStyleHint( QFont::Helvetica ); - statusBarFont.setPixelSize( 12 ); + statusBarFont.setPixelSize( 18 ); QFont buttonFont; buttonFont.setStyleHint( QFont::Helvetica ); @@ -73,9 +73,7 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a iStatusBar->setBackgroundColor( Qt::white ); iStatusBar->setBorderWidth( 4 ); iStatusBar->setFont(statusBarFont); - iStatusBar->setFixedHeight( 28 ); - QPixmap pixmap(":ixonos_logo"); - iStatusBar->setPixmap( pixmap ); + iStatusBar->setFixedHeight( 36 ); iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign ); iSchedule = new ScheduleWidget( aCurrentDateTime, iConfiguration->displaySettings(), this ); diff --git a/src/UserInterface/WindowManager.cpp b/src/UserInterface/WindowManager.cpp index d7a1252..aa90587 100644 --- a/src/UserInterface/WindowManager.cpp +++ b/src/UserInterface/WindowManager.cpp @@ -15,8 +15,13 @@ WindowManager::WindowManager( QWidget *aParent ) : { this->setWindowTitle( iApplicationName ); settingsAction = new QAction(tr("&Settings"), this); + closeAction = new QAction(tr("&Close"), this); connect(settingsAction, SIGNAL(triggered()), this, SIGNAL(showSettingsClicked())); - menuBar()->addAction(settingsAction); + connect(closeAction, SIGNAL(triggered()), this, SIGNAL(closeClicked())); + editMenu = menuBar()->addMenu(tr("&Edit")); + editMenu->addAction(settingsAction); + menuBar()->addMenu(editMenu); + menuBar()->addAction(closeAction); } WindowManager::~WindowManager() diff --git a/src/UserInterface/WindowManager.h b/src/UserInterface/WindowManager.h index d110767..b71c04d 100644 --- a/src/UserInterface/WindowManager.h +++ b/src/UserInterface/WindowManager.h @@ -60,6 +60,8 @@ signals: void showSettingsClicked(); + void closeClicked(); + void dialogActivated(); void dialogDeactivated(); @@ -104,7 +106,12 @@ private: //! Stack of views previously displayed. QStack iViewList; + //! Menu settings QAction *settingsAction; + //! Menu close application + QAction *closeAction; + //! Edit menu + QMenu *editMenu; }; #endif /*WINDOWMANAGER_H_*/