# HG changeset patch # User hgs # Date 1282725133 -19800 # Node ID a3cb48f6c8894f7c82a0823af84d2653423dba08 # Parent bb2d3e476f29273249e200cdbf216d7a718b3bab 201033 diff -r bb2d3e476f29 -r a3cb48f6c889 alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_calendar_unlocked.docml --- a/alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_calendar_unlocked.docml Mon Aug 09 18:30:52 2010 +0530 +++ b/alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_calendar_unlocked.docml Wed Aug 25 14:02:13 2010 +0530 @@ -7,6 +7,8 @@ + + @@ -14,100 +16,124 @@ - - - + + + - - - - + + - - - - - - - + + + - - + + - - - - - - - - + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + - - - -
-
- - + + + + + + + + + + - + + + + + - - - + + +
+
- - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- + + - diff -r bb2d3e476f29 -r a3cb48f6c889 alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_clock_unlocked.docml --- a/alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_clock_unlocked.docml Mon Aug 09 18:30:52 2010 +0530 +++ b/alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_clock_unlocked.docml Wed Aug 25 14:02:13 2010 +0530 @@ -16,14 +16,15 @@ + - + - + @@ -33,6 +34,7 @@ + @@ -41,15 +43,15 @@ - + - + diff -r bb2d3e476f29 -r a3cb48f6c889 alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_todo_unlocked.docml --- a/alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_todo_unlocked.docml Mon Aug 09 18:30:52 2010 +0530 +++ b/alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_todo_unlocked.docml Wed Aug 25 14:02:13 2010 +0530 @@ -24,14 +24,16 @@ - + + + @@ -40,15 +42,15 @@ - + - + diff -r bb2d3e476f29 -r a3cb48f6c889 alarmui/alarmalertwidget/alarmalertplugin/inc/alarmalertwidget_p.h --- a/alarmui/alarmalertwidget/alarmalertplugin/inc/alarmalertwidget_p.h Mon Aug 09 18:30:52 2010 +0530 +++ b/alarmui/alarmalertwidget/alarmalertplugin/inc/alarmalertwidget_p.h Wed Aug 25 14:02:13 2010 +0530 @@ -18,6 +18,7 @@ // System includes #include +#include #include #include #include @@ -215,19 +216,19 @@ * @var mAlarmDescription * @brief Points to the alarm description label */ - HbLabel *mAlarmDescription; + QPointer mAlarmDescription; /** * @var mAlarmDateTime * @brief Points to the alarm expiry time label */ - HbLabel *mAlarmDateTime; + QPointer mAlarmDateTime; /** * @var mAlarmIcon * @brief Points to the alarm icon label */ - HbLabel *mAlarmIcon; + QPointer mAlarmIcon; /** * @var mMainWindow diff -r bb2d3e476f29 -r a3cb48f6c889 alarmui/alarmalertwidget/alarmalertplugin/src/alarmalertwidget_p.cpp --- a/alarmui/alarmalertwidget/alarmalertplugin/src/alarmalertwidget_p.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/alarmui/alarmalertwidget/alarmalertplugin/src/alarmalertwidget_p.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -417,12 +417,6 @@ qFatal("Unable to find the alarmDate label"); } alarmDate->setPlainText(mAlarmDate); - HbLabel *alarmDateNonTimed = qobject_cast ( - mAlertDocLoader->findWidget("nonTimedAlarmDate")); - if (!alarmDateNonTimed) { - qFatal("Unable to find the nonTimedAlarmDate label"); - } - alarmDateNonTimed->hide(); }else { mAlertDocLoader->load( alarmNormalUICalendarDocml, "nonTimedAlarm",&success); @@ -440,13 +434,7 @@ if (!alarmDate) { qFatal("Unable to find the alarmDate label"); } - alarmDate->hide(); - HbLabel *alarmDateNonTimed = qobject_cast ( - mAlertDocLoader->findWidget("nonTimedAlarmDate")); - if (!alarmDateNonTimed) { - qFatal("Unable to find the alarmDateNonTimed label"); - } - alarmDateNonTimed->setPlainText(mAlarmDate); + alarmDate->setPlainText(mAlarmDate); } QGraphicsWidget *headingWidget = mAlertDocLoader->findWidget("heading"); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/agendaeventviewer/bwins/agendaeventvieweru.def --- a/calendarui/agendaeventviewer/bwins/agendaeventvieweru.def Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/agendaeventviewer/bwins/agendaeventvieweru.def Wed Aug 25 14:02:13 2010 +0530 @@ -1,8 +1,10 @@ EXPORTS - ?view@AgendaEventViewer@@QAEXVAgendaEntry@@W4Actions@1@@Z @ 1 NONAME ; void AgendaEventViewer::view(class AgendaEntry, enum AgendaEventViewer::Actions) - ?view@AgendaEventViewer@@QAEXABVQFile@@W4Actions@1@@Z @ 2 NONAME ; void AgendaEventViewer::view(class QFile const &, enum AgendaEventViewer::Actions) - ??1AgendaEventViewer@@UAE@XZ @ 3 NONAME ; AgendaEventViewer::~AgendaEventViewer(void) - ??0AgendaEventViewer@@QAE@PAVAgendaUtil@@PAVQObject@@@Z @ 4 NONAME ; AgendaEventViewer::AgendaEventViewer(class AgendaUtil *, class QObject *) - ?view@AgendaEventViewer@@QAEXKW4Actions@1@@Z @ 5 NONAME ; void AgendaEventViewer::view(unsigned long, enum AgendaEventViewer::Actions) - ??0AgendaEventViewer@@QAE@PAVQObject@@@Z @ 6 NONAME ; AgendaEventViewer::AgendaEventViewer(class QObject *) + ?view@AgendaEventViewer@@QAEXABVQFile@@W4Actions@1@@Z @ 1 NONAME ; void AgendaEventViewer::view(class QFile const &, enum AgendaEventViewer::Actions) + ??1AgendaEventViewer@@UAE@XZ @ 2 NONAME ; AgendaEventViewer::~AgendaEventViewer(void) + ?saveAndCloseEditor@AgendaEventViewer@@QAEXXZ @ 3 NONAME ; void AgendaEventViewer::saveAndCloseEditor(void) + ?view@AgendaEventViewer@@QAEXVAgendaEntry@@W4Actions@1@@Z @ 4 NONAME ; void AgendaEventViewer::view(class AgendaEntry, enum AgendaEventViewer::Actions) + ??0AgendaEventViewer@@QAE@PAVAgendaUtil@@PAVQObject@@@Z @ 5 NONAME ; AgendaEventViewer::AgendaEventViewer(class AgendaUtil *, class QObject *) + ?closeAgendaEventView@AgendaEventViewer@@QAEXXZ @ 6 NONAME ; void AgendaEventViewer::closeAgendaEventView(void) + ?view@AgendaEventViewer@@QAEXKW4Actions@1@@Z @ 7 NONAME ; void AgendaEventViewer::view(unsigned long, enum AgendaEventViewer::Actions) + ??0AgendaEventViewer@@QAE@PAVQObject@@@Z @ 8 NONAME ; AgendaEventViewer::AgendaEventViewer(class QObject *) diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/agendaeventviewer/eabi/agendaeventvieweru.def --- a/calendarui/agendaeventviewer/eabi/agendaeventvieweru.def Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/agendaeventviewer/eabi/agendaeventvieweru.def Wed Aug 25 14:02:13 2010 +0530 @@ -1,12 +1,14 @@ EXPORTS - _ZN17AgendaEventViewer4viewE11AgendaEntryNS_7ActionsE @ 1 NONAME - _ZN17AgendaEventViewer4viewERK5QFileNS_7ActionsE @ 2 NONAME - _ZN17AgendaEventViewer4viewEmNS_7ActionsE @ 3 NONAME - _ZN17AgendaEventViewerC1EP10AgendaUtilP7QObject @ 4 NONAME - _ZN17AgendaEventViewerC1EP7QObject @ 5 NONAME - _ZN17AgendaEventViewerC2EP10AgendaUtilP7QObject @ 6 NONAME - _ZN17AgendaEventViewerC2EP7QObject @ 7 NONAME - _ZN17AgendaEventViewerD0Ev @ 8 NONAME - _ZN17AgendaEventViewerD1Ev @ 9 NONAME - _ZN17AgendaEventViewerD2Ev @ 10 NONAME + _ZN17AgendaEventViewer18saveAndCloseEditorEv @ 1 NONAME + _ZN17AgendaEventViewer20closeAgendaEventViewEv @ 2 NONAME + _ZN17AgendaEventViewer4viewE11AgendaEntryNS_7ActionsE @ 3 NONAME + _ZN17AgendaEventViewer4viewERK5QFileNS_7ActionsE @ 4 NONAME + _ZN17AgendaEventViewer4viewEmNS_7ActionsE @ 5 NONAME + _ZN17AgendaEventViewerC1EP10AgendaUtilP7QObject @ 6 NONAME + _ZN17AgendaEventViewerC1EP7QObject @ 7 NONAME + _ZN17AgendaEventViewerC2EP10AgendaUtilP7QObject @ 8 NONAME + _ZN17AgendaEventViewerC2EP7QObject @ 9 NONAME + _ZN17AgendaEventViewerD0Ev @ 10 NONAME + _ZN17AgendaEventViewerD1Ev @ 11 NONAME + _ZN17AgendaEventViewerD2Ev @ 12 NONAME diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/agendaeventviewer/inc/agendaeventview.h --- a/calendarui/agendaeventviewer/inc/agendaeventview.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/agendaeventviewer/inc/agendaeventview.h Wed Aug 25 14:02:13 2010 +0530 @@ -50,7 +50,19 @@ AgendaEventView( AgendaEventViewerPrivate *owner, QObject *parent=0); virtual ~AgendaEventView(); - +public: + + /* + * forcefully closing the editor. + * should be call if view is open, + */ + void saveAndCloseEditor(); + + /* + * forcefully closing the view. + * should be call if view is open, + */ + void closeAgendaEventView(); private: void execute(AgendaEntry entry, AgendaEventViewer::Actions action); void addViewerData(); @@ -125,6 +137,7 @@ QTimer *mProgressTimer; int mProgressIconCount; bool mMaptileStatusReceived; + bool mCalenEditorClosed ; int mMaptileStatus; bool mNotesPluginLoaded; diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/agendaeventviewer/inc/agendaeventviewer.h --- a/calendarui/agendaeventviewer/inc/agendaeventviewer.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/agendaeventviewer/inc/agendaeventviewer.h Wed Aug 25 14:02:13 2010 +0530 @@ -63,6 +63,10 @@ AGENDAEVENTVIEWER_EXPORT void view(AgendaEntry entry, Actions action = ActionNothing); + AGENDAEVENTVIEWER_EXPORT void saveAndCloseEditor(); + + AGENDAEVENTVIEWER_EXPORT void closeAgendaEventView(); + signals: void viewingCompleted(const QDate date = QDate()); void editingStarted(); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/agendaeventviewer/inc/agendaeventviewer_p.h --- a/calendarui/agendaeventviewer/inc/agendaeventviewer_p.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/agendaeventviewer/inc/agendaeventviewer_p.h Wed Aug 25 14:02:13 2010 +0530 @@ -43,6 +43,18 @@ void view(const ulong id, AgendaEventViewer::Actions action); void view(const QFile &fileHandle, AgendaEventViewer::Actions action); void view(AgendaEntry entry, AgendaEventViewer::Actions action); + + /** + * close the editor and save the entry + * should be call if editor is open + */ + void saveAndCloseEditor(); + + /** + * close agenda event view + * should be call if agenda eevent view is open + */ + void closeAgendaEventView(); private slots: void viewingCompleted(const QDate date); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/agendaeventviewer/src/agendaeventview.cpp --- a/calendarui/agendaeventviewer/src/agendaeventview.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/agendaeventviewer/src/agendaeventview.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -94,7 +94,8 @@ mProgressIconCount(0), mMaptileStatusReceived(false), mMaptileStatus(-1), - mNotesPluginLoaded(false) + mNotesPluginLoaded(false), + mCalenEditorClosed(true) { OstTraceFunctionEntry0( AGENDAEVENTVIEW_AGENDAEVENTVIEW_ENTRY ); mTranslator->loadCommon(); @@ -1110,7 +1111,7 @@ connect(mCalenEditor, SIGNAL(dialogClosed()), this, SLOT(handleCalendarEditorClosed())); mCalenEditor->edit(mAgendaEntry, false); - + mCalenEditorClosed = false; } OstTraceFunctionExit0( AGENDAEVENTVIEW_EDIT_EXIT ); @@ -1276,6 +1277,7 @@ OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLECALENDAREDITORCLOSED_ENTRY ); // Cleanup. + mCalenEditorClosed = true; mCalenEditor->deleteLater(); mOwner->editingCompleted(); @@ -1493,4 +1495,36 @@ OstTraceFunctionExit0( AGENDAEVENTVIEW_CHANGEDORIENTATION_EXIT ); } +/*! + Close the editor and save the entry. + should be call if editor is open + */ +void AgendaEventView::saveAndCloseEditor() +{ + if(mCalenEditorClosed){ + QObject *plugin = qobject_cast ( + mNotesEditorPluginLoader->instance()); + + NotesEditorInterface* interface = + qobject_cast(plugin); + + + interface->close(NotesEditorInterface::CloseWithSave ,mOwner->mAgendaUtil); + + } + else{ + if(mCalenEditor){ + mCalenEditor->saveAndCloseEditor(); + } + } +} + +/*! + Close the view . + should be call if view is open + */ +void AgendaEventView::closeAgendaEventView() +{ + close(); +} // End of file diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/agendaeventviewer/src/agendaeventviewer.cpp --- a/calendarui/agendaeventviewer/src/agendaeventviewer.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/agendaeventviewer/src/agendaeventviewer.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -147,4 +147,22 @@ OstTraceFunctionExit0( DUP2_AGENDAEVENTVIEWER_VIEW_EXIT ); } +/*! + save the entry and close the editor +*/ +void AgendaEventViewer::saveAndCloseEditor() +{ + d_ptr->saveAndCloseEditor(); +} + + +/*! + close the aganda event view +*/ +void AgendaEventViewer::closeAgendaEventView() +{ + d_ptr->closeAgendaEventView(); +} + + // End of file diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/agendaeventviewer/src/agendaeventviewer_p.cpp --- a/calendarui/agendaeventviewer/src/agendaeventviewer_p.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/agendaeventviewer/src/agendaeventviewer_p.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -275,4 +275,25 @@ mAction = AgendaEventViewer::ActionNothing; OstTraceFunctionExit0( AGENDAEVENTVIEWERPRIVATE_VIEWCREATIONCOMPLETED_EXIT ); } + +// ---------------------------------------------------------------------------- +// AgendaEventViewerPrivate::saveAndCloseEditor +// save the entry and close the editor +// ---------------------------------------------------------------------------- +// +void AgendaEventViewerPrivate::saveAndCloseEditor() +{ + mAgendaEventView->saveAndCloseEditor(); +} + + +// ---------------------------------------------------------------------------- +// AgendaEventViewerPrivate::closeAgendaEventView +// close the agenda event view +// ---------------------------------------------------------------------------- +// +void AgendaEventViewerPrivate::closeAgendaEventView() +{ + mAgendaEventView->closeAgendaEventView(); +} // End of file diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/caleneditor/data/caleneditor.qrc --- a/calendarui/caleneditor/data/caleneditor.qrc Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/caleneditor/data/caleneditor.qrc Wed Aug 25 14:02:13 2010 +0530 @@ -1,6 +1,6 @@ caleneditorview.docml - caleneditorlocationitem.docml + caleneditorcustomitem.css diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/caleneditor/data/caleneditorcustomitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/caleneditor/data/caleneditorcustomitem.css Wed Aug 25 14:02:13 2010 +0530 @@ -0,0 +1,22 @@ +CalenEditorCustomItem[!hasIcon][expandItem]:landscape +{ + layout:layout_portrait_without_icon; +} + +CalenEditorCustomItem[hasIcon][expandItem]:landscape +{ + layout:layout_portrait_with_icon; +} + +CalenEditorCustomItem[expandItem]::dataItem_Label:landscape +{ + size-policy-horizontal:preferred; +} + +CalenEditorCustomItem[expandItem]::DataItem_ContentWidget:landscape +{ + top: -var(hb-param-margin-gene-top); + left:-var(hb-param-margin-gene-left); + right:var(hb-param-margin-gene-right); + bottom:var(hb-param-margin-gene-bottom); +} \ No newline at end of file diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/caleneditor/data/caleneditorlocationitem.docml --- a/calendarui/caleneditor/data/caleneditorlocationitem.docml Mon Aug 09 18:30:52 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/caleneditor/src/caleneditorcustomitem.cpp --- a/calendarui/caleneditor/src/caleneditorcustomitem.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/caleneditor/src/caleneditorcustomitem.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -72,6 +73,7 @@ mRequestPending(false) { OstTraceFunctionEntry0( CALENEDITORCUSTOMITEM_CALENEDITORCUSTOMITEM_ENTRY ); + HbStyleLoader::registerFilePath(":/xml"); mMinDate = CalenDateUtils::minTime().date(); mMaxDate = CalenDateUtils::maxTime().date(); mMinTime.setHMS(0,0,0,0); @@ -114,22 +116,43 @@ switch (itemType) { case CustomWidgetFrom: { - HbWidget *widgetTop = new HbWidget(); - QGraphicsLinearLayout *layoutTop = - new QGraphicsLinearLayout(Qt::Horizontal); - widgetTop->setLayout(layoutTop); + // Set the property so that the custom item layout + // will be the same for both portrait and landscape + setProperty("expandItem", true); + // Create the widget + HbWidget *widgetTop = new HbWidget(); + QGraphicsLinearLayout *layoutTop = + new QGraphicsLinearLayout(Qt::Horizontal); + layoutTop->setContentsMargins(0, 0, 0, 0); + + widgetTop->setLayout(layoutTop); + + // Set the button spacing. + HbDeviceProfile deviceProfile; + // The layout guide specifies the spacing as 2 u. + qreal spacing = deviceProfile.unitValue() * 2 ; + layoutTop->setSpacing(spacing); + // Calculate the button width. + qreal right = 0.0; + qreal left = 0.0; + style()->parameter("hb-param-margin-gene-right", right); + style()->parameter("hb-param-margin-gene-left", left); + qreal screenWidth = 0.0; + style()->parameter("hb-param-screen-short-edge", screenWidth); + qreal buttonWidth = (screenWidth - right - left - spacing) / 2; mPushButtonTime = new HbPushButton(); + mPushButtonTime->setPreferredWidth(buttonWidth); mPushButtonTime->setObjectName("startTime"); connect(mPushButtonTime, SIGNAL(clicked()), - this, SLOT(handleTime())); + this, SLOT(handleTime())); layoutTop->addItem(mPushButtonTime); - mPushButtonDate = - new HbPushButton(); + mPushButtonDate = new HbPushButton(); + mPushButtonDate->setPreferredWidth(buttonWidth); mPushButtonDate->setObjectName("startDate"); connect(mPushButtonDate, SIGNAL(clicked()), - this, SLOT(handleDate())); + this, SLOT(handleDate())); layoutTop->addItem(mPushButtonDate); OstTraceFunctionExit0( CALENEDITORCUSTOMITEM_CREATECUSTOMWIDGET_EXIT ); return widgetTop; @@ -138,72 +161,103 @@ case CustomWidgetTo: { - HbWidget *widgetBottom = new HbWidget(); - QGraphicsLinearLayout *layoutBottom = - new QGraphicsLinearLayout(Qt::Horizontal); - widgetBottom->setLayout(layoutBottom); + // Set the property so that the custom item layout + // will be the same for both portrait and landscape + setProperty("expandItem", true); + // Create the widget + HbWidget *widgetBottom = new HbWidget(); + + QGraphicsLinearLayout *layoutBottom = + new QGraphicsLinearLayout(Qt::Horizontal); + layoutBottom->setContentsMargins(0, 0, 0, 0); + widgetBottom->setLayout(layoutBottom); - mPushButtonTime = new HbPushButton(this); - mPushButtonTime->setObjectName("endTime"); - connect(mPushButtonTime, SIGNAL(clicked()), - this, SLOT(handleTime())); - layoutBottom->addItem(mPushButtonTime); - - mPushButtonDate = new HbPushButton(this); - mPushButtonDate->setObjectName("endDate"); - connect(mPushButtonDate, SIGNAL(clicked()), - this, SLOT(handleDate())); - layoutBottom->addItem(mPushButtonDate); + // Set the button spacing. + HbDeviceProfile deviceProfile; + // The layout guide specifies the spacing as 2 u. + qreal spacing = deviceProfile.unitValue() * 2 ; + layoutBottom->setSpacing(spacing); + // Calculate the button width. + qreal right = 0.0; + qreal left = 0.0; + style()->parameter("hb-param-margin-gene-right", right); + style()->parameter("hb-param-margin-gene-left", left); + qreal screenWidth = 0.0; + style()->parameter("hb-param-screen-short-edge", screenWidth); + qreal buttonWidth = (screenWidth - right - left - spacing) / 2; + + mPushButtonTime = new HbPushButton(this); + mPushButtonTime->setPreferredWidth(buttonWidth); + mPushButtonTime->setObjectName("endTime"); + connect(mPushButtonTime, SIGNAL(clicked()), + this, SLOT(handleTime())); + layoutBottom->addItem(mPushButtonTime); + + mPushButtonDate = new HbPushButton(this); + mPushButtonDate->setPreferredWidth(buttonWidth); + mPushButtonDate->setObjectName("endDate"); + connect(mPushButtonDate, SIGNAL(clicked()), + this, SLOT(handleDate())); + layoutBottom->addItem(mPushButtonDate); OstTraceFunctionExit0( DUP1_CALENEDITORCUSTOMITEM_CREATECUSTOMWIDGET_EXIT ); - return widgetBottom; + return widgetBottom; } case CustomWidgetLocation: { - CalenEditorDocLoader editorLocationDocLoader; - bool loadSuccess = false; - - editorLocationDocLoader.load(CALEN_EDITOR_LOCATION_XML_FILE, - &loadSuccess); - Q_ASSERT_X(loadSuccess, "caleneditor.cpp", - "Unable to load caleneditor location view XML"); - HbWidget* widgetLocation = qobject_cast ( - editorLocationDocLoader.findWidget(CALEN_EDITOR_LOCATION)); - - mLocationLineEdit = qobject_cast( - editorLocationDocLoader.findWidget( - CALEN_EDITOR_LOCATION_LINEEDIT)); + setProperty("expandItem", false); + HbWidget *widgetLocation = new HbWidget(); + QGraphicsLinearLayout *layoutLocation = + new QGraphicsLinearLayout(Qt::Horizontal); + layoutLocation->setContentsMargins(0, 0, 0, 0); + widgetLocation->setLayout(layoutLocation); + + // Set the spacing between LineEdit and PushButton + qreal spacing = 0.0; + style()->parameter( + "hb-param-margin-gene-middle-horizontal", spacing); + layoutLocation->setSpacing(spacing); + + mLocationLineEdit = new HbLineEdit(this); mLocationLineEdit->setObjectName("locationLineEdit"); - mLocationLineEdit->setMinRows(1); mLocationLineEdit->setMaxRows(MaxRowsInTextItem); - mLocationPushButton = qobject_cast( - editorLocationDocLoader.findWidget( - CALEN_EDITOR_LOCATION_PUSHBUTTON)); + connect(mLocationLineEdit, SIGNAL(textChanged(const QString)), + this, SLOT(handleLocationTextChange(const QString))); + connect(mLocationLineEdit, SIGNAL(editingFinished()), + this, SLOT(handleEditingFinished())); + layoutLocation->addItem(mLocationLineEdit); + + mLocationPushButton = new HbPushButton(this); + + HbDeviceProfile deviceProfile; + // The layout guide specifies the spacing as 9.5 u + // and the height as 7.4 u + qreal width = deviceProfile.unitValue() * 9.5; + qreal height = deviceProfile.unitValue() * 7.4 ; + mLocationPushButton->setPreferredSize(width, height); + mLocationPushButton->setSizePolicy( + QSizePolicy::Fixed, QSizePolicy::Fixed); + mLocationPushButton->setIcon( HbIcon("qtg_mono_location")); mLocationPushButton->setObjectName("locationIcon"); - mLocationPushButton->setIcon( HbIcon("qtg_mono_location")); - connect(mLocationPushButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker())); - connect(mLocationLineEdit, SIGNAL(textChanged(const QString)), - this, SLOT(handleLocationTextChange(const QString))); - - connect(mLocationLineEdit, SIGNAL(editingFinished()), - this, SLOT(handleEditingFinished())); - + layoutLocation->addItem(mLocationPushButton); OstTraceFunctionExit0( DUP2_CALENEDITORCUSTOMITEM_CREATECUSTOMWIDGET_EXIT ); return widgetLocation; } case RepeatUntilOffset: { - mRepeatUntilWidget = new HbPushButton(this); - mRepeatUntilWidget->setObjectName("repeatUntilItem"); - OstTraceFunctionExit0( DUP3_CALENEDITORCUSTOMITEM_CREATECUSTOMWIDGET_EXIT ); - return mRepeatUntilWidget; + setProperty("expandItem", false); + mRepeatUntilWidget = new HbPushButton(this); + mRepeatUntilWidget->setObjectName("repeatUntilItem"); + OstTraceFunctionExit0( DUP3_CALENEDITORCUSTOMITEM_CREATECUSTOMWIDGET_EXIT ); + return mRepeatUntilWidget; } case ReminderTimeOffset: { + setProperty("expandItem", false); mReminderTimeWidget = new HbPushButton(this); mReminderTimeWidget->setObjectName("remainderTimeItem"); OstTraceFunctionExit0( DUP4_CALENEDITORCUSTOMITEM_CREATECUSTOMWIDGET_EXIT ); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/caleneditor/src/caleneditorreminderfield.cpp --- a/calendarui/caleneditor/src/caleneditorreminderfield.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/caleneditor/src/caleneditorreminderfield.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -205,13 +205,6 @@ if (pastEvent && mReminderTimeAdded) { mCustomReminderTimeItem->setEnabled(false); } - QStringList reminderChoicesForAllDay; - reminderChoicesForAllDay << hbTrId("txt_calendar_setlabel_reminder_val_off") - << hbTrId("txt_calendar_setlabel_reminder_val_on_event_day") - << hbTrId("txt_calendar_setlabel_reminder_val_1_day_before") - << hbTrId("txt_calendar_setlabel_reminder_val_2_days_before"); - mReminderItem->setContentWidgetData(QString("items"), - reminderChoicesForAllDay); QTime referenceTime(0, 0, 0); // Set the appropriate reminder depending on the value of time offset. reminder = mCalenEditor->editedEntry()->alarm(); @@ -220,7 +213,7 @@ mReminderItem->setContentWidgetData("currentIndex", ReminderOnEventDay); mReminderTimeForAllDay = referenceTime.addSecs(-(offsetInMins * 60)); - } else if (offsetInMins < numberOfMinutesInADay) { + } else if (offsetInMins <= numberOfMinutesInADay) { mReminderItem->setContentWidgetData("currentIndex", ReminderOneDayBefore); mReminderTimeForAllDay = referenceTime.addSecs(-(offsetInMins * 60)); @@ -549,6 +542,8 @@ { OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_REMOVEREMINDERTIMEFIELD_ENTRY ); mReminderTimeAdded = false; + mEditorForm->removeConnection(mCustomReminderTimeItem, SIGNAL(clicked()), + this, SLOT(launchReminderTimePicker())); if (mCustomReminderTimeItem) { QModelIndex reminderIndex = mCalenEditorModel->indexFromItem(mCustomReminderTimeItem); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/caleneditor/src/caleneditorrepeatfield.cpp --- a/calendarui/caleneditor/src/caleneditorrepeatfield.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/caleneditor/src/caleneditorrepeatfield.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -290,102 +290,108 @@ repeatPropertyChange = false; } QDate repeatUntilDate = mRepeatUntilDate; - - if (value != mRepeatRoleValue) - { - mRepeatRoleValue = value; - switch (value) { - case DailyRole: { - if (!mRepeatUntilItemAdded) { - insertRepeatUntilItem(); + // Update the repeat type only if its has been changed + // ie. if the previous repeatrole is different from the current repeat role + if (value != mRepeatRoleValue) { + mRepeatRoleValue = value; + switch (value) { + case DailyRole: { + if (!mRepeatUntilItemAdded) { + insertRepeatUntilItem(); + } + if (mCustomRepeatUntilItem) { + // Show default repeat until date till one year for daily rule + mRepeatUntilDate = + mCalenEditor->editedEntry()->startTime().date().addYears(1); + mCustomRepeatUntilItem->setContentWidgetData( "text", + locale.format( + mRepeatUntilDate, r_qtn_date_usual_with_zero)); + } + mRepeatRuleType = AgendaRepeatRule::DailyRule; } - if (mCustomRepeatUntilItem) { - // Show default repeat until date till one year for daily rule - mRepeatUntilDate = mCalenEditor->editedEntry()->startTime().date().addYears(1); - mCustomRepeatUntilItem->setContentWidgetData( "text", - locale.format( mRepeatUntilDate, - r_qtn_date_usual_with_zero)); + break; + case WorkdaysRole: { + if (!mRepeatUntilItemAdded) { + insertRepeatUntilItem(); + } + if (mCustomRepeatUntilItem) { + // Show default repeat until date till one year for workdays rule + mRepeatUntilDate = + mCalenEditor->editedEntry()->startTime().date().addYears(1); + mCustomRepeatUntilItem->setContentWidgetData( "text", + locale.format( + mRepeatUntilDate, r_qtn_date_usual_with_zero)); + } + mRepeatRuleType = AgendaRepeatRule::WeeklyRule; + mIsWorkdays = true; } - mRepeatRuleType = AgendaRepeatRule::DailyRule; - } - break; - case WorkdaysRole: { - if (!mRepeatUntilItemAdded) { - insertRepeatUntilItem(); + break; + case WeeklyRole: { + if (!mRepeatUntilItemAdded) { + insertRepeatUntilItem(); + } + if (mCustomRepeatUntilItem) { + // Show default repeat until date till one year for weekly rule + mRepeatUntilDate = + mCalenEditor->editedEntry()->startTime().date().addYears(1); + mCustomRepeatUntilItem->setContentWidgetData( "text", + locale.format( + mRepeatUntilDate, r_qtn_date_usual_with_zero)); + } + mRepeatRuleType = AgendaRepeatRule::WeeklyRule; } - if (mCustomRepeatUntilItem) { - // Show default repeat until date till one year for workdays rule - mRepeatUntilDate = mCalenEditor->editedEntry()->startTime().date().addYears(1); - mCustomRepeatUntilItem->setContentWidgetData( "text", - locale.format( mRepeatUntilDate, - r_qtn_date_usual_with_zero)); + break; + case BiWeeklyRole: { + if (!mRepeatUntilItemAdded) { + insertRepeatUntilItem(); + } + if (mCustomRepeatUntilItem) { + // Show default repeat until date till one year for bi-weekly rule + mRepeatUntilDate = + mCalenEditor->editedEntry()->startTime().date().addYears(1); + mCustomRepeatUntilItem->setContentWidgetData( "text", + locale.format( + mRepeatUntilDate, r_qtn_date_usual_with_zero)); + } + mRepeatRuleType = AgendaRepeatRule::WeeklyRule; + mIsBiWeekly = true; } - mRepeatRuleType = AgendaRepeatRule::WeeklyRule; - mIsWorkdays = true; - } - break; - case WeeklyRole: { - if (!mRepeatUntilItemAdded) { - insertRepeatUntilItem(); + break; + case MonthlyRole: { + if (!mRepeatUntilItemAdded) { + insertRepeatUntilItem(); + } + if (mCustomRepeatUntilItem) { + // Show default repeat until date till one year for monthly rule + mRepeatUntilDate = + mCalenEditor->editedEntry()->startTime().date().addYears(1); + mCustomRepeatUntilItem->setContentWidgetData( "text", + locale.format( + mRepeatUntilDate, r_qtn_date_usual_with_zero)); + } + mRepeatRuleType = AgendaRepeatRule::MonthlyRule; } - if (mCustomRepeatUntilItem) { - // Show default repeat until date till one year for weekly rule - mRepeatUntilDate = mCalenEditor->editedEntry()->startTime().date().addYears(1); - mCustomRepeatUntilItem->setContentWidgetData( "text", - locale.format( mRepeatUntilDate, - r_qtn_date_usual_with_zero)); + break; + case YearlyRole: { + if (!mRepeatUntilItemAdded) { + insertRepeatUntilItem(); + } + if (mCustomRepeatUntilItem) { + // Show default repeat until date till ten years for yearly rule + mRepeatUntilDate = + mCalenEditor->editedEntry()->startTime().date().addYears(10); + mCustomRepeatUntilItem->setContentWidgetData( "text", + locale.format( + mRepeatUntilDate, r_qtn_date_usual_with_zero)); + } + mRepeatRuleType = AgendaRepeatRule::YearlyRule; } - mRepeatRuleType = AgendaRepeatRule::WeeklyRule; + break; + default: { + removeRepeatUntilItem(); + } + break; } - break; - case BiWeeklyRole: { - if (!mRepeatUntilItemAdded) { - insertRepeatUntilItem(); - } - if (mCustomRepeatUntilItem) { - // Show default repeat until date till one year for bi-weekly rule - mRepeatUntilDate = mCalenEditor->editedEntry()->startTime().date().addYears(1); - mCustomRepeatUntilItem->setContentWidgetData( "text", - locale.format( mRepeatUntilDate, - r_qtn_date_usual_with_zero)); - } - mRepeatRuleType = AgendaRepeatRule::WeeklyRule; - mIsBiWeekly = true; - } - break; - case MonthlyRole: { - if (!mRepeatUntilItemAdded) { - insertRepeatUntilItem(); - } - if (mCustomRepeatUntilItem) { - // Show default repeat until date till one year for monthly rule - mRepeatUntilDate = mCalenEditor->editedEntry()->startTime().date().addYears(1); - mCustomRepeatUntilItem->setContentWidgetData( "text", - locale.format( mRepeatUntilDate, - r_qtn_date_usual_with_zero)); - } - mRepeatRuleType = AgendaRepeatRule::MonthlyRule; - } - break; - case YearlyRole: { - if (!mRepeatUntilItemAdded) { - insertRepeatUntilItem(); - } - if (mCustomRepeatUntilItem) { - // Show default repeat until date till ten years for yearly rule - mRepeatUntilDate = mCalenEditor->editedEntry()->startTime().date().addYears(10); - mCustomRepeatUntilItem->setContentWidgetData( "text", - locale.format( mRepeatUntilDate, - r_qtn_date_usual_with_zero)); - } - mRepeatRuleType = AgendaRepeatRule::YearlyRule; - } - break; - default: { - removeRepeatUntilItem(); - } - break; - } } if(!mCalenEditor->isNewEntry()) { mCalenEditor->addDiscardAction(); @@ -668,8 +674,17 @@ //Connecting back the slot for repeat index change before setting index. connect(mRepeatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(handleRepeatIndexChanged(int))); + // By default the repeat combobox index will be 0 // Set the previous user's choice mRepeatComboBox->setCurrentIndex(choice); + // If the previous user's choice is also zero, then slot + // handleRepeatIndexChanged will not be called as + // there is no change in current index + // So explicitly call updateReminderChoices to update the reminder choices + // for choice : 0 (Not repeated) + if(choice == 0) { + mCalenEditor->updateReminderChoices(); + } OstTraceFunctionExit0( DUP1_CALENEDITORREPEATFIELD_UPDATEREPEATCHOICES_EXIT ); } diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/controller/data/xml/calendayview.docml --- a/calendarui/controller/data/xml/calendayview.docml Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/controller/data/xml/calendayview.docml Wed Aug 25 14:02:13 2010 +0530 @@ -3,20 +3,20 @@ - - - + + + - + @@ -27,10 +27,8 @@ - - diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/controller/data/xml/calenmonthview.docml --- a/calendarui/controller/data/xml/calenmonthview.docml Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/controller/data/xml/calenmonthview.docml Wed Aug 25 14:02:13 2010 +0530 @@ -23,7 +23,6 @@ - @@ -33,44 +32,37 @@ - - + - - + - - + - - + - - + - - + - - + @@ -169,7 +161,6 @@ - @@ -227,7 +218,6 @@ - @@ -285,7 +275,6 @@ - diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/controller/inc/calenviewmanager.h --- a/calendarui/controller/inc/calenviewmanager.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/controller/inc/calenviewmanager.h Wed Aug 25 14:02:13 2010 +0530 @@ -103,7 +103,28 @@ void constructOtherViews(); void launchSettingsView(); + + /** + * @brief check if Agenda Event Viewer is active + */ + bool isEventViewerActive(); + + /** + * save the entry and close the editor + */ + void saveAndCloseEditor(); + + /** + * close agenda event view + * should be call if agenda eevent view is open + */ + void closeAgendaEventView(); + + /** + * remove the setting view + */ + void removeSettingsView(); public: // from MCalenNotificationHandler diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/controller/src/calencontroller.cpp --- a/calendarui/controller/src/calencontroller.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/controller/src/calencontroller.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -644,6 +644,8 @@ // launch the appropriate view iViewManager->constructAndActivateView(view); + iIsFromServiceFrmWrk = false; + } else { // Calendar was in backgroung but now its being brought to foreground // If current state is editing state or printing state // or deleting state or sending state, then dont do anything as @@ -654,11 +656,28 @@ (currentState == CCalenStateMachine::ECalenSendingState)) { // simply return - we dont have anything to do } + + else if (currentState == CCalenStateMachine::ECalenViewingState) { + if(iViewManager->isEventViewerActive()){ + iViewManager->closeAgendaEventView(); + } + } else if (currentState == CCalenStateMachine::ECalenEditingState) { - // close the editor and save the entry + // close the editor and save the entry if application is in background //and launch the desired view - iActionUi->saveAndCloseEditor(); + if(iViewManager->isEventViewerActive()){ + iViewManager->saveAndCloseEditor(); + iViewManager->closeAgendaEventView(); + } + else{ + iActionUi->saveAndCloseEditor(); + } } + + else if (currentState == CCalenStateMachine::ECalenSettingsState){ + iViewManager->removeSettingsView(); + } + // Set the context properly mContext->setFocusDateAndTime(dateTime); IssueCommandL(view); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/controller/src/calendocloader.cpp --- a/calendarui/controller/src/calendocloader.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/controller/src/calendocloader.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -153,10 +153,6 @@ QObject *calenDayInfo = new HbGroupBox(); calenDayInfo->setObjectName(name); return calenDayInfo; - } else if (name == QString(CALEN_DAYVIEW_REGIONALINFO)) { - QObject *calenRegionalInfo = new HbGroupBox(); - calenRegionalInfo->setObjectName(name); - return calenRegionalInfo; } else if (name == QString(CALEN_DAYVIEW_CONTENTWIDGET)) { QObject *calenContentWidget = new HbWidget(); calenContentWidget->setObjectName(name); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/controller/src/calenviewmanager.cpp --- a/calendarui/controller/src/calenviewmanager.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/controller/src/calenviewmanager.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -944,10 +944,12 @@ // solution for the month view implements the construction in two phases so // it needs to be refactored and a common solution needs to be put here. So // that code doesn't break if another view is added tomorow - if (mCalenMonthView) { + HbView *currentview = mController.MainWindow().currentView(); + + if (mCalenMonthView && currentview == mCalenMonthView) { mCalenMonthView->fetchEntriesAndUpdateModel(); } - else if (mCalenAgendaView) { + else if (mCalenAgendaView && currentview == mCalenAgendaView) { mCalenAgendaView->doPopulation(); } // Calls the emitAppReady function of CalenController. Need to emit this @@ -1039,4 +1041,53 @@ OstTraceFunctionExit0( CALENVIEWMANAGER_LAUNCHSETTINGSVIEW_EXIT ); } + +// ---------------------------------------------------------------------------- +// CalenViewManager::removeSettingsView +// remove settings view +// ---------------------------------------------------------------------------- +// +void CalenViewManager::removeSettingsView() +{ + if(mSettingsView){ + mController.Services().MainWindow().removeView(mSettingsView); + } +} + +// ---------------------------------------------------------------------------- +// CalenViewManager::isEventViewerActive +// check if Agenda Event Viewer is active +// ---------------------------------------------------------------------------- +// +bool CalenViewManager::isEventViewerActive() +{ + if(mCalenEventViewer) + return true; + else + return false; +} + +// ---------------------------------------------------------------------------- +// CalenViewManager::saveAndCloseEditor +// save the entry and close the editor +// isEventViewerActive() should be called before this function +// ---------------------------------------------------------------------------- +// +void CalenViewManager::saveAndCloseEditor() +{ + mCalenEventViewer->saveAndCloseEditor(); +} + +// ---------------------------------------------------------------------------- +// CalenViewManager::closeAgendaEventView +// close the agenda event view +// isEventViewerActive() should be called before this function +// ---------------------------------------------------------------------------- +// +void CalenViewManager::closeAgendaEventView() +{ + mCalenEventViewer->closeAgendaEventView(); +} + + // End of file --Don't remove this. diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/inc/calencommon.h --- a/calendarui/inc/calencommon.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/inc/calencommon.h Wed Aug 25 14:02:13 2010 +0530 @@ -81,7 +81,6 @@ #define CALEN_DAYVIEW_DOCML ":/xml/calendayview.docml" #define CALEN_DAYVIEW "dayView" #define CALEN_DAYVIEW_DAYINFO "dayViewDayInfo" -#define CALEN_DAYVIEW_REGIONALINFO "dayViewRegionalInfo" #define CALEN_DAYVIEW_CONTENTWIDGET "dayViewContentWidget" #define CALEN_DAYVIEW_HOURSCROLLAREA "dayViewHourScrollArea" #define CALEN_DAYVIEW_CONTENTSCROLLAREA "dayViewContentScrollArea" diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/bwins/calenviewsu.def --- a/calendarui/views/bwins/calenviewsu.def Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/bwins/calenviewsu.def Wed Aug 25 14:02:13 2010 +0530 @@ -199,4 +199,11 @@ ?moveFinished@CalenDayContentScrollArea@@AAEXXZ @ 198 NONAME ; void CalenDayContentScrollArea::moveFinished(void) ?scrollToHour@CalenDayHourScrollArea@@QAEXH@Z @ 199 NONAME ; void CalenDayHourScrollArea::scrollToHour(int) ??1CalenDayContentScrollArea@@UAE@XZ @ 200 NONAME ; CalenDayContentScrollArea::~CalenDayContentScrollArea(void) + ?handleThemeChange@CalenMonthGrid@@AAEXXZ @ 201 NONAME ; void CalenMonthGrid::handleThemeChange(void) + ?effectStarted@CalenPreviewPane@@QAEXXZ @ 202 NONAME ; void CalenPreviewPane::effectStarted(void) + ?handleThemeChange@CalenThickLinesDrawer@@AAEXXZ @ 203 NONAME ; void CalenThickLinesDrawer::handleThemeChange(void) + ?effectFinished@CalenPreviewPane@@QAEXXZ @ 204 NONAME ; void CalenPreviewPane::effectFinished(void) + ?handleThemeChange@CalenMonthView@@AAEXXZ @ 205 NONAME ; void CalenMonthView::handleThemeChange(void) + ?isHorizontalSwipe@CalenDayContentScrollArea@@ABE_NM@Z @ 206 NONAME ; bool CalenDayContentScrollArea::isHorizontalSwipe(float) const + ?handleThemeChange@CalenPreviewPane@@QAEXXZ @ 207 NONAME ; void CalenPreviewPane::handleThemeChange(void) diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/inc/calendaycommonheaders.h --- a/calendarui/views/dayview/inc/calendaycommonheaders.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/inc/calendaycommonheaders.h Wed Aug 25 14:02:13 2010 +0530 @@ -44,12 +44,12 @@ /*! The minimum width [un] of touchable event bubble (UI spec) */ -const qreal KCalenMinTouchableEventWidth = 8.2; +const qreal KCalenMinTouchableEventWidth = 8.0; /*! The minimum width [un] of event bubble (UI spec) */ -const qreal KCalenMinBubbleWidth = 3.0; +const qreal KCalenMinEventWidth = 3.0; /*! The width [un] of time strip (indicator) in event bubble (UI spec) @@ -57,11 +57,16 @@ const qreal KCalenTimeStripWidth = 1.5; /*! - The width [un] of space beetwen event buubles in Day View (UI spec) + The width [un] of space beetwen event bubbles in Day View (UI spec) */ const qreal KCalenSpaceBeetwenEvents = 1.5; /*! + The minimum width [un] of space beetwen event bubbles in Day View (UI spec) + */ +const qreal KCalenMinSpaceBeetwenEvents = 0.1; + +/*! Number of All day events displayed in single day that remains touchable in portrait orientation (UI spec) */ @@ -79,12 +84,17 @@ const qreal KCalenHourLineThickness = 0.15; /*! - Thickness [un] of time line (UI spec) + Thickness [un] of current time line (UI spec) */ -const qreal KCalenTimeLineThickness = 0.75; +const qreal KCalenCurrentTimeLineThickness = 0.75; /*! - Color scheme for hour line (UI spec) + Width [un] of dashes in half-hour line (UI spec) + */ +const qreal KCalenHalfHourLineDashWidth = 1.5; + +/*! + Color scheme for hour and half-hour lines (UI spec) */ const QString KCalenHourLineColor = "qtc_cal_day_hour_lines"; @@ -93,6 +103,16 @@ */ const QString KCalenTimeLineColor = "qtc_cal_month_current_day"; +/*! + Color scheme for Day View background in portrait mode (UI spec) + */ +const QString KCalenBackgroundColorPortrait = "qtg_graf_cal_bg_prt"; + +/*! + Color scheme for Day View background in landscape mode (UI spec) + */ +const QString KCalenBackgroundColorLandscape = "qtg_graf_cal_bg_lsc"; + // Enumerations diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/inc/calendaycontentscrollarea.h --- a/calendarui/views/dayview/inc/calendaycontentscrollarea.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/inc/calendaycontentscrollarea.h Wed Aug 25 14:02:13 2010 +0530 @@ -19,7 +19,7 @@ #define CALENDAYCONTENTSCROLLAREA_H_ // System includes -#include +#include // User includes #include "calendaycommonheaders.h" diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/inc/calendaycontentwidget.h --- a/calendarui/views/dayview/inc/calendaycontentwidget.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/inc/calendaycontentwidget.h Wed Aug 25 14:02:13 2010 +0530 @@ -19,7 +19,7 @@ #define CALENDAYCONTENTWIDGET_H_ // System includes -#include +#include // User includes #include "calendaycommonheaders.h" @@ -61,8 +61,8 @@ void relayoutWidgets(CalenScrollDirection scrollTo); void widgetScrolled(const QPointF &newPos); -private: - void initializeViews(QGraphicsItem *parent); +protected: + void initializeViews(); private: QGraphicsLinearLayout* mLayout; //!< Linear layout for day views diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/inc/calendaystatusstrip.h --- a/calendarui/views/dayview/inc/calendaystatusstrip.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/inc/calendaystatusstrip.h Wed Aug 25 14:02:13 2010 +0530 @@ -47,15 +47,11 @@ qreal range() const; - QColor color() const; - CalenDayStatusStrip::DrawingStyle drawingStyle() const; QPair startEndTime() const; - void setRange(qreal mRange); - - void setColor(QColor mStripColor); + void setRange(qreal range); void setDrawingStyle(CalenDayStatusStrip::DrawingStyle mDrawingStyle); @@ -78,7 +74,6 @@ private: qreal mRange; //! - - + + @@ -25,7 +25,7 @@ - + diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendaycontainer.cpp --- a/calendarui/views/dayview/src/calendaycontainer.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendaycontainer.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -238,12 +238,12 @@ // Event's startX/width eventWidth /= columns; - - // In case when eventWidth will be smaller then KCalenMinBubbleWidth [un] + + // In case when eventWidth will be smaller then KCalenMinEventWidth [un] // spacings between events should be smaller. // Check whether it's possible to shrink them so the bubbles width - // can stay at KCalenMinBubbleWidth [un] (time stripe + frame margins). - qreal minWidth = KCalenMinBubbleWidth * mLayoutValues.unitInPixels; + // can stay at KCalenMinEventWidth [un] (time stripe + frame margins). + qreal minWidth = KCalenMinEventWidth * mLayoutValues.unitInPixels; if (eventWidth - mLayoutValues.eventMargin < minWidth) { // Calculate new margin value @@ -267,7 +267,8 @@ eventWidth = minWidth; } - //First column margin should be always 1.5un (mLayoutValues.eventMargin) + // First column margin should be always KCalenSpaceBeetwenEvents + // (mLayoutValues.eventMargin) eventStartX += columnIdx * (eventWidth + newMarginValue) + mLayoutValues.eventMargin; } else { @@ -277,6 +278,10 @@ } QRectF eventGeometry(eventStartX, eventStartY, eventWidth, eventHeight); + + // Workaround to prevent size hint caching inside effectiveSizeHint + item->setMinimumSize(0, 0); + item->setMaximumSize(eventWidth, eventHeight); item->setGeometry(eventGeometry); } @@ -341,6 +346,10 @@ } QRectF eventGeometry(eventStartX, eventStartY, eventWidth, eventHeight); + + // Workaround to prevent size hint caching inside effectiveSizeHint + item->setMinimumSize(0, 0); + item->setMaximumSize(eventWidth, eventHeight); item->setGeometry(eventGeometry); } @@ -367,8 +376,7 @@ } // 2. event area width -> eventAreaWidth[out] - qreal emptyRightColumnWidth(0.0); - emptyRightColumnWidth = KCalenEmptyRightColumnWidth + qreal emptyRightColumnWidth = KCalenEmptyRightColumnWidth * layoutValues.unitInPixels; layoutValues.eventAreaWidth = contentWidth - emptyRightColumnWidth - layoutValues.eventAreaX; @@ -383,7 +391,8 @@ // check if we should create absorber over some overlapping region layoutValues.maxColumns = layoutValues.eventAreaWidth - / (KCalenMinTouchableEventWidth * layoutValues.unitInPixels); + / ((KCalenMinTouchableEventWidth + KCalenSpaceBeetwenEvents) + * layoutValues.unitInPixels); } diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendaycontentscrollarea.cpp --- a/calendarui/views/dayview/src/calendaycontentscrollarea.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendaycontentscrollarea.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include // User includes #include "calendaycontentscrollarea.h" diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendaycontentwidget.cpp --- a/calendarui/views/dayview/src/calendaycontentwidget.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendaycontentwidget.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -17,7 +17,7 @@ // System includes #include -#include +#include // User includes #include "calendaymodelmanager.h" @@ -33,6 +33,7 @@ /*! \brief Constructor + \param modelManager Day View model manager \param parent The parent of central widget */ CalenDayContentWidget::CalenDayContentWidget( @@ -41,7 +42,7 @@ HbWidget(parent), mLayout(NULL), mModelManager(modelManager) { mWidgets.clear(); - initializeViews(parent); + initializeViews(); } /*! @@ -198,7 +199,7 @@ \param parent Parent object */ -void CalenDayContentWidget::initializeViews(QGraphicsItem *parent) +void CalenDayContentWidget::initializeViews() { // Create item views HbModelIterator *iterator(0); @@ -227,12 +228,14 @@ connect(nextItemView, SIGNAL(scrollPositionChanged(const QPointF&)), this, SLOT(widgetScrolled(const QPointF&))); - // Install event filters to receive events necessary for gesture handling - CalenDayContentScrollArea* scrollArea = - static_cast (parent); - prevItemView->installEventFilter(scrollArea); - currItemView->installEventFilter(scrollArea); - nextItemView->installEventFilter(scrollArea); + if (parentItem()) { + // Install event filters to receive events necessary for gesture handling + CalenDayContentScrollArea* scrollArea = + static_cast (parentItem()); + prevItemView->installEventFilter(scrollArea); + currItemView->installEventFilter(scrollArea); + nextItemView->installEventFilter(scrollArea); + } // Add views to layout add(prevItemView); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendayeventspane.cpp --- a/calendarui/views/dayview/src/calendayeventspane.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendayeventspane.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -16,10 +16,11 @@ */ // System includes #include -#include +#include // User includes -#include "CalenDayEventsPane.h" +#include "calendayeventspane.h" +#include "calendaycommonheaders.h" /*! \class CalenDayEventsPane @@ -39,12 +40,13 @@ HbDeviceProfile deviceProfile; mUnitInPixels = deviceProfile.unitValue(); - mHourLineColor = HbColorScheme::color("qtc_cal_day_hour_lines"); + mHourLineColor = HbColorScheme::color(KCalenHourLineColor); // Set custom dashed pen - mCustomDashedPen.setWidth(0.15); + mCustomDashedPen.setWidth(KCalenHourLineThickness); QVector dashes; - dashes << 5 << 5; + dashes << KCalenHalfHourLineDashWidth * mUnitInPixels + << KCalenHalfHourLineDashWidth * mUnitInPixels; mCustomDashedPen.setDashPattern(dashes); mCustomDashedPen.setCapStyle(Qt::FlatCap); mCustomDashedPen.setColor(mHourLineColor); @@ -89,7 +91,7 @@ QRectF drawArea = option->rect; - const qreal hourLineThickness = 0.15; //un (according to UI spec) + const qreal hourLineThickness = KCalenHourLineThickness; painter->save(); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendayhourelement.cpp --- a/calendarui/views/dayview/src/calendayhourelement.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendayhourelement.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -141,8 +141,8 @@ * currentDateTime.time().minute() / 60; QColor color = HbColorScheme::color(KCalenTimeLineColor); - painter->setPen(QPen(color, KCalenTimeLineThickness * mUnitInPixels, - Qt::SolidLine, Qt::FlatCap)); + painter->setPen(QPen(color, KCalenCurrentTimeLineThickness + * mUnitInPixels, Qt::SolidLine, Qt::FlatCap)); QLineF currentTimeline(drawArea.left(), drawArea.top() + currentTimeY, drawArea.right(), drawArea.top() + currentTimeY); painter->drawLine(currentTimeline); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendayitem.cpp --- a/calendarui/views/dayview/src/calendayitem.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendayitem.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -16,15 +16,15 @@ * */ -//System includes -#include -#include +// System includes +#include +#include +#include +#include #include -#include -#include - -//User inlcudes +// User includes +#include "calendaycommonheaders.h" #include "calendayitem.h" #include "calendaystatusstrip.h" #include "calendaymodel.h" @@ -33,69 +33,61 @@ #include "calendaycontainer.h" /*! - \brief Constructor. -*/ -CalenDayItem::CalenDayItem(const CalenDayContainer *container): - mContainer(container), mUpdated(false), mBg(0), mEventDesc(0), mColorStripe(0), - mEventDescMinWidth(0.0), mFrameMinWidth(0.0) + \brief Constructor. + */ +CalenDayItem::CalenDayItem(const CalenDayContainer *container) : + mContainer(container), mUpdated(false), mBg(0), mEventDesc(0), + mColorStripe(0), mEventDescMinWidth(0.0), mFrameMinWidth(0.0) { } /*! - \brief Constructor. -*/ + \brief Constructor. + */ CalenDayItem::CalenDayItem(const CalenDayItem & source) : - HbAbstractViewItem(source), mContainer(source.container()), mUpdated(false), mBg(0), mEventDesc(0), - mColorStripe(0), mEventDescMinWidth(0.0), mFrameMinWidth(0.0) + HbAbstractViewItem(source), mContainer(source.container()), + mUpdated(false), mBg(0), mEventDesc(0), mColorStripe(0), + mEventDescMinWidth(0.0), mFrameMinWidth(0.0) { - // TODO: "qtg_fr_btn_pressed" need to replaced with qtg_fr_cal_meeting_bg - // when available - mBg = new HbFrameItem("qtg_fr_btn_pressed", HbFrameDrawer::NinePieces, this); + mBg = new HbFrameItem("qtg_fr_cal_meeting_bg", HbFrameDrawer::NinePieces, + this); mEventDesc = new HbTextItem(this); // TODO: probably ElideLeft needed for mirrored layout mEventDesc->setElideMode(Qt::ElideRight); mEventDesc->setTextWrapping(Hb::TextWrapAnywhere); - mColorStripe = new CalenDayStatusStrip(this); - + HbStyle::setItemName(mBg, QLatin1String("backgroundFrame")); HbStyle::setItemName(mEventDesc, QLatin1String("eventDescription")); - HbStyle::setItemName(static_cast(mColorStripe), QLatin1String("colorStripe")); - + HbStyle::setItemName(static_cast (mColorStripe), + QLatin1String("colorStripe")); + HbDeviceProfile deviceProfile; - HbStyle style; - - qreal horizontalSpacing = 0.0; - qreal rightMargin = 0.0; - - style.parameter(QString("hb-param-margin-gene-middle-horizontal"), - horizontalSpacing, deviceProfile); - style.parameter(QString("hb-param-margin-gene-right"), - rightMargin, deviceProfile); - - qreal stripeWidth = 1.5 * deviceProfile.unitValue(); //1.5un according to UI spec - - mFrameMinWidth = 2 * horizontalSpacing + stripeWidth; //smallest width for which background frame is displayed - mEventDescMinWidth = mFrameMinWidth + rightMargin;//smallest width for which text can be displayed - - //Minimum width is assured by widgetml and css - //additionally called here to prevent minimum size hint caching inside effectiveSizeHint + qreal stripeWidth = KCalenTimeStripWidth * deviceProfile.unitValue(); + mColorStripe->setPreferredWidth(stripeWidth); + + // Minimum size of event frame (without/with description) + mFrameMinWidth = KCalenMinEventWidth * deviceProfile.unitValue(); + mEventDescMinWidth = KCalenMinTouchableEventWidth + * deviceProfile.unitValue(); + + // Minimum width is assured by widgetml and css, additionally called here + // to prevent minimum size hint caching inside effectiveSizeHint setMinimumWidth(stripeWidth); - } /*! - \brief Destructor. -*/ + \brief Destructor. + */ CalenDayItem::~CalenDayItem() { } /*! - \brief Creates new instance of day item. - - \return New instance of day item. -*/ + \brief Creates new instance of day item. + + \return New instance of day item. + */ HbAbstractViewItem * CalenDayItem::createItem() { CalenDayItem* newItem = new CalenDayItem(*this); @@ -104,17 +96,16 @@ /*! - \brief Sets data to be displayed on item. -*/ + \brief Sets data to be displayed on item. + */ void CalenDayItem::updateChildItems() { // there is no need to update items after creation if (!mUpdated) { AgendaEntry entry; - entry = modelIndex().data(CalenDayEntry).value(); + entry = modelIndex().data(CalenDayEntry).value (); - bool isAllDayEvent = CalenAgendaUtils::isAlldayEvent(entry); - + bool isAllDayEvent = CalenAgendaUtils::isAlldayEvent(entry); setDescription(entry, isAllDayEvent); setStatusStrip(entry, isAllDayEvent); @@ -128,62 +119,53 @@ /*! - \brief Adds event description for the item. - - \param entry An for which description needs to be displayed. - \param allDayEvent Flag that indicates whether an item is all day event -*/ + \brief Adds event description for the item. + + \param entry An for which description needs to be displayed. + \param allDayEvent Flag that indicates whether an item is all day event + */ void CalenDayItem::setDescription(const AgendaEntry &entry, bool allDayEvent) { - QString description(entry.summary()); - QString location(entry.location()); - - - int separtorPos = 0; - - if(!location.isEmpty()) { - if ( !description.isEmpty() ) { - separtorPos = description.count(); - description.append(", "); - } - - description.append(location); - } - - if ( description.isEmpty() ) { - description.append(hbTrId("txt_calendar_dblist_unnamed")); - } - - //Description of all day events has to be displayed vertically - if(allDayEvent){ + QString description(entry.summary()); + QString location(entry.location()); + + int separtorPos = 0; + if (!location.isEmpty()) { + if (!description.isEmpty()) { + separtorPos = description.count(); + description.append(", "); + } + description.append(location); + } + + if (description.isEmpty()) { + description.append(hbTrId("txt_calendar_dblist_unnamed")); + } - QString verticalString; - for(int i=0; isetText(description); + //Description of all day events has to be displayed vertically + if (allDayEvent) { + QString verticalString; + for (int i = 0; i < description.count(); i++) { + verticalString.append(QString(description.at(i)) + "\n"); + } + + // remove "\n" before comma separator if exist + if (separtorPos) { + verticalString.remove(2 * separtorPos - 1, 1); + } + description = verticalString; + } + + mEventDesc->setText(description); } /*! - \brief It set all needed things for status strip from Agenda Entry. - - \param entry Status Strip is created from Agenda Entry -*/ + \brief It set all needed things for status strip from Agenda Entry. + + \param entry Status Strip is created from Agenda Entry + */ void CalenDayItem::setStatusStrip(const AgendaEntry &entry, bool allDayEvent) { - QColor color = HbColorScheme::color("qtc_cal_month_current_day"); - mColorStripe->setColor(color); - if (!allDayEvent) { QDateTime startTime; @@ -191,8 +173,8 @@ QDateTime currentDateTime; currentDateTime.setDate(container()->date()); - CalenDayUtils::instance()->getEventValidStartEndTime(startTime, endTime, entry, - currentDateTime); + CalenDayUtils::instance()->getEventValidStartEndTime(startTime, + endTime, entry, currentDateTime); mColorStripe->setStartEndTime(startTime.time(), endTime.time()); } @@ -202,49 +184,52 @@ // 00:00:00 and 00:00:00 next day respectively. // To draw it correctly we need times like those visible for user in // editor: 00:00:00 to 23:59:59 (the same day) - mColorStripe->setStartEndTime(entry.startTime().time(), entry.endTime().time().addSecs(-1)); + mColorStripe->setStartEndTime(entry.startTime().time(), + entry.endTime().time().addSecs(-1)); } - + switch (entry.status()) { case AgendaEntry::Confirmed: mColorStripe->setDrawingStyle(CalenDayStatusStrip::Filled); - break; + break; case AgendaEntry::Tentative: mColorStripe->setDrawingStyle(CalenDayStatusStrip::StripWithLines); - break; + break; case AgendaEntry::Cancelled: mColorStripe->setDrawingStyle(CalenDayStatusStrip::OnlyFrame); - break; + break; default: mColorStripe->setDrawingStyle(CalenDayStatusStrip::Filled); - break; + break; } } /*! - \brief Reimplemented from HbWidget. Handles resize event. - - \param event Instance of an event to be handled. -*/ + \brief Reimplemented from HbWidget. Handles resize event. + + \param event Instance of an event to be handled. + */ void CalenDayItem::resizeEvent(QGraphicsSceneResizeEvent *event) { Q_UNUSED(event) qreal width = rect().width(); - if(width < mEventDescMinWidth){ + if (width < mEventDescMinWidth) { mEventDesc->hide(); - } else{ + } + else { mEventDesc->show(); } - - if(width < mFrameMinWidth){ + + if (width < mFrameMinWidth) { mBg->hide(); - } else{ + } + else { mBg->show(); } - //Necessary to switch layout + // Necessary to switch layout repolish(); } diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendayitemview.cpp --- a/calendarui/views/dayview/src/calendayitemview.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendayitemview.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -18,9 +18,9 @@ //System includes #include #include -#include -#include -#include +#include +#include +#include //User includes #include "calendayitemview.h" @@ -55,9 +55,6 @@ setScrollingStyle(HbScrollArea::PanWithFollowOn); setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); - grabGesture(Qt::PanGesture); - ungrabGesture(Qt::SwipeGesture); - //TODO: KG: Animate item pressed?! HbAbstractItemView::TouchDown setEnabledAnimations( HbAbstractItemView::None ); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendaymodelmanager.cpp --- a/calendarui/views/dayview/src/calendaymodelmanager.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendaymodelmanager.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -15,9 +15,11 @@ * */ +// System includes #include #include +// User includes #include "calendaymodelmanager.h" #include "calendaymodel.h" diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendaystatusstrip.cpp --- a/calendarui/views/dayview/src/calendaystatusstrip.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendaystatusstrip.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -15,11 +15,15 @@ * */ +// System includes #include #include +#include +// User includes #include "calendaystatusstrip.h" +// Constants qreal const CalenDayStatusStrip::mMinute = 60; qreal const CalenDayStatusStrip::mMinimumTime = 5; @@ -28,7 +32,7 @@ */ CalenDayStatusStrip::CalenDayStatusStrip(HbWidget *parent) : HbWidget(parent), mRange(2), - mDrawingStyle(CalenDayStatusStrip::Filled) + mDrawingStyle(CalenDayStatusStrip::Filled) { setFlag(QGraphicsItem::ItemHasNoContents,false); @@ -54,16 +58,6 @@ } /*! - \brief Returns color drawing - - \sa setColor - */ -QColor CalenDayStatusStrip::color() const -{ - return mColor; -} - -/*! \brief Returns style of drawing. \sa CalenDayStatusStrip::DrawingStyle, setDrawingStyle @@ -97,18 +91,6 @@ } /*! - \brief It sets color drawing - - \param stripColor Color of drawing - - \sa stripColor - */ -void CalenDayStatusStrip::setColor(QColor stripColor) -{ - mColor = stripColor; -} - -/*! \brief It sets drawing style of strip \param drawingStyle Style of strip drawing. @@ -193,7 +175,7 @@ painter->setClipRect(bounding, Qt::IntersectClip); //prepare brush and paint - QBrush brush(mColor); + QBrush brush(HbColorScheme::color("qtc_cal_month_current_day")); painter->setBrush(brush); QPen pen; pen.setWidth(1); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendayutils.cpp --- a/calendarui/views/dayview/src/calendayutils.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendayutils.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -16,10 +16,10 @@ */ // System includes -#include -#include -#include -#include +#include +#include +#include +#include // User includes #include "calendayutils.h" diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/src/calendayview.cpp --- a/calendarui/views/dayview/src/calendayview.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/src/calendayview.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -20,13 +20,15 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include // User includes @@ -44,6 +46,7 @@ #include "CalendarPrivateCRKeys.h" #include "calenpluginlabel.h" #include "calendaymodel.h" +#include "calendayutils.h" //constants @@ -53,18 +56,18 @@ */ CalenDayView::CalenDayView(MCalenServices &services) : CalenNativeView(services), mContentScrollArea(NULL), mContentWidget(NULL), - mHourScrollArea(NULL), mVLayout(NULL), mDocLoader(NULL), mIsLaunching( - true), mSettingsManager(NULL), mRegionalInfo( - XQSettingsKey::TargetCentralRepository, KCRUidCalendar, - KCalendarShowRegionalInfo), mServices(services), - mRegionalInfoGroupBox(NULL), mGoToTodayMenuAction(NULL) + mHourScrollArea(NULL), mVLayout(NULL), mMainContainer(NULL), + mDocLoader(NULL), mIsLaunching(true), mSettingsManager(NULL), + mRegionalInfoKey(XQSettingsKey::TargetCentralRepository, + KCRUidCalendar, KCalendarShowRegionalInfo), mServices(services), + mRegionalInfoGroupBox(NULL), mGoToTodayMenuAction(NULL), mBg(NULL) { setupMenu(); // Create model manager mModelManager = new CalenDayModelManager(mServices, true, this); mSettingsManager = new XQSettingsManager(this); - mSettingsManager->startMonitoring(mRegionalInfo); + mSettingsManager->startMonitoring(mRegionalInfoKey); //setup Back functionality if (ECalenDayView != mServices.getFirstView()) { @@ -87,7 +90,13 @@ */ CalenDayView::~CalenDayView() { - mSettingsManager->stopMonitoring(mRegionalInfo); + mSettingsManager->stopMonitoring(mRegionalInfoKey); + + if (mRegionalInfoGroupBox) { + delete mRegionalInfoGroupBox; + mRegionalInfoGroupBox = NULL; + } + if (mDocLoader) { delete mDocLoader; mDocLoader = NULL; @@ -175,6 +184,19 @@ CALEN_DAYVIEW_DAYINFO)); HbEffect::add(mHeadingLabel, ":/fade_out.fxml", "fadeOut"); HbEffect::add(mHeadingLabel, ":/fade_in.fxml", "fadeIn"); + + // Set up main container for hour elements/content area + mMainContainer = qobject_cast (mDocLoader->findWidget( + CALEN_DAYVIEW_CONTENTWIDGET)); + if (Qt::Vertical == CalenDayUtils::instance()->orientation()) { + mBg = new HbFrameItem(KCalenBackgroundColorPortrait, + HbFrameDrawer::OnePiece, this); + } + else { + mBg = new HbFrameItem(KCalenBackgroundColorLandscape, + HbFrameDrawer::OnePiece, this); + } + mMainContainer->setBackgroundItem(mBg); // Set up hour scroll area mHourScrollArea @@ -185,13 +207,14 @@ mContentScrollArea = static_cast (mDocLoader->findWidget( CALEN_DAYVIEW_CONTENTSCROLLAREA)); - mContentWidget = new CalenDayContentWidget(*mModelManager, NULL); + // Pass parent object to mContentWidget to install event filters on parent + mContentWidget = new CalenDayContentWidget(*mModelManager, mContentScrollArea); mContentScrollArea->setContentWidget(mContentWidget); + setupSlots(); + // Set up regional info if variant is correct showRegionalInformationFadeIn(); - - setupSlots(); } //private slots @@ -229,7 +252,10 @@ // Triggers fading effect for heading label. HbEffect::start(mHeadingLabel, "fadeOut", this, "setHeadingText"); - HbEffect::start(mRegionalInfoGroupBox, "fadeOut", this, "showRegionalInformation"); + if (mRegionalInfoGroupBox) { + HbEffect::start(mRegionalInfoGroupBox, "fadeOut", this, + "showRegionalInformation"); + } mServices.Context().setFocusDate(mDate); } @@ -314,10 +340,14 @@ connect(mContentWidget, SIGNAL(scrollPositionChanged(const QPointF &)), mHourScrollArea, SLOT(scrollVertically(const QPointF &))); - + connect(mHourScrollArea, SIGNAL(scrollPositionChanged(const QPointF &)), mContentWidget, SLOT(widgetScrolled(const QPointF &))); - + + connect(CalenDayUtils::instance()->mainWindow(), + SIGNAL(orientationChanged(Qt::Orientation)), this, + SLOT(orientationChanged(Qt::Orientation))); + connect(mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)), this, SLOT(showHideRegionalInformationChanged(XQSettingsKey, QVariant))); } @@ -400,8 +430,10 @@ */ void CalenDayView::showRegionalInformationFadeIn() { - showHideRegionalInformationChanged(mRegionalInfo, 3); - HbEffect::start(mRegionalInfoGroupBox, "fadeIn"); + showHideRegionalInformationChanged(mRegionalInfoKey, 3); + if (mRegionalInfoGroupBox) { + HbEffect::start(mRegionalInfoGroupBox, "fadeIn"); + } } /*! @@ -411,34 +443,41 @@ const XQSettingsKey& key, const QVariant&) { - if (key.key() == mRegionalInfo.key()) { + if ((key.key() == mRegionalInfoKey.key()) && pluginEnabled()) { int showRegionalInfo = - mSettingsManager->readItemValue(mRegionalInfo).toUInt(); + mSettingsManager->readItemValue(mRegionalInfoKey).toUInt(); + if (showRegionalInfo) { + if (!mRegionalInfoGroupBox) { + mRegionalInfoGroupBox = new HbGroupBox(); + CalenPluginLabel *regionalInfo = new CalenPluginLabel( + mServices, this); + regionalInfo->setFontSpec(HbFontSpec(HbFontSpec::Primary)); - if (showRegionalInfo) { + // Set margins in groupbox according to UI spec + HbStyle style; + HbDeviceProfile deviceProfile; + qreal leftMargin = 0.0; + qreal rightMargin = 0.0; + qreal topMargin = 0.0; + qreal bottomMargin = 0.0; + style.parameter(QString("hb-param-margin-gene-left"), + leftMargin, deviceProfile); + style.parameter(QString("hb-param-margin-gene-right"), + rightMargin, deviceProfile); + style.parameter(QString("hb-param-margin-gene-top"), topMargin, + deviceProfile); + style.parameter(QString("hb-param-margin-gene-bottom"), + bottomMargin, deviceProfile); + regionalInfo->setContentsMargins(leftMargin, topMargin, + rightMargin, bottomMargin); + mRegionalInfoGroupBox->setContentWidget(regionalInfo); + + mVLayout->insertItem(1, mRegionalInfoGroupBox); + } QString *pluginString = pluginText(); - if (pluginString) { - if (!mRegionalInfoGroupBox) { - mRegionalInfoGroupBox = qobject_cast ( - mDocLoader->findWidget(CALEN_DAYVIEW_REGIONALINFO)); - CalenPluginLabel *regionalInfo = new CalenPluginLabel( - mServices, this); - HbEffect::add(mRegionalInfoGroupBox, ":/fade_out.fxml", - "fadeOut"); - HbEffect::add(mRegionalInfoGroupBox, ":/fade_in.fxml", - "fadeIn"); - regionalInfo->setContentsMargins(1, 1, 1, 1); - mRegionalInfoGroupBox->setContentWidget(regionalInfo); - } - - if (pluginEnabled()) { - HbLabel *pluginInfoLabel = qobject_cast ( - mRegionalInfoGroupBox->contentWidget()); - - pluginInfoLabel->setPlainText(*pluginString); - mVLayout->insertItem(1, mRegionalInfoGroupBox); - } - } + HbLabel *pluginInfoLabel = qobject_cast ( + mRegionalInfoGroupBox->contentWidget()); + pluginInfoLabel->setPlainText(*pluginString); } else { if (mRegionalInfoGroupBox) { @@ -483,4 +522,24 @@ } } +/*! + \brief Slot which is called whenever the orientation of the device changes. + + Changes the backgroung graphic element when orientation chandes. + + \param orientation Current device orientation + */ +void CalenDayView::orientationChanged(Qt::Orientation orientation) +{ + if (Qt::Vertical == orientation) { + mBg = new HbFrameItem(KCalenBackgroundColorPortrait, + HbFrameDrawer::OnePiece, this); + } + else { + mBg = new HbFrameItem(KCalenBackgroundColorLandscape, + HbFrameDrawer::OnePiece, this); + } + mMainContainer->setBackgroundItem(mBg); +} + //End of File diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/tsrc/unittests/unittest_calendaystatusstrip/unittest_calendaystatusstrip.cpp --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendaystatusstrip/unittest_calendaystatusstrip.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendaystatusstrip/unittest_calendaystatusstrip.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -42,7 +42,6 @@ void cleanup(); void testConstructors(); - void testSetGetColor(); void testSetGetRange(); void testSetGetDrawingStyle_data(); void testSetGetDrawingStyle(); @@ -129,24 +128,6 @@ } /*! - Test function for geting and setting color - 1. Test setting red color - 2. Test change color to blue - */ -void TestCalenStatusStrip::testSetGetColor() -{ - //1) - mStatusStrip->setColor(QColor(Qt::red)); - QColor testColor = mStatusStrip->color(); - QCOMPARE(QColor(Qt::red),testColor); - - //2) - mStatusStrip->setColor(QColor(Qt::blue)); - testColor = mStatusStrip->color(); - QCOMPARE(QColor(Qt::blue),testColor); -} - -/*! Test function for geting and setting range 1. Test setting 5px range 2. Test change range to 1px @@ -339,7 +320,6 @@ void TestCalenStatusStrip::testPaint() { //preapre data needed to draw on widget - mStatusStrip->setColor(QColor(Qt::red)); QPair startEndTime; startEndTime.first = QTime(10,20,0); startEndTime.second = QTime(15,10,00); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendayutils.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendayutils.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendayutils.h Wed Aug 25 14:02:13 2010 +0530 @@ -47,7 +47,7 @@ Qt::Orientation orientation() { - return 1; + return Qt::Horizontal; } HbMainWindow* mainWindow() diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/eabi/calenviewsu.def --- a/calendarui/views/eabi/calenviewsu.def Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/eabi/calenviewsu.def Wed Aug 25 14:02:13 2010 +0530 @@ -260,4 +260,11 @@ _ZThn8_N22CalenDayHourScrollAreaD1Ev @ 259 NONAME _ZThn8_N25CalenDayContentScrollAreaD0Ev @ 260 NONAME _ZThn8_N25CalenDayContentScrollAreaD1Ev @ 261 NONAME + _ZN14CalenMonthGrid17handleThemeChangeEv @ 262 NONAME + _ZN14CalenMonthView17handleThemeChangeEv @ 263 NONAME + _ZN16CalenPreviewPane13effectStartedEv @ 264 NONAME + _ZN16CalenPreviewPane14effectFinishedEv @ 265 NONAME + _ZN21CalenThickLinesDrawer17handleThemeChangeEv @ 266 NONAME + _ZN16CalenPreviewPane17handleThemeChangeEv @ 267 NONAME + _ZNK25CalenDayContentScrollArea17isHorizontalSwipeEf @ 268 NONAME diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/inc/calengriditemprototype.h --- a/calendarui/views/inc/calengriditemprototype.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/inc/calengriditemprototype.h Wed Aug 25 14:02:13 2010 +0530 @@ -32,15 +32,13 @@ // CONSTANTS const QString focusIconName = "qtg_fr_cal_focused_day_ind"; -const QString eventIndname = "qtg_graf_cal_event_ind"; +const QString eventIndname = ":/qtg_graf_cal_event_ind.svg"; class CalenGridItemPrototype : public HbGridViewItem { Q_OBJECT public: - CalenGridItemPrototype(QColor todayIndColor, QColor activeColor, QColor inActiveColor, - QGraphicsWidget *parent = 0); CalenGridItemPrototype(QGraphicsWidget *parent = 0); virtual ~CalenGridItemPrototype() { @@ -54,12 +52,14 @@ bool canSetModelIndex(const QModelIndex& index); void createPrimitives(); +public slots: + + void handleThemeChange(); + private: - QColor mTodayUnderLineColor; QColor mActiveTextColor; QColor mInActiveTextColor; QColor mCurrentDateColor; - QColor mGridBorderColor; HbIconItem *mEventIndicatorItem; HbTextItem *mMonthDayInfoItem; HbFrameItem *mFocusIndicatorItem; diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/inc/calenmonthgrid.h --- a/calendarui/views/inc/calenmonthgrid.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/inc/calenmonthgrid.h Wed Aug 25 14:02:13 2010 +0530 @@ -87,6 +87,10 @@ void appendRows(); void itemActivated(const QModelIndex &index); +private slots: + + void handleThemeChange(); + private: QStandardItemModel *mModel; scrollDirection mDirection; @@ -95,14 +99,13 @@ CalenMonthView *mView; int mCurrentRow; bool mIsNonActiveDayFocused; - QDateTime mNonActiveFocusedDay; bool mIgnoreItemActivated; QPointF mPressedPos; - QColor mGridLineColor; - QColor mGridBorderColor; QGraphicsWidget* mContentWidget; QList mLocalisedDates; QPointF mStartPos; + QColor mGridLineColor; + bool mActiveDatesSet; }; #endif // CALENMONTHGRID_H diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/inc/calenmonthview.h --- a/calendarui/views/inc/calenmonthview.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/inc/calenmonthview.h Wed Aug 25 14:02:13 2010 +0530 @@ -86,6 +86,7 @@ QDateTime firstDayOfGrid(); void fetchEntriesAndUpdateModel(); void launchDayView(); + void disconnectAboutToQuitEvent(); private: void createGrid(); @@ -116,6 +117,7 @@ void handleRightEffectCompleted(const HbEffect::EffectStatus &status); void addRemoveActionsInMenu(); void changeOrientation(Qt::Orientation orientation); + void handleThemeChange(); private: bool mIsFirstTimeLoad; @@ -175,6 +177,7 @@ HbMenu *mDeleteSubMenu; QColor mWeekDaysColor; bool mIsAboutToQuitEventConnected; // bool to check if month view is registered to get aboutToQuit signals + QColor mPreviewHeadingColor; }; #endif //CALENMONTHVIEW_H diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/inc/calenpreviewpane.h --- a/calendarui/views/inc/calenpreviewpane.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/inc/calenpreviewpane.h Wed Aug 25 14:02:13 2010 +0530 @@ -64,6 +64,7 @@ public slots: void onTwoSecondsTimeout(); void scrollingFinished(); + void handleThemeChange(); private: enum scrollDirection{ @@ -86,6 +87,7 @@ bool mIsGestureHandled; qreal mHtDiff; int mScrollDuration; + QColor mPreviewTextColor; }; #endif /* CALENPREVIEWPANE_H_ */ diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/inc/calenthicklinesdrawer.h --- a/calendarui/views/inc/calenthicklinesdrawer.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/inc/calenthicklinesdrawer.h Wed Aug 25 14:02:13 2010 +0530 @@ -37,7 +37,10 @@ CalenThickLinesDrawer( CalendarNamespace::WidgetType type, QGraphicsItem* parent = NULL ); virtual ~CalenThickLinesDrawer(); - + +private slots: + void handleThemeChange(); + private: void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/resources/calenresources.qrc --- a/calendarui/views/resources/calenresources.qrc Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/resources/calenresources.qrc Wed Aug 25 14:02:13 2010 +0530 @@ -5,8 +5,7 @@ caleneventlistviewitem.widgetml caleneventlistviewitem.css caleneventlistviewitem_color.css - qgn_indi_cdr_meeting_layer0.svg - qtg_mono_exception.png + qtg_graf_cal_event_ind.svg view_show_normal.fxml diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/resources/qgn_indi_cdr_meeting_layer0.svg --- a/calendarui/views/resources/qgn_indi_cdr_meeting_layer0.svg Mon Aug 09 18:30:52 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/resources/qtg_graf_cal_event_ind.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/views/resources/qtg_graf_cal_event_ind.svg Wed Aug 25 14:02:13 2010 +0530 @@ -0,0 +1,6 @@ + + + + + + diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/resources/qtg_mono_exception.png Binary file calendarui/views/resources/qtg_mono_exception.png has changed diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/src/calengriditemprototype.cpp --- a/calendarui/views/src/calengriditemprototype.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/src/calengriditemprototype.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -27,6 +27,7 @@ #include #include #include +#include // User includes #include "calengriditemprototype.h" @@ -47,19 +48,16 @@ /*! Constructor. */ -CalenGridItemPrototype::CalenGridItemPrototype(QColor todayIndColor, QColor activeColor, QColor inActiveColor, - QGraphicsWidget *parent) : - HbGridViewItem(parent), - mTodayUnderLineColor(todayIndColor), - mActiveTextColor(activeColor), - mInActiveTextColor(inActiveColor), - mCurrentDateColor(Qt::black), - mGridBorderColor(Qt::gray), - mEventIndicatorItem(0), - mMonthDayInfoItem(0), - mFocusIndicatorItem(0), - mTodayIndicatorItem(0) - { +CalenGridItemPrototype::CalenGridItemPrototype(QGraphicsWidget *parent) : + HbGridViewItem(parent), + mActiveTextColor(HbColorScheme::color("qtc_cal_month_active_dates")), + mInActiveTextColor(HbColorScheme::color("qtc_cal_month_notactive_dates")), + mCurrentDateColor(HbColorScheme::color("qtc_cal_month_highlighted_text")), + mEventIndicatorItem(0), + mMonthDayInfoItem(0), + mFocusIndicatorItem(0), + mTodayIndicatorItem(0) + { OstTraceFunctionEntry0( CALENGRIDITEMPROTOTYPE_CALENGRIDITEMPROTOTYPE_ENTRY ); OstTraceFunctionExit0( CALENGRIDITEMPROTOTYPE_CALENGRIDITEMPROTOTYPE_EXIT ); @@ -116,6 +114,9 @@ CalenGridItemPrototype* item = new CalenGridItemPrototype(*this); item->createPrimitives(); + connect( + HbTheme::instance(), SIGNAL(changed()), + item, SLOT(handleThemeChange())); // Set the default frame to NULL so that HbGridView does not add its // default frame for items HbFrameBackground frame; @@ -184,8 +185,13 @@ // Get the text color monthTextColorRole = itemList.at(CalendarNamespace::CalendarMonthTextColorRole).value(); if (monthTextColorRole) { - // Set the active text color - mMonthDayInfoItem->setTextColor(mActiveTextColor); + if (monthFocusRole) { + // Set the Highlighted text color + mMonthDayInfoItem->setTextColor(mCurrentDateColor); + } else { + // Set the active text color + mMonthDayInfoItem->setTextColor(mActiveTextColor); + } } else { // Set the inactive text color mMonthDayInfoItem->setTextColor(mInActiveTextColor); @@ -233,4 +239,18 @@ return true; } +/*! + Slot to handle the change in theme + */ +void CalenGridItemPrototype::handleThemeChange() +{ + OstTraceFunctionEntry0( CALENGRIDITEMPROTOTYPE_HANDLETHEMECHANGE_ENTRY ); + + mActiveTextColor = HbColorScheme::color("qtc_cal_month_active_dates"); + mInActiveTextColor = HbColorScheme::color("qtc_cal_month_notactive_dates"); + mCurrentDateColor = HbColorScheme::color("qtc_cal_month_highlighted_text"); + + OstTraceFunctionExit0( CALENGRIDITEMPROTOTYPE_HANDLETHEMECHANGE_EXIT ); + +} // End of file --Don't remove this. diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/src/calenmonthgrid.cpp --- a/calendarui/views/src/calenmonthgrid.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/src/calenmonthgrid.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -65,7 +65,8 @@ mCurrentRow(-100), mIsNonActiveDayFocused(false), mIgnoreItemActivated(false), - mGridBorderColor(Qt::gray) + mGridLineColor(HbColorScheme::color("qtc_cal_grid_line")), + mActiveDatesSet(false) { OstTraceFunctionEntry0( CALENMONTHGRID_CALENMONTHGRID_ENTRY ); @@ -81,15 +82,15 @@ setEnabledAnimations(HbAbstractItemView::None); setFrictionEnabled(false); setFlag(QGraphicsItem::ItemHasNoContents, false); + + // Disable the rows and columns swapping on orientation change + setSwapDimensionsOnOrientationChange(false); + resetTransform(); // Get the content widget of the scroll area to draw the grid lines mContentWidget = contentWidget(); - - // Get the all required colors - // Color of the grid lines - mGridLineColor = HbColorScheme::color("qtc_cal_grid_line"); - + // Get the localised dates well before // TODO: Need to update the mLocalisedDates when user changes the // phone language keeping calendar application in background @@ -101,6 +102,13 @@ // Connect to scrolling finished signal connect(this, SIGNAL(scrollingEnded()), this, SLOT(scrollingFinished())); + + connect( + HbTheme::instance(), SIGNAL(changed()), + this, SLOT(handleThemeChange())); + + // Disable the haptic feedback for the month grid during scrolling + setAttribute(Hb::InteractionDisabled); OstTraceFunctionExit0( CALENMONTHGRID_CALENMONTHGRID_EXIT ); } @@ -218,19 +226,14 @@ } if (isFirstTime) { - // Color of the today indicator - QColor todayIndColor = HbColorScheme::color("qtc_cal_month_current_day"); - // Color of the active dates - QColor mActiveTextColor = - HbColorScheme::color("qtc_cal_month_active_dates"); - // Color of the inactive dates - QColor mInActiveTextColor = - HbColorScheme::color("qtc_cal_month_notactive_dates"); // Create the prototype - CalenGridItemPrototype* gridItemPrototype = new CalenGridItemPrototype( - todayIndColor, mActiveTextColor, mInActiveTextColor, this); + CalenGridItemPrototype* gridItemPrototype = new CalenGridItemPrototype(this); + connect( + HbTheme::instance(), SIGNAL(changed()), + gridItemPrototype, SLOT(handleThemeChange())); + // Set the mode and the prototype setModel(mModel,gridItemPrototype); @@ -339,15 +342,32 @@ OstTraceFunctionEntry0( CALENMONTHGRID_DOWNGESTURE_ENTRY ); // Make sure that content widget is properly placed + // We are doing this as tapping on inactive date of previous month is leading to + // position the grid at wrong place after scrolling down. Hence, set the grid + // at proper position before we start actual scrolling if (mIsNonActiveDayFocused) { mIsAtomicScroll = true; int itemToBeScrolled = mView->rowsInPrevMonth() * KCalenDaysInWeek; QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); scrollTo(indexToBeScrolled); } + + // Set the required flags mDirection = down; mIsAtomicScroll = false; - setAttribute(Hb::InteractionDisabled); + + // Set the active and inactive dates + QDateTime activeMonth = mView->getActiveDay(); + // For previous month, substract one month to the current month + setActiveDates(activeMonth.addMonths(-1).date()); + mActiveDatesSet = true; + // Set the focus to proper date before scrolling to avoid somekind of + // jerkiness + if (!mIsNonActiveDayFocused) { + setFocusToProperDay(); + } + + // Start the scrolling QPointF targetPos(0.0, 0.0); scrollContentsTo(targetPos,500); @@ -361,17 +381,23 @@ { OstTraceFunctionEntry0( CALENMONTHGRID_UPGESTURE_ENTRY ); - // Make sure that content widget is properly placed - if (mIsNonActiveDayFocused) { - mIsAtomicScroll = true; - int itemToBeScrolled = mView->rowsInPrevMonth() * KCalenDaysInWeek; - itemToBeScrolled += KNumOfVisibleRows * KCalenDaysInWeek; - QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); - scrollTo(indexToBeScrolled); - } + + // Set the required flags mDirection = up; mIsAtomicScroll = false; - setAttribute(Hb::InteractionDisabled); + + // Set the active and inactive dates + QDateTime activeMonth = mView->getActiveDay(); + // For next month, add one month to the current month + setActiveDates(activeMonth.addMonths(1).date()); + mActiveDatesSet = true; + // Set the focus to proper date before scrolling to avoid somekind of + // jerkiness + if (!mIsNonActiveDayFocused) { + setFocusToProperDay(); + } + + // Start the scrolling QPointF targetPos(0.0, mStartPos.y() - size().height()); scrollContentsTo(-targetPos,500); @@ -420,12 +446,11 @@ if(HbPanGesture *gesture = qobject_cast(event->gesture(Qt::PanGesture))) { if (gesture->state() == Qt::GestureStarted) { - setAttribute(Hb::InteractionDisabled); mIsAtomicScroll = false; if (!mIsPanGesture) { mDirection = invalid; mStartPos = mContentWidget->pos(); - // TODO: This work aroung till framework provides an api + // TODO: This work around till framework provides an api // to know the direciton of the pan, until then we need // calculate the direction explicitly // Get to know the direction of the gesture @@ -478,7 +503,6 @@ } } else if(HbSwipeGesture *gesture = qobject_cast(event->gesture(Qt::SwipeGesture))) { if (gesture->state() == Qt::GestureStarted) { - setAttribute(Hb::InteractionDisabled); mIsAtomicScroll = false; mDirection = invalid; if (gesture->sceneVerticalDirection() == QSwipeGesture::Down) { @@ -524,23 +548,25 @@ } else if(!mIsAtomicScroll) { QDateTime activeDate = mView->getActiveDay(); if(mDirection == down) { // down gesture - if (!mIsNonActiveDayFocused) { + if (!mActiveDatesSet) { setActiveDates(activeDate.addMonths(-1).date()); + setFocusToProperDay(); } prependRows(); } else if (mDirection == up) { //up gesture - if (!mIsNonActiveDayFocused) { + if (!mActiveDatesSet) { setActiveDates(activeDate.addMonths(1).date()); + setFocusToProperDay(); } appendRows(); } mDirection = invalid; + mActiveDatesSet = false; } else { mIsAtomicScroll = false; mDirection = invalid; } mIgnoreItemActivated = false; - setAttribute(Hb::InteractionDisabled, false); OstTraceFunctionExit0( CALENMONTHGRID_SCROLLINGFINISHED_EXIT ); } @@ -581,7 +607,6 @@ // we should again show the current month by scrolling downwards mDirection = down; mIsAtomicScroll = true; - setAttribute(Hb::InteractionDisabled); scrollContentsTo(-mStartPos,500); } } else if (month == prevMonth.date().month()) { @@ -591,7 +616,6 @@ // we should again show the current month by scrolling upwards mDirection = up; mIsAtomicScroll = true; - setAttribute(Hb::InteractionDisabled); scrollContentsTo(-mStartPos,500); } else { // down gesture to show the previous month @@ -609,8 +633,7 @@ upGesture(); } else { // we should again show the current month by scrolling upwards - mDirection = invalid; - setAttribute(Hb::InteractionDisabled); + mDirection = up; scrollContentsTo(-mStartPos,500); } } else if (month == nextMonth.addMonths(1).date().month()) { @@ -629,13 +652,6 @@ void CalenMonthGrid::prependRows() { OstTraceFunctionEntry0( CALENMONTHGRID_PREPENDROWS_ENTRY ); - - // Before we do anything, set the focus to proper date - // Set it only when non active day was focussed. When inactive day - // was focussed, we need to focus the same day - if (!mIsNonActiveDayFocused) { - setFocusToProperDay(); - } // Block the signals generated by model, this is being done as // we want to avoid the overload of view listening to signals @@ -756,13 +772,6 @@ void CalenMonthGrid::appendRows() { OstTraceFunctionEntry0( CALENMONTHGRID_APPENDROWS_ENTRY ); - - // Before we do anything, set the focus to proper date - // Set it only when non active day was focussed. When inactive day - // was focussed, we need to focus the same day - if (!mIsNonActiveDayFocused) { - setFocusToProperDay(); - } // Block the signals generated by model, this is being done as // we want to avoid the overload of view listening to signals @@ -924,21 +933,19 @@ if(month != monthDataList[mCurrentRow].Day().date().month()){ // Set the flag mIsNonActiveDayFocused = true; - mNonActiveFocusedDay = monthDataList[mCurrentRow].Day(); + QDateTime nonActiveFocusedDay = monthDataList[mCurrentRow].Day(); // Add one month to active month activeMonth = activeMonth.addMonths(1); if (activeMonth.date().month() == - mNonActiveFocusedDay.date().month()) { + nonActiveFocusedDay.date().month()) { mDirection = up; // up gesture upGesture(); - setActiveDates(activeMonth.date()); } else { mDirection = down; // down gesture downGesture(); - setActiveDates(activeMonth.addMonths(-2).date()); } } mView->setContextForActiveDay(index.row()); @@ -1025,12 +1032,14 @@ end = firstDateInGrid.daysTo(endOfActiveMonth); // Set the active text color - for (int i = start; i < end; i++) { - QModelIndex index = mModel->index(i,0); - QVariant itemData = index.data(Qt::UserRole + 1); - QVariantList list = itemData.toList(); - list.replace(CalendarNamespace::CalendarMonthTextColorRole, true); - mModel->itemFromIndex(index)->setData(list); + if (start >= 0 && end < monthDataList.count()) { + for (int i = start; i < end; i++) { + QModelIndex index = mModel->index(i,0); + QVariant itemData = index.data(Qt::UserRole + 1); + QVariantList list = itemData.toList(); + list.replace(CalendarNamespace::CalendarMonthTextColorRole, true); + mModel->itemFromIndex(index)->setData(list); + } } // Now set the inactive text color to those which were active before the swipe @@ -1071,12 +1080,14 @@ } // Set the inactive text color - for (int i = start; i < end; i++) { - QModelIndex index = mModel->index(i,0); - QVariant itemData = index.data(Qt::UserRole + 1); - QVariantList list = itemData.toList(); - list.replace(CalendarNamespace::CalendarMonthTextColorRole, false); - mModel->itemFromIndex(index)->setData(list); + if (start >= 0 && end < monthDataList.count()) { + for (int i = start; i < end; i++) { + QModelIndex index = mModel->index(i,0); + QVariant itemData = index.data(Qt::UserRole + 1); + QVariantList list = itemData.toList(); + list.replace(CalendarNamespace::CalendarMonthTextColorRole, false); + mModel->itemFromIndex(index)->setData(list); + } } OstTraceFunctionExit0( DUP1_CALENMONTHGRID_SETACTIVEDATES_EXIT ); @@ -1162,11 +1173,8 @@ qreal widthInPixels = GRIDLINE_WIDTH * unitValue; pen.setStyle(Qt::SolidLine); pen.setWidth(widthInPixels); - if (mGridLineColor.isValid()) { - pen.setBrush(mGridLineColor); - } else { - pen.setBrush(mGridBorderColor); - } + pen.setBrush(mGridLineColor); + // Store the old pen QPen oldPen = painter->pen(); @@ -1235,4 +1243,16 @@ OstTraceFunctionExit0( CALENMONTHGRID_PAINT_EXIT ); } +/*! + Slot to handle the change in theme + */ +void CalenMonthGrid::handleThemeChange() +{ + OstTraceFunctionEntry0(CALENMONTHGRID_HANDLETHEMECHANGE_ENTRY); + + mGridLineColor = HbColorScheme::color("qtc_cal_grid_line"); + + OstTraceFunctionExit0(CALENMONTHGRID_HANDLETHEMECHANGE_EXIT); +} + // End of File diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/src/calenmonthview.cpp --- a/calendarui/views/src/calenmonthview.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/src/calenmonthview.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include // hbapplication @@ -93,9 +94,14 @@ mLocale = HbExtendedLocale::system(); mFirstWeekLabel = NULL; mIsPrevPaneGesture = false; - // Get the week day color from the theme + // Get the week day and preview heading color from the theme mWeekDaysColor = HbColorScheme::color("qtc_cal_week_day"); + mPreviewHeadingColor = HbColorScheme::color("qtc_cal_day_preview_heading"); + + connect(HbTheme::instance(), SIGNAL(changed()), + this, SLOT(handleThemeChange())); + OstTraceFunctionExit0( CALENMONTHVIEW_CALENMONTHVIEW_EXIT ); } @@ -179,6 +185,10 @@ mCurrPreviewPane->setView(this); mCurrPreviewPane->setNoEntriesLabel(currPaneNoEntriesLabel); + connect( + HbTheme::instance(), SIGNAL(changed()), + mCurrPreviewPane, SLOT(handleThemeChange())); + mCurrPaneLayoutWidget = qobject_cast(docLoader->findWidget(CALEN_CURRPANELAYOUT)); mCurrPaneLayout = static_cast(mCurrPaneLayoutWidget->layout()); @@ -194,6 +204,9 @@ docLoader->findWidget(CALEN_NOENTRIES_LABEL_PREV)); mPrevPreviewPane->setView(this); mPrevPreviewPane->setNoEntriesLabel(prevPaneNoEntriesLabel); + connect( + HbTheme::instance(), SIGNAL(changed()), + mPrevPreviewPane, SLOT(handleThemeChange())); mPrevPaneParent->setVisible(false); mPrevPaneLayoutWidget = qobject_cast(docLoader->findWidget(CALEN_PREVPANELAYOUT)); @@ -210,6 +223,10 @@ docLoader->findWidget(CALEN_NOENTRIES_LABEL_NEXT)); mNextPreviewPane->setView(this); mNextPreviewPane->setNoEntriesLabel(nextPaneNoEntriesLabel); + connect( + HbTheme::instance(), SIGNAL(changed()), + mNextPreviewPane, SLOT(handleThemeChange())); + mNextPaneParent->setVisible(false); mNextPaneLayoutWidget = qobject_cast(docLoader->findWidget(CALEN_NEXTPANELAYOUT)); mNextPaneLayout = static_cast(mNextPaneLayoutWidget->layout()); @@ -560,8 +577,11 @@ } QString *pluginString = pluginText(); mPrevRegionalInfo->setPlainText(*pluginString); + mPrevRegionalInfo->setTextColor(mPreviewHeadingColor); mCurrRegionalInfo->setPlainText(*pluginString); + mCurrRegionalInfo->setTextColor(mPreviewHeadingColor); mNextRegionalInfo->setPlainText(*pluginString); + mNextRegionalInfo->setTextColor(mPreviewHeadingColor); } else { if (mPrevRegionalInfo) { mPrevPaneLayout->removeItem(mPrevRegionalInfo); @@ -1427,16 +1447,27 @@ mServices.IssueCommandL(ECalenDayView); // day view launched now, disconnect to get the call backs for saveActivity // on aboutToQuit signal - if (mIsAboutToQuitEventConnected) - { - disconnect(qobject_cast(qApp), SIGNAL(aboutToQuit()), this, SLOT(saveActivity())); - mIsAboutToQuitEventConnected = false; - } + disconnectAboutToQuitEvent(); OstTraceFunctionExit0( CALENMONTHVIEW_LAUNCHDAYVIEW_EXIT ); } /*! +disconnects for the aboutToQuit events + */ +void CalenMonthView::disconnectAboutToQuitEvent() +{ + OstTraceFunctionEntry0( CALENMONTHVIEW_DISCONNECTABOUTTOQUITEVENT_ENTRY ); + + if (mIsAboutToQuitEventConnected) { + disconnect(qobject_cast(qApp), SIGNAL(aboutToQuit()), this, SLOT(saveActivity())); + mIsAboutToQuitEventConnected = false; + } + + OstTraceFunctionExit0( CALENMONTHVIEW_DISCONNECTABOUTTOQUITEVENT_EXIT ); +} + +/*! Slot to handle the change in orientation */ void CalenMonthView::changeOrientation(Qt::Orientation orientation) @@ -1453,6 +1484,28 @@ } /*! + Slot to handle the change in theme + */ +void CalenMonthView::handleThemeChange() +{ + OstTraceFunctionEntry0( CALENMONTHVIEW_HANDLETHEMECHANGE_ENTRY ); + + // Refresh the month view when the theme change happens + mWeekDaysColor = HbColorScheme::color("qtc_cal_week_day"); + QColor monthTitleColor = HbColorScheme::color("qtc_cal_monthgrid_title"); + + if (mTitleLabel && monthTitleColor.isValid()) { + mTitleLabel->setTextColor(monthTitleColor); + } + + mPreviewHeadingColor = HbColorScheme::color("qtc_cal_day_preview_heading"); + + mServices.IssueCommandL(ECalenStartActiveStep); + + OstTraceFunctionExit0( CALENMONTHVIEW_HANDLETHEMECHANGE_EXIT ); +} + +/*! Loads appropriate section from the docml dsepending on the current orientation of the device */ @@ -1721,9 +1774,12 @@ labels.append(mFifthDayLabel); labels.append(mSixthDayLabel); labels.append(mSeventhDayLabel); + QGraphicsLinearLayout* layout = static_cast (mDayNameWidget->layout()); for(int i=0;i < KCalenDaysInWeek; i++ ) { labels.at(i)->setPlainText(weekDayArray[weekDayIndex]); + // Set the stretch factor as 1 so that each label occupies equal space + layout->setStretchFactor(labels.at(i), 1); if(weekDayIndex == KCalenDaysInWeek - 1 )//Sunday { weekDayIndex = 0;//reset to monday diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/src/calenpreviewpane.cpp --- a/calendarui/views/src/calenpreviewpane.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/src/calenpreviewpane.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -74,6 +74,8 @@ mNoEntriesLabel = 0; mHtDiff = 0.0; mScrollDuration = 0; + mPreviewTextColor = HbColorScheme::color("qtc_cal_day_preview_text"); + setAcceptDrops(true); setScrollDirections(Qt::Vertical); setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); @@ -107,6 +109,9 @@ mNoEntriesLabel = label; + if (mPreviewTextColor.isValid()) { + mNoEntriesLabel->setTextColor(mPreviewTextColor); + } OstTraceFunctionExit0( CALENPREVIEWPANE_SETNOENTRIESLABEL_EXIT ); } @@ -138,6 +143,9 @@ HbFontSpec font(HbFontSpec::Secondary); if (mIsNoEntriesAdded) { if (!instanceCount) { + if (mPreviewTextColor.isValid()) { + mNoEntriesLabel->setTextColor(mPreviewTextColor); + } mNoEntriesLabel->setVisible(true); OstTraceFunctionExit0( CALENPREVIEWPANE_POPULATELABEL_EXIT ); return; @@ -162,13 +170,6 @@ // Set the required font label->setFontSpec(font); - // Set the text color from the theme - QColor previewPaneColor = HbColorScheme::color( - "qtc_cal_day_preview_text"); - if (previewPaneColor.isValid()) { - label->setTextColor(previewPaneColor); - } - // Set the elide mode to right label->setElideMode(Qt::ElideRight); // Add the label to the list @@ -179,6 +180,10 @@ label = mLabelList.at(i); count--; } + + if (mPreviewTextColor.isValid()) { + label->setTextColor(mPreviewTextColor); + } QString summary = mInstanceArray[i].summary(); if(!summary.length()) { // No summary display "Unnamed" @@ -234,6 +239,9 @@ // Clear the list mLabelList.clear(); + if (mPreviewTextColor.isValid()) { + mNoEntriesLabel->setTextColor(mPreviewTextColor); + } // Add the no entries text to the preview pane mNoEntriesLabel->setVisible(true); mIsNoEntriesAdded = true; @@ -431,11 +439,12 @@ HbInstantFeedback::play(HbFeedback::Basic); // Preview pane tapped mServices.IssueCommandL(ECalenAgendaView); + mView->disconnectAboutToQuitEvent(); event->accept(Qt::TapGesture); } } - OstTraceFunctionExit0( DUP2_CALENPREVIEWPANE_GESTUREEVENT_EXIT ); + OstTraceFunctionExit0( DUP3_CALENPREVIEWPANE_GESTUREEVENT_EXIT ); } /*! @@ -499,4 +508,16 @@ mIsGestureHandled = false; } +/*! + Slot to handle the change in theme + */ +void CalenPreviewPane::handleThemeChange() +{ + OstTraceFunctionEntry0( CALENPREVIEWPANE_HANDLETHEMECHANGE_ENTRY ); + + mPreviewTextColor = HbColorScheme::color("qtc_cal_day_preview_text"); + + OstTraceFunctionExit0( CALENPREVIEWPANE_HANDLETHEMECHANGE_EXIT ); +} + // End of file --Don't remove this. diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/src/calenthicklinesdrawer.cpp --- a/calendarui/views/src/calenthicklinesdrawer.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/src/calenthicklinesdrawer.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -21,6 +21,7 @@ #include #include #include +#include // User includes #include "calenthicklinesdrawer.h" @@ -53,6 +54,10 @@ mGridBorderColor = HbColorScheme::color("qtc_cal_grid_line"); setFlag(QGraphicsItem::ItemHasNoContents, false); + connect( + HbTheme::instance(), SIGNAL(changed()), + this, SLOT(handleThemeChange())); + OstTraceFunctionExit0( CALENTHICKLINESDRAWER_CALENTHICKLINESDRAWER_EXIT ); } @@ -121,4 +126,16 @@ OstTraceFunctionExit0( CALENTHICKLINESDRAWER_PAINT_EXIT ); } +/*! + Slot to handle the change in theme + */ +void CalenThickLinesDrawer::handleThemeChange() +{ + OstTraceFunctionEntry0(CALENTHICKLINESDRAWER_HANDLETHEMECHANGE_ENTRY); + + mGridBorderColor = HbColorScheme::color("qtc_cal_grid_line"); + + OstTraceFunctionExit0(CALENTHICKLINESDRAWER_HANDLETHEMECHANGE_EXIT); +} + // End of file --Don't remove this. diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/traces/calengriditemprototypeTraces.h --- a/calendarui/views/traces/calengriditemprototypeTraces.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/traces/calengriditemprototypeTraces.h Wed Aug 25 14:02:13 2010 +0530 @@ -20,6 +20,8 @@ #define DUP1_CALENGRIDITEMPROTOTYPE_PRESSSTATECHANGED_EXIT 0x8a0079 #define CALENGRIDITEMPROTOTYPE_CANSETMODELINDEX_ENTRY 0x8a007a #define CALENGRIDITEMPROTOTYPE_CANSETMODELINDEX_EXIT 0x8a007b +#define CALENGRIDITEMPROTOTYPE_HANDLETHEMECHANGE_ENTRY 0x8a0183 +#define CALENGRIDITEMPROTOTYPE_HANDLETHEMECHANGE_EXIT 0x8a0184 #endif diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/traces/calenmonthgridTraces.h --- a/calendarui/views/traces/calenmonthgridTraces.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/traces/calenmonthgridTraces.h Wed Aug 25 14:02:13 2010 +0530 @@ -60,6 +60,8 @@ #define CALENMONTHGRID_ORIENTATIONCHANGED_EXIT 0x8a00bf #define CALENMONTHGRID_PAINT_ENTRY 0x8a00c0 #define CALENMONTHGRID_PAINT_EXIT 0x8a00c1 +#define CALENMONTHGRID_HANDLETHEMECHANGE_ENTRY 0x8a0185 +#define CALENMONTHGRID_HANDLETHEMECHANGE_EXIT 0x8a0186 #endif diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/traces/calenmonthviewTraces.h --- a/calendarui/views/traces/calenmonthviewTraces.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/traces/calenmonthviewTraces.h Wed Aug 25 14:02:13 2010 +0530 @@ -105,6 +105,10 @@ #define CALENMONTHVIEW_HANDLERIGHTEFFECTCOMPLETED_EXIT 0x8a0122 #define CALENMONTHVIEW_UPDATEDAYLABEL_ENTRY 0x8a0123 #define CALENMONTHVIEW_UPDATEDAYLABEL_EXIT 0x8a0124 +#define CALENMONTHVIEW_DISCONNECTABOUTTOQUITEVENT_ENTRY 0x8a017f +#define CALENMONTHVIEW_DISCONNECTABOUTTOQUITEVENT_EXIT 0x8a0180 +#define CALENMONTHVIEW_HANDLETHEMECHANGE_ENTRY 0x8a0187 +#define CALENMONTHVIEW_HANDLETHEMECHANGE_EXIT 0x8a0188 #endif diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/traces/calenpreviewpaneTraces.h --- a/calendarui/views/traces/calenpreviewpaneTraces.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/traces/calenpreviewpaneTraces.h Wed Aug 25 14:02:13 2010 +0530 @@ -30,11 +30,14 @@ #define CALENPREVIEWPANE_GESTUREEVENT_ENTRY 0x8a015f #define CALENPREVIEWPANE_GESTUREEVENT_EXIT 0x8a0160 #define DUP1_CALENPREVIEWPANE_GESTUREEVENT_EXIT 0x8a0161 -#define DUP2_CALENPREVIEWPANE_GESTUREEVENT_EXIT 0x8a0162 #define CALENPREVIEWPANE_SETVIEW_ENTRY 0x8a0163 #define CALENPREVIEWPANE_SETVIEW_EXIT 0x8a0164 #define CALENPREVIEWPANE_STOPSCROLLING_ENTRY 0x8a0165 #define CALENPREVIEWPANE_STOPSCROLLING_EXIT 0x8a0166 +#define DUP2_CALENPREVIEWPANE_GESTUREEVENT_EXIT 0x8a0181 +#define DUP3_CALENPREVIEWPANE_GESTUREEVENT_EXIT 0x8a0182 +#define CALENPREVIEWPANE_HANDLETHEMECHANGE_ENTRY 0x8a0189 +#define CALENPREVIEWPANE_HANDLETHEMECHANGE_EXIT 0x8a018a #endif diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/traces/calenthicklinesdrawerTraces.h --- a/calendarui/views/traces/calenthicklinesdrawerTraces.h Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/traces/calenthicklinesdrawerTraces.h Wed Aug 25 14:02:13 2010 +0530 @@ -12,6 +12,8 @@ #define DUP1_CALENTHICKLINESDRAWER_CALENTHICKLINESDRAWER_EXIT 0x8a0174 #define CALENTHICKLINESDRAWER_PAINT_ENTRY 0x8a0175 #define CALENTHICKLINESDRAWER_PAINT_EXIT 0x8a0176 +#define CALENTHICKLINESDRAWER_HANDLETHEMECHANGE_ENTRY 0x8a018b +#define CALENTHICKLINESDRAWER_HANDLETHEMECHANGE_EXIT 0x8a018c #endif diff -r bb2d3e476f29 -r a3cb48f6c889 calendarui/views/traces/fixed_id.definitions --- a/calendarui/views/traces/fixed_id.definitions Mon Aug 09 18:30:52 2010 +0530 +++ b/calendarui/views/traces/fixed_id.definitions Wed Aug 25 14:02:13 2010 +0530 @@ -98,6 +98,8 @@ [TRACE]TRACE_FLOW[0x8A]_CALENGRIDITEMPROTOTYPE_CREATEITEM_EXIT=0x73 [TRACE]TRACE_FLOW[0x8A]_CALENGRIDITEMPROTOTYPE_CREATEPRIMITIVES_ENTRY=0x70 [TRACE]TRACE_FLOW[0x8A]_CALENGRIDITEMPROTOTYPE_CREATEPRIMITIVES_EXIT=0x71 +[TRACE]TRACE_FLOW[0x8A]_CALENGRIDITEMPROTOTYPE_HANDLETHEMECHANGE_ENTRY=0x183 +[TRACE]TRACE_FLOW[0x8A]_CALENGRIDITEMPROTOTYPE_HANDLETHEMECHANGE_EXIT=0x184 [TRACE]TRACE_FLOW[0x8A]_CALENGRIDITEMPROTOTYPE_PRESSSTATECHANGED_ENTRY=0x76 [TRACE]TRACE_FLOW[0x8A]_CALENGRIDITEMPROTOTYPE_PRESSSTATECHANGED_EXIT=0x77 [TRACE]TRACE_FLOW[0x8A]_CALENGRIDITEMPROTOTYPE_UPDATECHILDITEMS_ENTRY=0x74 @@ -130,6 +132,8 @@ [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_HANDLEPANGESTUREFINISHED_EXIT=0xa8 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_HANDLEPREPENDINGROWS_ENTRY=0xab [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_HANDLEPREPENDINGROWS_EXIT=0xac +[TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_HANDLETHEMECHANGE_ENTRY=0x185 +[TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_HANDLETHEMECHANGE_EXIT=0x186 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_ITEMACTIVATED_ENTRY=0xb1 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_ITEMACTIVATED_EXIT=0xb2 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_MOUSEPRESSEVENT_ENTRY=0x9c @@ -178,6 +182,8 @@ [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_CREATEGRID_EXIT=0xee [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_DATEFROMCONTEXT_ENTRY=0xe1 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_DATEFROMCONTEXT_EXIT=0xe2 +[TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_DISCONNECTABOUTTOQUITEVENT_ENTRY=0x17f +[TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_DISCONNECTABOUTTOQUITEVENT_EXIT=0x180 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_DOLAZYLOADING_ENTRY=0xc8 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_DOLAZYLOADING_EXIT=0xc9 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_DOPOPULATION_ENTRY=0xdb @@ -206,6 +212,8 @@ [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_HANDLEPREVIEWPANEGESTURE_EXIT=0x11a [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_HANDLERIGHTEFFECTCOMPLETED_ENTRY=0x121 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_HANDLERIGHTEFFECTCOMPLETED_EXIT=0x122 +[TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_HANDLETHEMECHANGE_ENTRY=0x187 +[TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_HANDLETHEMECHANGE_EXIT=0x188 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_LAUNCHDAYVIEW_ENTRY=0x111 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_LAUNCHDAYVIEW_EXIT=0x112 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHVIEW_MONTHDATALIST_ENTRY=0xeb @@ -296,6 +304,8 @@ [TRACE]TRACE_FLOW[0x8A]_CALENPREVIEWPANE_GESTUREEVENT_EXIT=0x160 [TRACE]TRACE_FLOW[0x8A]_CALENPREVIEWPANE_GETINSTANCELISTL_ENTRY=0x153 [TRACE]TRACE_FLOW[0x8A]_CALENPREVIEWPANE_GETINSTANCELISTL_EXIT=0x154 +[TRACE]TRACE_FLOW[0x8A]_CALENPREVIEWPANE_HANDLETHEMECHANGE_ENTRY=0x189 +[TRACE]TRACE_FLOW[0x8A]_CALENPREVIEWPANE_HANDLETHEMECHANGE_EXIT=0x18a [TRACE]TRACE_FLOW[0x8A]_CALENPREVIEWPANE_ONTWOSECONDSTIMEOUT_ENTRY=0x15a [TRACE]TRACE_FLOW[0x8A]_CALENPREVIEWPANE_ONTWOSECONDSTIMEOUT_EXIT=0x15b [TRACE]TRACE_FLOW[0x8A]_CALENPREVIEWPANE_POPULATELABEL_ENTRY=0x150 @@ -320,6 +330,8 @@ [TRACE]TRACE_FLOW[0x8A]_CALENSETTINGSVIEW_REFRESHVIEW_EXIT=0x170 [TRACE]TRACE_FLOW[0x8A]_CALENTHICKLINESDRAWER_CALENTHICKLINESDRAWER_ENTRY=0x171 [TRACE]TRACE_FLOW[0x8A]_CALENTHICKLINESDRAWER_CALENTHICKLINESDRAWER_EXIT=0x172 +[TRACE]TRACE_FLOW[0x8A]_CALENTHICKLINESDRAWER_HANDLETHEMECHANGE_ENTRY=0x18b +[TRACE]TRACE_FLOW[0x8A]_CALENTHICKLINESDRAWER_HANDLETHEMECHANGE_EXIT=0x18c [TRACE]TRACE_FLOW[0x8A]_CALENTHICKLINESDRAWER_PAINT_ENTRY=0x175 [TRACE]TRACE_FLOW[0x8A]_CALENTHICKLINESDRAWER_PAINT_EXIT=0x176 [TRACE]TRACE_FLOW[0x8A]_CALENTODAYINDICATORLINEDRAWER_CALENTODAYINDICATORLINEDRAWER_ENTRY=0x177 @@ -380,5 +392,7 @@ [TRACE]TRACE_FLOW[0x8A]_DUP2_CALENMONTHDATA_CALENMONTHDATA_EXIT=0x81 [TRACE]TRACE_FLOW[0x8A]_DUP2_CALENMONTHGRID_GESTUREEVENT_EXIT=0xa3 [TRACE]TRACE_FLOW[0x8A]_DUP2_CALENMONTHGRID_ITEMACTIVATED_EXIT=0xb4 -[TRACE]TRACE_FLOW[0x8A]_DUP2_CALENPREVIEWPANE_GESTUREEVENT_EXIT=0x162 +[TRACE]TRACE_FLOW[0x8A]_DUP2_CALENPREVIEWPANE_GESTUREEVENT_EXIT=0x181 [TRACE]TRACE_FLOW[0x8A]_DUP3_CALENMONTHGRID_GESTUREEVENT_EXIT=0xa4 +[TRACE]TRACE_FLOW[0x8A]_DUP3_CALENPREVIEWPANE_GESTUREEVENT_EXIT=0x182 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_DUP2_CALENPREVIEWPANE_GESTUREEVENT_EXIT=0x162 diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clock.pro --- a/clock/clock.pro Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clock.pro Wed Aug 25 14:02:13 2010 +0530 @@ -29,8 +29,7 @@ "./rom/clockengines.iby CORE_APP_LAYER_IBY_EXPORT_PATH(clockengines.iby)" \ "./rom/clockresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(clockresources.iby)" \ \ - "./conf/clockapp.confml APP_LAYER_CONFML(clockapp.confml)" \ - "./conf/CI_clockapp.confml APP_LAYER_CONFML(CI_clockapp.confml)" \ + "./conf/clockapp.confml APP_LAYER_CONFML(clockapp.confml)" \ "./conf/clockapp_101F874D.crml APP_LAYER_CRML(clockapp_101F874D.crml)" \ "./conf/clockapp_101F8876.crml APP_LAYER_CRML(clockapp_101F8876.crml)" \ # stubsis is added to provide IAD diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp --- a/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -362,6 +362,9 @@ // Check if the Alarm days item is added. // Remove if already added. if (mAlarmDayItemInserted) { + mAlarmEditorForm->removeConnection( + mAlarmDayItem, SIGNAL(currentIndexChanged(int)), + this, SLOT(handleDayChanged(int))); mAlarmEditorModel->removeItem(mAlarmDayItem); mAlarmDayItemInserted = false; } @@ -524,7 +527,8 @@ editor->setSelection(0, 0); if (editor->text().isEmpty()) { - editor->setText(hbTrId("txt_clk_formlabel_val_alarm")); + mAlarmDescription->setContentWidgetData( + "text", hbTrId("txt_clk_formlabel_val_alarm")); } } diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsplugin.h --- a/clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsplugin.h Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsplugin.h Wed Aug 25 14:02:13 2010 +0530 @@ -23,9 +23,11 @@ // System includes #include -// User includes +// User includes. #include +// Forward class declartion. +class HbTranslator; class DateTimeSettingsPlugin : public QObject, public CpPluginInterface { Q_OBJECT @@ -37,6 +39,9 @@ virtual int uid() const; QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; + +private: + HbTranslator *mTranslator; }; #endif /* DATETIMESETTINGSPLUGIN_H_ */ diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsview.h --- a/clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsview.h Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsview.h Wed Aug 25 14:02:13 2010 +0530 @@ -25,6 +25,7 @@ // Forward declarations class QTimer; class TimezoneClient; +class HbTranslator; class DateTimeSettingsView : public CpSettingFormEntryItemData { @@ -34,7 +35,8 @@ CpItemDataHelper &itemDataHelper, const QString &text = QString(), const QString &description = QString(), const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0); + const HbDataFormModelItem *parent = 0, + HbTranslator *translator = 0); virtual ~DateTimeSettingsView(); private slots: @@ -47,6 +49,7 @@ private: QTimer *mTickTimer; TimezoneClient *mTimezoneClient; + HbTranslator *mTranslator; }; diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsplugin.cpp --- a/clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsplugin.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsplugin.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -19,6 +19,7 @@ #include #include #include +#include // User includes #include "datetimesettingsplugin.h" @@ -35,6 +36,8 @@ DateTimeSettingsPlugin::DateTimeSettingsPlugin() { OstTraceFunctionEntry0( DATETIMESETTINGSPLUGIN_DATETIMESETTINGSPLUGIN_ENTRY ); + mTranslator = new HbTranslator("clocksettingsview"); + mTranslator->loadCommon(); OstTraceFunctionExit0( DATETIMESETTINGSPLUGIN_DATETIMESETTINGSPLUGIN_EXIT ); } @@ -44,6 +47,10 @@ DateTimeSettingsPlugin::~DateTimeSettingsPlugin() { OstTraceFunctionEntry0( DUP1_DATETIMESETTINGSPLUGIN_DATETIMESETTINGSPLUGIN_ENTRY ); + if(mTranslator) { + delete mTranslator; + mTranslator = 0; + } OstTraceFunctionExit0( DUP1_DATETIMESETTINGSPLUGIN_DATETIMESETTINGSPLUGIN_EXIT ); } @@ -66,7 +73,8 @@ CpItemDataHelper &itemDataHelper) const { OstTraceFunctionEntry0( DATETIMESETTINGSPLUGIN_CREATESETTINGFORMITEMDATA_ENTRY ); - HbIcon icon ; + HbIcon icon ; + HbExtendedLocale locale = HbExtendedLocale::system(); QString timeInfo = locale.format( QTime::currentTime(), r_qtn_time_usual_with_zero); @@ -79,8 +87,8 @@ QList entryItemList; CpSettingFormItemData *entryItem = new DateTimeSettingsView( - itemDataHelper,hbTrId("txt_cp_main_view_list_time_date"), - displayString,icon); + itemDataHelper, hbTrId("txt_cp_main_view_list_time_date"), + displayString,icon, 0, mTranslator); entryItemList.append(entryItem); OstTraceFunctionExit0( DATETIMESETTINGSPLUGIN_CREATESETTINGFORMITEMDATA_EXIT ); return entryItemList; diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsview.cpp --- a/clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsview.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsview.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -50,12 +50,13 @@ DateTimeSettingsView::DateTimeSettingsView( CpItemDataHelper &itemDataHelper, const QString &text, const QString &description, const HbIcon &icon, - const HbDataFormModelItem *parent): + const HbDataFormModelItem *parent, HbTranslator *translator): CpSettingFormEntryItemData( itemDataHelper, text, description, icon, parent) { OstTraceFunctionEntry0( DATETIMESETTINGSVIEW_DATETIMESETTINGSVIEW_ENTRY ); // Construct the timezone client. + mTranslator = translator; mTimezoneClient = TimezoneClient::getInstance(); connect( mTimezoneClient, SIGNAL(timechanged()), @@ -95,7 +96,7 @@ void DateTimeSettingsView::onLaunchView() { OstTraceFunctionEntry0( DATETIMESETTINGSVIEW_ONLAUNCHVIEW_ENTRY ); - ClockSettingsView *settingsView = new ClockSettingsView(this); + ClockSettingsView *settingsView = new ClockSettingsView(this, mTranslator, false); settingsView->loadSettingsView(); OstTraceFunctionExit0( DATETIMESETTINGSVIEW_ONLAUNCHVIEW_EXIT ); } diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/bwins/clocksettingsviewu.def --- a/clock/clockui/clocksettingsview/bwins/clocksettingsviewu.def Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/bwins/clocksettingsviewu.def Wed Aug 25 14:02:13 2010 +0530 @@ -1,8 +1,8 @@ EXPORTS - ??0ClockSettingsView@@QAE@PAVQObject@@@Z @ 1 NONAME ; ClockSettingsView::ClockSettingsView(class QObject *) - ??1ClockRegionalSettingsView@@UAE@XZ @ 2 NONAME ; ClockRegionalSettingsView::~ClockRegionalSettingsView(void) - ?loadSettingsView@ClockSettingsView@@QAEXXZ @ 3 NONAME ; void ClockSettingsView::loadSettingsView(void) - ??1ClockSettingsView@@UAE@XZ @ 4 NONAME ; ClockSettingsView::~ClockSettingsView(void) + ??1ClockRegionalSettingsView@@UAE@XZ @ 1 NONAME ; ClockRegionalSettingsView::~ClockRegionalSettingsView(void) + ?loadSettingsView@ClockSettingsView@@QAEXXZ @ 2 NONAME ; void ClockSettingsView::loadSettingsView(void) + ??1ClockSettingsView@@UAE@XZ @ 3 NONAME ; ClockSettingsView::~ClockSettingsView(void) + ??0ClockRegionalSettingsView@@QAE@PAVQObject@@_N@Z @ 4 NONAME ; ClockRegionalSettingsView::ClockRegionalSettingsView(class QObject *, bool) ?showView@ClockRegionalSettingsView@@QAEXXZ @ 5 NONAME ; void ClockRegionalSettingsView::showView(void) - ??0ClockRegionalSettingsView@@QAE@PAVQObject@@@Z @ 6 NONAME ; ClockRegionalSettingsView::ClockRegionalSettingsView(class QObject *) + ??0ClockSettingsView@@QAE@PAVQObject@@PAVHbTranslator@@_N@Z @ 6 NONAME ; ClockSettingsView::ClockSettingsView(class QObject *, class HbTranslator *, bool) diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/data/clocksettingsview.qrc --- a/clock/clockui/clocksettingsview/data/clocksettingsview.qrc Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/data/clocksettingsview.qrc Wed Aug 25 14:02:13 2010 +0530 @@ -3,4 +3,7 @@ xml/clocksettingsview.docml xml/clockregionalsettingsview.docml + + style/settingscustomitem.css + diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/data/style/settingscustomitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clocksettingsview/data/style/settingscustomitem.css Wed Aug 25 14:02:13 2010 +0530 @@ -0,0 +1,22 @@ +SettingsCustomItem[!hasIcon][expandItem]:landscape +{ + layout:layout_portrait_without_icon; +} + +SettingsCustomItem[hasIcon][expandItem]:landscape +{ + layout:layout_portrait_with_icon; +} + +SettingsCustomItem[expandItem]::dataItem_Label:landscape +{ + size-policy-horizontal:preferred; +} + +SettingsCustomItem[expandItem]::DataItem_ContentWidget:landscape +{ + top: -var(hb-param-margin-gene-top); + left:-var(hb-param-margin-gene-left); + right:var(hb-param-margin-gene-right); + bottom:var(hb-param-margin-gene-bottom); +} \ No newline at end of file diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/eabi/clocksettingsviewu.def --- a/clock/clockui/clocksettingsview/eabi/clocksettingsviewu.def Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/eabi/clocksettingsviewu.def Wed Aug 25 14:02:13 2010 +0530 @@ -1,13 +1,13 @@ EXPORTS _ZN17ClockSettingsView16loadSettingsViewEv @ 1 NONAME - _ZN17ClockSettingsViewC1EP7QObject @ 2 NONAME - _ZN17ClockSettingsViewC2EP7QObject @ 3 NONAME + _ZN17ClockSettingsViewC1EP7QObjectP12HbTranslatorb @ 2 NONAME + _ZN17ClockSettingsViewC2EP7QObjectP12HbTranslatorb @ 3 NONAME _ZN17ClockSettingsViewD0Ev @ 4 NONAME _ZN17ClockSettingsViewD1Ev @ 5 NONAME _ZN17ClockSettingsViewD2Ev @ 6 NONAME _ZN25ClockRegionalSettingsView8showViewEv @ 7 NONAME - _ZN25ClockRegionalSettingsViewC1EP7QObject @ 8 NONAME - _ZN25ClockRegionalSettingsViewC2EP7QObject @ 9 NONAME + _ZN25ClockRegionalSettingsViewC1EP7QObjectb @ 8 NONAME + _ZN25ClockRegionalSettingsViewC2EP7QObjectb @ 9 NONAME _ZN25ClockRegionalSettingsViewD0Ev @ 10 NONAME _ZN25ClockRegionalSettingsViewD1Ev @ 11 NONAME _ZN25ClockRegionalSettingsViewD2Ev @ 12 NONAME diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/inc/clockregionalsettingsview.h --- a/clock/clockui/clocksettingsview/inc/clockregionalsettingsview.h Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/inc/clockregionalsettingsview.h Wed Aug 25 14:02:13 2010 +0530 @@ -45,7 +45,7 @@ Q_OBJECT public: - CLOCKSETTINGSVIEW_EXPORT ClockRegionalSettingsView(QObject *parent = 0); + CLOCKSETTINGSVIEW_EXPORT ClockRegionalSettingsView(QObject *parent = 0, bool launchedByClock = 1); CLOCKSETTINGSVIEW_EXPORT virtual ~ClockRegionalSettingsView(); public: @@ -91,6 +91,7 @@ SettingsUtility *mSettingsUtility; SettingsCustomItem *mCustomPrototype; HbTranslator *mTranslator; + bool mLauncedByClock; }; #endif // CLOCKREGIONALSETTINGSVIEW_H diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/inc/clocksettingsview.h --- a/clock/clockui/clocksettingsview/inc/clocksettingsview.h Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/inc/clocksettingsview.h Wed Aug 25 14:02:13 2010 +0530 @@ -46,7 +46,8 @@ Q_OBJECT public: - CLOCKSETTINGSVIEW_EXPORT ClockSettingsView(QObject *parent = 0); + CLOCKSETTINGSVIEW_EXPORT ClockSettingsView(QObject *parent = 0, HbTranslator *translator = 0, + bool launchedByClock = 1); CLOCKSETTINGSVIEW_EXPORT virtual ~ClockSettingsView(); public: @@ -93,6 +94,7 @@ XQSettingsKey *mAlarmSnoozeTimeKey; QHash mAlarmSnoozeTimeHash; HbTranslator *mTranslator; + bool mLaunchedByClock; }; #endif // CLOCKSETTINGSVIEW_H diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/inc/settingscustomitem.h --- a/clock/clockui/clocksettingsview/inc/settingscustomitem.h Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/inc/settingscustomitem.h Wed Aug 25 14:02:13 2010 +0530 @@ -39,7 +39,7 @@ Q_OBJECT public: - SettingsCustomItem(QGraphicsItem *parent = 0); + SettingsCustomItem(QGraphicsItem *parent = 0, bool launchedByClock = 1); virtual ~SettingsCustomItem(); public: @@ -78,6 +78,7 @@ SettingsUtility *mSettingsUtility; ClockCitySelectionList *mCitySelectionList; TimezoneClient *mTimezoneClient; + bool mLaunchedByClock; }; #endif // SETTINGSCUSTOMITEM_H diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/inc/settingsdatatypes.h --- a/clock/clockui/clocksettingsview/inc/settingsdatatypes.h Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/inc/settingsdatatypes.h Wed Aug 25 14:02:13 2010 +0530 @@ -41,7 +41,8 @@ TimeItemOffset = 1, DateItemOffset, PlaceItemOffset, - RegionalItemOffset + RegionalItemOffset, + WorkdaysItemOffset }; #endif // CLOCKSETTINGSDATATYPES_H diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/src/clockregionalsettingsview.cpp --- a/clock/clockui/clocksettingsview/src/clockregionalsettingsview.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/src/clockregionalsettingsview.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -54,10 +54,11 @@ /*! Default constructor. */ -ClockRegionalSettingsView::ClockRegionalSettingsView(QObject *parent) +ClockRegionalSettingsView::ClockRegionalSettingsView(QObject *parent, bool launchedByClock) :QObject(parent), mView(0), - mLoader(0) + mLoader(0), + mLauncedByClock(launchedByClock) { OstTraceFunctionEntry0( CLOCKREGIONALSETTINGSVIEW_CLOCKREGIONALSETTINGSVIEW_ENTRY ); // Construct the document loader. @@ -142,6 +143,9 @@ createModel(); // Set the view as the current view. + if(!mLauncedByClock) { + mView->setTitle(hbTrId("txt_clock_title_control_panel")); + } HbMainWindow *window = hbInstance->allMainWindows().first(); window->addView(mView); window->setCurrentView(mView); @@ -437,7 +441,7 @@ HbDataFormModelItem::DataItemType workdaysItemType = static_cast - (HbDataFormModelItem::CustomItemBase + 50); + (HbDataFormModelItem::CustomItemBase + WorkdaysItemOffset); item = new HbDataFormModelItem(workdaysItemType, hbTrId("txt_clock_setlabel_workdays")); mFormModel->appendDataFormItem(item); diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/src/clocksettingsview.cpp --- a/clock/clockui/clocksettingsview/src/clocksettingsview.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/src/clocksettingsview.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -56,14 +56,16 @@ \param parent The parent of type QGraphicsWidget. */ -ClockSettingsView::ClockSettingsView(QObject *parent) -:QObject(parent) +ClockSettingsView::ClockSettingsView(QObject *parent, HbTranslator *translator, bool launchedByClock) +:QObject(parent), mTranslator(0), mLaunchedByClock(launchedByClock) { OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_CLOCKSETTINGSVIEW_ENTRY ); // Load the translation file and install the editor specific translator - mTranslator = new HbTranslator("clocksettingsview"); - mTranslator->loadCommon(); + if(!translator) { + mTranslator = new HbTranslator("clocksettingsview"); + mTranslator->loadCommon(); + } // Construct the settings utility. mSettingsUtility = new SettingsUtility(); @@ -292,6 +294,11 @@ void ClockSettingsView::setupView() { OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_SETUPVIEW_ENTRY ); + + if(!mLaunchedByClock) { + mSettingsView->setTitle(hbTrId("txt_clock_title_control_panel")); + } + HbMainWindow *window = hbInstance->allMainWindows().first(); window->addView(mSettingsView); window->setCurrentView(mSettingsView); @@ -309,7 +316,7 @@ // Create the custom prototype. QList prototypes = mSettingsForm->itemPrototypes(); - SettingsCustomItem *customPrototype = new SettingsCustomItem(mSettingsForm); + SettingsCustomItem *customPrototype = new SettingsCustomItem(mSettingsForm, mLaunchedByClock); prototypes.append(customPrototype); mSettingsForm->setItemPrototypes(prototypes); diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/src/settingscustomitem.cpp --- a/clock/clockui/clocksettingsview/src/settingscustomitem.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/src/settingscustomitem.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -28,6 +28,7 @@ #include #include #include +#include // User includes #include "settingscustomitem.h" @@ -54,14 +55,16 @@ \param parent The parent. */ -SettingsCustomItem::SettingsCustomItem(QGraphicsItem *parent) -:HbDataFormViewItem(parent) +SettingsCustomItem::SettingsCustomItem(QGraphicsItem *parent, bool launchedByClock) +:HbDataFormViewItem(parent), mLaunchedByClock(launchedByClock) { OstTraceFunctionEntry0( SETTINGSCUSTOMITEM_SETTINGSCUSTOMITEM_ENTRY ); // Construct the settignsutility. mSettingsUtility = new SettingsUtility(); // Construct the timezone client. mTimezoneClient = TimezoneClient::getInstance(); + // Register for the css. + HbStyleLoader::registerFilePath(":/style/settingscustomitem.css"); OstTraceFunctionExit0( SETTINGSCUSTOMITEM_SETTINGSCUSTOMITEM_EXIT ); } @@ -71,7 +74,8 @@ SettingsCustomItem::~SettingsCustomItem() { OstTraceFunctionEntry0( DUP1_SETTINGSCUSTOMITEM_SETTINGSCUSTOMITEM_ENTRY ); - // Nothing yet. + // Unregister the css. + HbStyleLoader::unregisterFilePath(":/style/settingscustomitem.css"); OstTraceFunctionExit0( DUP1_SETTINGSCUSTOMITEM_SETTINGSCUSTOMITEM_EXIT ); } @@ -185,6 +189,7 @@ switch (itemType) { case (TimeItemOffset + HbDataFormModelItem::CustomItemBase): { + setProperty("expandItem", false); mTimeWidget = new HbPushButton(this); connect( mTimeWidget, SIGNAL(clicked()), @@ -195,6 +200,7 @@ case (DateItemOffset + HbDataFormModelItem::CustomItemBase): { + setProperty("expandItem", false); mDateWidget = new HbPushButton(this); connect( mDateWidget, SIGNAL(clicked()), @@ -205,6 +211,7 @@ case (PlaceItemOffset + HbDataFormModelItem::CustomItemBase): { + setProperty("expandItem", false); mPlaceWidget = new HbPushButton(this); connect( mPlaceWidget, SIGNAL(clicked()), @@ -215,6 +222,7 @@ case (RegionalItemOffset + HbDataFormModelItem::CustomItemBase): { + setProperty("expandItem", false); mRegSettingsWidget = new HbPushButton(this); connect( mRegSettingsWidget, SIGNAL(clicked()), @@ -223,8 +231,11 @@ return mRegSettingsWidget; } - case (50 + HbDataFormModelItem::CustomItemBase): + case (WorkdaysItemOffset + HbDataFormModelItem::CustomItemBase): { + // Set the property so that the custom item layout + // will be the same for both portrait and landscape + setProperty("expandItem", true); mWorkdaysWidget = new HbListWidget(this); mWorkdaysWidget->setSelectionMode(HbAbstractItemView::MultiSelection); mWorkdaysWidget->setScrollDirections(0); @@ -424,7 +435,8 @@ { OstTraceFunctionEntry0( SETTINGSCUSTOMITEM_LAUNCHREGSETTINGSVIEW_ENTRY ); ClockRegionalSettingsView *view = - new ClockRegionalSettingsView(); + new ClockRegionalSettingsView(0, mLaunchedByClock); + connect(mTimezoneClient, SIGNAL(timechanged()), view, SLOT(updateWeekStartOn())); view->showView(); diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/traces/clocksettingsviewTraces.h --- a/clock/clockui/clocksettingsview/traces/clocksettingsviewTraces.h Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/traces/clocksettingsviewTraces.h Wed Aug 25 14:02:13 2010 +0530 @@ -38,6 +38,8 @@ #define CLOCKSETTINGSVIEW_HANDLECLOCKTYPECHANGED_EXIT 0x8a003f #define CLOCKSETTINGSVIEW_EVENTMONITOR_ENTRY 0x8a0040 #define CLOCKSETTINGSVIEW_EVENTMONITOR_EXIT 0x8a0041 +#define CLOCKSETTINGSVIEW_GETVIEW_ENTRY 0x8a0064 +#define CLOCKSETTINGSVIEW_GETVIEW_EXIT 0x8a0065 #endif diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clocksettingsview/traces/fixed_id.definitions --- a/clock/clockui/clocksettingsview/traces/fixed_id.definitions Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clocksettingsview/traces/fixed_id.definitions Wed Aug 25 14:02:13 2010 +0530 @@ -35,6 +35,8 @@ [TRACE]TRACE_FLOW[0x8A]_CLOCKSETTINGSVIEW_CREATEMODEL_EXIT=0x37 [TRACE]TRACE_FLOW[0x8A]_CLOCKSETTINGSVIEW_EVENTMONITOR_ENTRY=0x40 [TRACE]TRACE_FLOW[0x8A]_CLOCKSETTINGSVIEW_EVENTMONITOR_EXIT=0x41 +[TRACE]TRACE_FLOW[0x8A]_CLOCKSETTINGSVIEW_GETVIEW_ENTRY=0x64 +[TRACE]TRACE_FLOW[0x8A]_CLOCKSETTINGSVIEW_GETVIEW_EXIT=0x65 [TRACE]TRACE_FLOW[0x8A]_CLOCKSETTINGSVIEW_HANDLEALARMSNOOZETIMECHANGED_ENTRY=0x3c [TRACE]TRACE_FLOW[0x8A]_CLOCKSETTINGSVIEW_HANDLEALARMSNOOZETIMECHANGED_EXIT=0x3d [TRACE]TRACE_FLOW[0x8A]_CLOCKSETTINGSVIEW_HANDLEAUTOTIMEUPDATECHANGE_ENTRY=0x3a diff -r bb2d3e476f29 -r a3cb48f6c889 clock/clockui/clockviewmanager/src/clockviewmanager.cpp --- a/clock/clockui/clockviewmanager/src/clockviewmanager.cpp Mon Aug 09 18:30:52 2010 +0530 +++ b/clock/clockui/clockviewmanager/src/clockviewmanager.cpp Wed Aug 25 14:02:13 2010 +0530 @@ -161,6 +161,7 @@ // Find the main view. mMainView = static_cast ( docLoader->findWidget(CLOCK_MAIN_VIEW)); + mMainView->setParent(this); // Disable animation effect on toolbar. HbEffect::disable(mMainView->toolBar()->graphicsItem()); @@ -190,6 +191,7 @@ // Get the world list view. mWorldClockView = static_cast ( docLoader->findWidget(CLOCK_WORLD_VIEW)); + mWorldClockView->setParent(this); // Disable animation effect on toolbar. HbEffect::disable(mWorldClockView->toolBar()->graphicsItem()); diff -r bb2d3e476f29 -r a3cb48f6c889 clock/conf/CI_clockapp.confml Binary file clock/conf/CI_clockapp.confml has changed