# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273841469 -10800 # Node ID a949c2543c150849615484c2e0b3a15408604fcc # Parent fd30d51f876b61e2db6cb2f2af4ace02d7a16684 Revision: 201017 Kit: 201019 diff -r fd30d51f876b -r a949c2543c15 agendainterface/agendautil/inc/agendautil.h --- a/agendainterface/agendautil/inc/agendautil.h Mon May 03 12:30:32 2010 +0300 +++ b/agendainterface/agendautil/inc/agendautil.h Fri May 14 15:51:09 2010 +0300 @@ -120,6 +120,8 @@ void entryDeleted(ulong id); void entryUpdated(ulong id); void entriesDeleted(int status); + void entryViewCreationCompleted(int status); + void instanceViewCreationCompleted(int status); private: friend class AgendaUtilPrivate; diff -r fd30d51f876b -r a949c2543c15 agendainterface/agendautil/src/agendautil_p.cpp --- a/agendainterface/agendautil/src/agendautil_p.cpp Mon May 03 12:30:32 2010 +0300 +++ b/agendainterface/agendautil/src/agendautil_p.cpp Fri May 14 15:51:09 2010 +0300 @@ -108,70 +108,24 @@ delete filter; } - /* - // If view creation is in progress, then wait till it gets completed - if((iCalEntryView && !mEntryViewCreated) - || (iCalInstanceView && !mInstanceViewCreated)) - { - if(!iWait) - { - TRAP(iError, iWait = new (ELeave) CActiveSchedulerWait;); - if(!iWait->IsStarted()) - { - iWait->Start(); - } - } + // First construct the CCalInstanceView if not already available. + // The CCalEntryView is constructed in CompletedL. Instance view + // is created before entry view since entry view is required only + // when editing/saving any entry. So we will construct it later + if (!iCalInstanceView) { + TRAP (iError, iCalInstanceView = CCalInstanceView::NewL(*iCalSession, + *this);) } - */ - - // First construct the CCalEntryView if not already available. - // The CCalInstanceView is constructed in ::CompletedL. We block the - // thread here until everything is setup. - if (!iCalEntryView) - { - TRAP( - iError, - iCalEntryView = CCalEntryView::NewL(*iCalSession, *this); - ); - if (!iWait) - { - TRAP( - iError, - iWait = new (ELeave) CActiveSchedulerWait; - ) - if (!iWait->IsStarted()) - { - iWait->Start(); - } - } - } - - // Comes here only when timer is expired, hence one more - // check is needed here. - if (iCalSession && mEntryViewCreated && mInstanceViewCreated) - { - // Everything is ready. - return true; - } - - else - { - return false; - } + + // All the requests have been made + return true; } AgendaUtilPrivate::~AgendaUtilPrivate() { delete iCalEntryView; delete iCalInstanceView; - if (iWait && iWait->IsStarted()) - { - iWait->AsyncStop(); - } - - delete iWait; - if (iCalSession) - { + if (iCalSession) { iCalSession->StopChangeNotification(); } delete iCalSession; @@ -188,39 +142,33 @@ emit q->entriesDeleted(iError); } - if(KErrNone != iError) - { + if (KErrNone != iError) { // Something has gone wrong, return + if (iCalEntryView) { delete iCalEntryView; iCalEntryView = NULL; + } + if (iCalInstanceView) { delete iCalInstanceView; iCalInstanceView = NULL; + } return; } - if(iCalEntryView && !mEntryViewCreated) - { - mEntryViewCreated = true; - - // Start creating the instance view. - if(!iCalInstanceView) - { - TRAP(iError, iCalInstanceView = CCalInstanceView::NewL( - *iCalSession, *this);) + if (iCalInstanceView && !mInstanceViewCreated) { + // Instance view is now created. + mInstanceViewCreated = true; + emit q->instanceViewCreationCompleted(iError); + // Start with the construction of entry view + if (!iCalEntryView) { + TRAP (iError, + iCalEntryView = CCalEntryView::NewL(*iCalSession, *this); + ); } - } - else if(iCalInstanceView && !mInstanceViewCreated) - { - mInstanceViewCreated = true; - } - - // Stop the wait timer - if( iWait && iWait->IsStarted()) - { - if(mEntryViewCreated && mInstanceViewCreated) - { - iWait->AsyncStop(); - } + } else if(iCalEntryView && !mEntryViewCreated) { + // Entry view is now constructed + mEntryViewCreated = true; + emit q->entryViewCreationCompleted(iError); } } @@ -248,7 +196,7 @@ int success = 0; // First check if the session to the calendar database is prepared or not. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Something went wrong return localUid; } @@ -309,7 +257,7 @@ dtStamp.time().minute(), 0, 0); TTime creationTTime(creationDateTime); creationCalTime.SetTimeLocalL(creationTTime); - //newEntry->SetDTStampL(creationCalTime); + newEntry->SetDTStampL(creationCalTime); // Finally set the entry to the database using the entry view. entryArray.AppendL(newEntry); @@ -467,7 +415,7 @@ const AgendaEntry &entry, AgendaEntry::Type type) { // First prepare the session with agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Something went wrong. return 0; } @@ -671,7 +619,7 @@ bool AgendaUtilPrivate::deleteEntry(ulong id) { // First prepare the session with agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Something went wrong. return false; } @@ -709,7 +657,7 @@ qDebug("AgendaUtilPrivate::deleteRepeatedEntry"); // First prepare the session with agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Something went wrong. return; } @@ -766,7 +714,7 @@ bool AgendaUtilPrivate::updateEntry(const AgendaEntry& entry, bool isChild) { // First prepare the session with agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Something went wrong. return false; } @@ -1033,7 +981,7 @@ bool copyToChildren) { // First prepare the session with agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Something went wrong. return false; } @@ -1203,7 +1151,7 @@ { // First prepare the session with agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Something went wrong. return false; } @@ -1464,7 +1412,7 @@ AgendaEntry entry; // First check if the session with the calendar exists. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Return empty AgendaEntry. return entry; } @@ -1500,7 +1448,7 @@ QList listOfIds; // First check if the session with agenda server exists. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Return empty list. return listOfIds; } @@ -1561,7 +1509,7 @@ QList entryList; // First check if the session with agenda server exists. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Return empty list. return entryList; } @@ -1619,7 +1567,7 @@ AgendaUtil::FilterFlags filter) { QList entryList; - if(!prepareSession()) + if(!mInstanceViewCreated) { // return empty list return entryList; @@ -1676,6 +1624,12 @@ QDateTime rangeEnd,AgendaUtil::FilterFlags filter, QList& dates) { RPointerArray instanceList; + + if(!mInstanceViewCreated) { + // return empty list + return; + } + CleanupClosePushL(instanceList); CalCommon::TCalViewFilter filters = filter; TCalTime startDateForInstanceSearch; @@ -1757,7 +1711,7 @@ AgendaUtil::FilterFlags filter ) { QList entryList; - if(!prepareSession()) { + if(!mInstanceViewCreated) { // return empty list return entryList; } @@ -1833,7 +1787,7 @@ int success = -1 ; // First prepare the session with agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { return success; } @@ -1886,7 +1840,7 @@ const QString& fileName, ulong calendarEntryId) { // First prepare session with agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { return false; } TRAP( @@ -2022,7 +1976,7 @@ { AgendaEntry parentEntry; // First check if the session with the calendar exists. - if (!prepareSession()) { + if (!mInstanceViewCreated) { // Return empty AgendaEntry. return entry; } @@ -2458,6 +2412,11 @@ */ bool AgendaUtilPrivate::areNoEntriesInCalendar() { + // First prepare the session with the agenda server. + if (!mInstanceViewCreated) { + return false; + } + bool isEmpty; // Query for the entries for entire range RPointerArray instanceList; @@ -2846,7 +2805,7 @@ const QList& attendees, CCalEntry& entry) { // First prepare the session with the agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { return false; } @@ -2878,7 +2837,7 @@ const QList& categories, CCalEntry& entry) { // First prepare the session with the agenda server. - if (!prepareSession()) { + if (!mInstanceViewCreated) { return false; } TRAP( @@ -2984,7 +2943,7 @@ CCalInstance* AgendaUtilPrivate::findPossibleInstance(AgendaEntry& entry) { - if(!prepareSession()) { + if(!mInstanceViewCreated) { // return empty list return NULL; } diff -r fd30d51f876b -r a949c2543c15 agendainterface/bwins/agendainterfaceu.def --- a/agendainterface/bwins/agendainterfaceu.def Mon May 03 12:30:32 2010 +0300 +++ b/agendainterface/bwins/agendainterfaceu.def Fri May 14 15:51:09 2010 +0300 @@ -178,4 +178,6 @@ ?setRecurrenceId@AgendaEntry@@QAEXAAVQDateTime@@@Z @ 177 NONAME ; void AgendaEntry::setRecurrenceId(class QDateTime &) ?isNull@AgendaGeoValue@@QBE_NXZ @ 178 NONAME ; bool AgendaGeoValue::isNull(void) const ?areNoEntriesInCalendar@AgendaUtil@@QAE_NXZ @ 179 NONAME ; bool AgendaUtil::areNoEntriesInCalendar(void) + ?entryViewCreationCompleted@AgendaUtil@@IAEXH@Z @ 180 NONAME ; void AgendaUtil::entryViewCreationCompleted(int) + ?instanceViewCreationCompleted@AgendaUtil@@IAEXH@Z @ 181 NONAME ; void AgendaUtil::instanceViewCreationCompleted(int) diff -r fd30d51f876b -r a949c2543c15 agendainterface/eabi/agendainterfaceu.def --- a/agendainterface/eabi/agendainterfaceu.def Mon May 03 12:30:32 2010 +0300 +++ b/agendainterface/eabi/agendainterfaceu.def Fri May 14 15:51:09 2010 +0300 @@ -206,4 +206,6 @@ _ZTV14AgendaAttendee @ 205 NONAME _ZTV14AgendaCategory @ 206 NONAME _ZN10AgendaUtil22areNoEntriesInCalendarEv @ 207 NONAME + _ZN10AgendaUtil26entryViewCreationCompletedEi @ 208 NONAME + _ZN10AgendaUtil29instanceViewCreationCompletedEi @ 209 NONAME diff -r fd30d51f876b -r a949c2543c15 agendainterface/inc/agendautil.h --- a/agendainterface/inc/agendautil.h Mon May 03 12:30:32 2010 +0300 +++ b/agendainterface/inc/agendautil.h Fri May 14 15:51:09 2010 +0300 @@ -106,18 +106,22 @@ QDateTime& endTime); void getNextInstanceTimes(AgendaEntry& entry, QDateTime& startTime, QDateTime& endTime); - + void markDatesWithEvents(QDateTime rangeStart, QDateTime rangeEnd, + AgendaUtil::FilterFlags filter, QList& dates); + bool areNoEntriesInCalendar(); static QDateTime minTime(); static QDateTime maxTime(); - + static bool isWorkdaysRepeatingEntry(const AgendaRepeatRule& repeatRule); - + Q_SIGNALS: void entriesChanged(QList ids); void entryAdded(ulong id); void entryDeleted(ulong id); void entryUpdated(ulong id); void entriesDeleted(int status); + void entryViewCreationCompleted(int status); + void instanceViewCreationCompleted(int status); private: friend class AgendaUtilPrivate; diff -r fd30d51f876b -r a949c2543c15 alarmui/DataSrc/AlmAlert.rss --- a/alarmui/DataSrc/AlmAlert.rss Mon May 03 12:30:32 2010 +0300 +++ b/alarmui/DataSrc/AlmAlert.rss Fri May 14 15:51:09 2010 +0300 @@ -21,7 +21,7 @@ NAME ALRT #include -#include +#include #include "AlmAlertVariant.hrh" diff -r fd30d51f876b -r a949c2543c15 alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_calendar_unlocked.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_calendar_unlocked.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + diff -r fd30d51f876b -r a949c2543c15 alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_clock_unlocked.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_clock_unlocked.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_todo_unlocked.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/alarmui/alarmalertwidget/alarmalertplugin/data/xml/alarmalert_todo_unlocked.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 calendarui/agendaeventviewer/data/agendaeventviewer.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/agendaeventviewer/data/agendaeventviewer.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 calendarui/agendaeventviewer/data/agendaeventvieweritem.css --- a/calendarui/agendaeventviewer/data/agendaeventvieweritem.css Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/agendaeventviewer/data/agendaeventvieweritem.css Fri May 14 15:51:09 2010 +0300 @@ -1,3 +1,14 @@ + +AgendaEventViewerItem[leftPrimaryIconItem="true"]:portrait { + layout: layout-eventvieweritem-stretch; + fixed-width: var(hb-param-screen-width); +} + +AgendaEventViewerItem[leftPrimaryIconItem="true"]:landscape { + layout: layout-eventvieweritem-stretch; + fixed-width: var(hb-param-screen-width); +} + AgendaEventViewerItem:portrait { layout: layout-eventvieweritem; @@ -9,7 +20,16 @@ fixed-width: var(hb-param-screen-width); } -AgendaEventViewerItem::primaryIconItem { + +AgendaEventViewerItem::primaryLeftIconItem { + fixed-width:var(hb-param-graphic-size-primary-small); + fixed-height:var(hb-param-graphic-size-primary-small); + top: -var(hb-param-margin-gene-top); + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-middle-horizontal); +} + +AgendaEventViewerItem::primaryRightIconItem { fixed-width:var(hb-param-graphic-size-secondary); fixed-height:var(hb-param-graphic-size-secondary); top: -var(hb-param-margin-gene-top); @@ -20,6 +40,7 @@ fixed-width:var(hb-param-graphic-size-primary-small); fixed-height:var(hb-param-graphic-size-primary-small); left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-middle-horizontal); } AgendaEventViewerItem::primaryTextItem { @@ -28,7 +49,6 @@ text-align: left; top: -var(hb-param-margin-gene-top); right: var(hb-param-margin-gene-middle-horizontal); - } AgendaEventViewerItem::secondaryTextItem { @@ -37,7 +57,6 @@ text-align: left; top: -var(hb-param-margin-gene-middle-vertical); right: var(hb-param-margin-gene-right); - left: -var(hb-param-margin-gene-middle-horizontal); bottom: var(hb-param-margin-gene-bottom); } diff -r fd30d51f876b -r a949c2543c15 calendarui/agendaeventviewer/data/agendaeventvieweritem.widgetml --- a/calendarui/agendaeventviewer/data/agendaeventvieweritem.widgetml Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/agendaeventviewer/data/agendaeventvieweritem.widgetml Fri May 14 15:51:09 2010 +0300 @@ -16,4 +16,26 @@ - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r fd30d51f876b -r a949c2543c15 calendarui/agendaeventviewer/inc/agendaeventview.h --- a/calendarui/agendaeventviewer/inc/agendaeventview.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/agendaeventviewer/inc/agendaeventview.h Fri May 14 15:51:09 2010 +0300 @@ -71,7 +71,8 @@ void removeAllWidgets(); void addAllWidgets(); void showDeleteOccurencePopup(); - int showDeleteConfirmationQuery(); + void showDeleteConfirmationQuery(); + void getSubjectIcon(AgendaEntry::Type type, QString &subjectIcon); private slots: void markTodoStatus(); @@ -84,7 +85,7 @@ void handleNoteEditorClosed(bool status); void handleCalendarEditorClosed(); void handleDeleteOccurence(int index); - + void handleDeleteAction(); private: HbView *mViewer; diff -r fd30d51f876b -r a949c2543c15 calendarui/agendaeventviewer/inc/agendaeventvieweritem.h --- a/calendarui/agendaeventviewer/inc/agendaeventvieweritem.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/agendaeventviewer/inc/agendaeventvieweritem.h Fri May 14 15:51:09 2010 +0300 @@ -43,6 +43,8 @@ HbTextItem *mSecondaryText; HbIconItem *mPrimaryIcon; HbIconItem *mSecondaryIcon; + HbIconItem *mPrimaryRightIcon; + HbIconItem *mPrimaryLeftIcon; }; diff -r fd30d51f876b -r a949c2543c15 calendarui/agendaeventviewer/src/agendaeventview.cpp --- a/calendarui/agendaeventviewer/src/agendaeventview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/agendaeventviewer/src/agendaeventview.cpp Fri May 14 15:51:09 2010 +0300 @@ -64,6 +64,10 @@ //because HbLabel by default not displaying the actual size of image const int height = 128; const int width = 330; + +//This Property is use for setting a primary left icon +static const char *primaryLeftIconItem("leftPrimaryIconItem"); + /*! \class AgendaEventView. @@ -113,6 +117,9 @@ mSubjectWidget = qobject_cast ( mDocLoader->findWidget(AGENDA_EVENT_VIEWER_SUBJECT_WIDGET)); + //load layout that supports icon before subject label + mSubjectWidget->setProperty(primaryLeftIconItem,true); + mDateTimeWidget = qobject_cast ( mDocLoader->findWidget(AGENDA_EVENT_VIEWER_DATE_TIME_WIDGET)); @@ -228,7 +235,7 @@ } // Add softkey after adding view on window - mBackAction = new HbAction(Hb::BackAction); + mBackAction = new HbAction(Hb::BackNaviAction); mViewer->setNavigationAction(mBackAction); connect(mBackAction, SIGNAL(triggered()), this, SLOT(close())); @@ -383,11 +390,14 @@ mSubjectWidget->setEventViewerItemData(itemList, Qt::DisplayRole); - itemList.clear(); - QString priorityIcon(QString::null); - getPriorityIcon(mAgendaEntry.priority(), priorityIcon); - itemList.append(priorityIcon); - itemList.append(QString::null); + itemList.clear(); + QString priorityIcon(QString::null); + QString subjectIcon(QString::null); + getPriorityIcon(mAgendaEntry.priority(), priorityIcon); + getSubjectIcon(mAgendaEntry.type(),subjectIcon); + itemList.append(subjectIcon); + itemList.append(priorityIcon); + itemList.append(QString::null); mSubjectWidget->setEventViewerItemData(itemList, Qt::DecorationRole); @@ -410,7 +420,11 @@ QDateTime endDateTime = mAgendaEntry.endTime(); itemData.append(QString::null); + itemData.append(QString::null); itemData.append("qtg_small_calendar"); + + mDateTimeWidget->setProperty(primaryLeftIconItem, false); + mDateTimeWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); itemData.append(QString::null); @@ -492,7 +506,9 @@ qDebug() << "AgendaEventViewer: AgendaEventView::addLocationData -->"; QStringList itemData; itemData.append(QString::null); - itemData.append("qtg_small_location"); + itemData.append(QString::null); + itemData.append("qtg_small_location"); + mLocationWidget->setProperty(primaryLeftIconItem, false); mLocationWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); itemData.append(QString::null); @@ -518,7 +534,7 @@ { QIcon mapTileIcon(mMaptilePath); QPainter painter; - QPixmap baloon(HbIcon("qtg_small_location.svg").pixmap()); + QPixmap baloon(HbIcon("qtg_small_location").pixmap()); QPixmap map (mapTileIcon.pixmap(width,height)); //Display pin image in the center of maptile image painter.begin( &map ); @@ -549,14 +565,16 @@ qDebug() << "AgendaEventViewer: AgendaEventView::addReminderData -->"; QStringList itemData; itemData.append(QString::null); - itemData.append("qtg_small_reminder"); + itemData.append(QString::null); + itemData.append("qtg_small_reminder"); + mReminderWidget->setProperty(primaryLeftIconItem, false); mReminderWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); itemData.append(QString::null); itemData.append(alarmTimeText()); mReminderWidget->setEventViewerItemData(itemData, Qt::DisplayRole); qDebug() << "AgendaEventViewer: AgendaEventView::addReminderData <--"; -} + } /*! Add completed to-do data to Event viewer @@ -566,10 +584,11 @@ qDebug() << "AgendaEventViewer: AgendaEventView::addCompletedTodoData -->"; QStringList itemData; QString completedText; - HbExtendedLocale systemLocale = HbExtendedLocale::system();; - + HbExtendedLocale systemLocale = HbExtendedLocale::system();; + itemData.append(QString::null); itemData.append(QString::null); itemData.append(QString::null); + mReminderWidget->setProperty(primaryLeftIconItem, false); mReminderWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); completedText = systemLocale.format(mAgendaEntry.completedDateTime().date(), @@ -588,7 +607,9 @@ qDebug() << "AgendaEventViewer: AgendaEventView::addRepeatData -->"; QStringList itemData; itemData.append(QString::null); - itemData.append("qtg_mono_repeat.svg"); + itemData.append(QString::null); + itemData.append("qtg_mono_repeat.svg"); + mRepeatWidget->setProperty(primaryLeftIconItem, false); mRepeatWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); itemData.append(QString::null); @@ -606,6 +627,8 @@ QStringList itemData; itemData.append(QString::null); itemData.append(QString::null); + itemData.append(QString::null); + mDescriptionWidget->setProperty(primaryLeftIconItem, false); mDescriptionWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); itemData.append(hbTrId("txt_calendar_dblist_description")); @@ -859,10 +882,11 @@ void AgendaEventView::showDeleteOccurencePopup() { qDebug() - << "AgendaEventViewer: AgendaEventView::showDeleteOccurencePopup -->"; - HbDialog popUp; - popUp.setDismissPolicy(HbDialog::NoDismiss); - popUp.setTimeout(HbDialog::NoTimeout); + << "AgendaEventViewer: AgendaEventView::showDeleteOccurencePopup -->"; + HbDialog *popUp = new HbDialog(); + popUp->setDismissPolicy(HbDialog::NoDismiss); + popUp->setTimeout(HbDialog::NoTimeout); + popUp->setAttribute( Qt::WA_DeleteOnClose, true ); QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); HbWidget *deleteWidget = new HbWidget(mViewer); @@ -872,84 +896,94 @@ QStringList list; list << hbTrId("txt_calendar_info_this_occurrence_only") - << hbTrId("txt_calendar_info_all_occurences"); + << hbTrId("txt_calendar_info_all_occurences"); deleteButtonList->setItems(list); layout->addItem(deleteButtonList); - popUp.setContentWidget(deleteWidget); - popUp.setHeadingWidget(new HbLabel( - hbTrId("txt_calendar_title_delete_repeated_entry"))); + popUp->setContentWidget(deleteWidget); + popUp->setHeadingWidget(new HbLabel( + hbTrId("txt_calendar_title_delete_repeated_entry"))); connect(deleteButtonList, SIGNAL(itemSelected(int)), this, - SLOT(handleDeleteOccurence(int))); - connect(deleteButtonList, SIGNAL(itemSelected(int)), &popUp, SLOT(close())); + SLOT(handleDeleteOccurence(int))); + connect(deleteButtonList, SIGNAL(itemSelected(int)), popUp, SLOT(close())); - // Create secondary action - HbAction *cancelAction = new HbAction( - hbTrId("txt_calendar_button_softkey1_cancel")); - popUp.setSecondaryAction(cancelAction); - connect(cancelAction, SIGNAL(triggered()), &popUp, SLOT(close())); + popUp->addAction(new HbAction( + hbTrId("txt_calendar_button_softkey1_cancel"))); // Show the popup - popUp.exec(); + popUp->open(); qDebug() - << "AgendaEventViewer: AgendaEventView::showDeleteOccurencePopup <--"; + << "AgendaEventViewer: AgendaEventView::showDeleteOccurencePopup <--"; } - /*! - * Show delete confirmation query + Show delete confirmation query */ -int AgendaEventView::showDeleteConfirmationQuery() -{ - qDebug() - << "AgendaEventViewer: AgendaEventView::showDeleteConfirmationQuery -->"; - int retStatus = 0; +void AgendaEventView::showDeleteConfirmationQuery() + { + qDebug() + << "AgendaEventViewer: AgendaEventView::showDeleteConfirmationQuery -->"; + + HbMessageBox *popup = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + popup->setDismissPolicy(HbDialog::NoDismiss); + popup->setTimeout(HbDialog::NoTimeout); + popup->setAttribute( Qt::WA_DeleteOnClose, true ); - HbMessageBox popup(HbMessageBox::MessageTypeQuestion); - popup.setDismissPolicy(HbDialog::NoDismiss); - popup.setTimeout(HbDialog::NoTimeout); - popup.setIconVisible(true); - - QString text = 0; + QString text = 0; - switch (mAgendaEntry.type()) { - case AgendaEntry::TypeAppoinment: - case AgendaEntry::TypeEvent: { - text.append(hbTrId("txt_calendar_info_delete_meeting")); - break; - } - case AgendaEntry::TypeAnniversary: { - text.append(hbTrId("txt_calendar_info_delete_anniversary")); - break; - } - case AgendaEntry::TypeTodo: { - text.append(hbTrId("txt_calendar_info_delete_todo_note")); - break; - } - case AgendaEntry::TypeNote: { - text.append(hbTrId("txt_calendar_info_delete_anniversary")); - break; - } - } + switch (mAgendaEntry.type()) { + case AgendaEntry::TypeAppoinment: + case AgendaEntry::TypeEvent: { + text.append(hbTrId("txt_calendar_info_delete_meeting")); + break; + } + case AgendaEntry::TypeAnniversary: { + text.append(hbTrId("txt_calendar_info_delete_anniversary")); + break; + } + case AgendaEntry::TypeTodo: { + text.append(hbTrId("txt_calendar_info_delete_todo_note")); + break; + } + case AgendaEntry::TypeNote: { + text.append(hbTrId("txt_calendar_info_delete_anniversary")); + break; + } + } + popup->setText(text); + + QList list = popup->actions(); + for(int i=0; i < list.count(); i++) + { + popup->removeAction(list[i]); + } + HbAction *deleteAction = + new HbAction(hbTrId("txt_calendar_button_delete"), popup); + popup->addAction(deleteAction); + connect(deleteAction, SIGNAL(triggered()), this , + SLOT(handleDeleteAction())); + popup->addAction(new HbAction(hbTrId("txt_calendar_button_cancel"), popup)); + popup->open(); + qDebug() + << "AgendaEventViewer: AgendaEventView::showDeleteConfirmationQuery <--"; +} - popup.setText(text); - - popup.setPrimaryAction(new HbAction( - hbTrId("txt_calendar_button_delete"), &popup)); - popup.setSecondaryAction(new HbAction( - hbTrId("txt_calendar_button_cancel"), &popup)); - HbAction *selected = popup.exec(); - if (selected == popup.primaryAction()) { - retStatus = 1; - } +/*! + Handles the delete action + */ +void AgendaEventView::handleDeleteAction() + { + // If delete button is pressed delete the entry + // To notify client that deleting Started + // Calendar Application changing state from viewing to deleting. + mOwner->deletingStarted(); - qDebug() - << "AgendaEventViewer: AgendaEventView::showDeleteConfirmationQuery <--"; - return retStatus; + // Delete the entry. + mOwner->mAgendaUtil->deleteEntry(mAgendaEntry.id()); } /*! @@ -1038,15 +1072,7 @@ // Query user if he wants to delete whole series or just this occurence showDeleteOccurencePopup(); } else { - if (showDeleteConfirmationQuery()) { - - // To notify client that deleting Started - // Calendar Application changing state from viewing to deleting. - mOwner->deletingStarted(); - - // Delete the entry. - mOwner->mAgendaUtil->deleteEntry(mAgendaEntry.id()); - } + showDeleteConfirmationQuery(); } qDebug() << "AgendaEventViewer: AgendaEventView::deleteAgendaEntry <--"; @@ -1216,4 +1242,38 @@ qDebug() << "AgendaEventViewer: AgendaEventView::handleDeleteOccurence <--"; } +/*! + Returns subject icon + */ +void AgendaEventView::getSubjectIcon(AgendaEntry::Type type, QString &subjectIcon) + { + qDebug() << "AgendaEventViewer: AgendaEventView::getSubjectIcon -->"; + switch(type) { + case AgendaEntry::TypeAppoinment: + { + subjectIcon.append("qtg_small_favorite");//@to do add proper icon + } + break; + case AgendaEntry::TypeTodo: + { + subjectIcon.append("qtg_small_todo"); + } + break; + case AgendaEntry::TypeEvent: + { + subjectIcon.append("qtg_small_allday");//@ TODO add proper icon + } + break; + case AgendaEntry::TypeAnniversary: + { + subjectIcon.append("qtg_small_anniversary"); + } + break; + default: + break; + } + + qDebug() << "AgendaEventViewer: AgendaEventView::getSubjectIcon <--"; + } + // End of file diff -r fd30d51f876b -r a949c2543c15 calendarui/agendaeventviewer/src/agendaeventvieweritem.cpp --- a/calendarui/agendaeventviewer/src/agendaeventvieweritem.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/agendaeventviewer/src/agendaeventvieweritem.cpp Fri May 14 15:51:09 2010 +0300 @@ -40,7 +40,8 @@ */ AgendaEventViewerItem::AgendaEventViewerItem(QGraphicsItem *parent) : HbWidget(parent), mPrimaryText(NULL), mSecondaryText(NULL), - mPrimaryIcon(NULL), mSecondaryIcon(NULL) + mPrimaryIcon(NULL), mSecondaryIcon(NULL),mPrimaryRightIcon(NULL), + mPrimaryLeftIcon(NULL) { // Path for widgetml and css files. @@ -70,10 +71,15 @@ if (!itemData.isEmpty()) { QString firstItemData(QString::null); QString secondItemData(QString::null); - - if (itemData.count() == 2) { + QString thirdItemData(QString::null); + if (itemData.count() == 2) { + firstItemData = itemData.at(0); + secondItemData = itemData.at(1); + } + else if (itemData.count() == 3) { firstItemData = itemData.at(0); secondItemData = itemData.at(1); + thirdItemData = itemData.at(2); } else { firstItemData = itemData.at(0); } @@ -107,28 +113,43 @@ } } else { if (role == Qt::DecorationRole) { - if (!firstItemData.isEmpty()) { - if (!mPrimaryIcon) { - mPrimaryIcon = new HbIconItem(this); + if (!firstItemData.isEmpty()) { + if (!mPrimaryLeftIcon) { + mPrimaryLeftIcon = new HbIconItem(this); + } + HbStyle::setItemName(mPrimaryLeftIcon, "primaryLeftIconItem"); + mPrimaryLeftIcon->setVisible(true); + mPrimaryLeftIcon->setIconName(firstItemData); + + } else { + if (mPrimaryLeftIcon) { + HbStyle::setItemName(mPrimaryLeftIcon,""); + mPrimaryLeftIcon->setVisible(false); + } + + } + if (!secondItemData.isEmpty()) { + if (!mPrimaryRightIcon) { + mPrimaryRightIcon = new HbIconItem(this); } - HbStyle::setItemName(mPrimaryIcon, "primaryIconItem"); - mPrimaryIcon->setVisible(true); - mPrimaryIcon->setIconName(firstItemData); + HbStyle::setItemName(mPrimaryRightIcon, "primaryRightIconItem"); + mPrimaryRightIcon->setVisible(true); + mPrimaryRightIcon->setIconName(secondItemData); } else { - if (mPrimaryIcon) { - HbStyle::setItemName(mPrimaryIcon,""); - mPrimaryIcon->setVisible(false); + if (mPrimaryRightIcon) { + HbStyle::setItemName(mPrimaryRightIcon,""); + mPrimaryRightIcon->setVisible(false); } } - if (!secondItemData.isEmpty()) { + if (!thirdItemData.isEmpty()) { if (!mSecondaryIcon) { mSecondaryIcon = new HbIconItem(this); HbStyle::setItemName(mSecondaryIcon, "secondaryIconItem"); } - mSecondaryIcon->setIconName(secondItemData); + mSecondaryIcon->setIconName(thirdItemData); } else { if (mSecondaryIcon) { diff -r fd30d51f876b -r a949c2543c15 calendarui/application/src/main.cpp --- a/calendarui/application/src/main.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/application/src/main.cpp Fri May 14 15:51:09 2010 +0300 @@ -31,16 +31,12 @@ // Main window for providing the scene context HbMainWindow window; - window.setRenderHints( - QPainter::Antialiasing | QPainter::SmoothPixmapTransform); - window.setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate); //For translation, loading and installing translator QTranslator translator; QString lang = QLocale::system().name(); QString path = "Z:/resource/qt/translations/"; // TODO: Load the appropriate .qm file based on locale - //bool loaded = translator.load("calendar_" + lang, path); bool loaded = translator.load("calendar_en_GB",":/translations"); app.installTranslator(&translator); @@ -56,6 +52,7 @@ int retValue = app.exec(); // delete the controller + controller->ReleaseCustomisations(); controller->Release(); return retValue; diff -r fd30d51f876b -r a949c2543c15 calendarui/bwins/calencontrolleru.def --- a/calendarui/bwins/calencontrolleru.def Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/bwins/calencontrolleru.def Fri May 14 15:51:09 2010 +0300 @@ -24,4 +24,5 @@ ?OfferMenu@CCalenController@@QAEXPAVHbMenu@@@Z @ 23 NONAME ; void CCalenController::OfferMenu(class HbMenu *) ?RegisterForNotificationsL@CCalenController@@QAEXPAVMCalenNotificationHandler@@AAV?$RArray@W4TCalenNotification@@@@@Z @ 24 NONAME ; void CCalenController::RegisterForNotificationsL(class MCalenNotificationHandler *, class RArray &) ?NewServicesL@CCalenController@@UAEPAVMCalenServices@@XZ @ 25 NONAME ; class MCalenServices * CCalenController::NewServicesL(void) + ?ReleaseCustomisations@CCalenController@@QAEXXZ @ 26 NONAME ; void CCalenController::ReleaseCustomisations(void) diff -r fd30d51f876b -r a949c2543c15 calendarui/bwins/calenviewsu.def --- a/calendarui/bwins/calenviewsu.def Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/bwins/calenviewsu.def Fri May 14 15:51:09 2010 +0300 @@ -1,147 +1,154 @@ EXPORTS ?scrollingFinished@CalenPreviewPane@@QAEXXZ @ 1 NONAME ; void CalenPreviewPane::scrollingFinished(void) - ?setDate@CalenMonthView@@AAEXXZ @ 2 NONAME ; void CalenMonthView::setDate(void) - ?handleGridItemActivated@CalenMonthView@@QAEXXZ @ 3 NONAME ; void CalenMonthView::handleGridItemActivated(void) - ?setFocusToProperDay@CalenMonthGrid@@AAEXXZ @ 4 NONAME ; void CalenMonthGrid::setFocusToProperDay(void) - ??1CalenPreviewPane@@UAE@XZ @ 5 NONAME ; CalenPreviewPane::~CalenPreviewPane(void) - ?mousePressEvent@CalenMonthGrid@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 6 NONAME ; void CalenMonthGrid::mousePressEvent(class QGraphicsSceneMouseEvent *) - ?completePopulation@CalenMonthView@@AAEXXZ @ 7 NONAME ; void CalenMonthView::completePopulation(void) - ?handleChangeOrientation@CalenMonthView@@AAEXXZ @ 8 NONAME ; void CalenMonthView::handleChangeOrientation(void) - ?staticMetaObject@CalenSettingsView@@2UQMetaObject@@B @ 9 NONAME ; struct QMetaObject const CalenSettingsView::staticMetaObject - ?upGesture@CalenMonthGrid@@MAEXH@Z @ 10 NONAME ; void CalenMonthGrid::upGesture(int) - ?getStaticMetaObject@CalenSettingsView@@SAABUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const & CalenSettingsView::getStaticMetaObject(void) - ?updateMonthDataArrayWithActiveDates@CalenMonthView@@AAEXXZ @ 12 NONAME ; void CalenMonthView::updateMonthDataArrayWithActiveDates(void) - ?scrollingFinished@CalenMonthGrid@@QAEXXZ @ 13 NONAME ; void CalenMonthGrid::scrollingFinished(void) - ?setCurrentIdex@CalenMonthGrid@@QAEXH@Z @ 14 NONAME ; void CalenMonthGrid::setCurrentIdex(int) - ??_ECalenMonthGrid@@UAE@I@Z @ 15 NONAME ; CalenMonthGrid::~CalenMonthGrid(unsigned int) - ?trUtf8@CalenPreviewPane@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString CalenPreviewPane::trUtf8(char const *, char const *) - ?trUtf8@CalenMonthGrid@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString CalenMonthGrid::trUtf8(char const *, char const *) - ?populatePrevMonth@CalenMonthView@@QAEXXZ @ 18 NONAME ; void CalenMonthView::populatePrevMonth(void) - ?qt_metacall@CalenSettingsView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 19 NONAME ; int CalenSettingsView::qt_metacall(enum QMetaObject::Call, int, void * *) - ?handleLeftEffectCompleted@CalenMonthView@@AAEXABUEffectStatus@HbEffect@@@Z @ 20 NONAME ; void CalenMonthView::handleLeftEffectCompleted(struct HbEffect::EffectStatus const &) - ?getStaticMetaObject@CalenMonthGrid@@SAABUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const & CalenMonthGrid::getStaticMetaObject(void) - ?trUtf8@CalenSettingsView@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString CalenSettingsView::trUtf8(char const *, char const *, int) - ?qt_metacast@CalenMonthView@@UAEPAXPBD@Z @ 23 NONAME ; void * CalenMonthView::qt_metacast(char const *) - ?staticMetaObject@CalenMonthView@@2UQMetaObject@@B @ 24 NONAME ; struct QMetaObject const CalenMonthView::staticMetaObject - ?setupView@CalenMonthView@@QAEXPAVCalenDocLoader@@@Z @ 25 NONAME ; void CalenMonthView::setupView(class CalenDocLoader *) - ?metaObject@CalenMonthGrid@@UBEPBUQMetaObject@@XZ @ 26 NONAME ; struct QMetaObject const * CalenMonthGrid::metaObject(void) const - ?startAutoScroll@CalenPreviewPane@@QAEXXZ @ 27 NONAME ; void CalenPreviewPane::startAutoScroll(void) - ?setView@CalenMonthGrid@@QAEXPAVCalenMonthView@@@Z @ 28 NONAME ; void CalenMonthGrid::setView(class CalenMonthView *) - ?HandleNotification@CalenDayView@@UAEXW4TCalenNotification@@@Z @ 29 NONAME ; void CalenDayView::HandleNotification(enum TCalenNotification) - ?panGesture@CalenMonthGrid@@MAEXABVQPointF@@@Z @ 30 NONAME ; void CalenMonthGrid::panGesture(class QPointF const &) - ?mousePressEvent@CalenPreviewPane@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 31 NONAME ; void CalenPreviewPane::mousePressEvent(class QGraphicsSceneMouseEvent *) - ??1CalenSettingsView@@UAE@XZ @ 32 NONAME ; CalenSettingsView::~CalenSettingsView(void) - ?Date@CalenPreviewPane@@QAE?AVQDateTime@@XZ @ 33 NONAME ; class QDateTime CalenPreviewPane::Date(void) - ?tr@CalenPreviewPane@@SA?AVQString@@PBD0H@Z @ 34 NONAME ; class QString CalenPreviewPane::tr(char const *, char const *, int) - ?getInstanceList@CalenMonthView@@AAEXAAV?$QList@VAgendaEntry@@@@VQDateTime@@1@Z @ 35 NONAME ; void CalenMonthView::getInstanceList(class QList &, class QDateTime, class QDateTime) - ?metaObject@CalenMonthView@@UBEPBUQMetaObject@@XZ @ 36 NONAME ; struct QMetaObject const * CalenMonthView::metaObject(void) const - ??0CalenPreviewPane@@QAE@AAVMCalenServices@@PAVQGraphicsItem@@@Z @ 37 NONAME ; CalenPreviewPane::CalenPreviewPane(class MCalenServices &, class QGraphicsItem *) - ?mouseReleaseEvent@CalenPreviewPane@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 38 NONAME ; void CalenPreviewPane::mouseReleaseEvent(class QGraphicsSceneMouseEvent *) - ?rowsInPrevMonth@CalenMonthView@@QAEHXZ @ 39 NONAME ; int CalenMonthView::rowsInPrevMonth(void) - ?metaObject@CalenPreviewPane@@UBEPBUQMetaObject@@XZ @ 40 NONAME ; struct QMetaObject const * CalenPreviewPane::metaObject(void) const - ??0CalenDayView@@QAE@AAVMCalenServices@@@Z @ 41 NONAME ; CalenDayView::CalenDayView(class MCalenServices &) - ?populateNextMonth@CalenMonthView@@QAEXXZ @ 42 NONAME ; void CalenMonthView::populateNextMonth(void) - ?handleRightEffectCompleted@CalenMonthView@@AAEXABUEffectStatus@HbEffect@@@Z @ 43 NONAME ; void CalenMonthView::handleRightEffectCompleted(struct HbEffect::EffectStatus const &) - ?qt_metacast@CalenMonthGrid@@UAEPAXPBD@Z @ 44 NONAME ; void * CalenMonthGrid::qt_metacast(char const *) - ?firstDayOfGrid@CalenMonthView@@QAE?AVQDateTime@@XZ @ 45 NONAME ; class QDateTime CalenMonthView::firstDayOfGrid(void) - ?rowsInFutMonth@CalenMonthView@@QAEHXZ @ 46 NONAME ; int CalenMonthView::rowsInFutMonth(void) - ?getCurrGridIndex@CalenMonthView@@QAEHXZ @ 47 NONAME ; int CalenMonthView::getCurrGridIndex(void) - ?launchDayView@CalenMonthView@@QAEXXZ @ 48 NONAME ; void CalenMonthView::launchDayView(void) - ??1CalenDayViewWidget@@UAE@XZ @ 49 NONAME ; CalenDayViewWidget::~CalenDayViewWidget(void) - ??0CalenDayViewWidget@@QAE@AAVMCalenServices@@PAVCalenDocLoader@@@Z @ 50 NONAME ; CalenDayViewWidget::CalenDayViewWidget(class MCalenServices &, class CalenDocLoader *) - ?prependRows@CalenMonthGrid@@QAEXXZ @ 51 NONAME ; void CalenMonthGrid::prependRows(void) - ?orientationChanged@CalenMonthGrid@@MAEXW4Orientation@Qt@@@Z @ 52 NONAME ; void CalenMonthGrid::orientationChanged(enum Qt::Orientation) - ?handleGridItemLongPressed@CalenMonthView@@QAEXHAAVQPointF@@@Z @ 53 NONAME ; void CalenMonthView::handleGridItemLongPressed(int, class QPointF &) - ?qt_metacall@CalenPreviewPane@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 54 NONAME ; int CalenPreviewPane::qt_metacall(enum QMetaObject::Call, int, void * *) - ?trUtf8@CalenPreviewPane@@SA?AVQString@@PBD0H@Z @ 55 NONAME ; class QString CalenPreviewPane::trUtf8(char const *, char const *, int) - ??1CalenThickLinesDrawer@@UAE@XZ @ 56 NONAME ; CalenThickLinesDrawer::~CalenThickLinesDrawer(void) - ?setView@CalenPreviewPane@@QAEXPAVCalenMonthView@@@Z @ 57 NONAME ; void CalenPreviewPane::setView(class CalenMonthView *) - ??_ECalenMonthView@@UAE@I@Z @ 58 NONAME ; CalenMonthView::~CalenMonthView(unsigned int) - ?changeOrientation@CalenMonthView@@UAEXW4Orientation@Qt@@@Z @ 59 NONAME ; void CalenMonthView::changeOrientation(enum Qt::Orientation) - ?populatePreviewPane@CalenMonthView@@QAEXAAVQDateTime@@@Z @ 60 NONAME ; void CalenMonthView::populatePreviewPane(class QDateTime &) - ??0CalenSettingsView@@QAE@AAVMCalenServices@@PAVQGraphicsItem@@@Z @ 61 NONAME ; CalenSettingsView::CalenSettingsView(class MCalenServices &, class QGraphicsItem *) - ?updateModelWithPrevMonth@CalenMonthView@@QAEXXZ @ 62 NONAME ; void CalenMonthView::updateModelWithPrevMonth(void) - ?stopScrolling@CalenPreviewPane@@QAEXXZ @ 63 NONAME ; void CalenPreviewPane::stopScrolling(void) - ?addBackgroundFrame@CalenMonthView@@AAEXXZ @ 64 NONAME ; void CalenMonthView::addBackgroundFrame(void) - ?createGrid@CalenMonthView@@AAEXXZ @ 65 NONAME ; void CalenMonthView::createGrid(void) - ?tr@CalenPreviewPane@@SA?AVQString@@PBD0@Z @ 66 NONAME ; class QString CalenPreviewPane::tr(char const *, char const *) - ?getStaticMetaObject@CalenPreviewPane@@SAABUQMetaObject@@XZ @ 67 NONAME ; struct QMetaObject const & CalenPreviewPane::getStaticMetaObject(void) - ?launchPreviousView@CalenSettingsView@@AAEXXZ @ 68 NONAME ; void CalenSettingsView::launchPreviousView(void) - ?setCurrGridIndex@CalenMonthView@@QAEXH@Z @ 69 NONAME ; void CalenMonthView::setCurrGridIndex(int) - ?setDateToLabel@CalenMonthView@@AAEXXZ @ 70 NONAME ; void CalenMonthView::setDateToLabel(void) - ?addWeekNumbers@CalenMonthView@@AAEXXZ @ 71 NONAME ; void CalenMonthView::addWeekNumbers(void) - ?qt_metacall@CalenThickLinesDrawer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 72 NONAME ; int CalenThickLinesDrawer::qt_metacall(enum QMetaObject::Call, int, void * *) - ?setupView@CalenDayView@@QAEXPAVCalenDocLoader@@@Z @ 73 NONAME ; void CalenDayView::setupView(class CalenDocLoader *) - ??1CalenMonthView@@UAE@XZ @ 74 NONAME ; CalenMonthView::~CalenMonthView(void) - ?dateFromContext@CalenMonthView@@AAE?AVQDateTime@@ABVMCalenContext@@@Z @ 75 NONAME ; class QDateTime CalenMonthView::dateFromContext(class MCalenContext const &) - ?staticMetaObject@CalenMonthGrid@@2UQMetaObject@@B @ 76 NONAME ; struct QMetaObject const CalenMonthGrid::staticMetaObject - ?paint@CalenThickLinesDrawer@@EAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 77 NONAME ; void CalenThickLinesDrawer::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *) - ?trUtf8@CalenMonthGrid@@SA?AVQString@@PBD0H@Z @ 78 NONAME ; class QString CalenMonthGrid::trUtf8(char const *, char const *, int) - ?initializeForm@CalenSettingsView@@QAEXXZ @ 79 NONAME ; void CalenSettingsView::initializeForm(void) - ?tr@CalenMonthGrid@@SA?AVQString@@PBD0H@Z @ 80 NONAME ; class QString CalenMonthGrid::tr(char const *, char const *, int) - ?goToToday@CalenMonthView@@AAEXXZ @ 81 NONAME ; void CalenMonthView::goToToday(void) - ?trUtf8@CalenThickLinesDrawer@@SA?AVQString@@PBD0H@Z @ 82 NONAME ; class QString CalenThickLinesDrawer::trUtf8(char const *, char const *, int) - ?qt_metacast@CalenPreviewPane@@UAEPAXPBD@Z @ 83 NONAME ; void * CalenPreviewPane::qt_metacast(char const *) - ?docLoader@CalenDayView@@QAEPAVCalenDocLoader@@XZ @ 84 NONAME ; class CalenDocLoader * CalenDayView::docLoader(void) - ?getCurrentIndex@CalenMonthGrid@@QAEHXZ @ 85 NONAME ; int CalenMonthGrid::getCurrentIndex(void) - ?removeWeekNumbers@CalenMonthView@@AAEXXZ @ 86 NONAME ; void CalenMonthView::removeWeekNumbers(void) - ?tr@CalenSettingsView@@SA?AVQString@@PBD0H@Z @ 87 NONAME ; class QString CalenSettingsView::tr(char const *, char const *, int) - ?trUtf8@CalenMonthView@@SA?AVQString@@PBD0H@Z @ 88 NONAME ; class QString CalenMonthView::trUtf8(char const *, char const *, int) - ??0CalenMonthView@@QAE@AAVMCalenServices@@@Z @ 89 NONAME ; CalenMonthView::CalenMonthView(class MCalenServices &) - ?getStaticMetaObject@CalenThickLinesDrawer@@SAABUQMetaObject@@XZ @ 90 NONAME ; struct QMetaObject const & CalenThickLinesDrawer::getStaticMetaObject(void) - ?setNoEntriesLabel@CalenPreviewPane@@QAEXPAVHbLabel@@@Z @ 91 NONAME ; void CalenPreviewPane::setNoEntriesLabel(class HbLabel *) - ??0CalenThickLinesDrawer@@QAE@W4WidgetType@CalendarNamespace@@PAVQGraphicsItem@@@Z @ 92 NONAME ; CalenThickLinesDrawer::CalenThickLinesDrawer(enum CalendarNamespace::WidgetType, class QGraphicsItem *) - ?onLocaleChanged@CalenMonthView@@UAEXH@Z @ 93 NONAME ; void CalenMonthView::onLocaleChanged(int) - ?doPopulation@CalenMonthView@@UAEXXZ @ 94 NONAME ; void CalenMonthView::doPopulation(void) - ?tr@CalenMonthView@@SA?AVQString@@PBD0H@Z @ 95 NONAME ; class QString CalenMonthView::tr(char const *, char const *, int) - ?GetInstanceListL@CalenPreviewPane@@AAEXXZ @ 96 NONAME ; void CalenPreviewPane::GetInstanceListL(void) - ?tr@CalenMonthView@@SA?AVQString@@PBD0@Z @ 97 NONAME ; class QString CalenMonthView::tr(char const *, char const *) - ??0CalenMonthGrid@@QAE@PAVQGraphicsItem@@@Z @ 98 NONAME ; CalenMonthGrid::CalenMonthGrid(class QGraphicsItem *) - ?refreshViewOnGoToDate@CalenMonthView@@EAEXXZ @ 99 NONAME ; void CalenMonthView::refreshViewOnGoToDate(void) - ?appendRows@CalenMonthGrid@@QAEXXZ @ 100 NONAME ; void CalenMonthGrid::appendRows(void) - ?tr@CalenThickLinesDrawer@@SA?AVQString@@PBD0H@Z @ 101 NONAME ; class QString CalenThickLinesDrawer::tr(char const *, char const *, int) - ?mouseReleaseEvent@CalenMonthGrid@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 102 NONAME ; void CalenMonthGrid::mouseReleaseEvent(class QGraphicsSceneMouseEvent *) - ?getCurrentDay@CalenMonthView@@QAE?AVQDateTime@@XZ @ 103 NONAME ; class QDateTime CalenMonthView::getCurrentDay(void) - ?staticMetaObject@CalenPreviewPane@@2UQMetaObject@@B @ 104 NONAME ; struct QMetaObject const CalenPreviewPane::staticMetaObject - ?tr@CalenSettingsView@@SA?AVQString@@PBD0@Z @ 105 NONAME ; class QString CalenSettingsView::tr(char const *, char const *) - ?onTwoSecondsTimeout@CalenPreviewPane@@QAEXXZ @ 106 NONAME ; void CalenPreviewPane::onTwoSecondsTimeout(void) - ?timerExpired@CalenMonthGrid@@IAEXXZ @ 107 NONAME ; void CalenMonthGrid::timerExpired(void) - ?tr@CalenThickLinesDrawer@@SA?AVQString@@PBD0@Z @ 108 NONAME ; class QString CalenThickLinesDrawer::tr(char const *, char const *) - ?staticMetaObject@CalenThickLinesDrawer@@2UQMetaObject@@B @ 109 NONAME ; struct QMetaObject const CalenThickLinesDrawer::staticMetaObject - ?populateWithInstanceView@CalenMonthView@@AAEXXZ @ 110 NONAME ; void CalenMonthView::populateWithInstanceView(void) - ?trUtf8@CalenThickLinesDrawer@@SA?AVQString@@PBD0@Z @ 111 NONAME ; class QString CalenThickLinesDrawer::trUtf8(char const *, char const *) - ?downGesture@CalenMonthGrid@@MAEXH@Z @ 112 NONAME ; void CalenMonthGrid::downGesture(int) - ?populateLabel@CalenPreviewPane@@QAEXVQDateTime@@@Z @ 113 NONAME ; void CalenPreviewPane::populateLabel(class QDateTime) - ?doPopulation@CalenDayView@@UAEXXZ @ 114 NONAME ; void CalenDayView::doPopulation(void) - ??1CalenDayView@@UAE@XZ @ 115 NONAME ; CalenDayView::~CalenDayView(void) - ?updateModelWithFutureMonth@CalenMonthView@@QAEXXZ @ 116 NONAME ; void CalenMonthView::updateModelWithFutureMonth(void) - ?monthDataList@CalenMonthView@@QAE?AV?$QList@VCalenMonthData@@@@XZ @ 117 NONAME ; class QList CalenMonthView::monthDataList(void) - ?metaObject@CalenThickLinesDrawer@@UBEPBUQMetaObject@@XZ @ 118 NONAME ; struct QMetaObject const * CalenThickLinesDrawer::metaObject(void) const - ??1CalenMonthGrid@@UAE@XZ @ 119 NONAME ; CalenMonthGrid::~CalenMonthGrid(void) - ?updateWeekNumGridModel@CalenMonthView@@AAEXXZ @ 120 NONAME ; void CalenMonthView::updateWeekNumGridModel(void) - ?qt_metacast@CalenThickLinesDrawer@@UAEPAXPBD@Z @ 121 NONAME ; void * CalenThickLinesDrawer::qt_metacast(char const *) - ?prepareForPopulation@CalenMonthView@@AAEXXZ @ 122 NONAME ; void CalenMonthView::prepareForPopulation(void) - ?handlePreviewPaneGesture@CalenMonthView@@QAEX_N@Z @ 123 NONAME ; void CalenMonthView::handlePreviewPaneGesture(bool) - ?updateMonthGridModel@CalenMonthGrid@@QAEXAAV?$QList@VCalenMonthData@@@@H@Z @ 124 NONAME ; void CalenMonthGrid::updateMonthGridModel(class QList &, int) - ?setActiveDates@CalenMonthGrid@@AAEXVQDate@@@Z @ 125 NONAME ; void CalenMonthGrid::setActiveDates(class QDate) - ?trUtf8@CalenMonthView@@SA?AVQString@@PBD0@Z @ 126 NONAME ; class QString CalenMonthView::trUtf8(char const *, char const *) - ?setContextForActiveDay@CalenMonthView@@QAEXH@Z @ 127 NONAME ; void CalenMonthView::setContextForActiveDay(int) - ?trUtf8@CalenSettingsView@@SA?AVQString@@PBD0@Z @ 128 NONAME ; class QString CalenSettingsView::trUtf8(char const *, char const *) - ??_ECalenSettingsView@@UAE@I@Z @ 129 NONAME ; CalenSettingsView::~CalenSettingsView(unsigned int) - ??_ECalenThickLinesDrawer@@UAE@I@Z @ 130 NONAME ; CalenThickLinesDrawer::~CalenThickLinesDrawer(unsigned int) - ?metaObject@CalenSettingsView@@UBEPBUQMetaObject@@XZ @ 131 NONAME ; struct QMetaObject const * CalenSettingsView::metaObject(void) const - ?getStaticMetaObject@CalenMonthView@@SAABUQMetaObject@@XZ @ 132 NONAME ; struct QMetaObject const & CalenMonthView::getStaticMetaObject(void) - ?qt_metacast@CalenSettingsView@@UAEPAXPBD@Z @ 133 NONAME ; void * CalenSettingsView::qt_metacast(char const *) - ?tr@CalenMonthGrid@@SA?AVQString@@PBD0@Z @ 134 NONAME ; class QString CalenMonthGrid::tr(char const *, char const *) - ?qt_metacall@CalenMonthView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 135 NONAME ; int CalenMonthView::qt_metacall(enum QMetaObject::Call, int, void * *) - ?setActiveDay@CalenMonthView@@AAEXVQDateTime@@@Z @ 136 NONAME ; void CalenMonthView::setActiveDay(class QDateTime) - ?itemActivated@CalenMonthGrid@@QAEXABVQModelIndex@@@Z @ 137 NONAME ; void CalenMonthGrid::itemActivated(class QModelIndex const &) - ?qt_metacall@CalenMonthGrid@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 138 NONAME ; int CalenMonthGrid::qt_metacall(enum QMetaObject::Call, int, void * *) - ??_ECalenPreviewPane@@UAE@I@Z @ 139 NONAME ; CalenPreviewPane::~CalenPreviewPane(unsigned int) - ?createEditor@CalenMonthView@@AAEXXZ @ 140 NONAME ; void CalenMonthView::createEditor(void) - ?getActiveDay@CalenMonthView@@QAE?AVQDateTime@@XZ @ 141 NONAME ; class QDateTime CalenMonthView::getActiveDay(void) - ?showHideRegionalInformation@CalenMonthView@@AAEXXZ @ 142 NONAME ; void CalenMonthView::showHideRegionalInformation(void) - ?paint@CalenMonthGrid@@EAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 143 NONAME ; void CalenMonthGrid::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *) - ?mouseMoveEvent@CalenPreviewPane@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 144 NONAME ; void CalenPreviewPane::mouseMoveEvent(class QGraphicsSceneMouseEvent *) - ?addRemoveActionsInMenu@CalenMonthView@@AAEXXZ @ 145 NONAME ; void CalenMonthView::addRemoveActionsInMenu(void) + ?fetchEntriesAndUpdateModel@CalenMonthView@@QAEXXZ @ 2 NONAME ; void CalenMonthView::fetchEntriesAndUpdateModel(void) + ?setDate@CalenMonthView@@AAEXXZ @ 3 NONAME ; void CalenMonthView::setDate(void) + ?showHideRegionalInformation@CalenMonthView@@AAEXXZ @ 4 NONAME ; void CalenMonthView::showHideRegionalInformation(void) + ?updateMonthGridWithEventIndicators@CalenMonthGrid@@QAEXAAV?$QList@VCalenMonthData@@@@@Z @ 5 NONAME ; void CalenMonthGrid::updateMonthGridWithEventIndicators(class QList &) + ?handleGridItemActivated@CalenMonthView@@QAEXXZ @ 6 NONAME ; void CalenMonthView::handleGridItemActivated(void) + ?setFocusToProperDay@CalenMonthGrid@@AAEXXZ @ 7 NONAME ; void CalenMonthGrid::setFocusToProperDay(void) + ??1CalenPreviewPane@@UAE@XZ @ 8 NONAME ; CalenPreviewPane::~CalenPreviewPane(void) + ?mousePressEvent@CalenMonthGrid@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 9 NONAME ; void CalenMonthGrid::mousePressEvent(class QGraphicsSceneMouseEvent *) + ?completePopulation@CalenMonthView@@AAEXXZ @ 10 NONAME ; void CalenMonthView::completePopulation(void) + ?handleAppendingRows@CalenMonthGrid@@AAEXAAV?$QList@VCalenMonthData@@@@@Z @ 11 NONAME ; void CalenMonthGrid::handleAppendingRows(class QList &) + ?handleChangeOrientation@CalenMonthView@@AAEXXZ @ 12 NONAME ; void CalenMonthView::handleChangeOrientation(void) + ?staticMetaObject@CalenSettingsView@@2UQMetaObject@@B @ 13 NONAME ; struct QMetaObject const CalenSettingsView::staticMetaObject + ?upGesture@CalenMonthGrid@@MAEXH@Z @ 14 NONAME ; void CalenMonthGrid::upGesture(int) + ?getStaticMetaObject@CalenSettingsView@@SAABUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const & CalenSettingsView::getStaticMetaObject(void) + ?updateMonthDataArrayWithActiveDates@CalenMonthView@@AAEXXZ @ 16 NONAME ; void CalenMonthView::updateMonthDataArrayWithActiveDates(void) + ?scrollingFinished@CalenMonthGrid@@QAEXXZ @ 17 NONAME ; void CalenMonthGrid::scrollingFinished(void) + ?setCurrentIdex@CalenMonthGrid@@QAEXH@Z @ 18 NONAME ; void CalenMonthGrid::setCurrentIdex(int) + ??_ECalenMonthGrid@@UAE@I@Z @ 19 NONAME ; CalenMonthGrid::~CalenMonthGrid(unsigned int) + ?trUtf8@CalenPreviewPane@@SA?AVQString@@PBD0@Z @ 20 NONAME ; class QString CalenPreviewPane::trUtf8(char const *, char const *) + ?trUtf8@CalenMonthGrid@@SA?AVQString@@PBD0@Z @ 21 NONAME ; class QString CalenMonthGrid::trUtf8(char const *, char const *) + ?populatePrevMonth@CalenMonthView@@QAEXXZ @ 22 NONAME ; void CalenMonthView::populatePrevMonth(void) + ?qt_metacall@CalenSettingsView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 23 NONAME ; int CalenSettingsView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?handleLeftEffectCompleted@CalenMonthView@@AAEXABUEffectStatus@HbEffect@@@Z @ 24 NONAME ; void CalenMonthView::handleLeftEffectCompleted(struct HbEffect::EffectStatus const &) + ?getStaticMetaObject@CalenMonthGrid@@SAABUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const & CalenMonthGrid::getStaticMetaObject(void) + ?trUtf8@CalenSettingsView@@SA?AVQString@@PBD0H@Z @ 26 NONAME ; class QString CalenSettingsView::trUtf8(char const *, char const *, int) + ?qt_metacast@CalenMonthView@@UAEPAXPBD@Z @ 27 NONAME ; void * CalenMonthView::qt_metacast(char const *) + ?staticMetaObject@CalenMonthView@@2UQMetaObject@@B @ 28 NONAME ; struct QMetaObject const CalenMonthView::staticMetaObject + ?setupView@CalenMonthView@@QAEXPAVCalenDocLoader@@@Z @ 29 NONAME ; void CalenMonthView::setupView(class CalenDocLoader *) + ?metaObject@CalenMonthGrid@@UBEPBUQMetaObject@@XZ @ 30 NONAME ; struct QMetaObject const * CalenMonthGrid::metaObject(void) const + ?startAutoScroll@CalenPreviewPane@@QAEXXZ @ 31 NONAME ; void CalenPreviewPane::startAutoScroll(void) + ?doLazyLoading@CalenMonthView@@QAEXXZ @ 32 NONAME ; void CalenMonthView::doLazyLoading(void) + ?setView@CalenMonthGrid@@QAEXPAVCalenMonthView@@@Z @ 33 NONAME ; void CalenMonthGrid::setView(class CalenMonthView *) + ?HandleNotification@CalenDayView@@UAEXW4TCalenNotification@@@Z @ 34 NONAME ; void CalenDayView::HandleNotification(enum TCalenNotification) + ?panGesture@CalenMonthGrid@@MAEXABVQPointF@@@Z @ 35 NONAME ; void CalenMonthGrid::panGesture(class QPointF const &) + ?mousePressEvent@CalenPreviewPane@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 36 NONAME ; void CalenPreviewPane::mousePressEvent(class QGraphicsSceneMouseEvent *) + ??1CalenSettingsView@@UAE@XZ @ 37 NONAME ; CalenSettingsView::~CalenSettingsView(void) + ?Date@CalenPreviewPane@@QAE?AVQDateTime@@XZ @ 38 NONAME ; class QDateTime CalenPreviewPane::Date(void) + ?tr@CalenPreviewPane@@SA?AVQString@@PBD0H@Z @ 39 NONAME ; class QString CalenPreviewPane::tr(char const *, char const *, int) + ?metaObject@CalenMonthView@@UBEPBUQMetaObject@@XZ @ 40 NONAME ; struct QMetaObject const * CalenMonthView::metaObject(void) const + ??0CalenPreviewPane@@QAE@AAVMCalenServices@@PAVQGraphicsItem@@@Z @ 41 NONAME ; CalenPreviewPane::CalenPreviewPane(class MCalenServices &, class QGraphicsItem *) + ?mouseReleaseEvent@CalenPreviewPane@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 42 NONAME ; void CalenPreviewPane::mouseReleaseEvent(class QGraphicsSceneMouseEvent *) + ?rowsInPrevMonth@CalenMonthView@@QAEHXZ @ 43 NONAME ; int CalenMonthView::rowsInPrevMonth(void) + ?handlePrependingRows@CalenMonthGrid@@AAEXAAV?$QList@VCalenMonthData@@@@@Z @ 44 NONAME ; void CalenMonthGrid::handlePrependingRows(class QList &) + ?mouseMoveEvent@CalenPreviewPane@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 45 NONAME ; void CalenPreviewPane::mouseMoveEvent(class QGraphicsSceneMouseEvent *) + ?metaObject@CalenPreviewPane@@UBEPBUQMetaObject@@XZ @ 46 NONAME ; struct QMetaObject const * CalenPreviewPane::metaObject(void) const + ??0CalenDayView@@QAE@AAVMCalenServices@@@Z @ 47 NONAME ; CalenDayView::CalenDayView(class MCalenServices &) + ?populateNextMonth@CalenMonthView@@QAEXXZ @ 48 NONAME ; void CalenMonthView::populateNextMonth(void) + ?handleRightEffectCompleted@CalenMonthView@@AAEXABUEffectStatus@HbEffect@@@Z @ 49 NONAME ; void CalenMonthView::handleRightEffectCompleted(struct HbEffect::EffectStatus const &) + ?qt_metacast@CalenMonthGrid@@UAEPAXPBD@Z @ 50 NONAME ; void * CalenMonthGrid::qt_metacast(char const *) + ?firstDayOfGrid@CalenMonthView@@QAE?AVQDateTime@@XZ @ 51 NONAME ; class QDateTime CalenMonthView::firstDayOfGrid(void) + ?rowsInFutMonth@CalenMonthView@@QAEHXZ @ 52 NONAME ; int CalenMonthView::rowsInFutMonth(void) + ?getCurrGridIndex@CalenMonthView@@QAEHXZ @ 53 NONAME ; int CalenMonthView::getCurrGridIndex(void) + ?launchDayView@CalenMonthView@@QAEXXZ @ 54 NONAME ; void CalenMonthView::launchDayView(void) + ??1CalenDayViewWidget@@UAE@XZ @ 55 NONAME ; CalenDayViewWidget::~CalenDayViewWidget(void) + ??0CalenDayViewWidget@@QAE@AAVMCalenServices@@PAVCalenDocLoader@@@Z @ 56 NONAME ; CalenDayViewWidget::CalenDayViewWidget(class MCalenServices &, class CalenDocLoader *) + ?prependRows@CalenMonthGrid@@QAEXXZ @ 57 NONAME ; void CalenMonthGrid::prependRows(void) + ?orientationChanged@CalenMonthGrid@@MAEXW4Orientation@Qt@@@Z @ 58 NONAME ; void CalenMonthGrid::orientationChanged(enum Qt::Orientation) + ?qt_metacall@CalenPreviewPane@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 59 NONAME ; int CalenPreviewPane::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@CalenPreviewPane@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString CalenPreviewPane::trUtf8(char const *, char const *, int) + ??1CalenThickLinesDrawer@@UAE@XZ @ 61 NONAME ; CalenThickLinesDrawer::~CalenThickLinesDrawer(void) + ?setView@CalenPreviewPane@@QAEXPAVCalenMonthView@@@Z @ 62 NONAME ; void CalenPreviewPane::setView(class CalenMonthView *) + ??_ECalenMonthView@@UAE@I@Z @ 63 NONAME ; CalenMonthView::~CalenMonthView(unsigned int) + ?changeOrientation@CalenMonthView@@UAEXW4Orientation@Qt@@@Z @ 64 NONAME ; void CalenMonthView::changeOrientation(enum Qt::Orientation) + ?populatePreviewPane@CalenMonthView@@QAEXAAVQDateTime@@@Z @ 65 NONAME ; void CalenMonthView::populatePreviewPane(class QDateTime &) + ??0CalenSettingsView@@QAE@AAVMCalenServices@@PAVQGraphicsItem@@@Z @ 66 NONAME ; CalenSettingsView::CalenSettingsView(class MCalenServices &, class QGraphicsItem *) + ?updateModelWithPrevMonth@CalenMonthView@@QAEXXZ @ 67 NONAME ; void CalenMonthView::updateModelWithPrevMonth(void) + ?stopScrolling@CalenPreviewPane@@QAEXXZ @ 68 NONAME ; void CalenPreviewPane::stopScrolling(void) + ?addBackgroundFrame@CalenMonthView@@AAEXXZ @ 69 NONAME ; void CalenMonthView::addBackgroundFrame(void) + ?createGrid@CalenMonthView@@AAEXXZ @ 70 NONAME ; void CalenMonthView::createGrid(void) + ?tr@CalenPreviewPane@@SA?AVQString@@PBD0@Z @ 71 NONAME ; class QString CalenPreviewPane::tr(char const *, char const *) + ?getStaticMetaObject@CalenPreviewPane@@SAABUQMetaObject@@XZ @ 72 NONAME ; struct QMetaObject const & CalenPreviewPane::getStaticMetaObject(void) + ?launchPreviousView@CalenSettingsView@@AAEXXZ @ 73 NONAME ; void CalenSettingsView::launchPreviousView(void) + ?setCurrGridIndex@CalenMonthView@@QAEXH@Z @ 74 NONAME ; void CalenMonthView::setCurrGridIndex(int) + ?setDateToLabel@CalenMonthView@@AAEXXZ @ 75 NONAME ; void CalenMonthView::setDateToLabel(void) + ?addWeekNumbers@CalenMonthView@@AAEXXZ @ 76 NONAME ; void CalenMonthView::addWeekNumbers(void) + ?qt_metacall@CalenThickLinesDrawer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 77 NONAME ; int CalenThickLinesDrawer::qt_metacall(enum QMetaObject::Call, int, void * *) + ?setupView@CalenDayView@@QAEXPAVCalenDocLoader@@@Z @ 78 NONAME ; void CalenDayView::setupView(class CalenDocLoader *) + ??1CalenMonthView@@UAE@XZ @ 79 NONAME ; CalenMonthView::~CalenMonthView(void) + ?dateFromContext@CalenMonthView@@AAE?AVQDateTime@@ABVMCalenContext@@@Z @ 80 NONAME ; class QDateTime CalenMonthView::dateFromContext(class MCalenContext const &) + ?staticMetaObject@CalenMonthGrid@@2UQMetaObject@@B @ 81 NONAME ; struct QMetaObject const CalenMonthGrid::staticMetaObject + ?trUtf8@CalenMonthGrid@@SA?AVQString@@PBD0H@Z @ 82 NONAME ; class QString CalenMonthGrid::trUtf8(char const *, char const *, int) + ?paint@CalenThickLinesDrawer@@EAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 83 NONAME ; void CalenThickLinesDrawer::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *) + ?initializeForm@CalenSettingsView@@QAEXXZ @ 84 NONAME ; void CalenSettingsView::initializeForm(void) + ?handlePanGestureFinished@CalenMonthGrid@@AAEXXZ @ 85 NONAME ; void CalenMonthGrid::handlePanGestureFinished(void) + ?tr@CalenMonthGrid@@SA?AVQString@@PBD0H@Z @ 86 NONAME ; class QString CalenMonthGrid::tr(char const *, char const *, int) + ?goToToday@CalenMonthView@@AAEXXZ @ 87 NONAME ; void CalenMonthView::goToToday(void) + ?trUtf8@CalenThickLinesDrawer@@SA?AVQString@@PBD0H@Z @ 88 NONAME ; class QString CalenThickLinesDrawer::trUtf8(char const *, char const *, int) + ?onContextChanged@CalenMonthView@@EAEXXZ @ 89 NONAME ; void CalenMonthView::onContextChanged(void) + ?qt_metacast@CalenPreviewPane@@UAEPAXPBD@Z @ 90 NONAME ; void * CalenPreviewPane::qt_metacast(char const *) + ?docLoader@CalenDayView@@QAEPAVCalenDocLoader@@XZ @ 91 NONAME ; class CalenDocLoader * CalenDayView::docLoader(void) + ?getCurrentIndex@CalenMonthGrid@@QAEHXZ @ 92 NONAME ; int CalenMonthGrid::getCurrentIndex(void) + ?tr@CalenSettingsView@@SA?AVQString@@PBD0H@Z @ 93 NONAME ; class QString CalenSettingsView::tr(char const *, char const *, int) + ?removeWeekNumbers@CalenMonthView@@AAEXXZ @ 94 NONAME ; void CalenMonthView::removeWeekNumbers(void) + ?trUtf8@CalenMonthView@@SA?AVQString@@PBD0H@Z @ 95 NONAME ; class QString CalenMonthView::trUtf8(char const *, char const *, int) + ??0CalenMonthView@@QAE@AAVMCalenServices@@@Z @ 96 NONAME ; CalenMonthView::CalenMonthView(class MCalenServices &) + ?getStaticMetaObject@CalenThickLinesDrawer@@SAABUQMetaObject@@XZ @ 97 NONAME ; struct QMetaObject const & CalenThickLinesDrawer::getStaticMetaObject(void) + ?setNoEntriesLabel@CalenPreviewPane@@QAEXPAVHbLabel@@@Z @ 98 NONAME ; void CalenPreviewPane::setNoEntriesLabel(class HbLabel *) + ?clearListModel@CalenDayView@@QAEXXZ @ 99 NONAME ; void CalenDayView::clearListModel(void) + ??0CalenThickLinesDrawer@@QAE@W4WidgetType@CalendarNamespace@@PAVQGraphicsItem@@@Z @ 100 NONAME ; CalenThickLinesDrawer::CalenThickLinesDrawer(enum CalendarNamespace::WidgetType, class QGraphicsItem *) + ?onLocaleChanged@CalenMonthView@@UAEXH@Z @ 101 NONAME ; void CalenMonthView::onLocaleChanged(int) + ?doPopulation@CalenMonthView@@UAEXXZ @ 102 NONAME ; void CalenMonthView::doPopulation(void) + ?tr@CalenMonthView@@SA?AVQString@@PBD0H@Z @ 103 NONAME ; class QString CalenMonthView::tr(char const *, char const *, int) + ?GetInstanceListL@CalenPreviewPane@@AAEXXZ @ 104 NONAME ; void CalenPreviewPane::GetInstanceListL(void) + ?getInstanceList@CalenMonthView@@AAEXAAV?$QList@VQDate@@@@VQDateTime@@1@Z @ 105 NONAME ; void CalenMonthView::getInstanceList(class QList &, class QDateTime, class QDateTime) + ?tr@CalenMonthView@@SA?AVQString@@PBD0@Z @ 106 NONAME ; class QString CalenMonthView::tr(char const *, char const *) + ??0CalenMonthGrid@@QAE@PAVQGraphicsItem@@@Z @ 107 NONAME ; CalenMonthGrid::CalenMonthGrid(class QGraphicsItem *) + ?refreshViewOnGoToDate@CalenMonthView@@EAEXXZ @ 108 NONAME ; void CalenMonthView::refreshViewOnGoToDate(void) + ?appendRows@CalenMonthGrid@@QAEXXZ @ 109 NONAME ; void CalenMonthGrid::appendRows(void) + ?tr@CalenThickLinesDrawer@@SA?AVQString@@PBD0H@Z @ 110 NONAME ; class QString CalenThickLinesDrawer::tr(char const *, char const *, int) + ?mouseReleaseEvent@CalenMonthGrid@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 111 NONAME ; void CalenMonthGrid::mouseReleaseEvent(class QGraphicsSceneMouseEvent *) + ?updateMonthGridWithInActiveMonths@CalenMonthGrid@@QAEXAAV?$QList@VCalenMonthData@@@@@Z @ 112 NONAME ; void CalenMonthGrid::updateMonthGridWithInActiveMonths(class QList &) + ?getCurrentDay@CalenMonthView@@QAE?AVQDateTime@@XZ @ 113 NONAME ; class QDateTime CalenMonthView::getCurrentDay(void) + ?staticMetaObject@CalenPreviewPane@@2UQMetaObject@@B @ 114 NONAME ; struct QMetaObject const CalenPreviewPane::staticMetaObject + ?tr@CalenSettingsView@@SA?AVQString@@PBD0@Z @ 115 NONAME ; class QString CalenSettingsView::tr(char const *, char const *) + ?onTwoSecondsTimeout@CalenPreviewPane@@QAEXXZ @ 116 NONAME ; void CalenPreviewPane::onTwoSecondsTimeout(void) + ?tr@CalenThickLinesDrawer@@SA?AVQString@@PBD0@Z @ 117 NONAME ; class QString CalenThickLinesDrawer::tr(char const *, char const *) + ?staticMetaObject@CalenThickLinesDrawer@@2UQMetaObject@@B @ 118 NONAME ; struct QMetaObject const CalenThickLinesDrawer::staticMetaObject + ?populateWithInstanceView@CalenMonthView@@AAEXXZ @ 119 NONAME ; void CalenMonthView::populateWithInstanceView(void) + ?trUtf8@CalenThickLinesDrawer@@SA?AVQString@@PBD0@Z @ 120 NONAME ; class QString CalenThickLinesDrawer::trUtf8(char const *, char const *) + ?downGesture@CalenMonthGrid@@MAEXH@Z @ 121 NONAME ; void CalenMonthGrid::downGesture(int) + ?populateLabel@CalenPreviewPane@@QAEXVQDateTime@@@Z @ 122 NONAME ; void CalenPreviewPane::populateLabel(class QDateTime) + ?doPopulation@CalenDayView@@UAEXXZ @ 123 NONAME ; void CalenDayView::doPopulation(void) + ??1CalenDayView@@UAE@XZ @ 124 NONAME ; CalenDayView::~CalenDayView(void) + ?updateModelWithFutureMonth@CalenMonthView@@QAEXXZ @ 125 NONAME ; void CalenMonthView::updateModelWithFutureMonth(void) + ?monthDataList@CalenMonthView@@QAE?AV?$QList@VCalenMonthData@@@@XZ @ 126 NONAME ; class QList CalenMonthView::monthDataList(void) + ?updateMonthGridModel@CalenMonthGrid@@QAEXAAV?$QList@VCalenMonthData@@@@H_N@Z @ 127 NONAME ; void CalenMonthGrid::updateMonthGridModel(class QList &, int, bool) + ??1CalenMonthGrid@@UAE@XZ @ 128 NONAME ; CalenMonthGrid::~CalenMonthGrid(void) + ?metaObject@CalenThickLinesDrawer@@UBEPBUQMetaObject@@XZ @ 129 NONAME ; struct QMetaObject const * CalenThickLinesDrawer::metaObject(void) const + ?updateWeekNumGridModel@CalenMonthView@@AAEXXZ @ 130 NONAME ; void CalenMonthView::updateWeekNumGridModel(void) + ?qt_metacast@CalenThickLinesDrawer@@UAEPAXPBD@Z @ 131 NONAME ; void * CalenThickLinesDrawer::qt_metacast(char const *) + ?prepareForPopulation@CalenMonthView@@AAEXXZ @ 132 NONAME ; void CalenMonthView::prepareForPopulation(void) + ?handlePreviewPaneGesture@CalenMonthView@@QAEX_N@Z @ 133 NONAME ; void CalenMonthView::handlePreviewPaneGesture(bool) + ?setActiveDates@CalenMonthGrid@@AAEXVQDate@@@Z @ 134 NONAME ; void CalenMonthGrid::setActiveDates(class QDate) + ?trUtf8@CalenMonthView@@SA?AVQString@@PBD0@Z @ 135 NONAME ; class QString CalenMonthView::trUtf8(char const *, char const *) + ?setContextForActiveDay@CalenMonthView@@QAEXH@Z @ 136 NONAME ; void CalenMonthView::setContextForActiveDay(int) + ?trUtf8@CalenSettingsView@@SA?AVQString@@PBD0@Z @ 137 NONAME ; class QString CalenSettingsView::trUtf8(char const *, char const *) + ??_ECalenSettingsView@@UAE@I@Z @ 138 NONAME ; CalenSettingsView::~CalenSettingsView(unsigned int) + ??_ECalenThickLinesDrawer@@UAE@I@Z @ 139 NONAME ; CalenThickLinesDrawer::~CalenThickLinesDrawer(unsigned int) + ?metaObject@CalenSettingsView@@UBEPBUQMetaObject@@XZ @ 140 NONAME ; struct QMetaObject const * CalenSettingsView::metaObject(void) const + ?getStaticMetaObject@CalenMonthView@@SAABUQMetaObject@@XZ @ 141 NONAME ; struct QMetaObject const & CalenMonthView::getStaticMetaObject(void) + ?paint@CalenMonthGrid@@EAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 142 NONAME ; void CalenMonthGrid::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *) + ?qt_metacast@CalenSettingsView@@UAEPAXPBD@Z @ 143 NONAME ; void * CalenSettingsView::qt_metacast(char const *) + ?tr@CalenMonthGrid@@SA?AVQString@@PBD0@Z @ 144 NONAME ; class QString CalenMonthGrid::tr(char const *, char const *) + ?qt_metacall@CalenMonthView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 145 NONAME ; int CalenMonthView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?setActiveDay@CalenMonthView@@AAEXVQDateTime@@@Z @ 146 NONAME ; void CalenMonthView::setActiveDay(class QDateTime) + ?itemActivated@CalenMonthGrid@@QAEXABVQModelIndex@@@Z @ 147 NONAME ; void CalenMonthGrid::itemActivated(class QModelIndex const &) + ?qt_metacall@CalenMonthGrid@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 148 NONAME ; int CalenMonthGrid::qt_metacall(enum QMetaObject::Call, int, void * *) + ??_ECalenPreviewPane@@UAE@I@Z @ 149 NONAME ; CalenPreviewPane::~CalenPreviewPane(unsigned int) + ?createEditor@CalenMonthView@@AAEXXZ @ 150 NONAME ; void CalenMonthView::createEditor(void) + ?getActiveDay@CalenMonthView@@QAE?AVQDateTime@@XZ @ 151 NONAME ; class QDateTime CalenMonthView::getActiveDay(void) + ?addRemoveActionsInMenu@CalenMonthView@@AAEXXZ @ 152 NONAME ; void CalenMonthView::addRemoveActionsInMenu(void) diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/data/caleneditorlocationitem.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/caleneditor/data/caleneditorlocationitem.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/data/caleneditorview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/caleneditor/data/caleneditorview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/inc/caleneditor_p.h --- a/calendarui/caleneditor/inc/caleneditor_p.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/caleneditor/inc/caleneditor_p.h Fri May 14 15:51:09 2010 +0300 @@ -92,6 +92,7 @@ DateTimeToItem, LocationItem, ReminderItem, + ReminderTimeForAllDayItem, RepeatItem, RepeatUntilItem }; @@ -104,7 +105,14 @@ AgendaEntry* originalEntry(); bool isNewEntry(); HbDataFormModelItem* allDayCheckBoxItem(); - + bool isReminderTimeForAllDayAdded(); + bool isAllDayEvent(); + void updateReminderChoices(); + int currentIndexOfReminderField(); + void setCurrentIndexOfReminderField(int index); + void setReminderChoices(); + bool isEditRangeThisOnly(); + bool isAllDayFieldAdded(); private: void edit(const QFile &handle, bool launchCalendar); void edit(AgendaEntry entry, bool launchCalendar); @@ -113,6 +121,7 @@ bool launchCalendar); void create(CalenEditor::CreateType type, AgendaEntry entry, bool launchCalendar); + void openEditor(AgendaEntry entry); void showEditor(AgendaEntry entry); void showEditOccurencePopup(); void setUpView(); @@ -135,7 +144,6 @@ void populateRepeatItem(); void populateDescriptionItem(); void removeDescriptionItem(); - void closeEditor(); bool isChild() const ; @@ -144,7 +152,6 @@ void deleteEntry(bool close = false); bool handleAllDayToSave(); void enableFromTotimeFileds(bool, QDateTime, QDateTime); - int showDeleteConfirmationQuery(); private slots: void handleSubjectChange(const QString subject); @@ -154,6 +161,7 @@ void handleLocationChange(const QString location); void handleDescriptionChange(const QString description); void saveAndCloseEditor(); + void showDeleteConfirmationQuery(bool closeEditor = false); void handleDeleteAction(); void launchSettingsView(); void discardChanges(); @@ -161,6 +169,7 @@ void handleEditOccurence(int index); void handleCancel(); void handleCalendarLaunchError(int error); + void closeEditor(); private: enum EditRange { @@ -191,7 +200,8 @@ EditRange mEditRange; QDateTime mNewEntryDateTime; - + + AgendaEntry mEntry; AgendaEntry *mOriginalEntry; AgendaEntry *mEditedEntry; diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/inc/caleneditorcommon.h --- a/calendarui/caleneditor/inc/caleneditorcommon.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/caleneditor/inc/caleneditorcommon.h Fri May 14 15:51:09 2010 +0300 @@ -35,7 +35,8 @@ CustomWidgetFrom = HbDataFormModelItem::CustomItemBase + 1, CustomWidgetTo, CustomWidgetLocation, - RepeatUntilOffset + RepeatUntilOffset, + ReminderTimeOffset }; #endif /* CALENEDITORCOMMON_H_ */ diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/inc/caleneditorcustomitem.h --- a/calendarui/caleneditor/inc/caleneditorcustomitem.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/caleneditor/inc/caleneditorcustomitem.h Fri May 14 15:51:09 2010 +0300 @@ -39,6 +39,7 @@ ~CalenEditorCustomItem(); virtual HbAbstractViewItem* createItem(); void enableFromTimeFieldAndSetTime(bool, QDateTime); + void disableFromToDateField(); void enableToTimeFieldAndSetTime(bool, QDateTime); void populateDateTime(QDateTime defaultDateTime, bool isFromItem); void populateLocation( QString location); @@ -78,6 +79,7 @@ HbPushButton* mPushButtonTime; HbPushButton* mPushButtonDate; HbPushButton *mRepeatUntilWidget; + HbPushButton *mReminderTimeWidget; HbDateTimePicker *mDatePicker; HbDateTimePicker *mTimePicker; diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/inc/caleneditorreminderfield.h --- a/calendarui/caleneditor/inc/caleneditorreminderfield.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/caleneditor/inc/caleneditorreminderfield.h Fri May 14 15:51:09 2010 +0300 @@ -30,6 +30,7 @@ class HbDataFormModelItem; class HbDataForm; class HbDataFormModelItem; +class HbDateTimePicker; class CalenEditorDataHandler; class CalenEditorReminderField : public QObject @@ -43,20 +44,37 @@ virtual ~CalenEditorReminderField(); public: + void setReminderChoices(); void addItemToModel(); void removeItemFromModel(); void populateReminderItem(bool newEntry); QModelIndex modelIndex(); - + void setReminderOff(); + void setDefaultAlarmForAllDay(); + void updateReminderChoicesForAllDay(QDate repeatUntilDate); + void insertReminderTimeField(); + void setDisplayTime(); + void removeReminderTimeField(); + bool isReminderFieldEnabled(); + int reminderItemsCount(); + int currentReminderIndex(); + void setCurrentIndex(int index); + void disableReminderTimeField(); + bool isReminderTimeForAllDayAdded(); private slots: void handleReminderIndexChanged(int index); - + void launchReminderTimePicker(); + void setReminderTimeForAllDay(); private: CalenEditorPrivate* mCalenEditor; HbDataForm* mEditorForm; HbDataFormModel* mCalenEditorModel; HbDataFormModelItem* mReminderItem; + HbDataFormModelItem *mCustomReminderTimeItem; + HbDateTimePicker *mTimePicker; + QTime mReminderTimeForAllDay; QHash mReminderHash; + bool mReminderTimeAdded; }; #endif // CALENEDITORREMINDERFIELD_H diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/inc/caleneditorrepeatfield.h --- a/calendarui/caleneditor/inc/caleneditorrepeatfield.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/caleneditor/inc/caleneditorrepeatfield.h Fri May 14 15:51:09 2010 +0300 @@ -53,6 +53,7 @@ void updateRepeatChoices(); void saveRepeatRule(); bool isRepeatUntilItemAdded(); + QDate repeatUntilDate(); private: void insertRepeatUntilItem(); diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/src/caleneditor_p.cpp --- a/calendarui/caleneditor/src/caleneditor_p.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/caleneditor/src/caleneditor_p.cpp Fri May 14 15:51:09 2010 +0300 @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -290,7 +289,7 @@ { mNewEntry = false; mLaunchCalendar = launchCalendar; - showEditor(entry); + openEditor(entry); } /*! @@ -326,7 +325,7 @@ break; } mLaunchCalendar = launchCalendar; - showEditor(entry); + openEditor(entry); } /*! @@ -350,7 +349,7 @@ } mNewEntryDateTime = entry.startTime(); mLaunchCalendar = launchCalendar; - showEditor(entry); + openEditor(entry); } /*! @@ -358,10 +357,11 @@ */ void CalenEditorPrivate::showEditOccurencePopup() { - HbDialog popUp; - popUp.setDismissPolicy(HbDialog::NoDismiss); - popUp.setTimeout(HbDialog::NoTimeout); - + HbDialog *popUp = new HbDialog(); + popUp->setDismissPolicy(HbDialog::NoDismiss); + popUp->setTimeout(HbDialog::NoTimeout); + popUp->setAttribute( Qt::WA_DeleteOnClose, true ); + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); HbWidget *editWidget = new HbWidget(); editWidget->setLayout(layout); @@ -376,22 +376,20 @@ layout->addItem(editButtonList); - popUp.setContentWidget(editWidget); - popUp.setHeadingWidget(new HbLabel(hbTrId("txt_calendar_title_edit"))); + popUp->setContentWidget(editWidget); + popUp->setHeadingWidget(new HbLabel(hbTrId("txt_calendar_title_edit"))); - // Create secondary action + // Create cancel action HbAction *cancelAction = new HbAction(hbTrId("txt_calendar_button_softkey1_cancel")); - popUp.setSecondaryAction(cancelAction); + popUp->addAction(cancelAction); connect(editButtonList, SIGNAL(itemSelected(int)), this, SLOT(handleEditOccurence(int))); - connect(editButtonList, SIGNAL(itemSelected(int)), &popUp, SLOT(close())); - - connect(cancelAction, SIGNAL(triggered()), &popUp, SLOT(close())); + connect(editButtonList, SIGNAL(itemSelected(int)), popUp, SLOT(close())); connect(cancelAction, SIGNAL(triggered()), this, SLOT(handleCancel())); // Show the popup - popUp.exec(); + popUp->open(); } /*! @@ -409,6 +407,13 @@ mEditRange = ThisAndAll; break; } + // If user has selected to edit all the occurences, + // then get the parent of it + AgendaEntry entryToBeEdited = mEntry; + if (mEditRange == ThisAndAll) { + entryToBeEdited = mAgendaUtil->parentEntry(mEntry); + } + showEditor(entryToBeEdited); } /*! @@ -418,6 +423,36 @@ { // User has chosen not to edit the event, hence return mEditRange = UserCancelled; + // Do cleanup and return + emit q_ptr->dialogClosed(); + return; +} + +/*! + Opens the editor. + */ +void CalenEditorPrivate::openEditor(AgendaEntry entry) +{ + if (0 < entry.id()) { + mNewEntry = false; + } + if (!mNewEntry) { + // Before we do anything, check in the entry is repeating + // OR its a child item + mIsChild = !(entry.recurrenceId().isNull()); + bool isRepeating = entry.isRepeating(); + // For later reference + mEntry = entry; + if (mIsChild || isRepeating) { + // Query user if he wants to edit whole series + // or just this occurence + showEditOccurencePopup(); + return; + }else { + mEditRange = ThisAndAll; + } + } + showEditor(entry); } /*! @@ -425,52 +460,23 @@ */ void CalenEditorPrivate::showEditor(AgendaEntry entry) { - - if (0 < entry.id()) { - mNewEntry = false; - } - - AgendaEntry entryToBeEdited = entry; - if (!mNewEntry) { - // Before we do anything, check in the entry is repeating - // OR its a child item - mIsChild = !(entry.recurrenceId().isNull()); - bool isRepeating = entry.isRepeating(); - if (mIsChild || isRepeating) { - // Query user if he wants to edit whole series - // or just this occurence - showEditOccurencePopup(); - // If user has selected to edit all the occurences, - // then get the parent of it - if (mEditRange == ThisAndAll) { - entryToBeEdited = mAgendaUtil->parentEntry(entry); - } else if (mEditRange == UserCancelled) { - // Do cleanup and return - emit q_ptr->dialogClosed(); - return; - } - } else { - mEditRange = ThisAndAll; - } - } - - mOriginalEntry = new AgendaEntry(entryToBeEdited); - mEditedEntry = new AgendaEntry(entryToBeEdited); + mOriginalEntry = new AgendaEntry(entry); + mEditedEntry = new AgendaEntry(entry); if (!mEditedEntry->description().isEmpty()) { mDescriptionItemAdded = true; } // Construct the view using docloader setUpView(); - + // Set the title text. mEditorView->setTitle(hbTrId("txt_calendar_title_calendar")); - mSoftKeyAction = new HbAction(Hb::BackAction); + mSoftKeyAction = new HbAction(Hb::BackNaviAction); mEditorView->setNavigationAction(mSoftKeyAction); connect(mSoftKeyAction, SIGNAL(triggered()), this, SLOT(saveAndCloseEditor())); - + // Create the data handler mDataHandler = new CalenEditorDataHandler(this,mEditedEntry, mOriginalEntry); } @@ -514,7 +520,7 @@ mEditorDocLoader->findObject( CALEN_EDITOR_DELETE_EVENT_ACTION)); connect(deleteEventAction, SIGNAL(triggered()), this, - SLOT(handleDeleteAction())); + SLOT(showDeleteConfirmationQuery())); if (!mNewEntry) { //TODO: Add the text id based on the entry type Anniversary or meeting @@ -582,14 +588,9 @@ // Add all day check box for new entry creation or while editing // parent entry or existing non repeating event - if (mNewEntry) { + if (mNewEntry || (mEditRange == ThisAndAll)) { addAllDayCheckBoxItem(); - } else { - if (!mEditedEntry->isRepeating() || (mEditRange == ThisAndAll)) { - addAllDayCheckBoxItem(); - } } - addCustomItemFrom(); addCustomItemTo(); addCustomItemLocation(); @@ -598,7 +599,6 @@ if (mEditRange == ThisAndAll) { addRepeatItem(); } - mCalenEditorForm->setModel(mCalenEditorModel); } @@ -793,7 +793,7 @@ QDateTime endTime = mEditedEntry-> startTime().addSecs(durationInSeconds); - // set this to the original entr as well as edited entry + // set this to the original entry as well as edited entry mOriginalEntry->setStartAndEndTime(mOriginalEntry->startTime(), endTime); mEditedEntry->setStartAndEndTime(mEditedEntry->startTime(), endTime); @@ -859,6 +859,12 @@ nextInstanceStartTime.addDays(-1).date()); mViewToItem->setDateRange(prevInstanceEndTime.date().addDays(1), nextInstanceEndTime.date().addDays(-1)); + + // If repeating daily then disable the date fields as + // date cannot be changed + if (mEditedEntry->repeatRule().type() == AgendaRepeatRule::DailyRule) { + mViewFromItem->disableFromToDateField(); + } } } else { toDateTime = fromDateTime.addSecs(60 * 60); @@ -871,9 +877,9 @@ if (mNewEntry) { mOriginalEntry->setStartAndEndTime(fromDateTime, toDateTime); } - if (mAllDayCheckBoxItem - && (mAllDayCheckBoxItem->contentWidgetData("checkState") - == Qt::Checked)) { + if ((mAllDayCheckBoxItem && + (mAllDayCheckBoxItem->contentWidgetData("checkState") == Qt::Checked)) + || (!mNewEntry && mEditedEntry->type() == AgendaEntry::TypeEvent)) { // If the all day option is checked, we need to // disable the time fields enableFromTotimeFileds(false, mEditedEntry->startTime(), @@ -898,11 +904,11 @@ } QModelIndex index = mCalenEditorModel->index(itemIndex, 0); mViewLocationItem = qobject_cast - (mCalenEditorForm->dataFormViewItem(index)); - + (mCalenEditorForm->itemByIndex(index)); + connect(mViewLocationItem, SIGNAL(locationTextChanged(const QString)), this, SLOT(handleLocationChange(const QString))); - + mViewLocationItem->populateLocation(mEditedEntry->location()); } /*! @@ -935,6 +941,49 @@ // update the repeat choices depending on the meeting duration mRepeatField->updateRepeatChoices(); } + + updateReminderChoices(); +} + +void CalenEditorPrivate::updateReminderChoices() +{ + QDate referenceDate; + + // Start date or repeat until date will be the reference to decide + // whether the event is in past or future. + if (mRepeatField && mRepeatField->isRepeatUntilItemAdded()) { + referenceDate = mRepeatField->repeatUntilDate(); + } else { + referenceDate = mEditedEntry->startTime().date(); + } + + // Check if all day event or not. + if (isAllDayEvent()) { + int currentIndex = mReminderField->currentReminderIndex(); + mReminderField->updateReminderChoicesForAllDay(referenceDate); + int numberOfReminderChoices = mReminderField->reminderItemsCount(); + if (currentIndex >= numberOfReminderChoices) { + currentIndex = 0; + mReminderField->disableReminderTimeField(); + } + mReminderField->setCurrentIndex(currentIndex); + if(currentIndex == 0 && mReminderField->isReminderTimeForAllDayAdded()) { + mReminderField->removeReminderTimeField(); + } + } else { + if ((referenceDate < QDate::currentDate()) + || (referenceDate == QDate::currentDate() + && (mEditedEntry->startTime().time() < QTime::currentTime()))) + { + mReminderField->setReminderOff(); + } else { + // Enabled implies future. If changing from future to future do not + // do anything. + if (!mReminderField->isReminderFieldEnabled()) { + mReminderField->setReminderChoices(); + } + } + } } /*! @@ -943,17 +992,21 @@ void CalenEditorPrivate::saveToDateTime(QDateTime& toDateTime) { QDateTime startTime = mEditedEntry->startTime(); + bool fromDateChanged = false; // Update the start time accordingly on UI - duration will be 60 mins // bydefault for new entry and if it crosses the starttime if (mNewEntry && toDateTime < startTime) { startTime = toDateTime.addSecs(-3600); - } else { // for exisitng entry + fromDateChanged = true; + } else { + // for exisitng entry // we need to see if user has moved end time before the start time // then substract the duration of the meeting that was saved earlier to // the new end time to get the new start time if (toDateTime < startTime) { int duration = mEditedEntry->durationInSecs(); startTime = toDateTime.addSecs(-duration); + fromDateChanged = true; } } // Set the new start time to the form @@ -968,6 +1021,11 @@ // update the repeat choices depending on the meeting duration mRepeatField->updateRepeatChoices(); } + + // Update reminder choices if start time got changed. + if (fromDateChanged) { + updateReminderChoices(); + } } /*! @@ -977,11 +1035,14 @@ { // Check if all day has been added or not // and calculate the index accordingly + // all day added implies reminder time field is also added int index; - if (mIsAllDayItemAdded) { + if (mIsAllDayItemAdded && !isReminderTimeForAllDayAdded()) { + index = RepeatItem - 1; + } else if (!mNewEntry && isReminderTimeForAllDayAdded()) { index = RepeatItem; } else { - index = RepeatItem - 1; + index = RepeatItem - 2; } mRepeatField->populateRepeatItem(index); @@ -1096,13 +1157,38 @@ tempEndTime.setTime(tempEndQTime); enableFromTotimeFileds(false, tempSartTime, tempEndTime); + QDate referenceDate; + if (mRepeatField->isRepeatUntilItemAdded()) { + referenceDate = mRepeatField->repeatUntilDate(); + } else { + referenceDate = mEditedEntry->startTime().date(); + } + mReminderField->updateReminderChoicesForAllDay(referenceDate); + // If the reminder field is enabled and it is not off + // it implies default alarm day and time is being displayed. + if (mReminderField->isReminderFieldEnabled() && + mReminderField->currentReminderIndex() != 0) { + // Set the default alarm for all day. + mReminderField->setDefaultAlarmForAllDay(); + } else { + // Remove reminder time field. + mReminderField->removeReminderTimeField(); + } } else { // AllDayCheckBox in un-checked // Set From/To times buttons editable // Update Start/End Times with Edited entry values enableFromTotimeFileds(true, mEditedEntry->startTime(), mEditedEntry->endTime()); - + int index; + if (mIsAllDayItemAdded) { + index = ReminderTimeForAllDayItem; + } else { + index = ReminderTimeForAllDayItem - 1; + } + mReminderField->removeReminderTimeField(); + mReminderField->setReminderChoices(); + updateReminderChoices(); } addDiscardAction(); } @@ -1135,7 +1221,9 @@ void CalenEditorPrivate::saveAndCloseEditor() { Action action = handleDone(); - closeEditor(); + if (CalenEditorPrivate::ActionDelete != action) { + closeEditor(); + } if (CalenEditorPrivate::ActionSave == action) { // check if we need to launch the calendar application @@ -1165,17 +1253,14 @@ */ void CalenEditorPrivate::handleDeleteAction() { - + // If its a new entry just close the editor if (mNewEntry) { - if (showDeleteConfirmationQuery()) { - closeEditor(); - } + closeEditor(); return; + }else { + // Delete entry and close editor + deleteEntry(true); } - - // Delete entry and close editor - deleteEntry(true); - } /*! @@ -1198,14 +1283,12 @@ /*! * Show delete confirmation query */ -int CalenEditorPrivate::showDeleteConfirmationQuery() +void CalenEditorPrivate::showDeleteConfirmationQuery(bool closeEditor) { - int retStatus = 0; - - HbMessageBox popup(HbMessageBox::MessageTypeQuestion); - popup.setDismissPolicy(HbDialog::NoDismiss); - popup.setTimeout(HbDialog::NoTimeout); - popup.setIconVisible(true); + HbMessageBox *popup = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + popup->setDismissPolicy(HbDialog::NoDismiss); + popup->setTimeout(HbDialog::NoTimeout); + popup->setAttribute( Qt::WA_DeleteOnClose, true ); QString text = 0; @@ -1225,18 +1308,27 @@ } } - popup.setText(text); - - popup.setPrimaryAction(new HbAction(hbTrId("txt_calendar_button_delete"), - &popup)); - popup.setSecondaryAction(new HbAction(hbTrId("txt_calendar_button_cancel"), - &popup)); - HbAction *selected = popup.exec(); - if (selected == popup.primaryAction()) { - retStatus = 1; + popup->setText(text); + + QList list = popup->actions(); + for(int i=0; i < list.count(); i++) + { + popup->removeAction(list[i]); + } + HbAction *deleteAction = new HbAction(hbTrId("txt_calendar_button_delete"), + popup); + popup->addAction(deleteAction); + connect(deleteAction, SIGNAL(triggered()), this, + SLOT(handleDeleteAction())); + HbAction *cancelAction = new HbAction(hbTrId("txt_calendar_button_cancel"), + popup); + // Editor should not be closed for all the cases when cancel is pressed + if(closeEditor) { + connect(cancelAction, SIGNAL(triggered()), this, + SLOT(closeEditor())); } - - return retStatus; + popup->addAction(cancelAction); + popup->open(); } /*! @@ -1273,7 +1365,7 @@ } return CalenEditorPrivate::ActionNothing; case CalenEditorPrivate::ActionDelete: - deleteEntry(); + showDeleteConfirmationQuery(true); return CalenEditorPrivate::ActionDelete; case CalenEditorPrivate::ActionNothing: return CalenEditorPrivate::ActionNothing; @@ -1341,26 +1433,22 @@ */ void CalenEditorPrivate::deleteEntry(bool close) { - // if editor is launched from Notes then don't delete entry // Just exit from calendar editor if (mOriginalEntry->id() > 0) { - // If user is editing single instanc then delete single instance // else delete entry - if (showDeleteConfirmationQuery()) { - if (mEditRange == ThisOnly) { - // User wants to delete only this occurence - mAgendaUtil->deleteRepeatedEntry(*mOriginalEntry, - AgendaUtil::ThisOnly); - } else { - // Delete the entry. - mAgendaUtil->deleteEntry(mOriginalEntry->id()); - } + if (mEditRange == ThisOnly) { + // User wants to delete only this occurence + mAgendaUtil->deleteRepeatedEntry(*mOriginalEntry, + AgendaUtil::ThisOnly); + } else { + // Delete the entry. + mAgendaUtil->deleteEntry(mOriginalEntry->id()); + } - if (close) { - closeEditor(); - } + if (close) { + closeEditor(); } } } @@ -1462,4 +1550,74 @@ { return mAllDayCheckBoxItem; } + +/*! + Checks if all day item is added and if selected implies reminder time is added. + When editing single occurence irrespective of type of the event + the all day item is not shown. + Used to calculate the index of other items which are dependant on this. + */ +bool CalenEditorPrivate::isReminderTimeForAllDayAdded() +{ + return mReminderField->isReminderTimeForAllDayAdded(); +} + +/*! + Checks if it is an all day event or not. + */ +bool CalenEditorPrivate::isAllDayEvent() +{ + if (mAllDayCheckBoxItem) { + return (mAllDayCheckBoxItem->contentWidgetData("checkState") + == Qt::Checked)? true:false; + } else if (!mNewEntry && mEditedEntry->type() == AgendaEntry::TypeEvent) { + // If editing single occurence then all day item not shown but still it + // is an all day event.. + return true;; + } else { + return false; + } +} + +/*! + Returns the current index of the reminder field. + */ +int CalenEditorPrivate::currentIndexOfReminderField() +{ + return mReminderField->currentReminderIndex(); +} + +/*! + Sets the index. + /param index indicates the index value to be set. + */ +void CalenEditorPrivate::setCurrentIndexOfReminderField(int index) +{ + mReminderField->setCurrentIndex(index); +} + +/*! + Sets the reminder choices for a non all day event. + */ +void CalenEditorPrivate::setReminderChoices() +{ + mReminderField->setReminderChoices(); +} + +/*! + Checks if editing all occurences or a single occurence. + */ +bool CalenEditorPrivate::isEditRangeThisOnly() +{ + return (mEditRange == ThisOnly); +} + +/*! + Checks if all day field is added. + */ +bool CalenEditorPrivate::isAllDayFieldAdded() +{ + return mIsAllDayItemAdded; +} + // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/src/caleneditorcustomitem.cpp --- a/calendarui/caleneditor/src/caleneditorcustomitem.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/caleneditor/src/caleneditorcustomitem.cpp Fri May 14 15:51:09 2010 +0300 @@ -113,7 +113,8 @@ case CustomWidgetTo: { HbWidget *widgetBottom = new HbWidget(); - QGraphicsLinearLayout *layoutBottom = new QGraphicsLinearLayout(Qt::Horizontal); + QGraphicsLinearLayout *layoutBottom = + new QGraphicsLinearLayout(Qt::Horizontal); widgetBottom->setLayout(layoutBottom); mPushButtonTime = new HbPushButton(this); @@ -133,20 +134,27 @@ CalenEditorDocLoader editorLocationDocLoader; bool loadSuccess = false; - editorLocationDocLoader.load(CALEN_EDITOR_LOCATION_XML_FILE, &loadSuccess); + 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)); + "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)); mLocationLineEdit->setMinRows(1); mLocationLineEdit->setMaxRows(4); - mLocationPushButton = qobject_cast(editorLocationDocLoader.findWidget(CALEN_EDITOR_LOCATION_PUSHBUTTON)); + mLocationPushButton = qobject_cast( + editorLocationDocLoader.findWidget( + CALEN_EDITOR_LOCATION_PUSHBUTTON)); mLocationPushButton->setIcon( HbIcon("qtg_mono_location")); - connect(mLocationPushButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker())); + connect(mLocationPushButton, SIGNAL(clicked()), this, + SLOT(launchLocationPicker())); connect(mLocationLineEdit, SIGNAL(textChanged(const QString)), - this, SLOT(handleLocationTextChange(const QString))); + this, SLOT(handleLocationTextChange(const QString))); return widgetLocation; } @@ -156,7 +164,12 @@ return mRepeatUntilWidget; } - + case ReminderTimeOffset: + { + mReminderTimeWidget = new HbPushButton(this); + return mReminderTimeWidget; + } + default: return 0; } @@ -204,6 +217,10 @@ mLocationLineEdit->setText(locationString ); } } + +/*! + Populates the date and time in proper formats on the buttons + */ void CalenEditorCustomItem::populateDateTime(QDateTime defaultDateTime, bool isFromItem) { // Store the date and time to be shown @@ -213,17 +230,22 @@ mIsFromItem = isFromItem; mPushButtonDate->setText(mLocale.format(defaultDateTime.date(), - r_qtn_date_usual_with_zero)); + r_qtn_date_usual_with_zero)); mPushButtonTime->setText(mLocale.format(defaultDateTime.time(), - r_qtn_time_usual_with_zero)); + r_qtn_time_usual_with_zero)); } +/*! + Sets the location on the button + */ void CalenEditorCustomItem::populateLocation(QString location ) { mLocationLineEdit->setText( location ); - } +/*! + Sets the date range + */ void CalenEditorCustomItem::setDateRange(QDate start, QDate end) { mMaxDate = end; @@ -236,82 +258,104 @@ } } +/*! + Sets the time range + */ void CalenEditorCustomItem::setTimeRange(QTime start, QTime end) { mMaxTime = start; mMinTime = end; } +/*! + Enables the date button + */ void CalenEditorCustomItem::enableDateButton(bool value) { mPushButtonDate->setEnabled(value); } - +/*! + Handles the location change + */ void CalenEditorCustomItem::handleLocationTextChange(QString location) { emit locationTextChanged(location); } - - +/*! + Launches the date picker + */ void CalenEditorCustomItem::handleDate() { - // Create a date picker - mDatePicker = new HbDateTimePicker(mDate, this); - mDatePicker->setMinimumDate(mMinDate); - mDatePicker->setMaximumDate(mMaxDate); - // Create a popup with datepicker for the user to select date. - HbDialog popUp; - popUp.setDismissPolicy(HbDialog::NoDismiss); - popUp.setTimeout(HbDialog::NoTimeout); + HbDialog *popUp = new HbDialog(); + popUp->setDismissPolicy(HbDialog::NoDismiss); + popUp->setTimeout(HbDialog::NoTimeout); + popUp->setAttribute( Qt::WA_DeleteOnClose, true ); // Set the proper heading if (mIsFromItem) { - popUp.setHeadingWidget(new HbLabel(hbTrId("txt_calendar_title_start_date"))); - }else { - popUp.setHeadingWidget(new HbLabel(hbTrId("txt_calendar_title_end_date"))); - } - - popUp.setContentWidget(mDatePicker); + popUp->setHeadingWidget( + new HbLabel(hbTrId("txt_calendar_title_start_date"))); + }else { + popUp->setHeadingWidget( + new HbLabel(hbTrId("txt_calendar_title_end_date"))); + } + // Create a date picker + if(mDatePicker) { + mDatePicker = NULL; + } + mDatePicker = new HbDateTimePicker(mDate, popUp); + mDatePicker->setMinimumDate(mMinDate); + mDatePicker->setMaximumDate(mMaxDate); + + popUp->setContentWidget(mDatePicker); HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok")); - popUp.setPrimaryAction(okAction); + popUp->addAction(okAction); connect(okAction, SIGNAL(triggered()), this, SLOT(saveDate())); - connect(okAction, SIGNAL(triggered()), &popUp, SLOT(close())); - popUp.setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"))); - popUp.exec(); + popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"))); + popUp->open(); } +/*! + Launches the time picker + */ void CalenEditorCustomItem::handleTime() { + // Create a popup with time picker for the user to select time. + HbDialog *popUp = new HbDialog(); + popUp->setDismissPolicy(HbDialog::NoDismiss); + popUp->setTimeout(HbDialog::NoTimeout); + popUp->setAttribute( Qt::WA_DeleteOnClose, true ); + + // Set the proper heading + if (mIsFromItem) { + popUp->setHeadingWidget( + new HbLabel(hbTrId("txt_calendar_title_start_time"))); + }else { + popUp->setHeadingWidget( + new HbLabel(hbTrId("txt_calendar_title_end_time"))); + } // Create a time picker. - mTimePicker = new HbDateTimePicker(mTime, this); + if(mTimePicker) { + mTimePicker = NULL; + } + mTimePicker = new HbDateTimePicker(mTime, popUp); + if(mLocale.timeStyle() == HbExtendedLocale::Time12) { mTimePicker->setDisplayFormat("hh:mm ap"); }else { mTimePicker->setDisplayFormat("hh:mm"); } mTimePicker->setTime(mTime); - // Create a popup with time picker for the user to select time. - HbDialog popUp; - popUp.setDismissPolicy(HbDialog::NoDismiss); - popUp.setTimeout(HbDialog::NoTimeout); - - // Set the proper heading - if (mIsFromItem) { - popUp.setHeadingWidget(new HbLabel(hbTrId("txt_calendar_title_start_time"))); - }else { - popUp.setHeadingWidget(new HbLabel(hbTrId("txt_calendar_title_end_time"))); - } - - popUp.setContentWidget(mTimePicker); + popUp->setContentWidget(mTimePicker); + HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok")); - popUp.setPrimaryAction(okAction); + popUp->addAction(okAction); connect(okAction, SIGNAL(triggered()), this, SLOT(saveTime())); - connect(okAction, SIGNAL(triggered()), &popUp, SLOT(close())); - popUp.setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), &popUp)); - popUp.exec(); + popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"), popUp)); + popUp->open(); } /*! @@ -356,6 +400,15 @@ } /*! + Disable Date field. + */ +void CalenEditorCustomItem::disableFromToDateField() +{ + // disable the date field. + mPushButtonDate->setEnabled(false); +} + +/*! Enable/Desable ToTime filed and update time value */ void CalenEditorCustomItem::enableToTimeFieldAndSetTime(bool enableTimeFiles, QDateTime toDateTime) @@ -364,7 +417,8 @@ mPushButtonTime->setEnabled(enableTimeFiles); // Set ToTime in Editor - mPushButtonTime->setText(mLocale.format(toDateTime.time(),r_qtn_time_usual_with_zero)); + mPushButtonTime->setText(mLocale.format( + toDateTime.time(),r_qtn_time_usual_with_zero)); } /*! @@ -377,7 +431,7 @@ index.data(HbDataFormModelItem::ItemTypeRole).toInt()); if(itemType == CustomWidgetFrom || itemType == CustomWidgetTo || itemType == RepeatUntilOffset - || itemType == CustomWidgetLocation ) { + || itemType == CustomWidgetLocation || itemType == ReminderTimeOffset ) { return true; } else { return false; @@ -400,6 +454,12 @@ mRepeatUntilWidget->setText(modelItem->contentWidgetData("text").toString()); } break; + + case ReminderTimeOffset: + { + mReminderTimeWidget->setText(modelItem->contentWidgetData("text").toString()); + } + break; } } diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/src/caleneditorreminderfield.cpp --- a/calendarui/caleneditor/src/caleneditorreminderfield.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/caleneditor/src/caleneditorreminderfield.cpp Fri May 14 15:51:09 2010 +0300 @@ -18,13 +18,22 @@ // System Includes +#include + #include #include #include +#include +#include +#include +#include +#include +#include // User Includes #include "caleneditorreminderfield.h" +#define numberOfMinutesInADay 1440 /*! \class CalenEditorReminderField */ @@ -42,35 +51,16 @@ :QObject(parent), mCalenEditor(calenEditor), mEditorForm(form), - mCalenEditorModel(model) + mCalenEditorModel(model), + mCustomReminderTimeItem(NULL), + mReminderTimeAdded(false) { mReminderItem = new HbDataFormModelItem(); mReminderItem->setType(HbDataFormModelItem::ComboBoxItem); mReminderItem->setData(HbDataFormModelItem::LabelRole, - hbTrId("txt_calendar_setlabel_alarm")); - // Create the remaindar choices - QStringList remaindarChoices; - remaindarChoices << hbTrId("txt_calendar_setlabel_alarm_val_off") - << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_minutes", 5) - << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_minutes", 10) - << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_minutes", 15) - << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_minutes", 30) - << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_hours", 1) - << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_hours", 2); - - mReminderItem->setContentWidgetData(QString("items"), remaindarChoices); - - // Build the hash map for the reminder. - mReminderHash[0] = 0; // OFF. - mReminderHash[1] = 5; - mReminderHash[2] = 10; - mReminderHash[3] = 15; - mReminderHash[4] = 30; - mReminderHash[5] = 60; - mReminderHash[6] = 120; - + hbTrId("txt_calendar_setlabel_alarm")); // Add it to the model - mCalenEditorModel->appendDataFormItem( mReminderItem, + mCalenEditorModel->appendDataFormItem(mReminderItem, mCalenEditorModel->invisibleRootItem()); } @@ -83,6 +73,35 @@ } /*! + Set the reminder choices. + */ +void CalenEditorReminderField::setReminderChoices() +{ + // Create the reminder choices + QStringList reminderChoices; + reminderChoices << hbTrId("txt_calendar_setlabel_alarm_val_off") + << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_minutes", 5) + << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_minutes", 10) + << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_minutes", 15) + << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_minutes", 30) + << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_hours", 1) + << hbTrId("txt_calendar_setlabel_alarm_val_before_ln_hours", 2); + + mReminderItem->setContentWidgetData(QString("items"), reminderChoices); + + // Build the hash map for the reminder. + mReminderHash[0] = 0; // OFF. + mReminderHash[1] = 5; + mReminderHash[2] = 10; + mReminderHash[3] = 15; + mReminderHash[4] = 30; + mReminderHash[5] = 60; + mReminderHash[6] = 120; + + mReminderItem->setEnabled(true); +} + +/*! Adds reminder item to the model */ void CalenEditorReminderField::addItemToModel() @@ -93,7 +112,7 @@ } /*! - Removes reminder item frm the model + Removes reminder item from the model */ void CalenEditorReminderField::removeItemFromModel() { @@ -106,33 +125,106 @@ */ void CalenEditorReminderField::populateReminderItem(bool newEntry) { + AgendaAlarm reminder; + bool pastEvent = false; + + // Set reference date to start date or repeat until date accordingly to + // decide whether its a past event or not. + QDate referenceDate; + if (!mCalenEditor->editedEntry()->isRepeating() || + (mCalenEditor->isEditRangeThisOnly())) { + referenceDate = mCalenEditor->editedEntry()->startTime().date(); + } else { + referenceDate = mCalenEditor->editedEntry()->repeatRule().until().date(); + } + + if ((referenceDate < QDate::currentDate()) || + (referenceDate == QDate::currentDate() + && (mCalenEditor->editedEntry()->startTime().time() < + QTime::currentTime()))) { + pastEvent = true; + } + + if (mCalenEditor->isAllDayEvent()) { + updateReminderChoicesForAllDay(referenceDate); + } else { + setReminderChoices(); + } // Set the default reminder value to 15 minutes if (newEntry) { - mReminderItem->setContentWidgetData("currentIndex", 3); - // Save the reminder alarm for the entry - AgendaAlarm reminder; - reminder.setTimeOffset(mReminderHash.value(3)); - reminder.setAlarmSoundName(QString(" ")); - // Set the reminder to the entry as well as original entry. - mCalenEditor->editedEntry()->setAlarm(reminder); - mCalenEditor->originalEntry()->setAlarm(reminder); + if (!pastEvent) { + mReminderItem->setContentWidgetData("currentIndex", 3); + // Save the reminder alarm for the entry + reminder.setTimeOffset(mReminderHash.value(3)); + reminder.setAlarmSoundName(QString(" ")); + // Set the reminder to the entry as well as original entry. + mCalenEditor->editedEntry()->setAlarm(reminder); + mCalenEditor->originalEntry()->setAlarm(reminder); + } else { + mReminderItem->setContentWidgetData("currentIndex", 0); + mReminderItem->setEnabled(false); + } } else { + // If the alarm is not null, + // Check if all day event or not and then set the choices accordingly. if (mCalenEditor->editedEntry()->alarm().isNull()) { // Alarm is set off mReminderItem->setContentWidgetData("currentIndex", 0); - } else { + if(mReminderTimeAdded) { + removeReminderTimeField(); + } + } else if (mCalenEditor->editedEntry()->type() + != AgendaEntry::TypeEvent) { // Get the reminder offset value. - int reminderOffset = mCalenEditor->editedEntry()->alarm().timeOffset(); + int reminderOffset = + mCalenEditor->editedEntry()->alarm().timeOffset(); // Get the index value for the reminder combo box from the hash // table. int index = mReminderHash.key(reminderOffset); mReminderItem->setContentWidgetData("currentIndex", index); + } else { + // Insert reminder time field and display entry's reminder time. + // If past then disable the field. + if (!mReminderTimeAdded) { + insertReminderTimeField(); + if (pastEvent) { + mCustomReminderTimeItem->setEnabled(false); + } + } + QStringList reminderChoicesForAllDay; + reminderChoicesForAllDay << hbTrId("off") + << hbTrId("On event day") + << hbTrId("1 day before") + << hbTrId("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(); + int offsetInMins = reminder.timeOffset(); + if (offsetInMins < 0 || offsetInMins == 0) { + mReminderItem->setContentWidgetData("currentIndex", 1); + mReminderTimeForAllDay = referenceTime.addSecs(-(offsetInMins + * 60)); + } else if (offsetInMins < numberOfMinutesInADay) { + mReminderItem->setContentWidgetData("currentIndex", 2); + mReminderTimeForAllDay = referenceTime.addSecs(-(offsetInMins + * 60)); + } else { + mReminderItem->setContentWidgetData("currentIndex", 3); + offsetInMins %= (24 * 60); + mReminderTimeForAllDay = referenceTime.addSecs(-(offsetInMins + * 60)); + } + setDisplayTime(); + } + if (pastEvent) { + mReminderItem->setEnabled(false); } } mEditorForm->addConnection(mReminderItem, SIGNAL(currentIndexChanged(int)), this, SLOT(handleReminderIndexChanged(int))); - } /*! @@ -146,17 +238,58 @@ if (!mCalenEditor->editedEntry()->alarm().isNull()) { reminder = mCalenEditor->editedEntry()->alarm(); } - // If value for the index in hash table is 0 i.e reminder is "OFF", - // then dont do anything only set the default constructed reminder to - // the entry which is Null. - if (mReminderHash.value(index)) { - // If not zero then set the reminder offset - // value to the entry. - reminder.setTimeOffset(mReminderHash.value(index)); - reminder.setAlarmSoundName(QString(" ")); + // Check whether all day event or not and store appropriately. + if (!mCalenEditor->isAllDayEvent()) { + // If value for the index in hash table is 0 i.e reminder is "OFF", + // then set the default constructed reminder to + // the entry which is Null. + if (!mReminderHash.value(index)) { + // Construct the default alarm which is NULL + reminder = AgendaAlarm(); + } else { + // If not zero then set the reminder offset + // value to the entry. + reminder.setTimeOffset(mReminderHash.value(index)); + reminder.setAlarmSoundName(QString(" ")); + } } else { - // Construct the default alarm which is NULL - reminder = AgendaAlarm(); + QDateTime reminderDateTimeForAllDay; + QDateTime + startDateTimeForAllDay( + mCalenEditor->editedEntry()->startTime().date(), + QTime(0, 0, 0)); + if (mReminderItem->contentWidgetData("currentIndex") == 0) { + reminder = AgendaAlarm(); + mCustomReminderTimeItem->setEnabled(false); + } else { + int offset = 0; + if (mReminderItem->contentWidgetData("currentIndex") == 2) { + offset = 1; + } else if (mReminderItem->contentWidgetData("currentIndex") == 3) { + offset = 2; + } + if(!mReminderTimeAdded) { + insertReminderTimeField() +; } + // If on same day as that of the event then check if time has been + // changed , if changed retain that else set default time. + if (offset == 0) { + if(mReminderTimeForAllDay == QTime(18, 0, 0, 0)) { + mReminderTimeForAllDay.setHMS(8, 0, 0); + setDisplayTime(); + } + } + reminderDateTimeForAllDay.setDate( + mCalenEditor->editedEntry()->startTime().date().addDays( + -offset)); + reminderDateTimeForAllDay.setTime(mReminderTimeForAllDay); + int seconds = + reminderDateTimeForAllDay.secsTo(startDateTimeForAllDay); + int timeOffest = seconds / 60; + mCustomReminderTimeItem->setEnabled(true); + reminder.setTimeOffset(timeOffest); + reminder.setAlarmSoundName(QString(" ")); + } } // Set the reminder to the entry. mCalenEditor->editedEntry()->setAlarm(reminder); @@ -171,4 +304,236 @@ { return mCalenEditorModel->indexFromItem(mReminderItem); } + +/*! + Set reminder off. + */ +void CalenEditorReminderField::setReminderOff() +{ + // Create the remindar choices + QStringList reminderChoices; + reminderChoices << hbTrId("txt_calendar_setlabel_alarm_val_off"); + mReminderItem->setContentWidgetData(QString("items"), reminderChoices); + mReminderItem->setEnabled(false); +} + +/*! + Set the default alarm for a new all day event. + */ +void CalenEditorReminderField::setDefaultAlarmForAllDay() +{ + // Set default alarm if its a new entry. + if (mCalenEditor->isNewEntry()) { + AgendaAlarm reminder; + QDate defaultDate + (mCalenEditor->editedEntry()->startTime().date().addDays(-1)); + // Set default time. + mReminderTimeForAllDay.setHMS(18, 0, 0, 0); + setDisplayTime(); + QDateTime startDateTimeForAllDay( + mCalenEditor->editedEntry()->startTime().date(), QTime(0, 0)); + QDateTime defaultReminderDateTimeForAllDay + (defaultDate, mReminderTimeForAllDay); + int offsetInSecs = + defaultReminderDateTimeForAllDay.secsTo(startDateTimeForAllDay); + int offsetInMins = offsetInSecs/60; + reminder.setTimeOffset(offsetInMins); + reminder.setAlarmSoundName(QString(" ")); + // Set the reminder to the entry as well as original entry. + mCalenEditor->editedEntry()->setAlarm(reminder); + mCalenEditor->originalEntry()->setAlarm(reminder); + } +} + +/*! + Updates the reminder choices for an all day event. + \param referenceDate to indicate past or not. + */ +void CalenEditorReminderField::updateReminderChoicesForAllDay(QDate referenceDate) +{ + if (!mReminderTimeAdded){ + insertReminderTimeField(); + } + QStringList reminderChoicesForAllDay; + QDate tomorrow = QDate::currentDate().addDays(1); + QDate theDayAfterTomorrow = QDate::currentDate().addDays(2); + + if (referenceDate < QDate::currentDate() || + referenceDate == QDate::currentDate()) { + // Set reminder off for past event. + reminderChoicesForAllDay << hbTrId("off"); + mReminderItem->setContentWidgetData(QString("items"), + reminderChoicesForAllDay); + mReminderItem->setEnabled(false); + removeReminderTimeField(); + } else if (theDayAfterTomorrow < referenceDate || + theDayAfterTomorrow == referenceDate) { + reminderChoicesForAllDay << hbTrId("off") + << hbTrId("On event day") + << hbTrId("1 day before") + << hbTrId("2 days before"); + mReminderItem->setEnabled(true); + mCustomReminderTimeItem->setEnabled(true); + } else { + reminderChoicesForAllDay << hbTrId("off") + << hbTrId("On event day") + << hbTrId("1 day before"); + mReminderItem->setEnabled(true); + mCustomReminderTimeItem->setEnabled(true); + } + if (mReminderItem->isEnabled()) { + mReminderItem->setContentWidgetData(QString("items"), + reminderChoicesForAllDay); + } +} + +/*! + Insert the reminder time field for an all day event. + */ +void CalenEditorReminderField::insertReminderTimeField() +{ + HbDataFormModelItem::DataItemType itemType = + static_cast (ReminderTimeOffset); + + // If all day item is not added then insert at one level before. + int index = CalenEditorPrivate::ReminderTimeForAllDayItem; + if(!mCalenEditor->isAllDayFieldAdded()) { + index = CalenEditorPrivate::ReminderTimeForAllDayItem - 1; + } + mCustomReminderTimeItem = mCalenEditorModel->insertDataFormItem( + index, + itemType, + QString(hbTrId("Reminder Time")), + mCalenEditorModel->invisibleRootItem()); + if (currentReminderIndex() != 1){ + mReminderTimeForAllDay.setHMS(18,0,0,0); + } else { + mReminderTimeForAllDay.setHMS(8,0,0,0); + } + + mEditorForm->addConnection(mCustomReminderTimeItem, SIGNAL(clicked()), + this, SLOT(launchReminderTimePicker())); + setDisplayTime(); + mReminderTimeAdded = true; +} + +/*! + Set the reminder time selected by the user. + */ +void CalenEditorReminderField::setDisplayTime() +{ + HbExtendedLocale locale = HbExtendedLocale::system(); + QString timeString = locale.format( + mReminderTimeForAllDay, + r_qtn_time_usual_with_zero); + mCustomReminderTimeItem->setContentWidgetData("text", timeString); +} + +/*! + Remove the reminder time field if its not an all day event. + */ +void CalenEditorReminderField::removeReminderTimeField() +{ + mReminderTimeAdded = false; + if (mCustomReminderTimeItem) { + QModelIndex reminderIndex = + mCalenEditorModel->indexFromItem(mCustomReminderTimeItem); + mCalenEditorModel->removeItem( + mCalenEditorModel->index( + reminderIndex.row(), 0)); + mCustomReminderTimeItem = NULL; + } +} + +/*! + Launches time picker to select time. + */ +void CalenEditorReminderField::launchReminderTimePicker() +{ + mTimePicker = new HbDateTimePicker(mReminderTimeForAllDay); + mTimePicker->setTime(mReminderTimeForAllDay); + HbDialog *popUp = new HbDialog(); + popUp->setDismissPolicy(HbDialog::NoDismiss); + popUp->setTimeout(HbDialog::NoTimeout); + popUp->setContentWidget(mTimePicker); + popUp->setHeadingWidget( new HbLabel( + hbTrId("Reminder Time"))); + HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok")); + popUp->addAction(okAction); + connect(okAction, SIGNAL(triggered()), this, SLOT(setReminderTimeForAllDay())); + connect(okAction, SIGNAL(triggered()), popUp, SLOT(close())); + popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"), + popUp)); + popUp->open(); +} + +/*! + Set the reminder time chosen. + */ +void CalenEditorReminderField::setReminderTimeForAllDay() +{ + mReminderTimeForAllDay = mTimePicker->time(); + if (mReminderTimeForAllDay.isValid()) { + // Change the time displayed to that selected by the user. + setDisplayTime(); + handleReminderIndexChanged(currentReminderIndex()); + } +} + +/*! + Checks if reminder field is enabled or not. + */ +bool CalenEditorReminderField::isReminderFieldEnabled() +{ + return mReminderItem->isEnabled(); +} + +/*! + Returns the number of items present in the reminder option. + */ +int CalenEditorReminderField::reminderItemsCount() +{ + QVariant strings = mReminderItem->contentWidgetData("items"); + QStringList stringList(strings.toStringList()); + int count = stringList.count(); + return count; +} + +/*! + Returns the current chosen index. + */ +int CalenEditorReminderField::currentReminderIndex() +{ + QVariant countVariant = mReminderItem->contentWidgetData("currentIndex"); + int index = countVariant.toInt(); + return index; +} + +/*! + Sets the chosen index as current index. + /param index indicates the idex value to be set. + */ +void CalenEditorReminderField::setCurrentIndex(int index) +{ + mReminderItem->setContentWidgetData("currentIndex", index); +} + +/*! + Disables the reminder time field. + */ +void CalenEditorReminderField::disableReminderTimeField() +{ + if (mReminderTimeAdded) { + mCustomReminderTimeItem->setEnabled(false); + } +} + +/*! + Checks if reminder time field is added or not. + */ +bool CalenEditorReminderField::isReminderTimeForAllDayAdded() +{ + return mReminderTimeAdded; +} + // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 calendarui/caleneditor/src/caleneditorrepeatfield.cpp --- a/calendarui/caleneditor/src/caleneditorrepeatfield.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/caleneditor/src/caleneditorrepeatfield.cpp Fri May 14 15:51:09 2010 +0300 @@ -18,6 +18,7 @@ // System Includes +#include #include #include #include @@ -178,11 +179,11 @@ AgendaRepeatRule( AgendaRepeatRule::InvalidRule)); } - connect(mRepeatComboBox, SIGNAL(currentIndexChanged(int)), this, - SLOT(handleRepeatIndexChanged(int))); // Update the repeat choices depending upon the duration updateRepeatChoices(); + connect(mRepeatComboBox, SIGNAL(currentIndexChanged(int)), this, + SLOT(handleRepeatIndexChanged(int))); } /*! @@ -296,6 +297,7 @@ break; } mCalenEditor->addDiscardAction(); + mCalenEditor->updateReminderChoices(); } /*! @@ -314,10 +316,13 @@ { HbDataFormModelItem::DataItemType itemType = static_cast (RepeatUntilOffset); - - QModelIndex repeatIndex = mCalenEditorModel->indexFromItem(mRepeatItem); + + int index = CalenEditorPrivate::RepeatUntilItem; + if (!mCalenEditor->isReminderTimeForAllDayAdded()) { + index -= 1; + } mCustomRepeatUntilItem = mCalenEditorModel->insertDataFormItem( - CalenEditorPrivate::RepeatUntilItem, + index, itemType, QString( hbTrId( @@ -351,12 +356,19 @@ */ void CalenEditorRepeatField::launchRepeatUntilDatePicker() { + HbDialog *popUp = new HbDialog(); + popUp->setDismissPolicy(HbDialog::NoDismiss); + popUp->setTimeout(HbDialog::NoTimeout); + popUp->setHeadingWidget( new HbLabel( + hbTrId("txt_calendar_title_repeat_until"))); + popUp->setAttribute( Qt::WA_DeleteOnClose, true ); + if (mDatePicker) { mDatePicker = NULL; } if (mRepeatRuleType == AgendaRepeatRule::DailyRule) { QDate minDate = mCalenEditor->editedEntry()->endTime().date().addDays(1); - mDatePicker = new HbDateTimePicker(mRepeatUntilDate); + mDatePicker = new HbDateTimePicker(mRepeatUntilDate, popUp); mDatePicker->setMinimumDate(minDate); mDatePicker->setMaximumDate(QDate(31, 12, 2100)); mDatePicker->setDate(mRepeatUntilDate); @@ -367,36 +379,30 @@ } else { minDate = mCalenEditor->editedEntry()->endTime().date().addDays(14); } - mDatePicker = new HbDateTimePicker(mRepeatUntilDate); + mDatePicker = new HbDateTimePicker(mRepeatUntilDate, popUp); mDatePicker->setMinimumDate(minDate); mDatePicker->setMaximumDate(QDate(31, 12, 2100)); mDatePicker->setDate(mRepeatUntilDate); } else if (mRepeatRuleType == AgendaRepeatRule::MonthlyRule) { QDate minDate = mCalenEditor->editedEntry()->endTime().date().addMonths(1); - mDatePicker = new HbDateTimePicker(mRepeatUntilDate); + mDatePicker = new HbDateTimePicker(mRepeatUntilDate, popUp); mDatePicker->setMinimumDate(minDate); mDatePicker->setMaximumDate(QDate(31, 12, 2100)); mDatePicker->setDate(mRepeatUntilDate); } else if (mRepeatRuleType == AgendaRepeatRule::YearlyRule) { QDate minDate = mCalenEditor->editedEntry()->endTime().date().addYears(1); - mDatePicker = new HbDateTimePicker(mRepeatUntilDate); + mDatePicker = new HbDateTimePicker(mRepeatUntilDate, popUp); mDatePicker->setMinimumDate(minDate); mDatePicker->setMaximumDate(QDate(31, 12, 2100)); mDatePicker->setDate(mRepeatUntilDate); } - HbDialog popUp; - popUp.setDismissPolicy(HbDialog::NoDismiss); - popUp.setTimeout(HbDialog::NoTimeout); - popUp.setContentWidget(mDatePicker); - popUp.setHeadingWidget( new HbLabel( - hbTrId("txt_calendar_title_repeat_until"))); + popUp->setContentWidget(mDatePicker); + HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok")); - popUp.setPrimaryAction(okAction); + popUp->addAction(okAction); connect(okAction, SIGNAL(triggered()), this, SLOT(setRepeatUntilDate())); - connect(okAction, SIGNAL(triggered()), &popUp, SLOT(close())); - popUp.setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), - &popUp)); - popUp.exec(); + popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"), popUp)); + popUp->open(); } /*! @@ -411,6 +417,15 @@ r_qtn_date_usual_with_zero); mCustomRepeatUntilItem->setContentWidgetData("text", dateString); } + mCalenEditor->updateReminderChoices(); +} + +/*! + Returns the repeatuntildate displayed. + */ +QDate CalenEditorRepeatField::repeatUntilDate() +{ + return mRepeatUntilDate; } /*! @@ -526,7 +541,6 @@ } // Set the previous user's choice mRepeatComboBox->setCurrentIndex(choice); - handleRepeatIndexChanged(choice); } /*! diff -r fd30d51f876b -r a949c2543c15 calendarui/calenplugins/calenplugins.pro --- a/calendarui/calenplugins/calenplugins.pro Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/calenplugins/calenplugins.pro Fri May 14 15:51:09 2010 +0300 @@ -17,7 +17,6 @@ TEMPLATE = subdirs -SUBDIRS += calensettingsplugin SUBDIRS += agendaeventviewerplugin CONFIG += ordered diff -r fd30d51f876b -r a949c2543c15 calendarui/calenplugins/calensettingsplugin/calensettingsplugin.pro --- a/calendarui/calenplugins/calensettingsplugin/calensettingsplugin.pro Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: This is the project file defnition for calensettingsplugin. -# - - -TEMPLATE = lib -TARGET = calensettingsplugin -DEPENDPATH += . \ - ./inc \ - ./src -INCLUDEPATH += . \ - ../../inc - -CONFIG += hb plugin - - -symbian: { - - TARGET.EPOCALLOWDLLDATA = 1 - TARGET.UID3 = 0x2002B338 - - LIBS += -lcalensettings \ - -lcpframework - - deploy.path = C: - headers.sources = qmakepluginstubs/calensettingsplugin.qtplugin - headers.path = /resource/qt/plugins/controlpanel - - # This is for new exporting system coming in garden - for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" - - TARGET.CAPABILITY = CAP_GENERAL_DLL - - plugin.sources = calensettingsplugin.dll - plugin.path = \resource\qt\plugins\controlpanel - DEPLOYMENT += plugin -} - -# Input -HEADERS += calensettingsplugin.h \ - calendarsettingsview.h - -SOURCES += calensettingsplugin.cpp \ - calendarsettingsview.cpp - - -# End of file --Don't remove this. \ No newline at end of file diff -r fd30d51f876b -r a949c2543c15 calendarui/calenplugins/calensettingsplugin/inc/calendarsettingsview.h --- a/calendarui/calenplugins/calensettingsplugin/inc/calendarsettingsview.h Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: - * - * Description: - * -*/ - -#ifndef CalendarSettingsView_H_ -#define CalendarSettingsView_H_ - -#include - -class SettingsUiUtility; - -class CalendarSettingsView : public CpBaseSettingView -{ - Q_OBJECT -public: - explicit CalendarSettingsView(QGraphicsItem *parent = 0); - virtual ~CalendarSettingsView(); -public slots: - -private: - SettingsUiUtility *mSettingsUtility; - -}; -#endif// CalendarSettingsView_H_ diff -r fd30d51f876b -r a949c2543c15 calendarui/calenplugins/calensettingsplugin/inc/calensettingsplugin.h --- a/calendarui/calenplugins/calensettingsplugin/inc/calensettingsplugin.h Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: - * - * Description: - * -*/ - - -#ifndef CalenSettingsPlugin_H_ -#define CalenSettingsPlugin_H_ - -#include -#include - -class CpItemDataHelper; - -class CalenSettingsPlugin : public QObject, public CpPluginPlatInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginPlatInterface) - -public: - CalenSettingsPlugin(); - virtual ~CalenSettingsPlugin(); - - virtual int uid() const; - virtual CpSettingFormItemData *createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; - -#endif /* CalenSettingsPlugin_H_ */ diff -r fd30d51f876b -r a949c2543c15 calendarui/calenplugins/calensettingsplugin/src/calendarsettingsview.cpp --- a/calendarui/calenplugins/calensettingsplugin/src/calendarsettingsview.cpp Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: - * - * Description: - * -*/ - - -#include -#include "calendarsettingsview.h" -#include "calensettings.h" - -CalendarSettingsView::CalendarSettingsView(QGraphicsItem *parent) -:CpBaseSettingView(0, parent) -{ - HbDataForm *form = settingForm(); - - if (form) { - form->setHeading(hbTrId("txt_calendar_subhead_calendar_settings")); - - CalenSettings *settings = new CalenSettings(form); - settings->createModel(); - settings->populateSettingList(); - } -} - -CalendarSettingsView::~CalendarSettingsView() -{ -} diff -r fd30d51f876b -r a949c2543c15 calendarui/calenplugins/calensettingsplugin/src/calensettingsplugin.cpp --- a/calendarui/calenplugins/calensettingsplugin/src/calensettingsplugin.cpp Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: - * - * Description: - * -*/ - -#include - -#include "calensettingsplugin.h" -#include "calendarsettingsview.h" -#include - - -CalenSettingsPlugin::CalenSettingsPlugin() -{ -} - -CalenSettingsPlugin::~CalenSettingsPlugin() -{ -} - -int CalenSettingsPlugin::uid() const -{ - // TODO: get a uid and replace it. - return 0x20029F7F; -} - -CpSettingFormItemData *CalenSettingsPlugin::createSettingFormItemData(CpItemDataHelper& itemDataHelper) const -{ - //CpItemDataHelper* pHelper = new CpItemDataHelper(); - - // For now dummyicon - HbIcon* icon = new HbIcon(); - return new CpSettingFormEntryItemDataImpl(itemDataHelper, QString("Calendar application"), - QString("Calendar settings plugin"), *icon); -} - -Q_EXPORT_PLUGIN2(CalenSettingsPlugin, CalenSettingsPlugin) diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/data/xml/calendayview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/controller/data/xml/calendayview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + +
+
+ + + + + + + + + + +
+ + + + + + + +
diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/data/xml/calenmonthview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/controller/data/xml/calenmonthview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,518 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/inc/calenactionuiutils.h --- a/calendarui/controller/inc/calenactionuiutils.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/controller/inc/calenactionuiutils.h Fri May 14 15:51:09 2010 +0300 @@ -42,13 +42,6 @@ { public: - enum TDeleteConfirmationType - { - EDeleteEntry = 1, - EDeleteToDo, - EDeleteToDos, - EDeleteAll - }; enum TRepeatQueryType { @@ -78,9 +71,6 @@ AgendaEntry& entry, const bool status ); - static int showDeleteConfirmationQueryL(const TDeleteConfirmationType type, - const TInt count = 0); - private: // Construction and destruction // Hiding constructor, because this is static utility class. //lint -e{1526} diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/inc/calencontroller.h --- a/calendarui/controller/inc/calencontroller.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/controller/inc/calencontroller.h Fri May 14 15:51:09 2010 +0300 @@ -62,25 +62,32 @@ { public: // Construction and destruction - /** + /** * C++ constructor */ CCalenController(bool isFromServiceFrmwrk); /** - * Constructs CCalenController with existing CAknViewAppUi. If the - * controller has been previously initialized with the same CAknViewAppUi, - * the existing instance will be returned. - * @param aAppUi Reference to CAknViewAppUi - * @return CCalenController pointer - */ - static CCalenController* InstanceL(); + * Constructs CCalenController with existing CAknViewAppUi. If the + * controller has been previously initialized with the same CAknViewAppUi, + * the existing instance will be returned. + * @param aAppUi Reference to CAknViewAppUi + * @return CCalenController pointer + */ + static CCalenController* InstanceL(); - /** - * CCalenController is a reference counting singleton. Call Release() - * when you are done with it, it will clean itself when it needs to - */ - void Release(); + + /** + * Releases all plugins, should only be called when + * the application is exiting. + */ + void ReleaseCustomisations(); + + /** + * CCalenController is a reference counting singleton. Call Release() + * when you are done with it, it will clean itself when it needs to + */ + void Release(); /** * destructor diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/inc/calendeleteui.h --- a/calendarui/controller/inc/calendeleteui.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/controller/inc/calendeleteui.h Fri May 14 15:51:09 2010 +0300 @@ -29,11 +29,19 @@ #include "calenactionuiutils.h" #include "calennotificationhandler.h" #include "calencommandhandler.h" - +#include "hb_calencommands.hrh" // FORWARD DECLARATIONS class CCalenController; +class HbAction; +enum TDeleteConfirmationType +{ + EDeleteEntry = 1, + EDeleteToDo, + EDeleteToDos, + EDeleteAll +}; // CLASS DECLARATION /** @@ -121,28 +129,21 @@ void deleteEntriesEndingAtMidnight( QDateTime aMidnight ); /** - * Delete entry by passing CCalEntryView and CCalEntry - * Will query user for confirmation before deletion - * @return ETrue user confirms to delete EFalse otherwise - */ - TBool DeleteEntryL( AgendaEntry& aEntry ); - - /** * Delete entry without querying the user */ TBool DeleteEntryWithoutQueryL(); - + /** * Delete the given entry. Ask the user whether to delete the * instance or the entire series. */ - TBool DeleteSingleInstanceL( AgendaEntry& aInstance ); + void DeleteSingleInstanceL( AgendaEntry& aInstance ); /** * Delete the given entry, using aRepeatType to determine * whether to delete the instance or the entire series. */ - TBool DeleteSingleInstanceL( AgendaEntry& aInstance, + void DeleteSingleInstanceL( AgendaEntry& aInstance, AgendaUtil::RecurrenceRange aRepeatType ); /** @@ -152,7 +153,7 @@ * @param aRepeatType Repeat type choosen to apply on delete * @return ETrue is user confirms to delete, EFalse otherwise */ - TBool DoDeleteSingleInstanceL( AgendaEntry& aInstance, + void DoDeleteSingleInstanceL( AgendaEntry& aInstance, bool aHasRepeatType, AgendaUtil::RecurrenceRange aRepeatType ); @@ -162,11 +163,6 @@ void HandleECalenNotifyViewCreatedL(); /** - * Multiple entries delete query - */ - TInt ShowMultipleEntriesDeleteQueryL(int aCount); - - /** * Get the date from user. */ void dateQuery(); @@ -177,6 +173,18 @@ * or the entire series of a repeating entry */ void showRepeatingEntryDeleteQuery(); + + /** + * Shows a confirmation query to the user if + * he/she wants to delete instance/instances + */ + void showDeleteQuery(const TDeleteConfirmationType type, + const int count = 0); + + /** + * Deletes the entries before the selected date + */ + void getSelectedDateAndDelete(); private: // own methods /** @@ -200,7 +208,9 @@ public slots: void doCompleted( int aFirstPassError ); - void getSelectedDate(); + void handleDateQuery(HbAction* action); + void handleDeletion(HbAction* action); + void handleDeleteCancel(); private slots: void handleRepeatedEntryDelete(int index); @@ -228,20 +238,20 @@ bool iIsDeleting; // True, if asynchronous delete is running QDateTime iStartTime; QDateTime iEndTime; - QDateTime mDateTime; // Get the date selected by user. HbDateTimePicker *mDatePicker; // Confirmation note id is stored here. Note is shown when asynchronous // delete completes. int iConfirmationNoteId; CCalenController& iController; - + TCalenCommandId mDeleteCommand; + AgendaUtil::RecurrenceRange mRecurrenceRange; + // Stored command if the entry view // needs to constructed asyncronously TCalenCommand iStoredCommand; int iMutlipleContextIdsCount; bool iMoreEntriesToDelete; bool iDisplayQuery; - bool mIsDateValid; int iEntriesToDelete; }; diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/inc/calenviewmanager.h --- a/calendarui/controller/inc/calenviewmanager.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/controller/inc/calenviewmanager.h Fri May 14 15:51:09 2010 +0300 @@ -95,6 +95,8 @@ void removeDayViews(); + void constructOtherViews(); + public: // from MCalenNotificationHandler /** @@ -132,16 +134,16 @@ * day */ void loadAlternateDayView(); - - public slots: - void constructOtherViews(); private slots: + void handleMainViewReady(); void handleViewingCompleted(const QDate date); void handleEditingStarted(); void handleEditingCompleted(); void handleDeletingStarted(); void handleDeletingCompleted(); + void handleInstanceViewCreation(int status); + void handleEntryViewCreation(int status); private: // Data diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/src/calenactionuiutils.cpp --- a/calendarui/controller/src/calenactionuiutils.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/controller/src/calenactionuiutils.cpp Fri May 14 15:51:09 2010 +0300 @@ -105,62 +105,4 @@ TRACE_EXIT_POINT; } -int CalenActionUiUtils::showDeleteConfirmationQueryL(const TDeleteConfirmationType type, - const int count) - { - TRACE_ENTRY_POINT; - int retStatus = 0; - - - HbMessageBox popup(HbMessageBox::MessageTypeQuestion); - popup.setIconVisible(true); - popup.setTimeout(HbPopup::NoTimeout); - - QString text = 0; - - switch(type) - { - case CalenActionUiUtils::EDeleteEntry: - { - // TODO: Add the text id - text.append("Delete entry?"); - break; - } - case CalenActionUiUtils::EDeleteToDo: - { - text.append(hbTrId("txt_calendar_info_delete_todo_note")); - break; - } - case CalenActionUiUtils::EDeleteToDos: - {//"Delete %N to-do notes?" - // TODO: Add the text id - text.append("Delete %N to-do's?").arg(count); - break; - } - case CalenActionUiUtils::EDeleteAll: - { - text.append(hbTrId("txt_calendar_info_delete_all_calendar_entries")); - break; - } - default: - break; - } - - popup.setText(text); - - popup.setPrimaryAction(new HbAction( - hbTrId("txt_calendar_button_delete"), &popup)); - popup.setSecondaryAction(new HbAction( - hbTrId("txt_calendar_button_cancel"), &popup)); - HbAction *selected = popup.exec(); - if (selected == popup.primaryAction()) { - retStatus = 1; - } - - TRACE_EXIT_POINT - return retStatus; - } - - - // End of file diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/src/calencontroller.cpp --- a/calendarui/controller/src/calencontroller.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/controller/src/calencontroller.cpp Fri May 14 15:51:09 2010 +0300 @@ -51,6 +51,7 @@ TRACE_ENTRY_POINT; iIsFromServiceFrmWrk = isFromServiceFrmwrk; iNextServicesCommandBase = KCustomCommandRangeStart; + iRefCount = 0; // Store the pointer in tls, also avoid multiple creations checkMultipleCreation(); @@ -171,7 +172,24 @@ TRACE_EXIT_POINT; return self; } + +// ---------------------------------------------------------------------------- +// CCalenController::ReleaseCustomisations +// Releases any plugins by deleting the customisation manager +// should only be called on exiting by the application. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CCalenController::ReleaseCustomisations() + { + TRACE_ENTRY_POINT; + delete iCustomisationManager; + iCustomisationManager = NULL; + + TRACE_EXIT_POINT; + } + // ---------------------------------------------------------------------------- // CCalenController::Release // Decrement the reference count of this singleton. @@ -204,14 +222,38 @@ CCalenController::~CCalenController() { TRACE_ENTRY_POINT; + if ( iServices ) { iServices->Release(); } - delete iNotifier; - delete iActionUi; - delete iViewManager; - delete iCustomisationManager; + + if( iNotifier ) + { + delete iNotifier; + iNotifier = NULL; + } + + if( iActionUi ) + { + delete iActionUi; + iActionUi = NULL; + } + + if( iViewManager ) + { + delete iViewManager; + iViewManager = NULL; + } + + if( iCustomisationManager ) + { + delete iCustomisationManager; + iCustomisationManager = NULL; + } + + + Dll::SetTls( NULL ); TRACE_EXIT_POINT; } diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/src/calendeleteui.cpp --- a/calendarui/controller/src/calendeleteui.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/controller/src/calendeleteui.cpp Fri May 14 15:51:09 2010 +0300 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,6 @@ // User includes #include "calendarui_debug.h" #include "calendeleteui.h" -#include "hb_calencommands.hrh" #include "calencontext.h" #include "calencontroller.h" #include "CleanupResetAndDestroy.h" @@ -139,28 +139,35 @@ { TRACE_ENTRY_POINT; TBool continueCommand(EFalse); - + switch( aCommand.Command() ) { case ECalenDeleteCurrentEntry: - - DeleteCurrentEntryL(); // Entry & instance + mDeleteCommand = ECalenDeleteCurrentEntry; + DeleteCurrentEntryL(); // Entry & instance break; case ECalenDeleteSeries: - DeleteThisOrAllL( AgendaUtil::ThisAndAll ); + mDeleteCommand = ECalenDeleteSeries; + DeleteThisOrAllL( AgendaUtil::ThisAndAll ); break; case ECalenDeleteCurrentOccurrence: - DeleteThisOrAllL( AgendaUtil::ThisOnly ); + mDeleteCommand = ECalenDeleteCurrentOccurrence; + DeleteThisOrAllL( AgendaUtil::ThisOnly ); break; case ECalenDeleteEntryWithoutQuery: - continueCommand = DeleteEntryWithoutQueryL(); + //TODO: + // This case is not handled currently as no such commands + // has been issued. So this has to be handled once we start + // issuing the command. + /*continueCommand = DeleteEntryWithoutQueryL();*/ break; case ECalenDeleteAllEntries: - DeleteAllEntriesL(); // EntryView & instance + mDeleteCommand = ECalenDeleteAllEntries; + DeleteAllEntriesL(); // EntryView & instance break; case ECalenDeleteEntriesBeforeDate: @@ -186,26 +193,21 @@ // ---------------------------------------------------------------------------- // void CalenDeleteUi::DeleteThisOrAllL( AgendaUtil::RecurrenceRange aRepeatType ) - { - TRACE_ENTRY_POINT; - - bool isDeleted( false ); - - if( iController.context().instanceId().mEntryLocalUid ) - { - AgendaEntry instance = - CalenActionUiUtils::findPossibleInstanceL(iController.context().instanceId(), - iController.Services().agendaInterface() ); - if( !instance.isNull() ) - { - isDeleted = DeleteSingleInstanceL( instance, aRepeatType ); - } - } - iController.BroadcastNotification( isDeleted? ECalenNotifyEntryDeleted : - ECalenNotifyDeleteFailed ); - - TRACE_EXIT_POINT; - } +{ + TRACE_ENTRY_POINT; + + if( iController.context().instanceId().mEntryLocalUid ) + { + AgendaEntry instance = CalenActionUiUtils::findPossibleInstanceL( + iController.context().instanceId(), + iController.Services().agendaInterface() ); + if( !instance.isNull() ) + { + DeleteSingleInstanceL( instance, aRepeatType ); + } + } + TRACE_EXIT_POINT; +} // ---------------------------------------------------------------------------- // CalenDeleteUi::DeleteEntryWithoutQueryL() @@ -228,7 +230,7 @@ if(!iMoreEntriesToDelete) { - iDisplayQuery = ShowMultipleEntriesDeleteQueryL(iMutlipleContextIdsCount); + //iDisplayQuery = ShowMultipleEntriesDeleteQueryL(iMutlipleContextIdsCount); } if(iDisplayQuery) @@ -290,47 +292,38 @@ // void CalenDeleteUi::DeleteCurrentEntryL() { - TRACE_ENTRY_POINT; + TRACE_ENTRY_POINT; + + // Make sure we're focused on an entry. + if (iController.context().instanceId().mEntryLocalUid) { + // Fetch the entry + AgendaEntry entry = iController.Services().agendaInterface()->fetchById( + iController.context().instanceId().mEntryLocalUid); - bool deleted( false ); - TCalenNotification notification = ECalenNotifyDeleteFailed; - - // Make sure we're focused on an entry. - if (iController.context().instanceId().mEntryLocalUid) { - // Fetch the entry - AgendaEntry entry = iController.Services().agendaInterface()->fetchById( - iController.context().instanceId().mEntryLocalUid); - - // Check if the entry is a To-Do - if (AgendaEntry::TypeTodo == entry.type()) { - if(!entry.isNull()) { - deleted = DeleteEntryL(entry); - if(deleted) { - // Delete is successful - notification = ECalenNotifyEntryDeleted; - } - } - } - else { - if (entry.isRepeating() || !entry.recurrenceId().isNull()) { - // Show a confirmation note whether the user - // wants to delete the single instance or all of them - showRepeatingEntryDeleteQuery(); - } else { - // If the entry is not a repeating entry, - // delete it directly - deleted = DeleteEntryL(entry); - if (deleted) { - // Delete is successful - notification = ECalenNotifyEntryDeleted; - } - } - } - } - - iController.BroadcastNotification( notification ); - - TRACE_EXIT_POINT; + // Check if the entry is a To-Do + if (AgendaEntry::TypeTodo == entry.type()) { + if(!entry.isNull()) { + showDeleteQuery(entry.type() == AgendaEntry::TypeTodo ? + EDeleteToDo : + EDeleteEntry ); + } + } + else { + if (entry.isRepeating() || !entry.recurrenceId().isNull()) { + // Show a confirmation note whether the user + // wants to delete the single instance or all of them + showRepeatingEntryDeleteQuery(); + } else { + // If the entry is not a repeating entry, + // delete it directly + // Save the entry for later reference in the slot + showDeleteQuery(entry.type() == AgendaEntry::TypeTodo ? + EDeleteToDo : + EDeleteEntry ); + } + } + } + TRACE_EXIT_POINT; } // ---------------------------------------------------------------------------- @@ -341,24 +334,10 @@ // void CalenDeleteUi::DeleteAllEntriesL() { - TRACE_ENTRY_POINT; - ASSERT( !iIsDeleting ); - const int buttonId = CalenActionUiUtils::showDeleteConfirmationQueryL( - CalenActionUiUtils::EDeleteAll ); - if( buttonId ) - { - HandleDeleteMultipleEventsL( AgendaUtil::minTime(), AgendaUtil::maxTime(),1 ); - } - else - { - // notify delete failed - iController.BroadcastNotification(ECalenNotifyDeleteFailed); - } - - TRACE_EXIT_POINT; - } + showDeleteQuery(EDeleteAll ); + } // ---------------------------------------------------------------------------- // CalenDeleteUi::DeleteEntriesBeforeDateL @@ -369,63 +348,72 @@ void CalenDeleteUi::DeleteEntriesBeforeDateL() { TRACE_ENTRY_POINT; - ASSERT( !iIsDeleting ); - - TCalenNotification notification = ECalenNotifyDeleteFailed; // launch the datepicker - mIsDateValid = false; dateQuery(); - - if( mIsDateValid ) - { - // Do delete only if inputted day is after beginning of range - if( mDateTime > AgendaUtil::minTime() ) - { - // Two pass delete: - // 1. pass - // To prevent destroying entries starting and ending midnight - // subtract one second and do delete on that range. - mDateTime = mDateTime.addSecs(-1); - mDateTime = ( mDateTime > AgendaUtil::minTime()? mDateTime : AgendaUtil::minTime()); - - HandleDeleteMultipleEventsL( AgendaUtil::minTime(), - mDateTime,1 ); - notification = ECalenNotifyMultipleEntriesDeleted; - } - } - - iController.BroadcastNotification( notification ); TRACE_EXIT_POINT; } - + +// ---------------------------------------------------------------------------- +// CalenDeleteUi::dateQuery +// Launches the popup for the date selection +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// void CalenDeleteUi::dateQuery() { // Create a popup with datepicker to select the date. + HbDialog *popUp = new HbDialog(); + popUp->setDismissPolicy(HbDialog::NoDismiss); + popUp->setTimeout(HbDialog::NoTimeout ); + popUp->setAttribute( Qt::WA_DeleteOnClose, true ); + popUp->setHeadingWidget(new HbLabel(hbTrId("txt_calendar_title_set_date"))); + QDateTime currentDateTime(CalenDateUtils::today()); QDate currentDate(currentDateTime.date()); - mDatePicker = new HbDateTimePicker(currentDate); + if(mDatePicker) { + mDatePicker = NULL; + } + mDatePicker = new HbDateTimePicker(popUp); mDatePicker->setMinimumDate(CalenDateUtils::minTime().date()); mDatePicker->setMaximumDate(currentDate); - HbDialog popUp; - popUp.setDismissPolicy(HbDialog::NoDismiss); - popUp.setTimeout(HbDialog::NoTimeout ); - popUp.setHeadingWidget(new HbLabel(hbTrId("txt_calendar_title_set_date"))); - popUp.setContentWidget(mDatePicker); - HbAction *okAction = new HbAction(hbTrId("txt_calendar_button_dialog_delete")); - popUp.setPrimaryAction(okAction); - connect(okAction,SIGNAL(triggered()),this,SLOT(getSelectedDate())); - connect(okAction,SIGNAL(triggered()),&popUp,SLOT(close())); - popUp.setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"),&popUp)); - popUp.exec(); + mDatePicker->setDate(currentDate); + + popUp->setContentWidget(mDatePicker); + + popUp->addAction(new HbAction(hbTrId("txt_calendar_button_dialog_delete"))); + popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"),popUp)); + // Show the popup + popUp->open(this, SLOT(handleDateQuery(HbAction*))); } +// ---------------------------------------------------------------------------- +// CalenDeleteUi::handleDateQuery +// Handles the selection for the date query +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CalenDeleteUi::handleDateQuery(HbAction* action) +{ + if(action->text() == hbTrId("txt_calendar_button_dialog_delete")) { + getSelectedDateAndDelete(); + }else { + handleDeleteCancel(); + } +} +// ---------------------------------------------------------------------------- +// CalenDeleteUi::showRepeatingEntryDeleteQuery +// Launches the popup for deleting the repeating entry +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// void CalenDeleteUi::showRepeatingEntryDeleteQuery() { - HbDialog popUp; - popUp.setDismissPolicy(HbDialog::NoDismiss); - popUp.setTimeout(HbDialog::NoTimeout); + HbDialog *popUp = new HbDialog(); + popUp->setDismissPolicy(HbDialog::NoDismiss); + popUp->setTimeout(HbDialog::NoTimeout); + popUp->setAttribute( Qt::WA_DeleteOnClose, true ); QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); HbWidget *editWidget = new HbWidget(); @@ -441,38 +429,67 @@ layout->addItem(editButtonList); - popUp.setContentWidget(editWidget); - popUp.setHeadingWidget(new HbLabel( + popUp->setContentWidget(editWidget); + popUp->setHeadingWidget(new HbLabel( hbTrId("txt_calendar_title_delete_repeated_entry"))); - connect(editButtonList, SIGNAL(itemSelected(int)), this, - SLOT(handleRepeatedEntryDelete(int))); - connect(editButtonList, SIGNAL(itemSelected(int)), &popUp, SLOT(close())); - - // Create secondary action + // Add cancel action HbAction *cancelAction = new HbAction( hbTrId("txt_calendar_button_softkey1_cancel")); - popUp.setSecondaryAction(cancelAction); - connect(cancelAction, SIGNAL(triggered()), this, SLOT(handleCancel())); - connect(cancelAction, SIGNAL(triggered()), &popUp, SLOT(close())); + popUp->addAction(cancelAction); + connect(editButtonList, SIGNAL(itemSelected(int)), this, + SLOT(handleRepeatedEntryDelete(int))); + connect(editButtonList, SIGNAL(itemSelected(int)), popUp, SLOT(close())); + connect(cancelAction, SIGNAL(triggered()), this, + SLOT(handleDeleteCancel())); // Show the popup - popUp.exec(); + popUp->open(); +} + +// ---------------------------------------------------------------------------- +// CalenDeleteUi::handleDeleteCancel +// Handles the cancel action +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CalenDeleteUi::handleDeleteCancel() +{ + iController.BroadcastNotification(ECalenNotifyDeleteFailed); } -void CalenDeleteUi::getSelectedDate() - { - QDate selectedDate(mDatePicker->date()); - +// ---------------------------------------------------------------------------- +// CalenDeleteUi::getSelectedDateAndDelete +// Deletes the entries before the selected date +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CalenDeleteUi::getSelectedDateAndDelete() +{ + QDate selectedDate(mDatePicker->date()); + // Check if the date is within the range. - if(selectedDate.isValid()) - { + if(selectedDate.isValid()) { QTime time(0,0,0,0); - mDateTime.setDate(selectedDate); - mDateTime.setTime(time); - mIsDateValid = true; + QDateTime dateTime; + dateTime.setDate(selectedDate); + dateTime.setTime(time); + // Do delete only if inputted day is after beginning of range + if(dateTime > AgendaUtil::minTime()) { + // Two pass delete: + // 1. pass + // To prevent destroying entries starting and ending midnight + // subtract one second and do delete on that range. + dateTime = dateTime.addSecs(-1); + dateTime = ( dateTime > AgendaUtil::minTime()? dateTime : AgendaUtil::minTime()); + + HandleDeleteMultipleEventsL( AgendaUtil::minTime(), dateTime,1 ); + iController.BroadcastNotification(ECalenNotifyEntryDeleted); + }else { + iController.BroadcastNotification(ECalenNotifyDeleteFailed); } - } + } +} void CalenDeleteUi::handleRepeatedEntryDelete(int index) { @@ -498,6 +515,127 @@ } } +// ---------------------------------------------------------------------------- +// CalenDeleteUi::showDeleteQuery +// Launches the popup for deleting the instance/instances +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CalenDeleteUi::showDeleteQuery(const TDeleteConfirmationType type, + const int count) + { + HbMessageBox *popup = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + popup->setDismissPolicy(HbDialog::NoDismiss); + popup->setTimeout(HbDialog::NoTimeout); + popup->setAttribute( Qt::WA_DeleteOnClose, true ); + + QString text = 0; + + switch(type) + { + case EDeleteEntry: + { + // TODO: Add the text id + text.append("Delete entry?"); + break; + } + case EDeleteToDo: + { + text.append(hbTrId("txt_calendar_info_delete_todo_note")); + break; + } + case EDeleteToDos: + {//"Delete %N to-do notes?" + // TODO: Add the text id + text.append("Delete %N to-do's?").arg(count); + break; + } + case EDeleteAll: + { + text.append(hbTrId("txt_calendar_info_delete_all_calendar_entries")); + break; + } + default: + break; + } + + popup->setText(text); + + QList list = popup->actions(); + for(int i=0; i < list.count(); i++) + { + popup->removeAction(list[i]); + } + popup->addAction(new HbAction(hbTrId("txt_calendar_button_delete"), popup)); + popup->addAction(new HbAction( + hbTrId("txt_calendar_button_cancel"), popup)); + popup->open(this, SLOT(handleDeletion(HbAction*))); + } + +// ---------------------------------------------------------------------------- +// CalenDeleteUi::handleDeletion +// Deletes the entries based on the user selection +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CalenDeleteUi::handleDeletion(HbAction* action) +{ + TCalenNotification notification = ECalenNotifyDeleteFailed; + + if(action->text() == hbTrId("txt_calendar_button_delete")) { + + switch (mDeleteCommand) { + + case ECalenDeleteCurrentEntry: + { + // Get the entry + AgendaEntry entry = + iController.Services().agendaInterface()->fetchById( + iController.context().instanceId().mEntryLocalUid); + // Delete the entry if the delete button is been pressed + iController.Services().agendaInterface()->deleteEntry(entry.id()); + notification = ECalenNotifyEntryDeleted; + } + break; + + case ECalenDeleteSeries: + case ECalenDeleteCurrentOccurrence: + { + AgendaEntry instance = + CalenActionUiUtils::findPossibleInstanceL( + iController.context().instanceId(), + iController.Services().agendaInterface() ); + QDateTime recId = instance.recurrenceId().toUTC(); + const bool child = recId.isNull(); + + if( !child || mRecurrenceRange == AgendaUtil::ThisOnly + || mRecurrenceRange == AgendaUtil::ThisAndAll) { + iController.Services().agendaInterface()->deleteRepeatedEntry( + instance, mRecurrenceRange ); + } + notification = ECalenNotifyEntryDeleted; + } + break; + + case ECalenDeleteAllEntries: + { + HandleDeleteMultipleEventsL( AgendaUtil::minTime(), + AgendaUtil::maxTime(),1 ); + notification = ECalenNotifyEntryDeleted; + } + break; + + default: + break; + + } + } + // If the user presses cancel button the notification will be + // ECalenNotifyDeleteFailed as default. + // Notify the status + iController.BroadcastNotification(notification); +} + void CalenDeleteUi::entryDeleted(ulong id) { if (iController.context().instanceId().mEntryLocalUid == id) { @@ -639,11 +777,11 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -TBool CalenDeleteUi::DeleteSingleInstanceL( AgendaEntry& aInstance ) +void CalenDeleteUi::DeleteSingleInstanceL( AgendaEntry& aInstance ) { TRACE_ENTRY_POINT; + DoDeleteSingleInstanceL( aInstance, EFalse, AgendaUtil::ThisAndAll ); TRACE_EXIT_POINT; - return DoDeleteSingleInstanceL( aInstance, EFalse, AgendaUtil::ThisAndAll ); } // ----------------------------------------------------------------------------- @@ -652,12 +790,13 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -TBool CalenDeleteUi::DeleteSingleInstanceL( AgendaEntry& aInstance, +void CalenDeleteUi::DeleteSingleInstanceL( AgendaEntry& aInstance, AgendaUtil::RecurrenceRange aRepeatType ) { TRACE_ENTRY_POINT; + DoDeleteSingleInstanceL( aInstance, ETrue, aRepeatType ); TRACE_EXIT_POINT; - return DoDeleteSingleInstanceL( aInstance, ETrue, aRepeatType ); + } // ----------------------------------------------------------------------------- @@ -669,107 +808,43 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -TBool CalenDeleteUi::DoDeleteSingleInstanceL( AgendaEntry& aInstance, - bool aHasRepeatType, - AgendaUtil::RecurrenceRange aRepeatType ) - { - TRACE_ENTRY_POINT; - - bool repeating = aInstance.isRepeating(); - - if( !repeating ) - { - // Even though there is no RRule, the entry might - // have a list of rdates. - QList rDates = aInstance.rDates(); - repeating = ( rDates.count() > 0 ); - } - QDateTime recId = aInstance.recurrenceId().toUTC(); - const bool child = recId.isNull(); - - if( !aHasRepeatType ) - { - aRepeatType = AgendaUtil::ThisAndAll; - } +void CalenDeleteUi::DoDeleteSingleInstanceL( + AgendaEntry& aInstance, + bool aHasRepeatType, + AgendaUtil::RecurrenceRange aRepeatType ) +{ + TRACE_ENTRY_POINT; + bool repeating = aInstance.isRepeating(); - bool doDelete( ETrue ); - - if( !aHasRepeatType && ( child || repeating ) && ( aInstance.type() != AgendaEntry::TypeAnniversary ) ) - { - //doDelete = CalenActionUiUtils::ShowRepeatTypeQueryL( aRepeatType, - // CalenActionUiUtils::EDelete ); - } - else - { - doDelete = CalenActionUiUtils::showDeleteConfirmationQueryL(aInstance.type() == AgendaEntry::TypeTodo ? - CalenActionUiUtils::EDeleteToDo : - CalenActionUiUtils::EDeleteEntry ); - } - - if( doDelete ) - { - if( !child || aRepeatType == AgendaUtil::ThisOnly ) - { - iController.Services().agendaInterface()->deleteRepeatedEntry( aInstance, aRepeatType ); - } - else if( aRepeatType == AgendaUtil::ThisAndAll ) - { - iController.Services().agendaInterface()->deleteRepeatedEntry( aInstance, aRepeatType ); - } - } + if( !repeating ) { + // Even though there is no RRule, the entry might + // have a list of rdates. + QList rDates = aInstance.rDates(); + repeating = ( rDates.count() > 0 ); + } + QDateTime recId = aInstance.recurrenceId().toUTC(); + const bool child = recId.isNull(); - TRACE_EXIT_POINT; - return doDelete; - } - -// ----------------------------------------------------------------------------- -// CalenDeleteUi::DeleteEntryL -// Deletes an entry from the database -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CalenDeleteUi::DeleteEntryL( AgendaEntry& entry ) - { - TRACE_ENTRY_POINT; - - TBool doDelete = CalenActionUiUtils::showDeleteConfirmationQueryL(entry.type() == AgendaEntry::TypeTodo ? - CalenActionUiUtils::EDeleteToDo : - CalenActionUiUtils::EDeleteEntry ); - - if( doDelete ) - { - iController.Services().agendaInterface()->deleteEntry(entry.id()); - } + if( !aHasRepeatType ) { + aRepeatType = AgendaUtil::ThisAndAll; + } + // For later reference in handleDeletion() + mRecurrenceRange = aRepeatType; - TRACE_EXIT_POINT; - return doDelete; - } - -// ----------------------------------------------------------------------------- -// CalenDeleteUi::ShowMultipleEntriesDeleteQueryL -// For displaying multiple entries deletion confirmation query -// ----------------------------------------------------------------------------- -// -TInt CalenDeleteUi::ShowMultipleEntriesDeleteQueryL(int aCount) + if( !aHasRepeatType && ( child || repeating ) && + ( aInstance.type() != AgendaEntry::TypeAnniversary ) ) { + //doDelete = CalenActionUiUtils::ShowRepeatTypeQueryL( aRepeatType, + // CalenActionUiUtils::EDelete ); + } + else { - TRACE_ENTRY_POINT; - if( aCount > 1 ) - { - TRACE_EXIT_POINT; - return CalenActionUiUtils::showDeleteConfirmationQueryL(CalenActionUiUtils::EDeleteToDos, aCount ); - } - else if( aCount == 1 ) - { - TRACE_EXIT_POINT; - return CalenActionUiUtils::showDeleteConfirmationQueryL(CalenActionUiUtils::EDeleteToDo); - } - else - { - TRACE_EXIT_POINT; - return 0; //return 0 for other invalid aCount value ( < 0 ) - } - + showDeleteQuery(aInstance.type() == AgendaEntry::TypeTodo ? + EDeleteToDo : + EDeleteEntry ); } + TRACE_EXIT_POINT; +} + // ----------------------------------------------------------------------------- // CalenDeleteUi::DialogDismissedL diff -r fd30d51f876b -r a949c2543c15 calendarui/controller/src/calenviewmanager.cpp --- a/calendarui/controller/src/calenviewmanager.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/controller/src/calenviewmanager.cpp Fri May 14 15:51:09 2010 +0300 @@ -53,8 +53,16 @@ mMonthViewDocLoader = NULL; mDayViewDocLoader = NULL; mDayViewAltDocLoader = NULL; + mCalenDayView = NULL; + mCalenMonthView = NULL; + mCalenDayViewAlt = NULL; - mController.MainWindow().setItemVisible(Hb::NaviPaneItem, false); + // Connect to instance view and entry view creation signals from agenda + // interface + connect(mController.agendaInterface(), SIGNAL(instanceViewCreationCompleted(int)), + this, SLOT(handleInstanceViewCreation(int))); + connect(mController.agendaInterface(), SIGNAL(entryViewCreationCompleted(int)), + this, SLOT(handleEntryViewCreation(int))); if (isFromServiceFrmwrk) { // Dont load any views until our remote slot gets called in @@ -69,7 +77,7 @@ // Connect to the view ready signal so that we construct other view // once this view is shown connect(&mController.MainWindow(), SIGNAL(viewReady()), - this, SLOT(constructOtherViews())); + this, SLOT(handleMainViewReady())); mController.MainWindow().addView(mCalenMonthView); mController.MainWindow().setCurrentView(mCalenMonthView); @@ -106,18 +114,28 @@ void CalenViewManager::constructAndActivateView(int view) { TRACE_ENTRY_POINT; + // We are here because, some other application is launching calendar with + // the view, hence connect to viewReady() signal to do any lazy loading + // in the slot + + // Connect to the view ready signal so that we construct other view + // once this view is shown + connect(&mController.MainWindow(), SIGNAL(viewReady()), + this, SLOT(handleMainViewReady())); if (view == ECalenMonthView) { mFirstView = ECalenMonthView; loadMonthView(); ActivateDefaultViewL(ECalenMonthView); // Add month view to mainwindow. mController.MainWindow().addView(mCalenMonthView); + mController.MainWindow().setCurrentView(mCalenMonthView); } else if (view == ECalenDayView) { mFirstView = ECalenDayView; loadDayView(); ActivateDefaultViewL(ECalenDayView); // Add day view to mainwindow. mController.MainWindow().addView(mCalenDayView); + mController.MainWindow().setCurrentView(mCalenDayView); } TRACE_EXIT_POINT; } @@ -150,7 +168,7 @@ // Get the calenmonth view from the loader. mCalenMonthView = static_cast (mMonthViewDocLoader->findWidget(CALEN_MONTHVIEW)); - Q_ASSERT_X(mCalenDayView, "calenviewmanager.cpp", + Q_ASSERT_X(mCalenMonthView, "calenviewmanager.cpp", "Unable to load calenMonth view"); // Setup the month view. @@ -192,6 +210,27 @@ } // ---------------------------------------------------------------------------- +// CalenViewManager::handleMainViewReady +// Slot to handle viewReady() signal from mainwindow +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CalenViewManager::handleMainViewReady() +{ + // Construct the month view part that is kept for lazy loading + if (mCalenMonthView) { + mCalenMonthView->doLazyLoading(); + } + + // Construct other views + constructOtherViews(); + + // disconnect the view ready signal as we dont need it anymore + disconnect(&mController.MainWindow(), SIGNAL(viewReady()), + this, SLOT(handleMainViewReady())); +} + +// ---------------------------------------------------------------------------- // CalenViewManager::constructOtherViews // Constructs the other views apart frm firstview and adds them to main window // (other items were commented in a header). @@ -217,10 +256,6 @@ // Setup the settings view mSettingsView = new CalenSettingsView(mController.Services()); - - // disconnect the view ready signal as we dont need it anymore - disconnect(&mController.MainWindow(), SIGNAL(viewReady()), - this, SLOT(constructOtherViews())); } // ---------------------------------------------------------------------------- @@ -283,22 +318,22 @@ mCurrentViewId = ECalenDayView; if (mController.MainWindow().currentView() == mCalenDayView) { HbEffect::add(mCalenDayView, - ":/fxml/view_show", + ":/fxml/view_hide_back", "hide"); HbEffect::add(mCalenDayViewAlt, - ":/fxml/view_hide", + ":/fxml/view_show_back", "show"); mCalenDayViewAlt->doPopulation(); - mController.MainWindow().setCurrentView(mCalenDayViewAlt, true, Hb::ViewSwitchUseBackAnim); + mController.MainWindow().setCurrentView(mCalenDayViewAlt, true, Hb::ViewSwitchUseNormalAnim); } else { HbEffect::add(mCalenDayViewAlt, - ":/fxml/view_show", + ":/fxml/view_hide_back", "hide"); HbEffect::add(mCalenDayView, - ":/fxml/view_hide", + ":/fxml/view_show_back", "show"); mCalenDayView->doPopulation(); - mController.MainWindow().setCurrentView(mCalenDayView, true, Hb::ViewSwitchUseBackAnim); + mController.MainWindow().setCurrentView(mCalenDayView, true, Hb::ViewSwitchUseNormalAnim); } } @@ -309,6 +344,8 @@ // void CalenViewManager::removeDayViews() { + mCalenDayView->clearListModel(); + mCalenDayViewAlt->clearListModel(); mController.MainWindow().removeView(mCalenDayView); mController.MainWindow().removeView(mCalenDayViewAlt); } @@ -358,22 +395,28 @@ if (mController.MainWindow().currentView() == mCalenDayView) { // This happens when settings view or event viewer is opened // from the agenda view. Simply repopulate the view - mCalenDayView->doPopulation(); - mController.MainWindow().setCurrentView(mCalenDayView); + if (mCalenDayView) { + mCalenDayView->doPopulation(); + mController.MainWindow().setCurrentView(mCalenDayView); + } } else if (mController.MainWindow().currentView() == mCalenDayViewAlt){ // This happens when settings view or event viewer is opened // from the agenda view. Simply repopulate the view - mCalenDayViewAlt->doPopulation(); - mController.MainWindow().setCurrentView(mCalenDayViewAlt); + if (mCalenDayViewAlt) { + mCalenDayViewAlt->doPopulation(); + mController.MainWindow().setCurrentView(mCalenDayViewAlt); + } } else { // This is called whenever the day view is opened from the month // view. Since the day view is not added to the mainwindow, // add the day views to mainwindow and set any one of them as // current view - mCalenDayView->doPopulation(); - mController.MainWindow().addView(mCalenDayView); - mController.MainWindow().setCurrentView(mCalenDayView); - mController.MainWindow().addView(mCalenDayViewAlt); + if (mCalenDayView) { + mCalenDayView->doPopulation(); + mController.MainWindow().addView(mCalenDayView); + mController.MainWindow().setCurrentView(mCalenDayView); + mController.MainWindow().addView(mCalenDayViewAlt); + } } break; case ECalenLandscapeDayView: @@ -611,4 +654,27 @@ qDebug() <<"calendar: CalenViewManager::handleEditingStarted <--"; } +// ---------------------------------------------------------------------------- +// CalenViewManager::handleInstanceViewCreation +// Slot to handle completion of instance view creation +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CalenViewManager::handleInstanceViewCreation(int status) +{ + Q_UNUSED(status); + mCalenMonthView->fetchEntriesAndUpdateModel(); +} + +// ---------------------------------------------------------------------------- +// CalenViewManager::handleDeletingCompleted +// Slot to handle completion of entry view creation +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CalenViewManager::handleEntryViewCreation(int status) +{ + // Nothing Yet + Q_UNUSED(status); +} // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 calendarui/eabi/calencontrolleru.def --- a/calendarui/eabi/calencontrolleru.def Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/eabi/calencontrolleru.def Fri May 14 15:51:09 2010 +0300 @@ -11,21 +11,22 @@ _ZN16CCalenController19CancelNotificationsEP25MCalenNotificationHandler @ 10 NONAME _ZN16CCalenController20CustomisationManagerEv @ 11 NONAME _ZN16CCalenController21BroadcastNotificationE18TCalenNotification @ 12 NONAME - _ZN16CCalenController21checkMultipleCreationEv @ 13 NONAME - _ZN16CCalenController24handleServiceManagerSlotEiRK9QDateTime @ 14 NONAME - _ZN16CCalenController25RegisterForNotificationsLEP25MCalenNotificationHandler18TCalenNotification @ 15 NONAME - _ZN16CCalenController25RegisterForNotificationsLEP25MCalenNotificationHandlerR6RArrayI18TCalenNotificationE @ 16 NONAME - _ZN16CCalenController7InfobarEv @ 17 NONAME - _ZN16CCalenController7ReleaseEv @ 18 NONAME - _ZN16CCalenController7contextEv @ 19 NONAME - _ZN16CCalenController8NotifierEv @ 20 NONAME - _ZN16CCalenController8ServicesEv @ 21 NONAME - _ZN16CCalenController9InstanceLEv @ 22 NONAME - _ZN16CCalenController9OfferMenuEP6HbMenu @ 23 NONAME - _ZN16CCalenControllerC1Eb @ 24 NONAME - _ZN16CCalenControllerC2Eb @ 25 NONAME - _ZN16CCalenControllerD1Ev @ 26 NONAME - _ZN16CCalenControllerD2Ev @ 27 NONAME - _ZTI16CCalenController @ 28 NONAME - _ZTV16CCalenController @ 29 NONAME + _ZN16CCalenController21ReleaseCustomisationsEv @ 13 NONAME + _ZN16CCalenController21checkMultipleCreationEv @ 14 NONAME + _ZN16CCalenController24handleServiceManagerSlotEiRK9QDateTime @ 15 NONAME + _ZN16CCalenController25RegisterForNotificationsLEP25MCalenNotificationHandler18TCalenNotification @ 16 NONAME + _ZN16CCalenController25RegisterForNotificationsLEP25MCalenNotificationHandlerR6RArrayI18TCalenNotificationE @ 17 NONAME + _ZN16CCalenController7InfobarEv @ 18 NONAME + _ZN16CCalenController7ReleaseEv @ 19 NONAME + _ZN16CCalenController7contextEv @ 20 NONAME + _ZN16CCalenController8NotifierEv @ 21 NONAME + _ZN16CCalenController8ServicesEv @ 22 NONAME + _ZN16CCalenController9InstanceLEv @ 23 NONAME + _ZN16CCalenController9OfferMenuEP6HbMenu @ 24 NONAME + _ZN16CCalenControllerC1Eb @ 25 NONAME + _ZN16CCalenControllerC2Eb @ 26 NONAME + _ZN16CCalenControllerD1Ev @ 27 NONAME + _ZN16CCalenControllerD2Ev @ 28 NONAME + _ZTI16CCalenController @ 29 NONAME + _ZTV16CCalenController @ 30 NONAME diff -r fd30d51f876b -r a949c2543c15 calendarui/eabi/calenviewsu.def --- a/calendarui/eabi/calenviewsu.def Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/eabi/calenviewsu.def Fri May 14 15:51:09 2010 +0300 @@ -1,20 +1,20 @@ EXPORTS _ZN12CalenDayView12doPopulationEv @ 1 NONAME - _ZN12CalenDayView18HandleNotificationE18TCalenNotification @ 2 NONAME - _ZN12CalenDayView9docLoaderEv @ 3 NONAME - _ZN12CalenDayView9setupViewEP14CalenDocLoader @ 4 NONAME - _ZN12CalenDayViewC1ER14MCalenServices @ 5 NONAME - _ZN12CalenDayViewC2ER14MCalenServices @ 6 NONAME - _ZN12CalenDayViewD0Ev @ 7 NONAME - _ZN12CalenDayViewD1Ev @ 8 NONAME - _ZN12CalenDayViewD2Ev @ 9 NONAME - _ZN14CalenMonthGrid10appendRowsEv @ 10 NONAME - _ZN14CalenMonthGrid10panGestureERK7QPointF @ 11 NONAME - _ZN14CalenMonthGrid11downGestureEi @ 12 NONAME - _ZN14CalenMonthGrid11prependRowsEv @ 13 NONAME - _ZN14CalenMonthGrid11qt_metacallEN11QMetaObject4CallEiPPv @ 14 NONAME - _ZN14CalenMonthGrid11qt_metacastEPKc @ 15 NONAME - _ZN14CalenMonthGrid12timerExpiredEv @ 16 NONAME + _ZN12CalenDayView14clearListModelEv @ 2 NONAME + _ZN12CalenDayView18HandleNotificationE18TCalenNotification @ 3 NONAME + _ZN12CalenDayView9docLoaderEv @ 4 NONAME + _ZN12CalenDayView9setupViewEP14CalenDocLoader @ 5 NONAME + _ZN12CalenDayViewC1ER14MCalenServices @ 6 NONAME + _ZN12CalenDayViewC2ER14MCalenServices @ 7 NONAME + _ZN12CalenDayViewD0Ev @ 8 NONAME + _ZN12CalenDayViewD1Ev @ 9 NONAME + _ZN12CalenDayViewD2Ev @ 10 NONAME + _ZN14CalenMonthGrid10appendRowsEv @ 11 NONAME + _ZN14CalenMonthGrid10panGestureERK7QPointF @ 12 NONAME + _ZN14CalenMonthGrid11downGestureEi @ 13 NONAME + _ZN14CalenMonthGrid11prependRowsEv @ 14 NONAME + _ZN14CalenMonthGrid11qt_metacallEN11QMetaObject4CallEiPPv @ 15 NONAME + _ZN14CalenMonthGrid11qt_metacastEPKc @ 16 NONAME _ZN14CalenMonthGrid13itemActivatedERK11QModelIndex @ 17 NONAME _ZN14CalenMonthGrid14setActiveDatesE5QDate @ 18 NONAME _ZN14CalenMonthGrid14setCurrentIdexEi @ 19 NONAME @@ -25,165 +25,172 @@ _ZN14CalenMonthGrid17scrollingFinishedEv @ 24 NONAME _ZN14CalenMonthGrid18orientationChangedEN2Qt11OrientationE @ 25 NONAME _ZN14CalenMonthGrid19getStaticMetaObjectEv @ 26 NONAME - _ZN14CalenMonthGrid19setFocusToProperDayEv @ 27 NONAME - _ZN14CalenMonthGrid20updateMonthGridModelER5QListI14CalenMonthDataEi @ 28 NONAME - _ZN14CalenMonthGrid7setViewEP14CalenMonthView @ 29 NONAME - _ZN14CalenMonthGrid9upGestureEi @ 30 NONAME - _ZN14CalenMonthGridC1EP13QGraphicsItem @ 31 NONAME - _ZN14CalenMonthGridC2EP13QGraphicsItem @ 32 NONAME - _ZN14CalenMonthGridD0Ev @ 33 NONAME - _ZN14CalenMonthGridD1Ev @ 34 NONAME - _ZN14CalenMonthGridD2Ev @ 35 NONAME - _ZN14CalenMonthView10createGridEv @ 36 NONAME - _ZN14CalenMonthView11qt_metacallEN11QMetaObject4CallEiPPv @ 37 NONAME - _ZN14CalenMonthView11qt_metacastEPKc @ 38 NONAME - _ZN14CalenMonthView12createEditorEv @ 39 NONAME - _ZN14CalenMonthView12doPopulationEv @ 40 NONAME - _ZN14CalenMonthView12getActiveDayEv @ 41 NONAME - _ZN14CalenMonthView12setActiveDayE9QDateTime @ 42 NONAME - _ZN14CalenMonthView13getCurrentDayEv @ 43 NONAME - _ZN14CalenMonthView13launchDayViewEv @ 44 NONAME - _ZN14CalenMonthView13monthDataListEv @ 45 NONAME - _ZN14CalenMonthView14addWeekNumbersEv @ 46 NONAME - _ZN14CalenMonthView14firstDayOfGridEv @ 47 NONAME - _ZN14CalenMonthView14rowsInFutMonthEv @ 48 NONAME - _ZN14CalenMonthView14setDateToLabelEv @ 49 NONAME - _ZN14CalenMonthView15dateFromContextERK13MCalenContext @ 50 NONAME - _ZN14CalenMonthView15getInstanceListER5QListI11AgendaEntryE9QDateTimeS4_ @ 51 NONAME - _ZN14CalenMonthView15onLocaleChangedEi @ 52 NONAME - _ZN14CalenMonthView15rowsInPrevMonthEv @ 53 NONAME - _ZN14CalenMonthView16getCurrGridIndexEv @ 54 NONAME - _ZN14CalenMonthView16setCurrGridIndexEi @ 55 NONAME - _ZN14CalenMonthView16staticMetaObjectE @ 56 NONAME DATA 16 - _ZN14CalenMonthView17changeOrientationEN2Qt11OrientationE @ 57 NONAME - _ZN14CalenMonthView17populateNextMonthEv @ 58 NONAME - _ZN14CalenMonthView17populatePrevMonthEv @ 59 NONAME - _ZN14CalenMonthView17removeWeekNumbersEv @ 60 NONAME - _ZN14CalenMonthView18addBackgroundFrameEv @ 61 NONAME - _ZN14CalenMonthView18completePopulationEv @ 62 NONAME - _ZN14CalenMonthView19getStaticMetaObjectEv @ 63 NONAME - _ZN14CalenMonthView19populatePreviewPaneER9QDateTime @ 64 NONAME - _ZN14CalenMonthView20prepareForPopulationEv @ 65 NONAME - _ZN14CalenMonthView21refreshViewOnGoToDateEv @ 66 NONAME - _ZN14CalenMonthView22setContextForActiveDayEi @ 67 NONAME - _ZN14CalenMonthView22updateWeekNumGridModelEv @ 68 NONAME - _ZN14CalenMonthView23handleChangeOrientationEv @ 69 NONAME - _ZN14CalenMonthView23handleGridItemActivatedEv @ 70 NONAME - _ZN14CalenMonthView24handlePreviewPaneGestureEb @ 71 NONAME - _ZN14CalenMonthView24populateWithInstanceViewEv @ 72 NONAME - _ZN14CalenMonthView24updateModelWithPrevMonthEv @ 73 NONAME - _ZN14CalenMonthView25handleGridItemLongPressedEiR7QPointF @ 74 NONAME - _ZN14CalenMonthView25handleLeftEffectCompletedERKN8HbEffect12EffectStatusE @ 75 NONAME - _ZN14CalenMonthView26handleRightEffectCompletedERKN8HbEffect12EffectStatusE @ 76 NONAME - _ZN14CalenMonthView26updateModelWithFutureMonthEv @ 77 NONAME - _ZN14CalenMonthView35updateMonthDataArrayWithActiveDatesEv @ 78 NONAME - _ZN14CalenMonthView7setDateEv @ 79 NONAME - _ZN14CalenMonthView9goToTodayEv @ 80 NONAME - _ZN14CalenMonthView9setupViewEP14CalenDocLoader @ 81 NONAME - _ZN14CalenMonthViewC1ER14MCalenServices @ 82 NONAME - _ZN14CalenMonthViewC2ER14MCalenServices @ 83 NONAME - _ZN14CalenMonthViewD0Ev @ 84 NONAME - _ZN14CalenMonthViewD1Ev @ 85 NONAME - _ZN14CalenMonthViewD2Ev @ 86 NONAME - _ZN16CalenPreviewPane11qt_metacallEN11QMetaObject4CallEiPPv @ 87 NONAME - _ZN16CalenPreviewPane11qt_metacastEPKc @ 88 NONAME - _ZN16CalenPreviewPane13populateLabelE9QDateTime @ 89 NONAME - _ZN16CalenPreviewPane13stopScrollingEv @ 90 NONAME - _ZN16CalenPreviewPane15mousePressEventEP24QGraphicsSceneMouseEvent @ 91 NONAME - _ZN16CalenPreviewPane15startAutoScrollEv @ 92 NONAME - _ZN16CalenPreviewPane16GetInstanceListLEv @ 93 NONAME - _ZN16CalenPreviewPane16staticMetaObjectE @ 94 NONAME DATA 16 - _ZN16CalenPreviewPane17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 95 NONAME - _ZN16CalenPreviewPane17scrollingFinishedEv @ 96 NONAME - _ZN16CalenPreviewPane17setNoEntriesLabelEP7HbLabel @ 97 NONAME - _ZN16CalenPreviewPane19getStaticMetaObjectEv @ 98 NONAME - _ZN16CalenPreviewPane19onTwoSecondsTimeoutEv @ 99 NONAME - _ZN16CalenPreviewPane4DateEv @ 100 NONAME - _ZN16CalenPreviewPane7setViewEP14CalenMonthView @ 101 NONAME - _ZN16CalenPreviewPaneC1ER14MCalenServicesP13QGraphicsItem @ 102 NONAME - _ZN16CalenPreviewPaneC2ER14MCalenServicesP13QGraphicsItem @ 103 NONAME - _ZN16CalenPreviewPaneD0Ev @ 104 NONAME - _ZN16CalenPreviewPaneD1Ev @ 105 NONAME - _ZN16CalenPreviewPaneD2Ev @ 106 NONAME - _ZN17CalenSettingsView11qt_metacallEN11QMetaObject4CallEiPPv @ 107 NONAME - _ZN17CalenSettingsView11qt_metacastEPKc @ 108 NONAME - _ZN17CalenSettingsView14initializeFormEv @ 109 NONAME - _ZN17CalenSettingsView16staticMetaObjectE @ 110 NONAME DATA 16 - _ZN17CalenSettingsView18launchPreviousViewEv @ 111 NONAME - _ZN17CalenSettingsView19getStaticMetaObjectEv @ 112 NONAME - _ZN17CalenSettingsViewC1ER14MCalenServicesP13QGraphicsItem @ 113 NONAME - _ZN17CalenSettingsViewC2ER14MCalenServicesP13QGraphicsItem @ 114 NONAME - _ZN17CalenSettingsViewD0Ev @ 115 NONAME - _ZN17CalenSettingsViewD1Ev @ 116 NONAME - _ZN17CalenSettingsViewD2Ev @ 117 NONAME - _ZN18CalenDayViewWidgetC1ER14MCalenServicesP14CalenDocLoader @ 118 NONAME - _ZN18CalenDayViewWidgetC2ER14MCalenServicesP14CalenDocLoader @ 119 NONAME - _ZN18CalenDayViewWidgetD0Ev @ 120 NONAME - _ZN18CalenDayViewWidgetD1Ev @ 121 NONAME - _ZN18CalenDayViewWidgetD2Ev @ 122 NONAME - _ZN21CalenThickLinesDrawer11qt_metacallEN11QMetaObject4CallEiPPv @ 123 NONAME - _ZN21CalenThickLinesDrawer11qt_metacastEPKc @ 124 NONAME - _ZN21CalenThickLinesDrawer16staticMetaObjectE @ 125 NONAME DATA 16 - _ZN21CalenThickLinesDrawer19getStaticMetaObjectEv @ 126 NONAME - _ZN21CalenThickLinesDrawer5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 127 NONAME - _ZN21CalenThickLinesDrawerC1EN17CalendarNamespace10WidgetTypeEP13QGraphicsItem @ 128 NONAME - _ZN21CalenThickLinesDrawerC2EN17CalendarNamespace10WidgetTypeEP13QGraphicsItem @ 129 NONAME - _ZN21CalenThickLinesDrawerD0Ev @ 130 NONAME - _ZN21CalenThickLinesDrawerD1Ev @ 131 NONAME - _ZN21CalenThickLinesDrawerD2Ev @ 132 NONAME - _ZNK14CalenMonthGrid10metaObjectEv @ 133 NONAME - _ZNK14CalenMonthView10metaObjectEv @ 134 NONAME - _ZNK16CalenPreviewPane10metaObjectEv @ 135 NONAME - _ZNK17CalenSettingsView10metaObjectEv @ 136 NONAME - _ZNK21CalenThickLinesDrawer10metaObjectEv @ 137 NONAME - _ZTI14CalenMonthGrid @ 138 NONAME - _ZTI14CalenMonthView @ 139 NONAME - _ZTI16CalenPreviewPane @ 140 NONAME - _ZTI17CalenSettingsView @ 141 NONAME - _ZTI21CalenThickLinesDrawer @ 142 NONAME - _ZTV14CalenMonthGrid @ 143 NONAME - _ZTV14CalenMonthView @ 144 NONAME - _ZTV16CalenPreviewPane @ 145 NONAME - _ZTV17CalenSettingsView @ 146 NONAME - _ZTV21CalenThickLinesDrawer @ 147 NONAME - _ZThn16_N12CalenDayViewD0Ev @ 148 NONAME - _ZThn16_N12CalenDayViewD1Ev @ 149 NONAME - _ZThn16_N14CalenMonthGridD0Ev @ 150 NONAME - _ZThn16_N14CalenMonthGridD1Ev @ 151 NONAME - _ZThn16_N14CalenMonthViewD0Ev @ 152 NONAME - _ZThn16_N14CalenMonthViewD1Ev @ 153 NONAME - _ZThn16_N16CalenPreviewPaneD0Ev @ 154 NONAME - _ZThn16_N16CalenPreviewPaneD1Ev @ 155 NONAME - _ZThn16_N17CalenSettingsViewD0Ev @ 156 NONAME - _ZThn16_N17CalenSettingsViewD1Ev @ 157 NONAME - _ZThn16_N18CalenDayViewWidgetD0Ev @ 158 NONAME - _ZThn16_N18CalenDayViewWidgetD1Ev @ 159 NONAME - _ZThn16_N21CalenThickLinesDrawerD0Ev @ 160 NONAME - _ZThn16_N21CalenThickLinesDrawerD1Ev @ 161 NONAME - _ZThn28_N12CalenDayView18HandleNotificationE18TCalenNotification @ 162 NONAME - _ZThn8_N12CalenDayViewD0Ev @ 163 NONAME - _ZThn8_N12CalenDayViewD1Ev @ 164 NONAME - _ZThn8_N14CalenMonthGrid15mousePressEventEP24QGraphicsSceneMouseEvent @ 165 NONAME - _ZThn8_N14CalenMonthGrid17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 166 NONAME - _ZThn8_N14CalenMonthGridD0Ev @ 167 NONAME - _ZThn8_N14CalenMonthGridD1Ev @ 168 NONAME - _ZThn8_N14CalenMonthViewD0Ev @ 169 NONAME - _ZThn8_N14CalenMonthViewD1Ev @ 170 NONAME - _ZThn8_N16CalenPreviewPane15mousePressEventEP24QGraphicsSceneMouseEvent @ 171 NONAME - _ZThn8_N16CalenPreviewPane17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 172 NONAME - _ZThn8_N16CalenPreviewPaneD0Ev @ 173 NONAME - _ZThn8_N16CalenPreviewPaneD1Ev @ 174 NONAME - _ZThn8_N17CalenSettingsViewD0Ev @ 175 NONAME - _ZThn8_N17CalenSettingsViewD1Ev @ 176 NONAME - _ZThn8_N18CalenDayViewWidgetD0Ev @ 177 NONAME - _ZThn8_N18CalenDayViewWidgetD1Ev @ 178 NONAME - _ZThn8_N21CalenThickLinesDrawer5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 179 NONAME - _ZThn8_N21CalenThickLinesDrawerD0Ev @ 180 NONAME - _ZThn8_N21CalenThickLinesDrawerD1Ev @ 181 NONAME - _ZN14CalenMonthGrid5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 182 NONAME - _ZN14CalenMonthView27showHideRegionalInformationEv @ 183 NONAME - _ZThn8_N14CalenMonthGrid5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 184 NONAME - _ZN16CalenPreviewPane14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 185 NONAME - _ZThn8_N16CalenPreviewPane14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 186 NONAME - _ZN14CalenMonthView22addRemoveActionsInMenuEv @ 187 NONAME + _ZN14CalenMonthGrid19handleAppendingRowsER5QListI14CalenMonthDataE @ 27 NONAME + _ZN14CalenMonthGrid19setFocusToProperDayEv @ 28 NONAME + _ZN14CalenMonthGrid20handlePrependingRowsER5QListI14CalenMonthDataE @ 29 NONAME + _ZN14CalenMonthGrid20updateMonthGridModelER5QListI14CalenMonthDataEib @ 30 NONAME + _ZN14CalenMonthGrid24handlePanGestureFinishedEv @ 31 NONAME + _ZN14CalenMonthGrid33updateMonthGridWithInActiveMonthsER5QListI14CalenMonthDataE @ 32 NONAME + _ZN14CalenMonthGrid34updateMonthGridWithEventIndicatorsER5QListI14CalenMonthDataE @ 33 NONAME + _ZN14CalenMonthGrid5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 34 NONAME + _ZN14CalenMonthGrid7setViewEP14CalenMonthView @ 35 NONAME + _ZN14CalenMonthGrid9upGestureEi @ 36 NONAME + _ZN14CalenMonthGridC1EP13QGraphicsItem @ 37 NONAME + _ZN14CalenMonthGridC2EP13QGraphicsItem @ 38 NONAME + _ZN14CalenMonthGridD0Ev @ 39 NONAME + _ZN14CalenMonthGridD1Ev @ 40 NONAME + _ZN14CalenMonthGridD2Ev @ 41 NONAME + _ZN14CalenMonthView10createGridEv @ 42 NONAME + _ZN14CalenMonthView11qt_metacallEN11QMetaObject4CallEiPPv @ 43 NONAME + _ZN14CalenMonthView11qt_metacastEPKc @ 44 NONAME + _ZN14CalenMonthView12createEditorEv @ 45 NONAME + _ZN14CalenMonthView12doPopulationEv @ 46 NONAME + _ZN14CalenMonthView12getActiveDayEv @ 47 NONAME + _ZN14CalenMonthView12setActiveDayE9QDateTime @ 48 NONAME + _ZN14CalenMonthView13doLazyLoadingEv @ 49 NONAME + _ZN14CalenMonthView13getCurrentDayEv @ 50 NONAME + _ZN14CalenMonthView13launchDayViewEv @ 51 NONAME + _ZN14CalenMonthView13monthDataListEv @ 52 NONAME + _ZN14CalenMonthView14addWeekNumbersEv @ 53 NONAME + _ZN14CalenMonthView14firstDayOfGridEv @ 54 NONAME + _ZN14CalenMonthView14rowsInFutMonthEv @ 55 NONAME + _ZN14CalenMonthView14setDateToLabelEv @ 56 NONAME + _ZN14CalenMonthView15dateFromContextERK13MCalenContext @ 57 NONAME + _ZN14CalenMonthView15getInstanceListER5QListI5QDateE9QDateTimeS4_ @ 58 NONAME + _ZN14CalenMonthView15onLocaleChangedEi @ 59 NONAME + _ZN14CalenMonthView15rowsInPrevMonthEv @ 60 NONAME + _ZN14CalenMonthView16getCurrGridIndexEv @ 61 NONAME + _ZN14CalenMonthView16onContextChangedEv @ 62 NONAME + _ZN14CalenMonthView16setCurrGridIndexEi @ 63 NONAME + _ZN14CalenMonthView16staticMetaObjectE @ 64 NONAME DATA 16 + _ZN14CalenMonthView17changeOrientationEN2Qt11OrientationE @ 65 NONAME + _ZN14CalenMonthView17populateNextMonthEv @ 66 NONAME + _ZN14CalenMonthView17populatePrevMonthEv @ 67 NONAME + _ZN14CalenMonthView17removeWeekNumbersEv @ 68 NONAME + _ZN14CalenMonthView18addBackgroundFrameEv @ 69 NONAME + _ZN14CalenMonthView18completePopulationEv @ 70 NONAME + _ZN14CalenMonthView19getStaticMetaObjectEv @ 71 NONAME + _ZN14CalenMonthView19populatePreviewPaneER9QDateTime @ 72 NONAME + _ZN14CalenMonthView20prepareForPopulationEv @ 73 NONAME + _ZN14CalenMonthView21refreshViewOnGoToDateEv @ 74 NONAME + _ZN14CalenMonthView22addRemoveActionsInMenuEv @ 75 NONAME + _ZN14CalenMonthView22setContextForActiveDayEi @ 76 NONAME + _ZN14CalenMonthView22updateWeekNumGridModelEv @ 77 NONAME + _ZN14CalenMonthView23handleChangeOrientationEv @ 78 NONAME + _ZN14CalenMonthView23handleGridItemActivatedEv @ 79 NONAME + _ZN14CalenMonthView24handlePreviewPaneGestureEb @ 80 NONAME + _ZN14CalenMonthView24populateWithInstanceViewEv @ 81 NONAME + _ZN14CalenMonthView24updateModelWithPrevMonthEv @ 82 NONAME + _ZN14CalenMonthView25handleLeftEffectCompletedERKN8HbEffect12EffectStatusE @ 83 NONAME + _ZN14CalenMonthView26fetchEntriesAndUpdateModelEv @ 84 NONAME + _ZN14CalenMonthView26handleRightEffectCompletedERKN8HbEffect12EffectStatusE @ 85 NONAME + _ZN14CalenMonthView26updateModelWithFutureMonthEv @ 86 NONAME + _ZN14CalenMonthView27showHideRegionalInformationEv @ 87 NONAME + _ZN14CalenMonthView35updateMonthDataArrayWithActiveDatesEv @ 88 NONAME + _ZN14CalenMonthView7setDateEv @ 89 NONAME + _ZN14CalenMonthView9goToTodayEv @ 90 NONAME + _ZN14CalenMonthView9setupViewEP14CalenDocLoader @ 91 NONAME + _ZN14CalenMonthViewC1ER14MCalenServices @ 92 NONAME + _ZN14CalenMonthViewC2ER14MCalenServices @ 93 NONAME + _ZN14CalenMonthViewD0Ev @ 94 NONAME + _ZN14CalenMonthViewD1Ev @ 95 NONAME + _ZN14CalenMonthViewD2Ev @ 96 NONAME + _ZN16CalenPreviewPane11qt_metacallEN11QMetaObject4CallEiPPv @ 97 NONAME + _ZN16CalenPreviewPane11qt_metacastEPKc @ 98 NONAME + _ZN16CalenPreviewPane13populateLabelE9QDateTime @ 99 NONAME + _ZN16CalenPreviewPane13stopScrollingEv @ 100 NONAME + _ZN16CalenPreviewPane14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 101 NONAME + _ZN16CalenPreviewPane15mousePressEventEP24QGraphicsSceneMouseEvent @ 102 NONAME + _ZN16CalenPreviewPane15startAutoScrollEv @ 103 NONAME + _ZN16CalenPreviewPane16GetInstanceListLEv @ 104 NONAME + _ZN16CalenPreviewPane16staticMetaObjectE @ 105 NONAME DATA 16 + _ZN16CalenPreviewPane17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 106 NONAME + _ZN16CalenPreviewPane17scrollingFinishedEv @ 107 NONAME + _ZN16CalenPreviewPane17setNoEntriesLabelEP7HbLabel @ 108 NONAME + _ZN16CalenPreviewPane19getStaticMetaObjectEv @ 109 NONAME + _ZN16CalenPreviewPane19onTwoSecondsTimeoutEv @ 110 NONAME + _ZN16CalenPreviewPane4DateEv @ 111 NONAME + _ZN16CalenPreviewPane7setViewEP14CalenMonthView @ 112 NONAME + _ZN16CalenPreviewPaneC1ER14MCalenServicesP13QGraphicsItem @ 113 NONAME + _ZN16CalenPreviewPaneC2ER14MCalenServicesP13QGraphicsItem @ 114 NONAME + _ZN16CalenPreviewPaneD0Ev @ 115 NONAME + _ZN16CalenPreviewPaneD1Ev @ 116 NONAME + _ZN16CalenPreviewPaneD2Ev @ 117 NONAME + _ZN17CalenSettingsView11qt_metacallEN11QMetaObject4CallEiPPv @ 118 NONAME + _ZN17CalenSettingsView11qt_metacastEPKc @ 119 NONAME + _ZN17CalenSettingsView14initializeFormEv @ 120 NONAME + _ZN17CalenSettingsView16staticMetaObjectE @ 121 NONAME DATA 16 + _ZN17CalenSettingsView18launchPreviousViewEv @ 122 NONAME + _ZN17CalenSettingsView19getStaticMetaObjectEv @ 123 NONAME + _ZN17CalenSettingsViewC1ER14MCalenServicesP13QGraphicsItem @ 124 NONAME + _ZN17CalenSettingsViewC2ER14MCalenServicesP13QGraphicsItem @ 125 NONAME + _ZN17CalenSettingsViewD0Ev @ 126 NONAME + _ZN17CalenSettingsViewD1Ev @ 127 NONAME + _ZN17CalenSettingsViewD2Ev @ 128 NONAME + _ZN18CalenDayViewWidgetC1ER14MCalenServicesP14CalenDocLoader @ 129 NONAME + _ZN18CalenDayViewWidgetC2ER14MCalenServicesP14CalenDocLoader @ 130 NONAME + _ZN18CalenDayViewWidgetD0Ev @ 131 NONAME + _ZN18CalenDayViewWidgetD1Ev @ 132 NONAME + _ZN18CalenDayViewWidgetD2Ev @ 133 NONAME + _ZN21CalenThickLinesDrawer11qt_metacallEN11QMetaObject4CallEiPPv @ 134 NONAME + _ZN21CalenThickLinesDrawer11qt_metacastEPKc @ 135 NONAME + _ZN21CalenThickLinesDrawer16staticMetaObjectE @ 136 NONAME DATA 16 + _ZN21CalenThickLinesDrawer19getStaticMetaObjectEv @ 137 NONAME + _ZN21CalenThickLinesDrawer5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 138 NONAME + _ZN21CalenThickLinesDrawerC1EN17CalendarNamespace10WidgetTypeEP13QGraphicsItem @ 139 NONAME + _ZN21CalenThickLinesDrawerC2EN17CalendarNamespace10WidgetTypeEP13QGraphicsItem @ 140 NONAME + _ZN21CalenThickLinesDrawerD0Ev @ 141 NONAME + _ZN21CalenThickLinesDrawerD1Ev @ 142 NONAME + _ZN21CalenThickLinesDrawerD2Ev @ 143 NONAME + _ZNK14CalenMonthGrid10metaObjectEv @ 144 NONAME + _ZNK14CalenMonthView10metaObjectEv @ 145 NONAME + _ZNK16CalenPreviewPane10metaObjectEv @ 146 NONAME + _ZNK17CalenSettingsView10metaObjectEv @ 147 NONAME + _ZNK21CalenThickLinesDrawer10metaObjectEv @ 148 NONAME + _ZTI14CalenMonthGrid @ 149 NONAME + _ZTI14CalenMonthView @ 150 NONAME + _ZTI16CalenPreviewPane @ 151 NONAME + _ZTI17CalenSettingsView @ 152 NONAME + _ZTI21CalenThickLinesDrawer @ 153 NONAME + _ZTV14CalenMonthGrid @ 154 NONAME + _ZTV14CalenMonthView @ 155 NONAME + _ZTV16CalenPreviewPane @ 156 NONAME + _ZTV17CalenSettingsView @ 157 NONAME + _ZTV21CalenThickLinesDrawer @ 158 NONAME + _ZThn16_N12CalenDayViewD0Ev @ 159 NONAME + _ZThn16_N12CalenDayViewD1Ev @ 160 NONAME + _ZThn16_N14CalenMonthGridD0Ev @ 161 NONAME + _ZThn16_N14CalenMonthGridD1Ev @ 162 NONAME + _ZThn16_N14CalenMonthViewD0Ev @ 163 NONAME + _ZThn16_N14CalenMonthViewD1Ev @ 164 NONAME + _ZThn16_N16CalenPreviewPaneD0Ev @ 165 NONAME + _ZThn16_N16CalenPreviewPaneD1Ev @ 166 NONAME + _ZThn16_N17CalenSettingsViewD0Ev @ 167 NONAME + _ZThn16_N17CalenSettingsViewD1Ev @ 168 NONAME + _ZThn16_N18CalenDayViewWidgetD0Ev @ 169 NONAME + _ZThn16_N18CalenDayViewWidgetD1Ev @ 170 NONAME + _ZThn16_N21CalenThickLinesDrawerD0Ev @ 171 NONAME + _ZThn16_N21CalenThickLinesDrawerD1Ev @ 172 NONAME + _ZThn28_N12CalenDayView18HandleNotificationE18TCalenNotification @ 173 NONAME + _ZThn8_N12CalenDayViewD0Ev @ 174 NONAME + _ZThn8_N12CalenDayViewD1Ev @ 175 NONAME + _ZThn8_N14CalenMonthGrid15mousePressEventEP24QGraphicsSceneMouseEvent @ 176 NONAME + _ZThn8_N14CalenMonthGrid17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 177 NONAME + _ZThn8_N14CalenMonthGrid5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 178 NONAME + _ZThn8_N14CalenMonthGridD0Ev @ 179 NONAME + _ZThn8_N14CalenMonthGridD1Ev @ 180 NONAME + _ZThn8_N14CalenMonthViewD0Ev @ 181 NONAME + _ZThn8_N14CalenMonthViewD1Ev @ 182 NONAME + _ZThn8_N16CalenPreviewPane14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 183 NONAME + _ZThn8_N16CalenPreviewPane15mousePressEventEP24QGraphicsSceneMouseEvent @ 184 NONAME + _ZThn8_N16CalenPreviewPane17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 185 NONAME + _ZThn8_N16CalenPreviewPaneD0Ev @ 186 NONAME + _ZThn8_N16CalenPreviewPaneD1Ev @ 187 NONAME + _ZThn8_N17CalenSettingsViewD0Ev @ 188 NONAME + _ZThn8_N17CalenSettingsViewD1Ev @ 189 NONAME + _ZThn8_N18CalenDayViewWidgetD0Ev @ 190 NONAME + _ZThn8_N18CalenDayViewWidgetD1Ev @ 191 NONAME + _ZThn8_N21CalenThickLinesDrawer5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 192 NONAME + _ZThn8_N21CalenThickLinesDrawerD0Ev @ 193 NONAME + _ZThn8_N21CalenThickLinesDrawerD1Ev @ 194 NONAME diff -r fd30d51f876b -r a949c2543c15 calendarui/regionalplugins/lunarchinese/src/CalenLunarChinesePlugin.cpp --- a/calendarui/regionalplugins/lunarchinese/src/CalenLunarChinesePlugin.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/regionalplugins/lunarchinese/src/CalenLunarChinesePlugin.cpp Fri May 14 15:51:09 2010 +0300 @@ -375,21 +375,27 @@ TRACE_ENTRY_POINT; QString text = QString::fromUtf16(aMsgText.Ptr(),aMsgText.Length()); - // Instantiate a popup - HbMessageBox popup; - popup.setDismissPolicy(HbDialog::NoDismiss); - popup.setTimeout(HbDialog::NoTimeout); - popup.setIconVisible(false); + // Instantiate a popup + HbMessageBox *popup = new HbMessageBox(); + popup->setDismissPolicy(HbDialog::NoDismiss); + popup->setTimeout(HbDialog::NoTimeout); + popup->setIconVisible(false); + popup->setAttribute( Qt::WA_DeleteOnClose, true ); + + popup->setHeadingWidget(new HbLabel("Lunar Calendar")); + popup->setText(text); + + // Remove the default actions + QList list = popup->actions(); + for(int i=0; i < list.count(); i++) + { + popup->removeAction(list[i]); + } + // Sets the primary action + popup->addAction(new HbAction(hbTrId("txt_calendar_button_cancel"), popup)); - popup.setHeadingWidget(new HbLabel("Lunar Calendar")); - popup.setText(text); - - // Sets the primary action - popup.setPrimaryAction(new HbAction(hbTrId("txt_calendar_button_cancel"), - &popup)); - - // Launch popup syncronously - popup.exec(); + // Launch popup + popup->open(); TRACE_EXIT_POINT; } diff -r fd30d51f876b -r a949c2543c15 calendarui/rom/Calendar.iby --- a/calendarui/rom/Calendar.iby Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/rom/Calendar.iby Fri May 14 15:51:09 2010 +0300 @@ -31,7 +31,6 @@ // Application registration file. data=DATAZ_\private\10003a3f\import\apps\CALENDAR_REG.RSC \private\10003a3f\import\apps\CALENDAR_REG.RSC -data=\epoc32\data\c\resource\qt\plugins\controlpanel\calensettingsplugin.qtplugin resource\qt\plugins\controlpanel\calensettingsplugin.qtplugin data=\epoc32\data\z\pluginstub\calengriditemstyleplugin.qtplugin \private\10005901\calengriditemstyleplugin.qtplugin data=\epoc32\data\z\resource\qt\plugins\calendar\agendaeventviewerplugin.qtplugin resource\qt\plugins\calendar\agendaeventviewerplugin.qtplugin @@ -44,7 +43,6 @@ file=ABI_DIR\BUILD_DIR\caleneditor.dll SHARED_LIB_DIR\caleneditor.dll file=ABI_DIR\BUILD_DIR\calenviews.dll SHARED_LIB_DIR\calenviews.dll file=ABI_DIR\BUILD_DIR\calensettings.dll SHARED_LIB_DIR\calensettings.dll -file=ABI_DIR\BUILD_DIR\calensettingsplugin.dll SHARED_LIB_DIR\calensettingsplugin.dll file=ABI_DIR\BUILD_DIR\calengriditemstyleplugin.dll SHARED_LIB_DIR\calengriditemstyleplugin.dll file=ABI_DIR\BUILD_DIR\calencontroller.dll SHARED_LIB_DIR\calencontroller.dll file=ABI_DIR\BUILD_DIR\agendaeventviewer.dll SHARED_LIB_DIR\agendaeventviewer.dll diff -r fd30d51f876b -r a949c2543c15 calendarui/views/inc/calendayview.h --- a/calendarui/views/inc/calendayview.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/inc/calendayview.h Fri May 14 15:51:09 2010 +0300 @@ -88,6 +88,11 @@ CALENDAYVIEW_EXPORT CalenDocLoader* docLoader(); /** + * @brief clears the list model from the view + */ + CALENDAYVIEW_EXPORT void clearListModel(); + + /* * @brief Refreshes the view with the date set in the context */ void refreshViewOnGoToDate(); diff -r fd30d51f876b -r a949c2543c15 calendarui/views/inc/calendayviewwidget.h --- a/calendarui/views/inc/calendayviewwidget.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/inc/calendayviewwidget.h Fri May 14 15:51:09 2010 +0300 @@ -32,6 +32,7 @@ class HbGroupBox; class HbListView; class HbLabel; +class HbAction; class HbDateTimePicker; class XQSettingsManager; class MCalenServices; @@ -90,6 +91,11 @@ */ void handleLocaleChange(); + /** + * @brief clears the list model from the view + */ + void clearListModel(); + private: /** @@ -219,6 +225,17 @@ * events for some day other than the current day */ void goToToday(); + + /** + * @brief This slot connected to aboutToClose()signal of contextmenu + * To reset the flag of mLongTapEventFlag + */ + void contextMenuClosed(); + + /** + * @brief Called when contextMenu item is triggered + */ + void contextManuTriggered(HbAction *action); private: /** @@ -321,6 +338,13 @@ */ XQSettingsManager *mSettingsManager; + + /** + * @var mLongTapeventFlag + * @brief Set flag true if contextmenu is opened + */ + bool mLongTapEventFlag; + }; #endif //CALENDAYVIEWWIDGET_H diff -r fd30d51f876b -r a949c2543c15 calendarui/views/inc/calengriditemprototype.h --- a/calendarui/views/inc/calengriditemprototype.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/inc/calengriditemprototype.h Fri May 14 15:51:09 2010 +0300 @@ -28,13 +28,18 @@ class HbIconItem; class HbTextItem; class HbFrameItem; -class CalenGridItem; + +// CONSTANTS +const QString focusIconName = "qtg_fr_cal_focused_day_ind"; +const QString eventIndname = "qtg_graf_cal_event_ind"; class CalenGridItemPrototype : public HbGridViewItem { Q_OBJECT public: + CalenGridItemPrototype(QColor todayIndColor, QColor activeColor, QColor inActiveColor, + QGraphicsWidget *parent = 0); CalenGridItemPrototype(QGraphicsWidget *parent = 0); virtual ~CalenGridItemPrototype() { @@ -46,19 +51,20 @@ void pressStateChanged(bool pressed,bool animate); void pressStateChanged(bool animate); bool canSetModelIndex(const QModelIndex& index); + void createPrimitives(); private: void drawUnderline(bool underlineEnabled); private: - QGraphicsLinearLayout *mLayout; - CalenGridItem *mWidget; + QColor mTodayUnderLineColor; + QColor mActiveTextColor; + QColor mInActiveTextColor; QColor mCurrentDateColor; QColor mGridBorderColor; HbIconItem *mEventIndicatorItem; HbTextItem *mMonthDayInfoItem; HbFrameItem *mFocusIndicatorItem; HbIconItem *mTodayIndicatorItem; - QColor mTodayUnderLineColor; }; #endif // CALENGRIDITEMPROTOTYPE_H diff -r fd30d51f876b -r a949c2543c15 calendarui/views/inc/calenmonthgrid.h --- a/calendarui/views/inc/calenmonthgrid.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/inc/calenmonthgrid.h Fri May 14 15:51:09 2010 +0300 @@ -56,7 +56,11 @@ ~CalenMonthGrid(); void setView(CalenMonthView *view); void updateMonthGridModel(QList &monthDataArray, - int indexToBeScrolled); + int indexToBeScrolled, bool isFirstTime); + void updateMonthGridWithInActiveMonths( + QList &monthDataArray); + void updateMonthGridWithEventIndicators( + QList &monthDataArray); void setCurrentIdex(int index); int getCurrentIndex(); @@ -64,11 +68,15 @@ void orientationChanged(Qt::Orientation newOrientation); private: + void handlePrependingRows(QList &monthDataList); + void handleAppendingRows(QList &monthDataList); + void handlePanGestureFinished(); void mousePressEvent(QGraphicsSceneMouseEvent* event); void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); void setFocusToProperDay(); void setActiveDates(QDate activeDate); - void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); + void paint(QPainter* painter, + const QStyleOptionGraphicsItem* option, QWidget* widget); public slots: void scrollingFinished(); @@ -80,7 +88,6 @@ void downGesture(int value); void upGesture(int value); void panGesture(const QPointF &delta); - void timerExpired(); private: QStandardItemModel *mModel; @@ -97,6 +104,8 @@ QColor mGridLineColor; QColor mGridBorderColor; QGraphicsWidget* mContentWidget; + QList mLocalisedDates; + QPointF mStartPos; }; #endif // CALENMONTHGRID_H diff -r fd30d51f876b -r a949c2543c15 calendarui/views/inc/calenmonthview.h --- a/calendarui/views/inc/calenmonthview.h Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/inc/calenmonthview.h Fri May 14 15:51:09 2010 +0300 @@ -66,8 +66,8 @@ public: // From CCalenView virtual void doPopulation(); void setupView(CalenDocLoader *docLoader); + void doLazyLoading(); void handleGridItemActivated(); - void handleGridItemLongPressed(int index, QPointF &coords); void setContextForActiveDay(int index); QDateTime getCurrentDay(); QDateTime getActiveDay(); @@ -84,6 +84,7 @@ void populatePreviewPane(QDateTime &dateTime); void handlePreviewPaneGesture(bool rightGesture); QDateTime firstDayOfGrid(); + void fetchEntriesAndUpdateModel(); private: void createGrid(); @@ -93,8 +94,8 @@ QDateTime dateFromContext( const MCalenContext &context ); void setActiveDay(QDateTime day); void setDate(); - void getInstanceList(QList &list, - QDateTime rangeStart, QDateTime rangeEnd); + void getInstanceList(QList &list, + QDateTime rangeStart, QDateTime rangeEnd); void handleChangeOrientation(); void setDateToLabel(); void updateWeekNumGridModel(); @@ -173,6 +174,7 @@ CalenPluginLabel *mCurrRegionalInfo; CalenPluginLabel *mNextRegionalInfo; HbMenu *mDeleteSubMenu; + QColor mWeekDaysColor; }; #endif //CALENMONTHVIEW_H diff -r fd30d51f876b -r a949c2543c15 calendarui/views/resources/calenresources.qrc --- a/calendarui/views/resources/calenresources.qrc Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/resources/calenresources.qrc Fri May 14 15:51:09 2010 +0300 @@ -10,6 +10,8 @@ view_show_normal.fxml view_hide_normal.fxml + view_hide_back.fxml + view_show_back.fxml portrait_preview_pane_show_on_left_gesture_normal.fxml portrait_preview_pane_hide_on_left_gesture_normal.fxml portrait_preview_pane_show_on_right_gesture_normal.fxml diff -r fd30d51f876b -r a949c2543c15 calendarui/views/resources/view_hide_back.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/views/resources/view_hide_back.fxml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,10 @@ + + + + 0.35 + + extrect.right + 1 + + + diff -r fd30d51f876b -r a949c2543c15 calendarui/views/resources/view_show_back.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/views/resources/view_show_back.fxml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,10 @@ + + + + 0.35 + + -1 + extrect.left + + + \ No newline at end of file diff -r fd30d51f876b -r a949c2543c15 calendarui/views/src/calendayview.cpp --- a/calendarui/views/src/calendayview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/src/calendayview.cpp Fri May 14 15:51:09 2010 +0300 @@ -111,7 +111,7 @@ // Dont override the soft key behavior if day view is the first view if (ECalenDayView != mServices.getFirstView()) { - mSoftKeyAction = new HbAction(Hb::BackAction); + mSoftKeyAction = new HbAction(Hb::BackNaviAction); setNavigationAction(mSoftKeyAction); // Connect to the signal triggered by clicking on back button. connect(mSoftKeyAction, SIGNAL(triggered()), this, @@ -308,4 +308,14 @@ mServices.IssueCommandL(ECalenMonthView); } +// ---------------------------------------------------------------------------- +// CCalenDayView::clearListModel +// clears the list model +// ---------------------------------------------------------------------------- +// +void CalenDayView::clearListModel() + { + mDayViewWidget->clearListModel(); + } + // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 calendarui/views/src/calendayviewwidget.cpp --- a/calendarui/views/src/calendayviewwidget.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/src/calendayviewwidget.cpp Fri May 14 15:51:09 2010 +0300 @@ -67,7 +67,8 @@ CalenDocLoader *docLoader) : mServices(services), mDocLoader(docLoader), -mRegionalInfoGroupBox(NULL) +mRegionalInfoGroupBox(NULL), +mLongTapEventFlag(false) { // Construct the list view prototype mListViewPrototype = new CalenEventListViewItem(this); @@ -954,6 +955,7 @@ void CalenDayViewWidget::itemLongPressed(HbAbstractViewItem* listViewItem, const QPointF& coords) { + mLongTapEventFlag = true; // Update the selection index first mSelectedIndex = listViewItem->modelIndex().row(); @@ -968,29 +970,34 @@ HbMenu *contextMenu = new HbMenu(); // Add the open option - HbAction *openAction = contextMenu->addAction(hbTrId("txt_common_menu_open")); - connect(openAction, SIGNAL(triggered()), this, SLOT(viewEntry())); + HbAction *openAction = contextMenu->addAction( + hbTrId("txt_common_menu_open")); // Check the type of event if (AgendaEntry::TypeTodo == entry.type()) { // Add an option to mark the note as complete - HbAction *completeAction = contextMenu->addAction(hbTrId("txt_calendar_menu_mark_as_done")); - connect(completeAction, SIGNAL(triggered()), this, SLOT(markAsDone())); + HbAction *completeAction = contextMenu->addAction( + hbTrId("txt_calendar_menu_mark_as_done")); } // Add the edit option - HbAction *editAction = contextMenu->addAction(hbTrId("txt_common_menu_edit")); - connect(editAction, SIGNAL(triggered()), this, SLOT(editEntry())); + HbAction *editAction = contextMenu->addAction( + hbTrId("txt_common_menu_edit")); // Add the delete option - HbAction *deleteAction = contextMenu->addAction(hbTrId("txt_common_menu_delete")); - connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteEntry())); + HbAction *deleteAction = contextMenu->addAction( + hbTrId("txt_common_menu_delete")); contextMenu->setDismissPolicy(HbMenu::TapAnywhere); // Show context sensitive menu. // Param const QPointF& coordinate - is a longpress position. - contextMenu->exec(coords); + contextMenu->setPreferredPos(coords); + connect(contextMenu, SIGNAL(aboutToClose()), + this, + SLOT(contextMenuClosed())); + + contextMenu->open(this, SLOT(contextManuTriggered(HbAction *))); } // ---------------------------------------------------------------------------- @@ -1007,9 +1014,10 @@ if (mSelectedIndex < 0 || mSelectedIndex > mInstanceArray.count()) { return; } - + if( !mLongTapEventFlag ) { // Open the event for viewing viewEntry(); + } } // ---------------------------------------------------------------------------- @@ -1051,4 +1059,42 @@ mView->refreshViewOnGoToDate(); } +// ---------------------------------------------------------------------------- +// CalenDayViewWidget::contextMenuClosed +// Rest of the details are commented in the header +// ---------------------------------------------------------------------------- +// +void CalenDayViewWidget::contextMenuClosed() +{ + mLongTapEventFlag = false; +} + +// ---------------------------------------------------------------------------- +// CalenDayViewWidget::contextManuTriggered +// Rest of the details are commented in the header +// ---------------------------------------------------------------------------- +// +void CalenDayViewWidget::contextManuTriggered(HbAction *action) +{ + if (action->text() == hbTrId("txt_common_menu_open")) { + viewEntry(); + } else if (action->text() == hbTrId("txt_calendar_menu_mark_as_done")) { + markAsDone(); + } else if (action->text() == hbTrId("txt_common_menu_edit")) { + editEntry(); + } else { + if (action->text() == hbTrId("txt_common_menu_delete")) { + deleteEntry(); + } + } +} +// ---------------------------------------------------------------------------- +// CalenDayViewWidget::clearListModel +// clears the list model +// ---------------------------------------------------------------------------- +// +void CalenDayViewWidget::clearListModel() + { + mListModel->clear(); + } // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 calendarui/views/src/calengriditemprototype.cpp --- a/calendarui/views/src/calengriditemprototype.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/src/calengriditemprototype.cpp Fri May 14 15:51:09 2010 +0300 @@ -33,7 +33,6 @@ #include "calengriditemprototype.h" #include "calencommon.h" -#define GRIDLINE_WIDTH 0.075 //units /*! \class CalenGridItemPrototype @@ -43,19 +42,45 @@ /*! Constructor. */ -CalenGridItemPrototype::CalenGridItemPrototype(QGraphicsWidget *parent) : +CalenGridItemPrototype::CalenGridItemPrototype(QColor todayIndColor, QColor activeColor, QColor inActiveColor, + QGraphicsWidget *parent) : HbGridViewItem(parent), - mLayout(0), + mTodayUnderLineColor(todayIndColor), + mActiveTextColor(activeColor), + mInActiveTextColor(inActiveColor), mCurrentDateColor(Qt::black), mGridBorderColor(Qt::gray), mEventIndicatorItem(0), mMonthDayInfoItem(0), mFocusIndicatorItem(0), - mTodayIndicatorItem(0), - mTodayUnderLineColor(Qt::gray) + mTodayIndicatorItem(0) { - mTodayUnderLineColor = HbColorScheme::color("qtc_cal_month_current_day"); + } + +/*! + Constructs all the primitives +*/ +void CalenGridItemPrototype::createPrimitives() +{ + if (!mMonthDayInfoItem) { + mMonthDayInfoItem = new HbTextItem(this); + HbStyle::setItemName(mMonthDayInfoItem, + QLatin1String("monthDayInfoTextItem")); + mMonthDayInfoItem->setElideMode(Qt::ElideNone); } + + if (!mFocusIndicatorItem) { + mFocusIndicatorItem = new HbFrameItem(this); + mFocusIndicatorItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + mFocusIndicatorItem->setZValue(-1); + HbStyle::setItemName(mFocusIndicatorItem, QLatin1String("focusIconItem")); + } + + if (!mEventIndicatorItem) { + mEventIndicatorItem = new HbIconItem(this); + HbStyle::setItemName(mEventIndicatorItem, QLatin1String("eventIconItem")); + } +} /*! From HbAbstractViewItem. @@ -65,7 +90,9 @@ */ HbAbstractViewItem *CalenGridItemPrototype::createItem() { - return new CalenGridItemPrototype(*this); + CalenGridItemPrototype* item = new CalenGridItemPrototype(*this); + item->createPrimitives(); + return item; } /*! @@ -74,49 +101,31 @@ \sa HbAbstractViewItem, HbGridViewItem */ void CalenGridItemPrototype::updateChildItems() -{ - - // base class implementation - HbGridViewItem::updateChildItems(); - +{ // Here update content of each item. QVariant monthDayRole; - QVariant monthFocusRole; + bool monthFocusRole; bool underlineEnabled = false; - QVariant monthEventRole; - QVariant monthTextColorRole; + bool monthEventRole; + bool monthTextColorRole; QVariant itemData = modelIndex().data(Qt::UserRole + 1); if (itemData.isValid()) { if (itemData.canConvert()) { + // Get the item list QVariantList itemList = itemData.toList(); // Get the day text monthDayRole = itemList.at(CalendarNamespace::CalendarMonthDayRole); if (monthDayRole.canConvert()) { - QString monthDayText = monthDayRole.toString(); - - if (!mMonthDayInfoItem) { - mMonthDayInfoItem = new HbTextItem(this); - HbStyle::setItemName(mMonthDayInfoItem, - QLatin1String("monthDayInfoTextItem")); - - } - - mMonthDayInfoItem->setText(monthDayText); - mMonthDayInfoItem->setElideMode(Qt::ElideNone); + mMonthDayInfoItem->setText(monthDayRole.toString()); } // Get the focus data - monthFocusRole = itemList.at(CalendarNamespace::CalendarMonthFocusRole); - if (monthFocusRole.canConvert()) { - QString focusIconPath = monthFocusRole.toString(); - if (!mFocusIndicatorItem) { - mFocusIndicatorItem = new HbFrameItem(this); - mFocusIndicatorItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - mFocusIndicatorItem->setZValue(-1); - HbStyle::setItemName(mFocusIndicatorItem, QLatin1String("focusIconItem")); - } - mFocusIndicatorItem->frameDrawer().setFrameGraphicsName(focusIconPath); + monthFocusRole = itemList.at(CalendarNamespace::CalendarMonthFocusRole).value(); + if (monthFocusRole) { + mFocusIndicatorItem->frameDrawer().setFrameGraphicsName(focusIconName); + } else { + mFocusIndicatorItem->frameDrawer().setFrameGraphicsName(QString("")); } // Get the today indicator role @@ -124,25 +133,29 @@ drawUnderline(underlineEnabled); // Get the event indicator data - monthEventRole = itemList.at(CalendarNamespace::CalendarMonthEventRole); - if (monthEventRole.canConvert()) { - QString eventIconPath = monthEventRole.toString(); - if (!mEventIndicatorItem) { - mEventIndicatorItem = new HbIconItem(this); - HbStyle::setItemName(mEventIndicatorItem, QLatin1String("eventIconItem")); - } - mEventIndicatorItem->setIconName(eventIconPath); + monthEventRole = itemList.at(CalendarNamespace::CalendarMonthEventRole).value(); + if (monthEventRole) { + // Set the event indicator + //QString iconName(focusIconName); + mEventIndicatorItem->setIconName(eventIndname); + } else { + mEventIndicatorItem->setIconName(QString("")); } // Get the text color - monthTextColorRole = itemList.at(CalendarNamespace::CalendarMonthTextColorRole); - if (monthTextColorRole.canConvert()) { - QColor monthTextColor = monthTextColorRole.value(); - mMonthDayInfoItem->setTextColor(monthTextColor); + monthTextColorRole = itemList.at(CalendarNamespace::CalendarMonthTextColorRole).value(); + if (monthTextColorRole) { + // Set the active text color + mMonthDayInfoItem->setTextColor(mActiveTextColor); + } else { + // Set the inactive text color + mMonthDayInfoItem->setTextColor(mInActiveTextColor); } } } + // base class implementation + HbGridViewItem::updateChildItems(); } /*! diff -r fd30d51f876b -r a949c2543c15 calendarui/views/src/calenmonthgrid.cpp --- a/calendarui/views/src/calenmonthgrid.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/src/calenmonthgrid.cpp Fri May 14 15:51:09 2010 +0300 @@ -16,10 +16,6 @@ */ // System includes -#include -#include -#include -#include #include #include #include @@ -34,7 +30,7 @@ #include "calencommon.h" // Constants -#define SCROLL_SPEEED 1000 +#define SCROLL_SPEEED 2000 #define GRIDLINE_WIDTH 0.075 //units /*! @@ -66,27 +62,26 @@ setSelectionMode(HbGridView::NoSelection); setUniformItemSizes(true); setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); - setClampingStyle(HbScrollArea::StrictClamping ); + setClampingStyle(HbScrollArea::StrictClamping); + setEnabledAnimations(HbAbstractItemView::None); + resetTransform(); // Get the content widget of the scroll area to draw the grid lines mContentWidget = contentWidget(); - // Get the color of the grid lines + // Get the all required colors + // Color of the grid lines mGridLineColor = HbColorScheme::color("qtc_cal_grid_line"); - // Create the prototype - CalenGridItemPrototype* gridItemPrototype = new CalenGridItemPrototype(this); - // Create the model - mModel = new QStandardItemModel(14*KCalenDaysInWeek, 1, this); - // Set the mode and the prototype - setModel(mModel,gridItemPrototype); + // Get the localised dates well before + // TODO: Need to update the mLocalisedDates when user changes the + // phone language keeping calendar application in background + HbExtendedLocale locale = HbExtendedLocale::system(); + for (int i = 1; i <= 31; i++) { + mLocalisedDates.append(locale.toString(i)); + } - // Register the widgetml and css files - HbStyleLoader::registerFilePath(":/"); - - // Set the layout name - setLayoutName("calendarCustomGridItem"); - + // Connect to scrolling finished signal connect(this, SIGNAL(scrollingEnded()), this, SLOT(scrollingFinished())); @@ -100,6 +95,7 @@ */ CalenMonthGrid::~CalenMonthGrid() { + // Nothing Yet } /*! @@ -114,55 +110,66 @@ Updates the model with the proper dates and sets the required user roles */ void CalenMonthGrid::updateMonthGridModel(QList &monthDataArray, - int indexToBeScrolled) + int indexToBeScrolled, bool isFirstTime) { - // Check the counts - int dataCount = monthDataArray.count(); - int rowCount = mModel->rowCount(); - int countDiff = dataCount - rowCount; - if (countDiff < 0) { - // Delete extra rows in the model - mModel->removeRows(dataCount,abs(countDiff)); - } else if (countDiff > 0) { - // Add the necessary number of rows - mModel->insertRows(rowCount,countDiff); + int loopStart = 0; + int loopEnd = monthDataArray.count(); + if (isFirstTime) { + // Create the model with only 42 items as visible to the user + mModel = new QStandardItemModel(KCalenDaysInWeek * KNumOfVisibleRows, + 1, this); + loopStart = (mView->rowsInPrevMonth()) * KCalenDaysInWeek; + loopEnd = loopStart + (KCalenDaysInWeek * KNumOfVisibleRows); + } else { + // Block the signals generated by model, this is being done as + // we want to avoid the overload of view listening to signals + mModel->blockSignals(true); + + // Check the counts + int dataCount = monthDataArray.count(); + int rowCount = mModel->rowCount(); + int countDiff = dataCount - rowCount; + if (countDiff < 0) { + // Delete extra rows in the model + mModel->removeRows(dataCount,abs(countDiff)); + } else if (countDiff > 0) { + // Add the necessary number of rows + mModel->insertRows(rowCount,countDiff); + } + loopEnd = dataCount; } + QDateTime currDate = mView->getCurrentDay(); QDateTime currDateTime = CalenDateUtils::beginningOfDay(currDate); QDateTime activeDay = mView->getActiveDay(); QDateTime activeDateTime = CalenDateUtils::beginningOfDay(activeDay); QModelIndex currentIndex; - - // Get the default text color to be set - QColor textColor = HbColorScheme::color("qtc_cal_month_notactive_dates"); - HbExtendedLocale locale = HbExtendedLocale::system(); - for (int i = 0; i < dataCount; i++) { + int modelIndex = 0; + for (int i = loopStart; i < loopEnd; i++) { QDateTime dateTime = monthDataArray[i].Day(); - currentIndex = mModel->index(i, 0); - // Get the localised string for the day - QString date = locale.toString(dateTime.date().day()); + currentIndex = mModel->index(modelIndex++, 0); // Create the variant list to contain the date to depict a grid item QVariantList itemData; - // NOTE: Add the data in the order mentioned in the + // !!!NOTE!!!: Add the data in the order mentioned in the // CalendarNamespace::DataRole enum. Dont change the order. - itemData << date; + itemData << mLocalisedDates.at(dateTime.date().day()-1); // Check for active day if (activeDateTime == CalenDateUtils::beginningOfDay(dateTime)) { - mCurrentRow = currentIndex.row(); - // Set the focus icon - itemData << QString("qtg_fr_cal_focused_day_ind"); + mCurrentRow = i; + // Set the focus attribute to true + itemData << true; } else { // reset the highlight - itemData << QString(""); + itemData << false; } // Check for current day if (currDateTime == CalenDateUtils::beginningOfDay(dateTime)) { - // Set the underline icon + // Set the underline attribute to true itemData << true; } else { itemData << false; @@ -170,35 +177,118 @@ // Check for events if (monthDataArray[i].HasEvents()) { - // Set the underline icon - itemData << QString("qtg_graf_cal_event_ind"); + // Set the event indicator attribute + itemData << true; } else { - itemData << QString(""); + itemData << false; } // Add default text color - itemData << textColor; + if (monthDataArray[i].isActive()) { + itemData << true; + } else { + itemData << false; + } mModel->itemFromIndex(currentIndex)->setData(itemData); } + + 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); + + // Set the mode and the prototype + setModel(mModel,gridItemPrototype); + + // Register the widgetml and css files + HbStyleLoader::registerFilePath(":/"); + + // Set the layout name + setLayoutName("calendarCustomGridItem"); + } else { + // Since, we have finished setData, Now unblock the signals + mModel->blockSignals(false); + + // Since till now, we had blocked signals being generated frm the mode + // view will be unaware of the items that we added. Hence, inform the view + // explicitly in one shot + QModelIndex leftIndex = mModel->index(0, 0); + QModelIndex rightIndex = mModel->index(loopEnd-1, 0); + dataChanged(leftIndex, rightIndex); + + // NOTE: To make sure that we always display proper month, + // two calls have been made to scrollTo(), one with top + // visible item and other with bottom visible item + // Calculate the first visible item in the grid + QModelIndex firstVisibleIndex = mModel->index(indexToBeScrolled - + (KNumOfVisibleRows * KCalenDaysInWeek - 1), 0); + scrollTo(firstVisibleIndex); + + + // Calculate the last visible item in the grid + QModelIndex lastVisibleIndex = mModel->index(indexToBeScrolled, 0); + scrollTo(lastVisibleIndex); + } mMonthDataArray = monthDataArray; +} + +/*! + Updates the view with jprevious month dates when calendar is opened for the + first time to improve the opening time + */ +void CalenMonthGrid::updateMonthGridWithInActiveMonths( + QList &monthDataArray) +{ + mMonthDataArray = monthDataArray; + + // Prepend the required rows + handlePrependingRows(monthDataArray); - // Get the active month - QDateTime activeDate = mView->getActiveDay(); - // Set the text color properly - setActiveDates(activeDate.date()); + // Append the required rows + handleAppendingRows(monthDataArray); + + int rowsInPrevMonth = mView->rowsInPrevMonth(); - // NOTE: To make sure that we always display proper month, - // two calls have been made to scrollTo(), one with top - // visible item and other with bottom visible item - // Calculate the first visible item in the grid - QModelIndex firstVisibleIndex = mModel->index(indexToBeScrolled - - (KNumOfVisibleRows * KCalenDaysInWeek - 1), 0); - scrollTo(firstVisibleIndex); - - - // Calculate the last visible item in the grid - QModelIndex lastVisibleIndex = mModel->index(indexToBeScrolled, 0); - scrollTo(lastVisibleIndex); + // Calculate the proper index to be scrolled to + int itemToBeScrolled = rowsInPrevMonth * KCalenDaysInWeek; + QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); + mIsAtomicScroll = true; + scrollTo(indexToBeScrolled); + + // Scroll to proper index + itemToBeScrolled = ((rowsInPrevMonth + KNumOfVisibleRows) * + KCalenDaysInWeek) - 1; + indexToBeScrolled = mModel->index(itemToBeScrolled, 0); + mIsAtomicScroll = true; + scrollTo(indexToBeScrolled); +} + +/*! + Updates the view with just event indicators + */ +void CalenMonthGrid::updateMonthGridWithEventIndicators( + QList &monthDataArray) +{ + mMonthDataArray = monthDataArray; + for(int i = 0; i < monthDataArray.count(); i++) { + // Check if the day has events + if (monthDataArray[i].HasEvents()) { + QModelIndex itemIndex = mModel->index(i,0); + QVariant itemData = itemIndex.data(Qt::UserRole + 1); + QVariantList list = itemData.toList(); + list.replace(CalendarNamespace::CalendarMonthEventRole, true); + mModel->itemFromIndex(itemIndex)->setData(list); + } + } } /*! @@ -208,10 +298,11 @@ { Q_UNUSED(value) mDirection = down; - // Before we start scrolling, setthe active text color to previous month - QDateTime activeDate = mView->getActiveDay(); - setActiveDates(activeDate.addMonths(-1).date()); - HbScrollArea::downGesture(SCROLL_SPEEED); + mIsAtomicScroll = false; + setAttribute(Hb::InteractionDisabled); + + // pass it to parent + HbScrollArea::downGesture(value); } /*! @@ -221,10 +312,12 @@ { Q_UNUSED(value) mDirection = up; - // Before we start scrolling, setthe active text color to future month - QDateTime activeDate = mView->getActiveDay(); - setActiveDates(activeDate.addMonths(1).date()); - HbScrollArea::upGesture(SCROLL_SPEEED); + mIsAtomicScroll = false; + setAttribute(Hb::InteractionDisabled); + + // pass it to parent + HbScrollArea::upGesture(value); + } /*! @@ -257,25 +350,20 @@ */ void CalenMonthGrid::panGesture(const QPointF & delta) { + setAttribute(Hb::InteractionDisabled); + mIsAtomicScroll = false; if (!mIsPanGesture) { mIsPanGesture = true; mIgnoreItemActivated = true; - + mStartPos = mContentWidget->pos(); // Get to know the direction of the gesture if (delta.y() > 0) { mDirection = down; } else { mDirection = up; } - } else { // This case is when user changes the direction while panning - // without lifting the finger - // Check if direction has changed - if (((delta.y() > 0) && (mDirection == up)) - || ((delta.y() < 0) && (mDirection == down))) { - // Direction has changed, ignore this pan - return; - } } + // Call the parent class to perform the pan gesture // When scrolling finished, month grid will adjust to show the proper month HbScrollArea::panGesture(delta); @@ -288,40 +376,87 @@ { if (mIsPanGesture) { - mIsPanGesture = false; - if (mDirection == up) { - // Make a request for upgesture - upGesture(SCROLL_SPEEED); - return; // return immediately - } else if (mDirection == down) { - // Make a request for upgesture - downGesture(SCROLL_SPEEED); - return; // return immediately + handlePanGestureFinished(); + } else if(!mIsAtomicScroll) { + QDateTime activeDate = mView->getActiveDay(); + if(mDirection == down) { // down gesture + if (!mIsNonActiveDayFocused) { + setActiveDates(activeDate.addMonths(-1).date()); + } + prependRows(); + } else if (mDirection == up) { //up gesture + if (!mIsNonActiveDayFocused) { + setActiveDates(activeDate.addMonths(1).date()); + } + appendRows(); } - } else if(!mIsAtomicScroll) { - // 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(); - } - // To improve the performance, lets start the timer for 10 ms, - // return immediately and do the other things after that - QTimer::singleShot(10, this, SLOT(timerExpired())); + mDirection = invalid; } else { mIsAtomicScroll = false; } mIgnoreItemActivated = false; + setAttribute(Hb::InteractionDisabled, false); } -void CalenMonthGrid::timerExpired() +/*! + Function to handle completion of pan gesture + */ +void CalenMonthGrid::handlePanGestureFinished() { - if(mDirection == down) { // down gesture - prependRows(); - } else if (mDirection == up) { //up gesture - appendRows(); + mIsPanGesture = false; + // Get the first item that is visible + QList list = visibleItems(); + HbAbstractViewItem* item = list[0]; + QModelIndex modelIndex = item->modelIndex(); + + // Get the date which is visible at the above row + QDateTime date = mMonthDataArray[modelIndex.row()].Day(); + + // Check if this date belong to current active month or + // previous month else future month + QDateTime activeMonth = mView->getActiveDay(); + QDateTime prevMonth = activeMonth.addMonths(-1); + QDateTime nextMonth = activeMonth.addMonths(1); + int month = date.date().month(); + if (month == activeMonth.date().month()) { + // Then pan is completed on current month + // Check if the date is more than half of the current month or it is + // more than or equal to half of the future month + if (date.date().day() > (activeMonth.date().daysInMonth()) / 2 || + date.addDays(KNumOfVisibleRows*KCalenDaysInWeek).date().day() >= + (prevMonth.date().daysInMonth()) / 2) { + // up gesture to bring the next month + upGesture(SCROLL_SPEEED); + } else { + // we should again show the current month by scrolling downwards + mDirection = down; + mIsAtomicScroll = true; + scrollContentsTo(-mStartPos,500); + } + } else if (month == prevMonth.date().month()) { + // first visible item belongs to previous month + // Check if the date is more than half of the previous month + if (date.date().day() > (prevMonth.date().daysInMonth()) / 2) { + // we should again show the current month by scrolling upwards + mDirection = up; + mIsAtomicScroll = true; + scrollContentsTo(-mStartPos,500); + } else { + // down gesture to show the previous month + downGesture(SCROLL_SPEEED); + } + } else if (month == nextMonth.date().month()) { + // first visible item belongs to next month + // Check if the date is more than half of the next month + if (date.date().day() > (nextMonth.date().daysInMonth()) / 2) { + // up gesture to bring the next month + upGesture(SCROLL_SPEEED); + } else { + // we should again show the current month by scrolling upwards + mDirection = invalid; + scrollContentsTo(-mStartPos,500); + } } - mDirection = invalid; } /*! @@ -330,43 +465,81 @@ */ void CalenMonthGrid::prependRows() { + // 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 + mModel->blockSignals(true); + mIsNonActiveDayFocused = false; - QDateTime currDate = mView->getCurrentDay(); - QDateTime currDateTime = CalenDateUtils::beginningOfDay( currDate ); + int rowsInFutMonthEarlier = mView->rowsInFutMonth(); int rowsInPrevMonthEarlier = mView->rowsInPrevMonth(); + // remove the cells in the future month + int deleteFromIndex = (rowsInPrevMonthEarlier + KNumOfVisibleRows) * KCalenDaysInWeek; + int numOfIndices = rowsInFutMonthEarlier * KCalenDaysInWeek; + // Get the updated dates from the view mView->updateModelWithPrevMonth(); QList monthDataList = mView->monthDataList(); mMonthDataArray = monthDataList; - int listCount = monthDataList.count(); - // Get the updated rows to be inserted - int rowsInPrevMonth = mView->rowsInPrevMonth(); - int rowsInFutMonth = mView->rowsInFutMonth(); + + // Prepend the required rows + handlePrependingRows(monthDataList); + + // Since, we have finished setData, Now unblock the signals + mModel->blockSignals(false); - // remove the cells in the future month - int deleteFromIndex = (rowsInPrevMonthEarlier + KNumOfVisibleRows) * KCalenDaysInWeek; - int numOfIndices = rowsInFutMonthEarlier * KCalenDaysInWeek; - int count = mModel->rowCount(); + int rowsInPrevMonth = mView->rowsInPrevMonth(); + int countToBeAdded = rowsInPrevMonth * KCalenDaysInWeek; + + // Since till now, we had blocked signals being generated frm the model + // view will be unaware of the items that we added. Hence, inform the view + // explicitly in one shot + QModelIndex leftIndex = mModel->index(0, 0); + QModelIndex rightIndex = mModel->index(countToBeAdded-1, 0); + dataChanged(leftIndex, rightIndex); + + // Now remove the necessary items frm the model + mModel->removeRows(deleteFromIndex+countToBeAdded, numOfIndices); + mIsAtomicScroll = true; + int itemToBeScrolled = rowsInPrevMonth * KCalenDaysInWeek; + QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); + scrollTo(indexToBeScrolled); - count = mModel->rowCount(); - + // Scroll to proper index + itemToBeScrolled = ((rowsInPrevMonth + KNumOfVisibleRows) * + KCalenDaysInWeek) - 1; + indexToBeScrolled = mModel->index(itemToBeScrolled, 0); + mIsAtomicScroll = true; + scrollTo(indexToBeScrolled); + // Update the mCurrentRow + mCurrentRow += countToBeAdded; +} + +/*! + Helper function that prepends the required rows to the model + */ +void CalenMonthGrid::handlePrependingRows(QList &monthDataList) +{ + QDateTime currDate = mView->getCurrentDay(); + QDateTime currDateTime = CalenDateUtils::beginningOfDay( currDate ); + int rowsInPrevMonth = mView->rowsInPrevMonth(); // Add the new days int countToBeAdded = rowsInPrevMonth * KCalenDaysInWeek; mModel->insertRows(0, countToBeAdded); - count = mModel->rowCount(); - - // Get the default text color to be set - QColor textColor = HbColorScheme::color("qtc_cal_month_notactive_dates"); - HbExtendedLocale locale = HbExtendedLocale::system(); for (int i = 0; i < countToBeAdded; i++) { QDateTime dateTime = monthDataList[i].Day(); // Get the localised string for the day - QString date = locale.toString(dateTime.date().day()); QModelIndex currentIndex = mModel->index(i, 0); // Create the variant list to contain the date to depict a grid item @@ -374,14 +547,14 @@ // NOTE: Add the data in the order mentioned in the // CalendarNamespace::DataRole enum. Dont change the order. - itemData << date; + itemData << mLocalisedDates.at(dateTime.date().day()-1);; - // Diable the focus role - itemData << QString(""); + // Disable the focus role + itemData << false; // Check for current day if (currDateTime == CalenDateUtils::beginningOfDay( dateTime )) { - // Set the underline icon + // Set the underline icon attribute itemData << true; } else { itemData << false; @@ -389,39 +562,18 @@ // Update the event indicators if (monthDataList[i].HasEvents()) { - // Set the event indicator icon - itemData << QString("qtg_graf_cal_event_ind"); + // Set the event indicator attribute + itemData << true; } else { - itemData << QString(""); + itemData << false; } // Add default text color - - itemData << textColor; + itemData << false; // Set the data to model mModel->itemFromIndex(currentIndex)->setData(itemData); } - - // Update the mCurrentRow - mCurrentRow += countToBeAdded; - // Scroll to proper index - int itemToBeScrolled = ((rowsInPrevMonth + KNumOfVisibleRows) * - KCalenDaysInWeek) - 1; - QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); - QMap data; - data = mModel->itemData(indexToBeScrolled); - QVariant value = data.value(Qt::DisplayRole); - int date = value.toInt(); - mIsAtomicScroll = true; - scrollTo(indexToBeScrolled); - - // Now remove the necessary items frm the model - mModel->removeRows(deleteFromIndex+countToBeAdded, numOfIndices); - mIsAtomicScroll = true; - itemToBeScrolled = rowsInPrevMonth * KCalenDaysInWeek; - indexToBeScrolled = mModel->index(itemToBeScrolled, 0); - scrollTo(indexToBeScrolled); } /*! @@ -430,9 +582,19 @@ */ void CalenMonthGrid::appendRows() { + // 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 + mModel->blockSignals(true); + mIsNonActiveDayFocused = false; - QDateTime currDate = mView->getCurrentDay(); - QDateTime currDateTime = CalenDateUtils::beginningOfDay( currDate ); + int rowsInFutMonth = mView->rowsInFutMonth(); int rowsInPrevMonth = mView->rowsInPrevMonth(); // remove the cells in the previous month @@ -442,40 +604,77 @@ mView->updateModelWithFutureMonth(); QList monthDataList = mView->monthDataList(); mMonthDataArray = monthDataList; - // Get the updated rows to be inserted + + // Get the model count before we add any rows into the mode + int rowCount = mModel->rowCount(); + // Append the required rows + handleAppendingRows(monthDataList); + + // Since, we have finished setData, Now unblock the signals + mModel->blockSignals(false); + + // Since till now, we had blocked signals being generated frm the mode + // view will be unaware of the items that we added. Hence, inform the view + // explicitly in one shot + QModelIndex leftIndex = mModel->index(rowCount-1, 0); + QModelIndex rightIndex = mModel->index(mModel->rowCount()-1, 0); + dataChanged(leftIndex, rightIndex); + + // Update the mCurrentRow + mCurrentRow -= (countToBeDeleted); + for (int i = 0; i < countToBeDeleted; i++) { + mModel->removeRow(0); + } + + mIsAtomicScroll = true; + + rowsInFutMonth = mView->rowsInFutMonth(); rowsInPrevMonth = mView->rowsInPrevMonth(); - rowsInFutMonth = mView->rowsInFutMonth(); + + // Calculate the proper index to be scrolled to + int itemToBeScrolled = rowsInPrevMonth * KCalenDaysInWeek; + QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); + scrollTo(indexToBeScrolled); + + itemToBeScrolled = ((rowsInPrevMonth + KNumOfVisibleRows) * + KCalenDaysInWeek) - 1; + indexToBeScrolled = mModel->index(itemToBeScrolled, 0); + mIsAtomicScroll = true; + scrollTo(indexToBeScrolled); +} + +/*! + Helper function that appends the required rows to the model + */ +void CalenMonthGrid::handleAppendingRows(QList &monthDataList) +{ + QDateTime currDate = mView->getCurrentDay(); + QDateTime currDateTime = CalenDateUtils::beginningOfDay( currDate ); + int rowsInFutMonth = mView->rowsInFutMonth(); int countToBeAdded = rowsInFutMonth * KCalenDaysInWeek; int lastVisibleIndex = monthDataList.count() - countToBeAdded; int rowCount = mModel->rowCount(); mModel->insertRows(rowCount, countToBeAdded); - // Get the default text color to be set - QColor textColor = HbColorScheme::color("qtc_cal_month_notactive_dates"); for (int i = 0; i < countToBeAdded; i++) { - QMap data; QModelIndex currentIndex = mModel->index(rowCount + i, 0); QDateTime dateTime = monthDataList[lastVisibleIndex + i].Day(); - HbExtendedLocale locale = HbExtendedLocale::system(); - // Get the localised string for the day - QString date = locale.toString(dateTime.date().day()); - data.insert(CalendarNamespace::CalendarMonthDayRole, date); // Create the variant list to contain the date to depict a grid item QVariantList itemData; // NOTE: Add the data in the order mentioned in the // CalendarNamespace::DataRole enum. Dont change the order. - itemData << date; + itemData << mLocalisedDates.at(dateTime.date().day()-1);; // Disable the focus role - itemData << QString(""); + itemData << false; // Check for current day if (currDateTime == CalenDateUtils::beginningOfDay( dateTime )) { - // Set the underline icon + // Set the underline icon attribute itemData << true; } else { itemData << false; @@ -483,30 +682,18 @@ // Update the event indicators if (monthDataList[lastVisibleIndex + i].HasEvents()) { - // Set the underline icon - itemData << QString("qtg_graf_cal_event_ind"); + // Set the event indicator attribute + itemData << true; } else { - itemData << QString(""); + itemData << false; } // Add default text color - itemData << textColor; + itemData << false; // Set the data to model mModel->itemFromIndex(currentIndex)->setData(itemData); } - - // Update the mCurrentRow - mCurrentRow -= (countToBeDeleted); - for (int i = 0; i < countToBeDeleted; i++) { - mModel->removeRow(0); - } - mIsAtomicScroll = true; - - // Calculate the proper index to be scrolled to - int itemToBeScrolled = rowsInPrevMonth * KCalenDaysInWeek; - QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); - scrollTo(indexToBeScrolled); } /*! @@ -528,7 +715,7 @@ QModelIndex itemIndex = mModel->index(mCurrentRow,0); QVariant itemData = itemIndex.data(Qt::UserRole + 1); QVariantList list = itemData.toList(); - list.replace(CalendarNamespace::CalendarMonthFocusRole, QString("")); + list.replace(CalendarNamespace::CalendarMonthFocusRole, false); mModel->itemFromIndex(itemIndex)->setData(list); // Inform view to update the context and preview panes @@ -537,7 +724,7 @@ itemData = itemIndex.data(Qt::UserRole + 1); list = itemData.toList(); list.replace(CalendarNamespace::CalendarMonthFocusRole, - QString("qtg_fr_cal_focused_day_ind")); + true); mModel->itemFromIndex(itemIndex)->setData(list); // Check if inactive date is tapped QDateTime activeMonth = mView->getActiveDay(); @@ -547,17 +734,19 @@ mIsNonActiveDayFocused = true; mNonActiveFocusedDay = mMonthDataArray[mCurrentRow].Day(); - // Get the current active month - QDateTime activeMonth = mView->getActiveDay(); - // Add one month to it + // Add one month to active month activeMonth = activeMonth.addMonths(1); if (activeMonth.date().month() == mNonActiveFocusedDay.date().month()) { + mDirection = up; // up gesture upGesture(SCROLL_SPEEED); + setActiveDates(activeMonth.date()); } else { + mDirection = down; // down gesture downGesture(SCROLL_SPEEED); + setActiveDates(activeMonth.addMonths(-2).date()); } } mView->setContextForActiveDay(index.row()); @@ -588,7 +777,7 @@ QModelIndex index = mModel->index(mCurrentRow,0); QVariant itemData = index.data(Qt::UserRole + 1); QVariantList list = itemData.toList(); - list.replace(CalendarNamespace::CalendarMonthFocusRole, QString("")); + list.replace(CalendarNamespace::CalendarMonthFocusRole, false); mModel->itemFromIndex(index)->setData(list); // Search for this date in the model @@ -598,7 +787,7 @@ itemData = index.data(Qt::UserRole + 1); list = itemData.toList(); list.replace(CalendarNamespace::CalendarMonthFocusRole, - QString("qtg_fr_cal_focused_day_ind")); + true); mModel->itemFromIndex(index)->setData(list); mCurrentRow = i; mView->setContextForActiveDay(i); @@ -635,15 +824,12 @@ end = firstDateInGrid.daysTo(endOfActiveMonth); // Set the active text color - QColor textColor = HbColorScheme::color("qtc_cal_month_active_dates"); - if (textColor.isValid()) { - 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, textColor); - mModel->itemFromIndex(index)->setData(list); - } + 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 @@ -683,15 +869,12 @@ } // Set the inactive text color - textColor = HbColorScheme::color("qtc_cal_month_notactive_dates"); - if (textColor.isValid()) { - 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, textColor); - mModel->itemFromIndex(index)->setData(list); - } + 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); } } @@ -730,6 +913,7 @@ { Q_UNUSED(option); Q_UNUSED(widget); + painter->setRenderHint(QPainter::NonCosmeticDefaultPen); // Set the required attributes to the pen QPen pen; @@ -746,13 +930,29 @@ // Get the sizes of content widget qreal contentHeight = mContentWidget->size().height(); qreal contentWidth = mContentWidget->size().width(); + qreal rowWidth = 0.0; + int numOfRows = 0; + QPointF startPoint = mContentWidget->pos(); - // Get the num of rows - int numOfRows = mModel->rowCount() / KCalenDaysInWeek; - // Draw horizontal lines - qreal rowWidth = contentHeight / numOfRows; + // NOTE!!!: There is a filcker when we blindly draw equally spaced lines + // on complete content widget when scrolling is finished. This happens only + // when content widget size is changed due to the change in total number + // of rows when we append or prepend rows. Hence, to avoid this, we draw + // lines on complete content widget only when it is scrolling. + // That means, as soon as scrolling is finished, we will end up drawing + // only 6 lines that are visible to the user. + if (mDirection == invalid) { + // Start point is left most point on the screen + startPoint = QPointF(0,0); + rowWidth = size().height() / KNumOfVisibleRows; + numOfRows = KNumOfVisibleRows; + } else { + // Get the num of rows + numOfRows = mModel->rowCount() / KCalenDaysInWeek; + // Draw horizontal lines + rowWidth = contentHeight / numOfRows; + } - QPointF startPoint = mContentWidget->pos(); QPointF endPoint(startPoint.x() + contentWidth, startPoint.y()); diff -r fd30d51f876b -r a949c2543c15 calendarui/views/src/calenmonthview.cpp --- a/calendarui/views/src/calenmonthview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/src/calenmonthview.cpp Fri May 14 15:51:09 2010 +0300 @@ -79,6 +79,8 @@ mLocale = HbExtendedLocale::system(); mFirstWeekLabel = NULL; mIsPrevPaneGesture = false; + // Get the week day color from the theme + mWeekDaysColor = HbColorScheme::color("qtc_cal_week_day"); } /*! @@ -209,22 +211,44 @@ mMonthGrid->setView(this); + + + mIsFirstTimeLoad = true; + +} + +/*! + Constructs the remaining part of the month view that was kept as + part if lazy loading + */ +void CalenMonthView::doLazyLoading() +{ + // Add background items to all the widgets + addBackgroundFrame(); + + // Construct and add the previous month and next month items to the view + mMonthGrid->updateMonthGridWithInActiveMonths(mMonthDataArray); + + // Check if regional information needs to be shown + // and add it or remove it + showHideRegionalInformation(); + // Connect to the menu actions HbAction - *newEventAction = - qobject_cast ( + *newEventAction = + qobject_cast ( mDocLoader->findObject(CALEN_MONTVIEW_MENU_NEWEVENT)); connect(newEventAction, SIGNAL(triggered()), this, SLOT(createEditor())); mGoToTodayAction = - qobject_cast ( + qobject_cast ( mDocLoader->findObject(CALEN_MONTVIEW_MENU_GOTOTODAY)); connect(mGoToTodayAction, SIGNAL(triggered()), this, SLOT(goToToday())); HbAction - *goToDateAction = - qobject_cast ( + *goToDateAction = + qobject_cast ( mDocLoader->findObject(CALEN_MONTVIEW_MENU_GOTODATE)); connect(goToDateAction, SIGNAL(triggered()), this, SLOT(goToDate())); @@ -269,12 +293,7 @@ // Connect to the signal when options menu is shown // This is required to add/remove dynamically some options connect(menu(), SIGNAL(aboutToShow ()), this, - SLOT(addRemoveActionsInMenu())); - - mIsFirstTimeLoad = true; - - // Add background items to all the widgets - addBackgroundFrame(); + SLOT(addRemoveActionsInMenu())); } /*! @@ -529,29 +548,26 @@ long weekNumber(day.date().weekNumber()); mWeekNumbers.append(weekNumber); } - - // Get the week day color from the theme - QColor weekDayColor = HbColorScheme::color("qtc_cal_week_day"); // Update the week labels text QString text = QString::number(mWeekNumbers.at(0)); mFirstWeekLabel->setPlainText(text); - mFirstWeekLabel->setTextColor(weekDayColor); + mFirstWeekLabel->setTextColor(mWeekDaysColor); text = QString::number(mWeekNumbers.at(1)); mSecondWeekLabel->setPlainText(text); - mSecondWeekLabel->setTextColor(weekDayColor); + mSecondWeekLabel->setTextColor(mWeekDaysColor); text = QString::number(mWeekNumbers.at(2)); mThirdWeekLabel->setPlainText(text); - mThirdWeekLabel->setTextColor(weekDayColor); + mThirdWeekLabel->setTextColor(mWeekDaysColor); text = QString::number(mWeekNumbers.at(3)); mFourthWeekLabel->setPlainText(text); - mFourthWeekLabel->setTextColor(weekDayColor); + mFourthWeekLabel->setTextColor(mWeekDaysColor); text = QString::number(mWeekNumbers.at(4)); mFifthWeekLabel->setPlainText(text); - mFifthWeekLabel->setTextColor(weekDayColor); + mFifthWeekLabel->setTextColor(mWeekDaysColor); text = QString::number(mWeekNumbers.at(5)); mSixthWeekLabel->setPlainText(text); - mSixthWeekLabel->setTextColor(weekDayColor); + mSixthWeekLabel->setTextColor(mWeekDaysColor); } /*! @@ -617,22 +633,22 @@ handleChangeOrientation(); } } - mIsFirstTimeLoad = false; + // prepare for the population like reading the date frm the context // calculating the start of the grid etc., prepareForPopulation(); - - // fetch list of required calendar instances - populateWithInstanceView(); - - populatePreviewPane(mDate); - + + // Populate the view and preview panes only if we are not opening the calendar + if (!mIsFirstTimeLoad) { + // fetch list of required calendar instances + populateWithInstanceView(); + // Populate the preview panes + populatePreviewPane(mDate); + } + // Create the grid items with proper dates createGrid(); - // Check if regional information needs to be shown - // and add it or remove it - showHideRegionalInformation(); // Complete the population completePopulation(); @@ -642,6 +658,14 @@ // Start the auto scroll on current preview pane mCurrPreviewPane->startAutoScroll(); + + // Handle regional data here if we are not populating the month view for + // the first time + if (!mIsFirstTimeLoad) { + showHideRegionalInformation(); + } + // Reset the first time load flag + mIsFirstTimeLoad = false; } /*! @@ -651,6 +675,7 @@ { setActiveDay(dateFromContext(mServices.Context())); setDate(); + updateMonthDataArrayWithActiveDates(); } /*! @@ -660,13 +685,15 @@ { setActiveDay(dateFromContext(mServices.Context())); setDate(); + updateMonthDataArrayWithActiveDates(); setDateToLabel(); // fetch list of required calendar instances populateWithInstanceView(); populatePreviewPane(mDate); - mMonthGrid->updateMonthGridModel(mMonthDataArray, mIndexToBeScrolled); + mMonthGrid->updateMonthGridModel(mMonthDataArray, mIndexToBeScrolled, + mIsFirstTimeLoad); // Start the auto scroll on current preview pane mCurrPreviewPane->startAutoScroll(); @@ -804,7 +831,8 @@ void CalenMonthView::createGrid() { // Update the month grid - mMonthGrid->updateMonthGridModel(mMonthDataArray, mIndexToBeScrolled); + mMonthGrid->updateMonthGridModel(mMonthDataArray, mIndexToBeScrolled, + mIsFirstTimeLoad); // Read the week number setting from cenrep QVariant value = mSettingsManager->readItemValue(*mWeekNumberCenrepKey); @@ -1016,7 +1044,7 @@ /*! Fetches the calenda entries for a given range */ -void CalenMonthView::getInstanceList(QList &list, +void CalenMonthView::getInstanceList(QList &list, QDateTime rangeStart, QDateTime rangeEnd) { AgendaUtil::FilterFlags filter = @@ -1025,7 +1053,7 @@ | AgendaUtil::IncludeEvents | AgendaUtil::IncludeReminders | AgendaUtil::IncludeIncompletedTodos); - list = mAgendaUtil->fetchEntriesInRange(rangeStart, rangeEnd, filter); + mAgendaUtil->markDatesWithEvents(rangeStart, rangeEnd, filter, list); } /*! @@ -1040,18 +1068,10 @@ const int todayIndex(gridStart.daysTo(today)); QDateTime gridEnd(mLastDayOfGrid.date(), QTime(23, 59, 59, 0)); - QList list; - - AgendaUtil::FilterFlags filter = - AgendaUtil::FilterFlags(AgendaUtil::IncludeAnniversaries - | AgendaUtil::IncludeAppointments - | AgendaUtil::IncludeEvents - | AgendaUtil::IncludeReminders - | AgendaUtil::IncludeIncompletedTodos); // Get the list of dates which have events QList datesWithEvents; - mAgendaUtil->markDatesWithEvents(gridStart,gridEnd,filter,datesWithEvents); + getInstanceList(datesWithEvents,gridStart,gridEnd); // Parse thru the list of dates and set the required flags for(int i(0); i < datesWithEvents.count(); i++) { @@ -1068,7 +1088,6 @@ */ void CalenMonthView::populatePrevMonth() { - QList list; const QDateTime gridStart(CalenDateUtils::beginningOfDay(mFirstDayOfGrid)); const QDateTime today(CalenDateUtils::today()); @@ -1077,23 +1096,15 @@ QDateTime gridEnd(end.date(), QTime(23, 59, 59, 0)); - AgendaUtil::FilterFlags filter = - AgendaUtil::FilterFlags(AgendaUtil::IncludeAnniversaries - | AgendaUtil::IncludeAppointments - | AgendaUtil::IncludeEvents - | AgendaUtil::IncludeReminders - | AgendaUtil::IncludeIncompletedTodos); - // Get the list of dates which have events QList datesWithEvents; - mAgendaUtil->markDatesWithEvents(gridStart,gridEnd,filter,datesWithEvents); + getInstanceList(datesWithEvents,gridStart,gridEnd); // Parse thru the list of dates and set the required flags for(int i(0); i < datesWithEvents.count(); i++) { int offset = mFirstDayOfGrid.date().daysTo(datesWithEvents.at(i)); mMonthDataArray[offset].SetHasEvents(true); } - datesWithEvents.clear(); } @@ -1112,27 +1123,30 @@ const int todayIndex(gridStart.daysTo(today)); // grid index for "today" QDateTime gridEnd(mLastDayOfGrid.date(), QTime(23, 59, 59, 0)); - - AgendaUtil::FilterFlags filter = - AgendaUtil::FilterFlags(AgendaUtil::IncludeAnniversaries - | AgendaUtil::IncludeAppointments - | AgendaUtil::IncludeEvents - | AgendaUtil::IncludeReminders - | AgendaUtil::IncludeIncompletedTodos); - // Get the list of dates which have events QList datesWithEvents; - mAgendaUtil->markDatesWithEvents(gridStart,gridEnd,filter,datesWithEvents); + getInstanceList(datesWithEvents,gridStart,gridEnd); // Parse thru the list of dates and set the required flags for(int i(0); i < datesWithEvents.count(); i++) { int offset = mFirstDayOfGrid.date().daysTo(datesWithEvents.at(i)); mMonthDataArray[offset].SetHasEvents(true); } - + datesWithEvents.clear(); +} - - datesWithEvents.clear(); +/*! + Function that gets called when instacne view is created, so that it can + query agenda server for any entries + */ +void CalenMonthView::fetchEntriesAndUpdateModel() +{ + // Get to know if entries are there from the agenda server + populateWithInstanceView(); + // Update the month grid model + mMonthGrid->updateMonthGridWithEventIndicators(mMonthDataArray); + // Populate the preview panes + populatePreviewPane(mDate); } /*! @@ -1163,29 +1177,6 @@ } /*! - Handles the long press on a grid item - */ -void CalenMonthView::handleGridItemLongPressed(int index, QPointF &coords) -{ - QDateTime newActiveDay = CalenDateUtils::futureOf(mFirstDayOfGrid, index); - - // set the context - mServices.Context().setFocusDateL(newActiveDay, KCalenMonthViewUidValue); - - HbMenu *contextMenu = new HbMenu(this); - - connect(contextMenu->addAction(hbTrId("txt_common_menu_open")), SIGNAL( triggered() ), this, - SLOT( launchDayView())); - // TODO: Add the text id - connect(contextMenu->addAction("New Todo"), SIGNAL( triggered() ), this, - SLOT( createEditor())); - - // Show context sensitive menu. - // Param const QPointF& coordinate - is a longpress position. - contextMenu->exec(coords); -} - -/*! Sets the context w.r.t to the active day */ void CalenMonthView::setContextForActiveDay(int index) diff -r fd30d51f876b -r a949c2543c15 calendarui/views/src/calennativeview.cpp --- a/calendarui/views/src/calennativeview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/src/calennativeview.cpp Fri May 14 15:51:09 2010 +0300 @@ -95,27 +95,31 @@ */ void CalenNativeView::goToDate() { + // Create a popup with datepicker for the user to select date. + HbDialog *popUp = new HbDialog(); + popUp->setDismissPolicy(HbDialog::NoDismiss); + popUp->setTimeout(HbDialog::NoTimeout); + popUp->setAttribute( Qt::WA_DeleteOnClose, true ); + popUp->setHeadingWidget(new HbLabel(hbTrId("txt_calendar_opt_go_to_date"))); + // Get the current date. QDateTime currentDateTime = CalenDateUtils::today(); QDate currentDate = currentDateTime.date(); - mDatePicker = new HbDateTimePicker(currentDate, this); - + if(mDatePicker) { + mDatePicker = NULL; + } + mDatePicker = new HbDateTimePicker(currentDate, popUp); // Set the date range. mDatePicker->setMinimumDate(CalenDateUtils::minTime().date()); mDatePicker->setMaximumDate(CalenDateUtils::maxTime().date()); - - // Create a popup with datepicker for the user to select date. - HbDialog popUp; - popUp.setDismissPolicy(HbDialog::NoDismiss); - popUp.setTimeout(HbDialog::NoTimeout); - popUp.setHeadingWidget(new HbLabel(hbTrId("txt_calendar_opt_go_to_date"))); - popUp.setContentWidget(mDatePicker); + mDatePicker->setDate(currentDate); + + popUp->setContentWidget(mDatePicker); HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok")); - popUp.setPrimaryAction(okAction); + popUp->addAction(okAction); connect(okAction, SIGNAL(triggered()), this, SLOT(goToSelectedDate())); - connect(okAction, SIGNAL(triggered()), &popUp, SLOT(close())); - popUp.setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), &popUp)); - popUp.exec(); + popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"), popUp)); + popUp->open(); } /* diff -r fd30d51f876b -r a949c2543c15 calendarui/views/src/calensettingsview.cpp --- a/calendarui/views/src/calensettingsview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/calendarui/views/src/calensettingsview.cpp Fri May 14 15:51:09 2010 +0300 @@ -81,7 +81,7 @@ // Add view on main window and set back softkey mServices.MainWindow().addView(this); - mSoftKeyAction = new HbAction(Hb::BackAction); + mSoftKeyAction = new HbAction(Hb::BackNaviAction); setNavigationAction(mSoftKeyAction); connect(mSoftKeyAction, SIGNAL(triggered()), this, SLOT(launchPreviousView())); diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/bwins/clockalarmclientu.def --- a/clock/clockmw/bwins/clockalarmclientu.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/bwins/clockalarmclientu.def Fri May 14 15:51:09 2010 +0300 @@ -24,4 +24,5 @@ ?setAlarmRepeatType@AlarmClient@@AAEXW4TAlarmRepeatDefinition@@AAW4AlarmRepeatType@@@Z @ 23 NONAME ; void AlarmClient::setAlarmRepeatType(enum TAlarmRepeatDefinition, enum AlarmRepeatType &) ?qt_metacall@AlarmClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 24 NONAME ; int AlarmClient::qt_metacall(enum QMetaObject::Call, int, void * *) ?getAlarmInfo@AlarmClient@@QAEHHAAUAlarmInfo@@@Z @ 25 NONAME ; int AlarmClient::getAlarmInfo(int, struct AlarmInfo &) + ?deleteSnoozedAlarm@AlarmClient@@QAEHH@Z @ 26 NONAME ; int AlarmClient::deleteSnoozedAlarm(int) diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/bwins/clocksettingsutilityu.def --- a/clock/clockmw/bwins/clocksettingsutilityu.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/bwins/clocksettingsutilityu.def Fri May 14 15:51:09 2010 +0300 @@ -1,40 +1,34 @@ EXPORTS ?timeFormat@SettingsUtility@@QAEHAAVQStringList@@@Z @ 1 NONAME ; int SettingsUtility::timeFormat(class QStringList &) ?setSnoozeTime@SettingsUtility@@QAEXH@Z @ 2 NONAME ; void SettingsUtility::setSnoozeTime(int) - ?setDateFormat@SettingsUtility@@QAEXABVQString@@@Z @ 3 NONAME ; void SettingsUtility::setDateFormat(class QString const &) - ?time@SettingsUtility@@QAE?AVQString@@XZ @ 4 NONAME ; class QString SettingsUtility::time(void) - ?staticMetaObject@SettingsUtility@@2UQMetaObject@@B @ 5 NONAME ; struct QMetaObject const SettingsUtility::staticMetaObject - ?clockType@SettingsUtility@@QAEHAAVQStringList@@@Z @ 6 NONAME ; int SettingsUtility::clockType(class QStringList &) - ?setDateSeparator@SettingsUtility@@QAEXABVQString@@@Z @ 7 NONAME ; void SettingsUtility::setDateSeparator(class QString const &) - ?autoUpdate@SettingsUtility@@QAEHAAVQStringList@@@Z @ 8 NONAME ; int SettingsUtility::autoUpdate(class QStringList &) - ?dateSeparator@SettingsUtility@@QAEHAAVQStringList@@@Z @ 9 NONAME ; int SettingsUtility::dateSeparator(class QStringList &) - ?setTimeZone@SettingsUtility@@QAEXABVQString@@@Z @ 10 NONAME ; void SettingsUtility::setTimeZone(class QString const &) - ?setAutoUpdate@SettingsUtility@@QAEXABVQString@@@Z @ 11 NONAME ; void SettingsUtility::setAutoUpdate(class QString const &) - ?setTime@SettingsUtility@@QAEXABVQString@@@Z @ 12 NONAME ; void SettingsUtility::setTime(class QString const &) - ??_ESettingsUtility@@UAE@I@Z @ 13 NONAME ; SettingsUtility::~SettingsUtility(unsigned int) - ??0SettingsUtility@@QAE@PAVQObject@@@Z @ 14 NONAME ; SettingsUtility::SettingsUtility(class QObject *) - ?qt_metacall@SettingsUtility@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 15 NONAME ; int SettingsUtility::qt_metacall(enum QMetaObject::Call, int, void * *) - ?setClockType@SettingsUtility@@QAEXABVQString@@@Z @ 16 NONAME ; void SettingsUtility::setClockType(class QString const &) - ?setTimeFormat@SettingsUtility@@QAEXABVQString@@@Z @ 17 NONAME ; void SettingsUtility::setTimeFormat(class QString const &) - ?settingsChanged@SettingsUtility@@IAEXW4SettingsItemChanged@@VQString@@@Z @ 18 NONAME ; void SettingsUtility::settingsChanged(enum SettingsItemChanged, class QString) - ?timeFormatString@SettingsUtility@@QAE?AVQString@@XZ @ 19 NONAME ; class QString SettingsUtility::timeFormatString(void) - ?tr@SettingsUtility@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString SettingsUtility::tr(char const *, char const *, int) - ?setStartOfWeek@SettingsUtility@@QAEXH@Z @ 21 NONAME ; void SettingsUtility::setStartOfWeek(int) - ?getStaticMetaObject@SettingsUtility@@SAABUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const & SettingsUtility::getStaticMetaObject(void) - ?workdays@SettingsUtility@@QAEHAAVQStringList@@@Z @ 23 NONAME ; int SettingsUtility::workdays(class QStringList &) - ?date@SettingsUtility@@QAE?AVQString@@XZ @ 24 NONAME ; class QString SettingsUtility::date(void) - ?dateFormat@SettingsUtility@@QAEHAAVQStringList@@@Z @ 25 NONAME ; int SettingsUtility::dateFormat(class QStringList &) - ?setTimeSeparator@SettingsUtility@@QAEXABVQString@@@Z @ 26 NONAME ; void SettingsUtility::setTimeSeparator(class QString const &) - ?qt_metacast@SettingsUtility@@UAEPAXPBD@Z @ 27 NONAME ; void * SettingsUtility::qt_metacast(char const *) - ?snoozeTime@SettingsUtility@@QAEHAAVQStringList@@@Z @ 28 NONAME ; int SettingsUtility::snoozeTime(class QStringList &) - ?setWorkdays@SettingsUtility@@QAEXABVQString@@@Z @ 29 NONAME ; void SettingsUtility::setWorkdays(class QString const &) - ?dateFormatString@SettingsUtility@@QAE?AVQString@@XZ @ 30 NONAME ; class QString SettingsUtility::dateFormatString(void) - ?metaObject@SettingsUtility@@UBEPBUQMetaObject@@XZ @ 31 NONAME ; struct QMetaObject const * SettingsUtility::metaObject(void) const - ?timeZone@SettingsUtility@@QAE?AVQString@@XZ @ 32 NONAME ; class QString SettingsUtility::timeZone(void) - ?timeSeparator@SettingsUtility@@QAEHAAVQStringList@@@Z @ 33 NONAME ; int SettingsUtility::timeSeparator(class QStringList &) - ??1SettingsUtility@@UAE@XZ @ 34 NONAME ; SettingsUtility::~SettingsUtility(void) - ?trUtf8@SettingsUtility@@SA?AVQString@@PBD0@Z @ 35 NONAME ; class QString SettingsUtility::trUtf8(char const *, char const *) - ?tr@SettingsUtility@@SA?AVQString@@PBD0@Z @ 36 NONAME ; class QString SettingsUtility::tr(char const *, char const *) - ?trUtf8@SettingsUtility@@SA?AVQString@@PBD0H@Z @ 37 NONAME ; class QString SettingsUtility::trUtf8(char const *, char const *, int) - ?setDate@SettingsUtility@@QAEXABVQString@@@Z @ 38 NONAME ; void SettingsUtility::setDate(class QString const &) + ?workdays@SettingsUtility@@QAEHAAVQStringList@@@Z @ 3 NONAME ; int SettingsUtility::workdays(class QStringList &) + ?setDateFormat@SettingsUtility@@QAEXABVQString@@@Z @ 4 NONAME ; void SettingsUtility::setDateFormat(class QString const &) + ?time@SettingsUtility@@QAE?AVQString@@XZ @ 5 NONAME ; class QString SettingsUtility::time(void) + ?staticMetaObject@SettingsUtility@@2UQMetaObject@@B @ 6 NONAME ; struct QMetaObject const SettingsUtility::staticMetaObject + ?clockType@SettingsUtility@@QAEHAAVQStringList@@@Z @ 7 NONAME ; int SettingsUtility::clockType(class QStringList &) + ?setDateSeparator@SettingsUtility@@QAEXABVQString@@@Z @ 8 NONAME ; void SettingsUtility::setDateSeparator(class QString const &) + ?date@SettingsUtility@@QAE?AVQString@@XZ @ 9 NONAME ; class QString SettingsUtility::date(void) + ?dateFormat@SettingsUtility@@QAEHAAVQStringList@@@Z @ 10 NONAME ; int SettingsUtility::dateFormat(class QStringList &) + ?dateSeparator@SettingsUtility@@QAEHAAVQStringList@@@Z @ 11 NONAME ; int SettingsUtility::dateSeparator(class QStringList &) + ?setTimeSeparator@SettingsUtility@@QAEXABVQString@@@Z @ 12 NONAME ; void SettingsUtility::setTimeSeparator(class QString const &) + ?snoozeTime@SettingsUtility@@QAEHAAVQStringList@@@Z @ 13 NONAME ; int SettingsUtility::snoozeTime(class QStringList &) + ?qt_metacast@SettingsUtility@@UAEPAXPBD@Z @ 14 NONAME ; void * SettingsUtility::qt_metacast(char const *) + ?setWorkdays@SettingsUtility@@QAEXABVQString@@@Z @ 15 NONAME ; void SettingsUtility::setWorkdays(class QString const &) + ?dateFormatString@SettingsUtility@@QAE?AVQString@@XZ @ 16 NONAME ; class QString SettingsUtility::dateFormatString(void) + ??_ESettingsUtility@@UAE@I@Z @ 17 NONAME ; SettingsUtility::~SettingsUtility(unsigned int) + ?metaObject@SettingsUtility@@UBEPBUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const * SettingsUtility::metaObject(void) const + ??0SettingsUtility@@QAE@PAVQObject@@@Z @ 19 NONAME ; SettingsUtility::SettingsUtility(class QObject *) + ?qt_metacall@SettingsUtility@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 20 NONAME ; int SettingsUtility::qt_metacall(enum QMetaObject::Call, int, void * *) + ?timeSeparator@SettingsUtility@@QAEHAAVQStringList@@@Z @ 21 NONAME ; int SettingsUtility::timeSeparator(class QStringList &) + ?setClockType@SettingsUtility@@QAEXABVQString@@@Z @ 22 NONAME ; void SettingsUtility::setClockType(class QString const &) + ?setTimeFormat@SettingsUtility@@QAEXABVQString@@@Z @ 23 NONAME ; void SettingsUtility::setTimeFormat(class QString const &) + ?settingsChanged@SettingsUtility@@IAEXW4SettingsItemChanged@@VQString@@@Z @ 24 NONAME ; void SettingsUtility::settingsChanged(enum SettingsItemChanged, class QString) + ?timeFormatString@SettingsUtility@@QAE?AVQString@@XZ @ 25 NONAME ; class QString SettingsUtility::timeFormatString(void) + ?tr@SettingsUtility@@SA?AVQString@@PBD0H@Z @ 26 NONAME ; class QString SettingsUtility::tr(char const *, char const *, int) + ??1SettingsUtility@@UAE@XZ @ 27 NONAME ; SettingsUtility::~SettingsUtility(void) + ?setStartOfWeek@SettingsUtility@@QAEXH@Z @ 28 NONAME ; void SettingsUtility::setStartOfWeek(int) + ?trUtf8@SettingsUtility@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString SettingsUtility::trUtf8(char const *, char const *) + ?tr@SettingsUtility@@SA?AVQString@@PBD0@Z @ 30 NONAME ; class QString SettingsUtility::tr(char const *, char const *) + ?trUtf8@SettingsUtility@@SA?AVQString@@PBD0H@Z @ 31 NONAME ; class QString SettingsUtility::trUtf8(char const *, char const *, int) + ?getStaticMetaObject@SettingsUtility@@SAABUQMetaObject@@XZ @ 32 NONAME ; struct QMetaObject const & SettingsUtility::getStaticMetaObject(void) diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/bwins/timezoneclientu.def --- a/clock/clockmw/bwins/timezoneclientu.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/bwins/timezoneclientu.def Fri May 14 15:51:09 2010 +0300 @@ -1,45 +1,53 @@ EXPORTS - ??_ETimezoneClient@@UAE@I@Z @ 1 NONAME ; TimezoneClient::~TimezoneClient(unsigned int) - ?locationSelectorModel@TimezoneClient@@QAEPAVQStandardItemModel@@XZ @ 2 NONAME ; class QStandardItemModel * TimezoneClient::locationSelectorModel(void) - ?getUtcDstOffsetL@TimezoneClient@@QAE_NAAHABVCTzId@@@Z @ 3 NONAME ; bool TimezoneClient::getUtcDstOffsetL(int &, class CTzId const &) - ?getLocations@TimezoneClient@@QAE?AV?$QList@ULocationInfo@@@@XZ @ 4 NONAME ; class QList TimezoneClient::getLocations(void) - ?getCityOffsetByNameAndId@TimezoneClient@@QAEHABVQString@@H@Z @ 5 NONAME ; int TimezoneClient::getCityOffsetByNameAndId(class QString const &, int) - ?intToMonth@TimezoneClient@@AAE?AW4TMonth@@H@Z @ 6 NONAME ; enum TMonth TimezoneClient::intToMonth(int) - ?getDstZoneOffset@TimezoneClient@@AAEHH@Z @ 7 NONAME ; int TimezoneClient::getDstZoneOffset(int) - ?environmentCallback@TimezoneClient@@SAHPAX@Z @ 8 NONAME ; int TimezoneClient::environmentCallback(void *) - ?trUtf8@TimezoneClient@@SA?AVQString@@PBD0H@Z @ 9 NONAME ; class QString TimezoneClient::trUtf8(char const *, char const *, int) - ?getStandardOffset@TimezoneClient@@QAEHH@Z @ 10 NONAME ; int TimezoneClient::getStandardOffset(int) - ?getCurrentZoneInfoL@TimezoneClient@@QAE?AULocationInfo@@XZ @ 11 NONAME ; struct LocationInfo TimezoneClient::getCurrentZoneInfoL(void) - ?createWorldClockModel@TimezoneClient@@QAEXXZ @ 12 NONAME ; void TimezoneClient::createWorldClockModel(void) - ?dstOn@TimezoneClient@@QAE_NH@Z @ 13 NONAME ; bool TimezoneClient::dstOn(int) - ?tr@TimezoneClient@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString TimezoneClient::tr(char const *, char const *, int) - ?setAsCurrentLocationL@TimezoneClient@@QAEXAAULocationInfo@@@Z @ 15 NONAME ; void TimezoneClient::setAsCurrentLocationL(struct LocationInfo &) - ?timeUpdateOn@TimezoneClient@@QAE_NXZ @ 16 NONAME ; bool TimezoneClient::timeUpdateOn(void) - ?staticMetaObject@TimezoneClient@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const TimezoneClient::staticMetaObject - ?qt_metacast@TimezoneClient@@UAEPAXPBD@Z @ 18 NONAME ; void * TimezoneClient::qt_metacast(char const *) - ?trUtf8@TimezoneClient@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString TimezoneClient::trUtf8(char const *, char const *) - ?getDstRulesL@TimezoneClient@@QAEXAAVQDateTime@@0H@Z @ 20 NONAME ; void TimezoneClient::getDstRulesL(class QDateTime &, class QDateTime &, int) - ?getSavedLocations@TimezoneClient@@QAE?AV?$QList@ULocationInfo@@@@XZ @ 21 NONAME ; class QList TimezoneClient::getSavedLocations(void) - ?listUpdated@TimezoneClient@@IAEXXZ @ 22 NONAME ; void TimezoneClient::listUpdated(void) - ?populateCities@TimezoneClient@@AAEXXZ @ 23 NONAME ; void TimezoneClient::populateCities(void) - ?tr@TimezoneClient@@SA?AVQString@@PBD0@Z @ 24 NONAME ; class QString TimezoneClient::tr(char const *, char const *) - ?getStaticMetaObject@TimezoneClient@@SAABUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const & TimezoneClient::getStaticMetaObject(void) - ?metaObject@TimezoneClient@@UBEPBUQMetaObject@@XZ @ 26 NONAME ; struct QMetaObject const * TimezoneClient::metaObject(void) const - ?setDateTime@TimezoneClient@@QAEXVQDateTime@@@Z @ 27 NONAME ; void TimezoneClient::setDateTime(class QDateTime) - ??0TimezoneClient@@QAE@PAVQObject@@@Z @ 28 NONAME ; TimezoneClient::TimezoneClient(class QObject *) - ?setTimeUpdateOn@TimezoneClient@@QAEX_N@Z @ 29 NONAME ; void TimezoneClient::setTimeUpdateOn(bool) - ?getCountries@TimezoneClient@@QAEXAAV?$QMap@VQString@@H@@@Z @ 30 NONAME ; void TimezoneClient::getCountries(class QMap &) - ?getCityGroupIdByName@TimezoneClient@@QAEHABVQString@@@Z @ 31 NONAME ; int TimezoneClient::getCityGroupIdByName(class QString const &) - ?checkForDstChange@TimezoneClient@@QAE_NAAUAlarmInfo@@@Z @ 32 NONAME ; bool TimezoneClient::checkForDstChange(struct AlarmInfo &) - ?getCitiesForCountry@TimezoneClient@@QAEXHAAV?$QMap@VQString@@H@@@Z @ 33 NONAME ; void TimezoneClient::getCitiesForCountry(int, class QMap &) - ?isDSTOnL@TimezoneClient@@QAE_NH@Z @ 34 NONAME ; bool TimezoneClient::isDSTOnL(int) - ?timechanged@TimezoneClient@@IAEXXZ @ 35 NONAME ; void TimezoneClient::timechanged(void) - ??1TimezoneClient@@UAE@XZ @ 36 NONAME ; TimezoneClient::~TimezoneClient(void) - ?saveLocations@TimezoneClient@@QAEXABV?$QList@ULocationInfo@@@@@Z @ 37 NONAME ; void TimezoneClient::saveLocations(class QList const &) - ?getLocationInfo@TimezoneClient@@QAEXHHAAULocationInfo@@@Z @ 38 NONAME ; void TimezoneClient::getLocationInfo(int, int, struct LocationInfo &) - ?qt_metacall@TimezoneClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 39 NONAME ; int TimezoneClient::qt_metacall(enum QMetaObject::Call, int, void * *) - ?addCity@TimezoneClient@@QAE?AULocationInfo@@HAAVQString@@H@Z @ 40 NONAME ; struct LocationInfo TimezoneClient::addCity(int, class QString &, int) - ?getAllTimeZoneOffsets@TimezoneClient@@QAE?AV?$QList@H@@XZ @ 41 NONAME ; class QList TimezoneClient::getAllTimeZoneOffsets(void) - ?getCountriesForUTCOffset@TimezoneClient@@QAE?AV?$QList@ULocationInfo@@@@H@Z @ 42 NONAME ; class QList TimezoneClient::getCountriesForUTCOffset(int) - ?getAllTimeZoneIds@TimezoneClient@@QAE?AV?$QList@H@@XZ @ 43 NONAME ; class QList TimezoneClient::getAllTimeZoneIds(void) + ?deleteInstance@TimezoneClient@@QAEXXZ @ 1 NONAME ; void TimezoneClient::deleteInstance(void) + ?addCity@TimezoneClient@@QAE?AULocationInfo@@HAAVQString@@H@Z @ 2 NONAME ; struct LocationInfo TimezoneClient::addCity(int, class QString &, int) + ?isNull@TimezoneClient@@QAE_NXZ @ 3 NONAME ; bool TimezoneClient::isNull(void) + ??_ETimezoneClient@@UAE@I@Z @ 4 NONAME ; TimezoneClient::~TimezoneClient(unsigned int) + ?getLocations@TimezoneClient@@QAEAAV?$QList@ULocationInfo@@@@XZ @ 5 NONAME ; class QList & TimezoneClient::getLocations(void) + ?getDstRulesL@TimezoneClient@@AAEXAAVQDateTime@@0H@Z @ 6 NONAME ; void TimezoneClient::getDstRulesL(class QDateTime &, class QDateTime &, int) + ?locationSelectorModel@TimezoneClient@@QAEPAVQStandardItemModel@@XZ @ 7 NONAME ; class QStandardItemModel * TimezoneClient::locationSelectorModel(void) + ?getUtcDstOffsetL@TimezoneClient@@AAE_NAAHABVCTzId@@@Z @ 8 NONAME ; bool TimezoneClient::getUtcDstOffsetL(int &, class CTzId const &) + ?mReferenceCount@TimezoneClient@@0HA @ 9 NONAME ; int TimezoneClient::mReferenceCount + ??0TimezoneClient@@AAE@XZ @ 10 NONAME ; TimezoneClient::TimezoneClient(void) + ?intToMonth@TimezoneClient@@AAE?AW4TMonth@@H@Z @ 11 NONAME ; enum TMonth TimezoneClient::intToMonth(int) + ?getDstZoneOffset@TimezoneClient@@AAEHH@Z @ 12 NONAME ; int TimezoneClient::getDstZoneOffset(int) + ?environmentCallback@TimezoneClient@@SAHPAX@Z @ 13 NONAME ; int TimezoneClient::environmentCallback(void *) + ?trUtf8@TimezoneClient@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString TimezoneClient::trUtf8(char const *, char const *, int) + ?getStandardOffset@TimezoneClient@@QAEHH@Z @ 15 NONAME ; int TimezoneClient::getStandardOffset(int) + ?getCurrentZoneInfoL@TimezoneClient@@QAE?AULocationInfo@@XZ @ 16 NONAME ; struct LocationInfo TimezoneClient::getCurrentZoneInfoL(void) + ?dstOn@TimezoneClient@@QAE_NH@Z @ 17 NONAME ; bool TimezoneClient::dstOn(int) + ?createWorldClockModel@TimezoneClient@@QAEXXZ @ 18 NONAME ; void TimezoneClient::createWorldClockModel(void) + ?tr@TimezoneClient@@SA?AVQString@@PBD0H@Z @ 19 NONAME ; class QString TimezoneClient::tr(char const *, char const *, int) + ?setAsCurrentLocationL@TimezoneClient@@QAEXAAULocationInfo@@@Z @ 20 NONAME ; void TimezoneClient::setAsCurrentLocationL(struct LocationInfo &) + ?eventMonitor@TimezoneClient@@AAEXABVXQSettingsKey@@ABVQVariant@@@Z @ 21 NONAME ; void TimezoneClient::eventMonitor(class XQSettingsKey const &, class QVariant const &) + ?getInstance@TimezoneClient@@SAPAV1@XZ @ 22 NONAME ; class TimezoneClient * TimezoneClient::getInstance(void) + ?getCityGroupIdByName@TimezoneClient@@AAEHABVQString@@@Z @ 23 NONAME ; int TimezoneClient::getCityGroupIdByName(class QString const &) + ?getCityOffsetByNameAndId@TimezoneClient@@AAEHABVQString@@H@Z @ 24 NONAME ; int TimezoneClient::getCityOffsetByNameAndId(class QString const &, int) + ?getAllTimeZoneOffsets@TimezoneClient@@QAE?AV?$QList@H@@XZ @ 25 NONAME ; class QList TimezoneClient::getAllTimeZoneOffsets(void) + ?getCitiesForCountry@TimezoneClient@@AAEXHAAV?$QMap@VQString@@H@@@Z @ 26 NONAME ; void TimezoneClient::getCitiesForCountry(int, class QMap &) + ?getCountriesForUTCOffset@TimezoneClient@@QAE?AV?$QList@ULocationInfo@@@@H@Z @ 27 NONAME ; class QList TimezoneClient::getCountriesForUTCOffset(int) + ??1TimezoneClient@@EAE@XZ @ 28 NONAME ; TimezoneClient::~TimezoneClient(void) + ?timeUpdateOn@TimezoneClient@@QAE_NXZ @ 29 NONAME ; bool TimezoneClient::timeUpdateOn(void) + ?staticMetaObject@TimezoneClient@@2UQMetaObject@@B @ 30 NONAME ; struct QMetaObject const TimezoneClient::staticMetaObject + ?qt_metacast@TimezoneClient@@UAEPAXPBD@Z @ 31 NONAME ; void * TimezoneClient::qt_metacast(char const *) + ?autoTimeUpdateChanged@TimezoneClient@@IAEXH@Z @ 32 NONAME ; void TimezoneClient::autoTimeUpdateChanged(int) + ?trUtf8@TimezoneClient@@SA?AVQString@@PBD0@Z @ 33 NONAME ; class QString TimezoneClient::trUtf8(char const *, char const *) + ?listUpdated@TimezoneClient@@IAEXXZ @ 34 NONAME ; void TimezoneClient::listUpdated(void) + ?getSavedLocations@TimezoneClient@@QAE?AV?$QList@ULocationInfo@@@@XZ @ 35 NONAME ; class QList TimezoneClient::getSavedLocations(void) + ?getLocationInfo@TimezoneClient@@AAEXHHAAULocationInfo@@@Z @ 36 NONAME ; void TimezoneClient::getLocationInfo(int, int, struct LocationInfo &) + ?getAllTimeZoneIds@TimezoneClient@@QAE?AV?$QList@H@@XZ @ 37 NONAME ; class QList TimezoneClient::getAllTimeZoneIds(void) + ?populateCities@TimezoneClient@@AAEXXZ @ 38 NONAME ; void TimezoneClient::populateCities(void) + ?tr@TimezoneClient@@SA?AVQString@@PBD0@Z @ 39 NONAME ; class QString TimezoneClient::tr(char const *, char const *) + ?setDateTime@TimezoneClient@@QAEXVQDateTime@@@Z @ 40 NONAME ; void TimezoneClient::setDateTime(class QDateTime) + ?metaObject@TimezoneClient@@UBEPBUQMetaObject@@XZ @ 41 NONAME ; struct QMetaObject const * TimezoneClient::metaObject(void) const + ?getStaticMetaObject@TimezoneClient@@SAABUQMetaObject@@XZ @ 42 NONAME ; struct QMetaObject const & TimezoneClient::getStaticMetaObject(void) + ?mTimezoneClient@TimezoneClient@@0PAV1@A @ 43 NONAME ; class TimezoneClient * TimezoneClient::mTimezoneClient + ?cityUpdated@TimezoneClient@@IAEXXZ @ 44 NONAME ; void TimezoneClient::cityUpdated(void) + ?setTimeUpdateOn@TimezoneClient@@QAEX_N@Z @ 45 NONAME ; void TimezoneClient::setTimeUpdateOn(bool) + ?getCountries@TimezoneClient@@QAEXAAV?$QMap@VQString@@H@@@Z @ 46 NONAME ; void TimezoneClient::getCountries(class QMap &) + ?checkForDstChange@TimezoneClient@@QAE_NAAUAlarmInfo@@@Z @ 47 NONAME ; bool TimezoneClient::checkForDstChange(struct AlarmInfo &) + ?isDSTOnL@TimezoneClient@@QAE_NH@Z @ 48 NONAME ; bool TimezoneClient::isDSTOnL(int) + ?timechanged@TimezoneClient@@IAEXXZ @ 49 NONAME ; void TimezoneClient::timechanged(void) + ?saveLocations@TimezoneClient@@QAEXABV?$QList@ULocationInfo@@@@@Z @ 50 NONAME ; void TimezoneClient::saveLocations(class QList const &) + ?qt_metacall@TimezoneClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 51 NONAME ; int TimezoneClient::qt_metacall(enum QMetaObject::Call, int, void * *) diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/clockalarms/inc/alarmclient.h --- a/clock/clockmw/clockalarms/inc/alarmclient.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/clockalarms/inc/alarmclient.h Fri May 14 15:51:09 2010 +0300 @@ -56,6 +56,7 @@ void getAlarmList(QList& alarmList); void setAlarm(AlarmInfo& alarmInfo); void deleteAlarm(int alarmId); + int deleteSnoozedAlarm(int alarmId); int getAlarmInfo(int alarmId, AlarmInfo& alarmInfo); void toggleAlarmStatus(int alarmId, int alarmStatus); diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/clockalarms/src/alarmclient.cpp --- a/clock/clockmw/clockalarms/src/alarmclient.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/clockalarms/src/alarmclient.cpp Fri May 14 15:51:09 2010 +0300 @@ -18,8 +18,6 @@ // System includes #include -#include - // User includes #include "alarmclient.h" #include "alarmlistener.h" @@ -34,18 +32,11 @@ AlarmClient::AlarmClient(QObject* parent) :QObject(parent), mListener(0) -{ - qDebug("clock: AlarmClient::AlarmClient() -->"); - +{ // Connect to the alarm server. User::LeaveIfError(mAlarmSrvSession.Connect()); - - qDebug("clock: AlarmClient::AlarmClient() - Connection done, looks ok."); - // Construct the listener, but do not start it. mListener = new AlarmListener(this, mAlarmSrvSession); - - qDebug("clock: AlarmClient::AlarmClient() <--"); } /*! @@ -53,7 +44,6 @@ */ AlarmClient::~AlarmClient() { - qDebug("clock: AlarmClient::~AlarmClient() -->"); if (mListener) { mListener->stop(); @@ -61,8 +51,6 @@ mListener = 0; } mAlarmSrvSession.Close(); - - qDebug("clock: AlarmClient::~AlarmClient() <--"); } /*! @@ -72,8 +60,6 @@ */ void AlarmClient::getAlarmList(QList& alarmList) { - qDebug() << "clock: AlarmClient::getAlarmList -->"; - // This will hold the alarm ids returned from alarm server. RArray alarmIdArray; AlarmInfo alarmInfo; @@ -135,8 +121,6 @@ } // Cleanup. alarmIdArray.Close(); - - qDebug() << "clock: AlarmClient::getAlarmList <--"; } /*! @@ -144,8 +128,6 @@ */ void AlarmClient::setAlarm(AlarmInfo& alarmInfo) { - qDebug() << "clock: AlarmClient::setAlarm -->"; - // Get the current home time TTime homeTime; homeTime.HomeTime(); @@ -222,14 +204,10 @@ alarmInfo.alarmDateTime = alarmDate; } - - qDebug() << "clock: AlarmClient::setAlarm <--"; } void AlarmClient::setAlarmState(TAlarmState state, AlarmState& alarmState) { - qDebug() << "clock: AlarmClient::setAlarmState -->"; - switch (state) { case EAlarmStateInPreparation: alarmState = InPreparation; @@ -253,13 +231,10 @@ break; } - qDebug() << "clock: AlarmClient::setAlarmState <--"; } void AlarmClient::setAlarmState(AlarmState state, TAlarmState& alarmState) { - qDebug() << "clock: AlarmClient::setAlarmState -->"; - switch (state) { case InPreparation: alarmState = EAlarmStateInPreparation; @@ -282,15 +257,11 @@ default: break; } - - qDebug() << "clock: AlarmClient::setAlarmState <--"; } void AlarmClient::setAlarmRepeatType( TAlarmRepeatDefinition repeat, AlarmRepeatType& repeatType) { - qDebug() << "clock: AlarmClient::setAlarmRepeatType -->"; - switch (repeat) { case EAlarmRepeatDefintionRepeatOnce: repeatType = Once; @@ -307,15 +278,11 @@ default: break; } - - qDebug() << "clock: AlarmClient::setAlarmRepeatType <--"; } void AlarmClient::setAlarmRepeatType( AlarmRepeatType repeat, TAlarmRepeatDefinition& repeatType) { - qDebug() << "clock: AlarmClient::setAlarmRepeatType -->"; - switch (repeat) { case Once: repeatType = EAlarmRepeatDefintionRepeatOnce; @@ -332,24 +299,41 @@ default: break; } - - qDebug() << "clock: AlarmClient::setAlarmRepeatType <--"; } void AlarmClient::deleteAlarm(int alarmId) { - qDebug() << "clock: AlarmClient::deleteAlarm -->"; - // Request the alarmserver to delete the alarm. mAlarmSrvSession.AlarmDelete(alarmId); +} - qDebug() << "clock: AlarmClient::deleteAlarm <--"; +/*! + Delete the snoozed alarm. + + \param alarmId needs to be deleted and reset again. + \return int error value if any. + */ +int AlarmClient::deleteSnoozedAlarm(int alarmId) +{ + AlarmInfo alarmInfo; + int retVal(KErrNone); + int returnVal = getAlarmInfo(alarmId, alarmInfo); + if (KErrNone != retVal) { + return retVal; + } + returnVal = mAlarmSrvSession.AlarmDelete(alarmId); + if (KErrNone != retVal) { + return retVal; + } + alarmInfo.alarmState = InPreparation; + alarmInfo.nextDueTime = alarmInfo.origAlarmTime; + setAlarm(alarmInfo); + + return retVal; } int AlarmClient::getAlarmInfo(int alarmId, AlarmInfo& alarmInfo) { - qDebug() << "clock: AlarmClient::getAlarmInfo -->"; - TASShdAlarm tempSharedAlarm; // Get the requested alarm info from the alarm server. @@ -373,11 +357,15 @@ tempSharedAlarm.NextDueTime().DateTime().Minute(), tempSharedAlarm.NextDueTime().DateTime().Second()); - // Alarm day + // Alarm date alarmInfo.alarmDateTime.setYMD( tempSharedAlarm.OriginalExpiryTime().DateTime().Year(), tempSharedAlarm.OriginalExpiryTime().DateTime().Month()+1, tempSharedAlarm.OriginalExpiryTime().DateTime().Day()+1); + + // Set alarm day. + alarmInfo.alarmDay = + tempSharedAlarm.OriginalExpiryTime().DayNoInWeek(); // The alarm status if (EAlarmStatusEnabled == tempSharedAlarm.Status()) { @@ -404,46 +392,31 @@ alarmInfo.volumeStatus = AlarmVolumeOff; } } - - qDebug() << "clock: AlarmClient::getAlarmInfo <--"; - return error; } void AlarmClient::toggleAlarmStatus(int alarmId, int alarmStatus) { - qDebug() << "clock: AlarmClient::toggleAlarmStatus -->"; mAlarmSrvSession.SetAlarmStatus(alarmId, (TAlarmStatus)alarmStatus); - qDebug() << "clock: AlarmClient::toggleAlarmStatus <--"; } void AlarmClient::startListener() { - qDebug("clock: AlarmClient::startListener() -->"); + mListener->start(); - mListener->start(); - - qDebug("clock: AlarmClient::startListener() <--"); } void AlarmClient::stopListener() { - qDebug("clock: AlarmClient::stopListener() -->"); - mListener->stop(); - qDebug("clock: AlarmClient::stopListener() <--"); } void AlarmClient::notifyChange(int alarmId) { - qDebug() << "clock: AlarmClient::notifyChange -->"; - - emit alarmStateChanged(alarmId); - - qDebug() << "clock: AlarmClient::notifyChange <--"; + emit alarmStateChanged(alarmId); } // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/clockalarms/src/alarmlistener.cpp --- a/clock/clockmw/clockalarms/src/alarmlistener.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/clockalarms/src/alarmlistener.cpp Fri May 14 15:51:09 2010 +0300 @@ -25,57 +25,39 @@ mClient(client), mSession(session) { - qDebug("clock: AlarmListener::AlarmListener -->"); - - // Nothing to do. - - qDebug("clock: AlarmListener::AlarmListener <--"); + // Nothing to do. } AlarmListener::~AlarmListener() { - qDebug("clock: AlarmListener::~AlarmListener -->"); - if (IsActive()) { Cancel(); } - qDebug("clock: AlarmListener::~AlarmListener <--"); } void AlarmListener::start() { - qDebug("clock: AlarmListener::start -->"); - // Add the AO to the scheduler. CActiveScheduler::Add(this); // Subscrive for async notification from alarm server. mSession.NotifyChange(iStatus, mAlarmId); - qDebug("clock: AlarmListener::start - Successfully subscribed for change notifiation."); - // Set the AO active. SetActive(); - qDebug("clock: AlarmListener::start <--"); } void AlarmListener::stop() { - qDebug("clock: AlarmListener::stop -->"); - if (IsActive()) { Cancel(); } - - qDebug("clock: AlarmListener::stop <--"); } void AlarmListener::RunL() { - qDebug("clock: AlarmListener::RunL --"); - if (iStatus != KRequestPending) { // We get notification for various changes with the alarm server. // Only the required Events are used to emit a signal. @@ -95,18 +77,13 @@ SetActive(); } - - qDebug("clock: AlarmListener::RunL <--"); } void AlarmListener::DoCancel() { - qDebug("clock: AlarmListener::DoCancel -->"); - // Cancel async request. mSession.NotifyChangeCancel(); - qDebug("clock: AlarmListener::DoCancel <--"); } // End of file diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/clocksettingsutility/inc/settingsutility.h --- a/clock/clockmw/clocksettingsutility/inc/settingsutility.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/clocksettingsutility/inc/settingsutility.h Fri May 14 15:51:09 2010 +0300 @@ -42,11 +42,11 @@ ~SettingsUtility(); public: - void setTime(const QString &time); +// void setTime(const QString &time); QString time(); - void setTimeZone(const QString &timezone); - QString timeZone(); +/* void setTimeZone(const QString &timezone); + QString timeZone();*/ void setTimeFormat(const QString &format); int timeFormat(QStringList &format); @@ -57,10 +57,10 @@ void setTimeSeparator(const QString &separator); int timeSeparator(QStringList &list); - void setAutoUpdate(const QString &value); - int autoUpdate(QStringList &list); +/* void setAutoUpdate(const QString &value); + int autoUpdate(QStringList &list);*/ - void setDate(const QString &date); +// void setDate(const QString &date); QString date(); void setDateFormat(const QString &format); @@ -91,8 +91,6 @@ QStringList mDateSeparatorList; QStringList mAutoUpdateValueList; QStringList mSnoozeValueList; - - TimezoneClient *mTimeZoneClient; }; #endif // SETTINGSUTILITY_H diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/clocksettingsutility/src/settingsutility.cpp --- a/clock/clockmw/clocksettingsutility/src/settingsutility.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/clocksettingsutility/src/settingsutility.cpp Fri May 14 15:51:09 2010 +0300 @@ -37,8 +37,6 @@ SettingsUtility::SettingsUtility(QObject *parent) :QObject(parent) { - qDebug("clock: SettingsUtility::SettingsUtility -->"); - mTimeSeparatorList << tr(".") << tr(":"); mClockTypeList << tr("Analog") << tr("Digital"); mTimeFormatList << hbTrId("txt_clk_setlabel_val_24_hour") << hbTrId("txt_clk_setlabel_val_12_hour"); @@ -46,12 +44,6 @@ mDateSeparatorList << tr(".") << tr(":") << tr("/") << tr("-"); mAutoUpdateValueList << tr("ON") << tr("OFF"); mSnoozeValueList << tr("5 minutes") << tr("15 minutes") << tr(" 30 minutes") << tr("1 hour"); - - mTimeZoneClient = new TimezoneClient(this); - - qDebug("clock: SettingsUtility::SettingsUtility <--"); - -// mSettingsMamager = new XQSettingsManager(this); } /*! @@ -59,23 +51,11 @@ */ SettingsUtility::~SettingsUtility() { - // Nothing yet. + // Nothing. } /*! - - */ -void SettingsUtility::setTime(const QString &time) -{ - QTime newTime = QTime::fromString(time, timeFormatString()); - - if (newTime.isValid()) { - mTimeZoneClient->setDateTime(QDateTime(QDate::currentDate(), newTime)); - } -} - -/*! - + Returns the current time in the device. */ QString SettingsUtility::time() { @@ -85,64 +65,6 @@ /*! */ -void SettingsUtility::setTimeZone(const QString &timezone) -{ - Q_UNUSED(timezone) -} - -/*! - - */ -QString SettingsUtility::timeZone() -{ - QStringList dummyList; - - // Get the current zone info. - LocationInfo currentZoneInfo = mTimeZoneClient->getCurrentZoneInfoL(); - - // Construct the GMT +/- X string. - QString gmtOffset(hbTrId("txt_common_common_gmt")); - - int utcOffset = currentZoneInfo.zoneOffset; - int offsetInHours (utcOffset/60); - int offsetInMinutes (utcOffset%60); - - // Check wether the offset is +ve or -ve. - if (0 < utcOffset) { - // We have a positive offset. Append the '+' character. - gmtOffset += tr("+ "); - } else if (0 > utcOffset) { - // We have a negative offset. Append the '-' character. - gmtOffset += tr("- "); - offsetInHours = -offsetInHours; - } else { - // We dont have an offset. We are at GMT zone. - } - - // Append the hour component. - gmtOffset += QString::number(offsetInHours); - - // Append the time separator. - gmtOffset += mTimeSeparatorList.at(timeSeparator(dummyList)); - - // Append the minute component. - // If minute component is less less than 10, append a '00' - if (0 <= offsetInMinutes && offsetInMinutes < 10) { - gmtOffset += tr("00"); - } else { - gmtOffset += QString::number(offsetInMinutes); - } - - gmtOffset += tr(" "); - // TODO: append city name when more than one cities else country name. - gmtOffset += currentZoneInfo.cityName; - - return gmtOffset; -} - -/*! - - */ void SettingsUtility::setTimeFormat(const QString& format) { TLocale locale; @@ -234,8 +156,6 @@ */ int SettingsUtility::timeSeparator(QStringList &list) { - qDebug() << "clock: SettingsUtility::timeSeparator -->"; - TLocale locale; TChar separatorChar = locale.TimeSeparator(1); int value = -1; @@ -249,70 +169,14 @@ } list = mTimeSeparatorList; - - qDebug() << "clock: SettingsUtility::timeSeparator <--"; - return value; } /*! */ -void SettingsUtility::setAutoUpdate(const QString &value) -{ - // TODO: implement the changes after server is in place. - // 1. Inform the server about the setting. - // 2. Get the status of the change from server - // 3. Emit the signal to inform the clients of the change in the settings item, - // pass the enum of settings item changed and the updated value. - - if (0 == value.compare(tr("ON"), Qt::CaseInsensitive)) { - mTimeZoneClient->setTimeUpdateOn(true); - } else { - mTimeZoneClient->setTimeUpdateOn(false); - } - - emit settingsChanged(AutoTimeUpdate, value); -} - -/*! - - */ -int SettingsUtility::autoUpdate(QStringList &list) -{ - // TODO: implement properly. this is jst a dummy implementation. - int value = 1; - - bool autoUpdate = mTimeZoneClient->timeUpdateOn(); - - if (autoUpdate) { - value = 0; - } - list = mAutoUpdateValueList; - return value; -} - -/*! - - */ -void SettingsUtility::setDate(const QString &date) -{ - QDate newDate = QDate::fromString(date, dateFormatString()); - - if (newDate.isValid()) { - mTimeZoneClient->setDateTime(QDateTime(newDate, QTime::currentTime())); - } -} - -/*! - - */ QString SettingsUtility::date() { - qDebug() << "clock: SettingsUtility::date -->"; - - qDebug() << "clock: SettingsUtility::date <--"; - return QDate::currentDate().toString(dateFormatString()); } diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/clocktimezone/clocktimezone.pro --- a/clock/clockmw/clocktimezone/clocktimezone.pro Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/clocktimezone/clocktimezone.pro Fri May 14 15:51:09 2010 +0300 @@ -41,7 +41,8 @@ -lbafl \ -ltimezonelocalization \ -ltzclient \ - -lclockserverclient + -lclockserverclient \ + -lxqsettingsmanager BLD_INF_RULES.prj_exports += \ "../../data/timezonedata/timezonelocalization.loc APP_LAYER_LOC_EXPORT_PATH(timezonelocalization.loc)" \ diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/clocktimezone/inc/timezoneclient.h --- a/clock/clockmw/clocktimezone/inc/timezoneclient.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/clocktimezone/inc/timezoneclient.h Fri May 14 15:51:09 2010 +0300 @@ -41,6 +41,8 @@ class CEnvironmentChangeNotifier; class QStandardItemModel; class CTzLocalizer; +class XQSettingsManager; +class XQSettingsKey; const int KInitialEvent = ( EChangesLocale | @@ -56,29 +58,31 @@ Q_OBJECT public: - TimezoneClient(QObject* parent = 0); + /*TIMEZONECLIENT_EXPORT*/ static TimezoneClient* getInstance(); + /*TIMEZONECLIENT_EXPORT*/ void deleteInstance(); + /*TIMEZONECLIENT_EXPORT*/ bool isNull(); + +private: + TimezoneClient(); ~TimezoneClient(); +private: + +private: + static TimezoneClient *mTimezoneClient; + static int mReferenceCount; + +// TODO: still refatoring public: - QList getLocations(); - bool getUtcDstOffsetL(int &dstOffset, - const CTzId &tzId); - LocationInfo getCurrentZoneInfoL(); - void setAsCurrentLocationL(LocationInfo &location); - bool isDSTOnL(int timezoneId); - int getStandardOffset(int timezoneId); - void getDstRulesL( - QDateTime &startTime, QDateTime &endTime,int timezoneId); + /*TIMEZONECLIENT_EXPORT*/ QList &getLocations(); + /*TIMEZONECLIENT_EXPORT*/ LocationInfo getCurrentZoneInfoL(); + /*TIMEZONECLIENT_EXPORT*/ void setAsCurrentLocationL(LocationInfo &location); + /*TIMEZONECLIENT_EXPORT*/ bool isDSTOnL(int timezoneId); + /*TIMEZONECLIENT_EXPORT*/ int getStandardOffset(int timezoneId); QList getSavedLocations(); void saveLocations(const QList &locationList); void getCountries(QMap& countries); - void getCitiesForCountry( - int id, QMap& cities); - void getLocationInfo( - int groupId, int cityIndex, LocationInfo& cityInfo); bool dstOn(int tzId); - int getCityGroupIdByName(const QString& name); - int getCityOffsetByNameAndId(const QString& name, int tzId); void setDateTime(QDateTime dateTime); void setTimeUpdateOn(bool timeUpdate = true); bool timeUpdateOn(); @@ -96,13 +100,25 @@ signals: void timechanged(); void listUpdated(); - + void autoTimeUpdateChanged(int value); + void cityUpdated(); + private: int getDstZoneOffset(int tzId); TMonth intToMonth(int month); + bool getUtcDstOffsetL(int &dstOffset, const CTzId &tzId); + void getDstRulesL( + QDateTime &startTime, QDateTime &endTime,int timezoneId); + void getCitiesForCountry( + int id, QMap& cities); + void getLocationInfo( + int groupId, int cityIndex, LocationInfo& cityInfo); + int getCityGroupIdByName(const QString& name); + int getCityOffsetByNameAndId(const QString& name, int tzId); private slots: - void populateCities(); + void populateCities(); + void eventMonitor(const XQSettingsKey& key, const QVariant& value); public: CEnvironmentChangeNotifier *mNotifier; @@ -112,14 +128,16 @@ QMap mAllCountries; QList mAllLocations; QStandardItemModel *mWorldClockModel; + XQSettingsManager *mSettingsManager; + XQSettingsKey *mAutoTimeUpdateKey; QList mTimeZoneIds; - bool mTimeUpdateOn; - int mFetchCount; +// bool mTimeUpdateOn; int mCountryCount; + int mAutoTimeUpdateValue; }; -#endif // __TIMEZONECLIENT_H__ +#endif // __TIMEZONECLIENT_H__ // End of file diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/clocktimezone/src/timezoneclient.cpp --- a/clock/clockmw/clocktimezone/src/timezoneclient.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/clocktimezone/src/timezoneclient.cpp Fri May 14 15:51:09 2010 +0300 @@ -19,17 +19,17 @@ // System includes #include #include -#include #include #include #include #include #include +#include +#include // User includes #include "timezoneclient.h" #include "clockcommon.h" -#include "debug.h" #include "clockserverclt.h" const int KDaysInWeek(7); @@ -44,39 +44,78 @@ tzserver and timezonelocalization. */ +TimezoneClient* TimezoneClient::mTimezoneClient = 0; +int TimezoneClient::mReferenceCount = 0; /*! - Default constructor. + Call this funtion to instantiate the TimezoneClient class. + */ +TimezoneClient* TimezoneClient::getInstance() +{ + if (!mTimezoneClient) { + mTimezoneClient = new TimezoneClient(); + } - \param parent The parent. + mReferenceCount++; + return mTimezoneClient; +} + +/*! + Call this function to clean up the instance of TimezoneClient class. */ -TimezoneClient::TimezoneClient(QObject* parent) -:QObject(parent), - mTimeUpdateOn(false), - mFetchCount(0) +void TimezoneClient::deleteInstance() { - qDebug("clock: TimezoneClient::TimezoneClient() -->"); + mReferenceCount--; + + if (0 == mReferenceCount) { + delete mTimezoneClient; + mTimezoneClient = 0; + } +} +/*! + Call this function to check if the object is NULL. + */ +bool TimezoneClient::isNull() +{ + bool deleted = false; + if (0 == mReferenceCount) { + deleted = true; + } + return deleted; +} + +/*! + The constructor. + */ +TimezoneClient::TimezoneClient() +{ TCallBack callback(environmentCallback, this); mNotifier = CEnvironmentChangeNotifier::NewL( CActive::EPriorityStandard, callback); mNotifier->Start(); - RClkSrvInterface clkSrvInterface1; - User::LeaveIfError(clkSrvInterface1.Connect()); - TBool aUpdate; - clkSrvInterface1.IsAutoTimeUpdateOn(aUpdate); - if(aUpdate){ - mTimeUpdateOn = true; - } - else { - mTimeUpdateOn = false; - } - clkSrvInterface1.Close(); - mTzLocalizer = CTzLocalizer::NewL(); - qDebug("clock: TimezoneClient::TimezoneClient() <--"); + // Create the settings manager. + mSettingsManager = new XQSettingsManager(this); + + // Create the key for auto time update. + mAutoTimeUpdateKey = new XQSettingsKey( + XQSettingsKey::TargetCentralRepository, + KCRUidNitz, + KActiveProtocol); + + // Start the monitoring for the auto time update key. + mSettingsManager->startMonitoring(*mAutoTimeUpdateKey); + + // Get the value of auto time update from cenrep. + mAutoTimeUpdateValue = timeUpdateOn(); + + // Listen to the key value changes. + connect( + mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)), + this, SLOT(eventMonitor(XQSettingsKey, QVariant))); } /*! @@ -99,6 +138,11 @@ if (mTimeZoneIds.count()) { mTimeZoneIds.clear(); } + // Clear the locations if exist. + if (mAllLocations.count()) { + mAllLocations.clear(); + } + } /*! @@ -109,20 +153,15 @@ valid cityName, countryName, tz id and city group id. None of the other data is filled. */ -QList TimezoneClient::getLocations() +QList& TimezoneClient::getLocations() { - qDebug("clock: TimezoneClient::getLocations() -->"); - - // This list will contain the info of the cities fetched from tz server. - QList infoList; - - // Construct the timezone localizer. - CTzLocalizer* localizer = CTzLocalizer::NewL(); - CleanupStack::PushL(localizer); + if (mAllLocations.count()) { + mAllLocations.clear(); + } // Get the cities, in alphabetical-ascending sorted order. CTzLocalizedCityArray* cityArray = - localizer->GetCitiesL(CTzLocalizer::ETzAlphaNameAscending); + mTzLocalizer->GetCitiesL(CTzLocalizer::ETzAlphaNameAscending); ASSERT(cityArray); CleanupStack::PushL(cityArray); int cityCount = cityArray->Count(); @@ -150,7 +189,7 @@ if (country) { delete country; } - country = localizer->GetCityGroupL(cityGroupId); + country = mTzLocalizer->GetCityGroupL(cityGroupId); countryName.Set(country->Name()); } @@ -162,16 +201,12 @@ cityName.Ptr(), cityName.Length()); cityInfo.countryName = QString::fromUtf16( countryName.Ptr(), countryName.Length()); - infoList.append(cityInfo); + mAllLocations.append(cityInfo); } // Cleanup. CleanupStack::PopAndDestroy(cityArray); - CleanupStack::PopAndDestroy(localizer); - - qDebug("clock: TimezoneClient::getLocations() <--"); - - return infoList; + return mAllLocations; } bool TimezoneClient::getUtcDstOffsetL(int& dstOffset, const CTzId& timezoneId) @@ -246,8 +281,6 @@ LocationInfo TimezoneClient::getCurrentZoneInfoL() { - qDebug() << "clock: TimezoneClient::getCurrentZoneInfoL -->"; - // Current zone info. LocationInfo currentLocation; int timezoneId(0); @@ -281,140 +314,130 @@ timeZones.Close(); zoneOffsets.Close(); - // Construct CTzLocalizer object to get the timezone from the ID. - CTzLocalizer* tzLocalizer = CTzLocalizer::NewL(); - // Get all the localized timezones for the current timezone ID. CTzLocalizedTimeZone* localizedTimeZone(NULL); - if (tzLocalizer) { - // Get the currently set localized timezone. - CleanupStack::PushL(tzLocalizer); - localizedTimeZone = - tzLocalizer->GetLocalizedTimeZoneL(tzId->TimeZoneNumericID()); + localizedTimeZone = + mTzLocalizer->GetLocalizedTimeZoneL(tzId->TimeZoneNumericID()); + + if (localizedTimeZone) { + CleanupStack::PushL(localizedTimeZone); - if (localizedTimeZone) { - CleanupStack::PushL(localizedTimeZone); + // Get the frequently used localized city. + CTzLocalizedCity* localizedCity(0); + localizedCity = mTzLocalizer->GetFrequentlyUsedZoneCityL( + CTzLocalizedTimeZone::ECurrentZone); + CleanupStack::PushL(localizedCity); - // Get the frequently used localized city. - CTzLocalizedCity* localizedCity(0); - localizedCity = tzLocalizer->GetFrequentlyUsedZoneCityL( - CTzLocalizedTimeZone::ECurrentZone); - CleanupStack::PushL(localizedCity); + // Get all the city groups. + CTzLocalizedCityGroupArray* cityGroupArray = + mTzLocalizer->GetAllCityGroupsL( + CTzLocalizer::ETzAlphaNameAscending); + CleanupStack::PushL(cityGroupArray); - // Get all the city groups. - CTzLocalizedCityGroupArray* cityGroupArray = - tzLocalizer->GetAllCityGroupsL( - CTzLocalizer::ETzAlphaNameAscending); - CleanupStack::PushL(cityGroupArray); - - // Get the index of the country corresponding to the city group ID. - int countryIndex(1); + // Get the index of the country corresponding to the city group ID. + int countryIndex(1); - for (int index = 0; index < cityGroupArray->Count(); index++) { - if (localizedCity->GroupId() == - cityGroupArray->At(index).Id()) { - countryIndex = index; - } + for (int index = 0; index < cityGroupArray->Count(); index++) { + if (localizedCity->GroupId() == + cityGroupArray->At(index).Id()) { + countryIndex = index; } + } - // Get all the cities within the currently set country. - CTzLocalizedCityArray* cityList = tzLocalizer->GetCitiesInGroupL( - (cityGroupArray->At(countryIndex )).Id(), - CTzLocalizer::ETzAlphaNameAscending); - CleanupStack::PushL(cityList); + // Get all the cities within the currently set country. + CTzLocalizedCityArray* cityList = mTzLocalizer->GetCitiesInGroupL( + (cityGroupArray->At(countryIndex )).Id(), + CTzLocalizer::ETzAlphaNameAscending); + CleanupStack::PushL(cityList); - // Check if automatic time update is enabled. - bool timeUpdateOn( false ); + // Check if automatic time update is enabled. + bool timeUpdateOn( false ); - // Connect to the clock server. - // TODO: connect to the clock server and get auto update status in - // var: timeUpdateOn - // Check if the country contains only one city or if automatic - // time update is on. - if (1 == cityList->Count() || timeUpdateOn) { - // If yes, then display only the country name. - // TODO - } else { - // Display city name. - // TODO: - } + // Connect to the clock server. + // TODO: connect to the clock server and get auto update status in + // var: timeUpdateOn + // Check if the country contains only one city or if automatic + // time update is on. + if (1 == cityList->Count() || timeUpdateOn) { + // If yes, then display only the country name. + // TODO + } else { + // Display city name. + // TODO: + } - // Get the country name. - TPtrC countryName(cityGroupArray->At(countryIndex).Name()); - currentLocation.countryName = QString::fromUtf16( - countryName.Ptr(), countryName.Length()); - - // Get the city name. - TPtrC cityName(localizedCity->Name()); - currentLocation.cityName = QString::fromUtf16( - cityName.Ptr(), cityName.Length()); + // Get the country name. + TPtrC countryName(cityGroupArray->At(countryIndex).Name()); + currentLocation.countryName = QString::fromUtf16( + countryName.Ptr(), countryName.Length()); - // Get the UTC offset. - timezoneId = localizedCity->TimeZoneId(); + // Get the city name. + TPtrC cityName(localizedCity->Name()); + currentLocation.cityName = QString::fromUtf16( + cityName.Ptr(), cityName.Length()); - if (timezoneId) { - // Check if the DST is on for the current timezone. - if (isDSTOnL(timezoneId)) { - // Get the offset with DST enabled. - getUtcDstOffsetL(utcOffset, *tzId); + // Get the UTC offset. + timezoneId = localizedCity->TimeZoneId(); - currentLocation.dstOn = true; - currentLocation.timezoneId = timezoneId; - currentLocation.zoneOffset = utcOffset; - } else { - // Use the standard offset. - currentLocation.dstOn = false; - currentLocation.timezoneId = timezoneId; - currentLocation.zoneOffset = initialTimeZoneOffset; - } + if (timezoneId) { + // Check if the DST is on for the current timezone. + if (isDSTOnL(timezoneId)) { + // Get the offset with DST enabled. + getUtcDstOffsetL(utcOffset, *tzId); + + currentLocation.dstOn = true; + currentLocation.timezoneId = timezoneId; + currentLocation.zoneOffset = utcOffset; + } else { + // Use the standard offset. + currentLocation.dstOn = false; + currentLocation.timezoneId = timezoneId; + currentLocation.zoneOffset = initialTimeZoneOffset; } - - // Cleanup. - CleanupStack::PopAndDestroy( cityList ); - CleanupStack::PopAndDestroy( cityGroupArray ); - CleanupStack::PopAndDestroy( localizedCity ); - CleanupStack::PopAndDestroy( localizedTimeZone ); } // Cleanup. - CleanupStack::PopAndDestroy( tzLocalizer ); + CleanupStack::PopAndDestroy( cityList ); + CleanupStack::PopAndDestroy( cityGroupArray ); + CleanupStack::PopAndDestroy( localizedCity ); + CleanupStack::PopAndDestroy( localizedTimeZone ); } // Cleanup. CleanupStack::PopAndDestroy( tzId ); CleanupStack::PopAndDestroy( &tzHandle ); - - qDebug() << "clock: TimezoneClient::getCurrentZoneInfoL <--"; - return currentLocation; } void TimezoneClient::setAsCurrentLocationL(LocationInfo &location) { - Debug::writeDebugMsg( +/* Debug::writeDebugMsg( "In time zone client setAsCurrentLocationL " + location.cityName + " " + location.countryName + " " + - QString::number(location.zoneOffset)); + QString::number(location.zoneOffset));*/ - // Construct CTzLocalizer object. - CTzLocalizer* tzLocalizer = CTzLocalizer::NewL(); - CleanupStack::PushL( tzLocalizer ); - tzLocalizer->SetTimeZoneL( location.timezoneId ); + LocationInfo prevLocationInfo ; + prevLocationInfo = getCurrentZoneInfoL(); + + mTzLocalizer->SetTimeZoneL( location.timezoneId ); TPtrC ptrCityName( reinterpret_cast(location.cityName.constData())); CTzLocalizedCity* localizedCity = - tzLocalizer->FindCityByNameL(ptrCityName, location.timezoneId); + mTzLocalizer->FindCityByNameL(ptrCityName, location.timezoneId); CleanupStack::PushL( localizedCity ); - tzLocalizer->SetFrequentlyUsedZoneL( + mTzLocalizer->SetFrequentlyUsedZoneL( *localizedCity, CTzLocalizedTimeZone::ECurrentZone); // Cleanup. CleanupStack::PopAndDestroy( localizedCity ); - CleanupStack::PopAndDestroy( tzLocalizer ); + + if(prevLocationInfo.timezoneId == location.timezoneId) { + emit cityUpdated(); + } } bool TimezoneClient::isDSTOnL(int timezoneId) @@ -588,16 +611,11 @@ void TimezoneClient::getCountries(QMap& countries) { - // Construct the timezone localizer. - CTzLocalizer* localizer = CTzLocalizer::NewL(); - CleanupStack::PushL(localizer); - // Get all the city groups(countries). QTime t; t.start(); CTzLocalizedCityGroupArray* cityGroupArray = - localizer->GetAllCityGroupsL(CTzLocalizer::ETzAlphaNameAscending); - qDebug() << "Fetching city groups from tzloc: " << t.elapsed(); + mTzLocalizer->GetAllCityGroupsL(CTzLocalizer::ETzAlphaNameAscending); CleanupStack::PushL(cityGroupArray); t.restart(); @@ -611,27 +629,18 @@ countryName.Ptr(),countryName.Length()); countries[qCountryName] = cityGroup.Id(); } - qDebug() << "Converting " << - cityGroupArray->Count() << - "countries to qstring: " << - t.elapsed(); // Cleanup. CleanupStack::PopAndDestroy(cityGroupArray); - CleanupStack::PopAndDestroy(localizer); } void TimezoneClient::getCitiesForCountry(int id, QMap& cities) { - // Construct the timezone localizer. - CTzLocalizer* localizer = CTzLocalizer::NewL(); - CleanupStack::PushL(localizer); - // Get the city group for the given id. - CTzLocalizedCityArray* cityArray = localizer->GetCitiesInGroupL(id, + CTzLocalizedCityArray* cityArray = mTzLocalizer->GetCitiesInGroupL(id, CTzLocalizer::ETzAlphaNameAscending); CleanupStack::PushL(cityArray); - CTzLocalizedCityArray* unsortedArray = localizer->GetCitiesInGroupL(id, + CTzLocalizedCityArray* unsortedArray = mTzLocalizer->GetCitiesInGroupL(id, CTzLocalizer::ETzUnsorted); CleanupStack::PushL(unsortedArray); @@ -654,7 +663,6 @@ // Cleanup. CleanupStack::PopAndDestroy(unsortedArray); CleanupStack::PopAndDestroy(cityArray); - CleanupStack::PopAndDestroy(localizer); } void TimezoneClient::getLocationInfo( @@ -663,15 +671,12 @@ TRAPD( error, - // Construct the localizer. - CTzLocalizer* localizer = CTzLocalizer::NewLC(); - // Get the localized city group. - CTzLocalizedCityGroup* cityGroup = localizer->GetCityGroupL(groupId); + CTzLocalizedCityGroup* cityGroup = mTzLocalizer->GetCityGroupL(groupId); CleanupStack::PushL(cityGroup); // Get the localized city array for the given city group. - CTzLocalizedCityArray* cityArray = localizer->GetCitiesInGroupL( + CTzLocalizedCityArray* cityArray = mTzLocalizer->GetCitiesInGroupL( groupId, CTzLocalizer::ETzUnsorted); CleanupStack::PushL(cityArray); @@ -690,7 +695,6 @@ // Cleanup. CleanupStack::PopAndDestroy(cityArray); CleanupStack::PopAndDestroy(cityGroup); - CleanupStack::PopAndDestroy(localizer); ) Q_UNUSED(error) } @@ -787,11 +791,8 @@ TPtrC namePtr; namePtr.Set(name.utf16(), name.length()); - // Construct the timezone localizer. - CTzLocalizer *localizer = CTzLocalizer::NewLC(); - // Get the citygroup matching the name. - CTzLocalizedCityGroup *cityGroup = localizer->FindCityGroupByNameL(namePtr); + CTzLocalizedCityGroup *cityGroup = mTzLocalizer->FindCityGroupByNameL(namePtr); CleanupStack::PushL(cityGroup); // Get the id. @@ -799,7 +800,6 @@ // Cleanup. CleanupStack::PopAndDestroy(cityGroup); - CleanupStack::PopAndDestroy(localizer); return id; } @@ -809,11 +809,8 @@ TPtrC namePtr; namePtr.Set(name.utf16(), name.length()); - // Construct the timezone localizer. - CTzLocalizer *localizer = CTzLocalizer::NewLC(); - // Get the citygroup matching the name. - CTzLocalizedCityArray *cityArray = localizer->GetCitiesL(tzId); + CTzLocalizedCityArray *cityArray = mTzLocalizer->GetCitiesL(tzId); CleanupStack::PushL(cityArray); int id; @@ -828,10 +825,8 @@ // Cleanup. CleanupStack::PopAndDestroy(cityArray); - CleanupStack::PopAndDestroy(localizer); return id; - } void TimezoneClient::setDateTime(QDateTime dateTime) @@ -850,21 +845,25 @@ void TimezoneClient::setTimeUpdateOn(bool timeUpdate) { - RClkSrvInterface clkSrvInterface; - User::LeaveIfError(clkSrvInterface.Connect()); - if (timeUpdate) { - clkSrvInterface.ActivateAllProtocols(); - } - else { - clkSrvInterface.DeActivateAllProtocols(); - } - mTimeUpdateOn = timeUpdate; + RClkSrvInterface clkSrvInterface; + User::LeaveIfError(clkSrvInterface.Connect()); + if (timeUpdate) { + clkSrvInterface.ActivateAllProtocols(); + } + else { + clkSrvInterface.DeActivateAllProtocols(); + } clkSrvInterface.Close(); } bool TimezoneClient::timeUpdateOn() { - return mTimeUpdateOn; + TBool autoTimeUpdateOn; + RClkSrvInterface clkSrvInterface; + User::LeaveIfError(clkSrvInterface.Connect()); + clkSrvInterface.IsAutoTimeUpdateOn(autoTimeUpdateOn); + clkSrvInterface.Close(); + return autoTimeUpdateOn; } QStandardItemModel *TimezoneClient::locationSelectorModel() @@ -1245,4 +1244,29 @@ return info; } + +/*! + Slot which is called when the value changes in cevrep. + + \param key The key which got changed in cenrep. + \param value The new value of that key. + */ +void TimezoneClient::eventMonitor(const XQSettingsKey& key, const QVariant& value) +{ + if (key.uid() == KCRUidNitz && key.key() == KActiveProtocol) { + if (mSettingsManager->error() == XQSettingsManager::NoError) { + + // New value of auto time update. + int autoTimeUpdate = value.toInt(); + + // Check if the auto time update value has actually changed. + bool keyValueChanged = (autoTimeUpdate != mAutoTimeUpdateValue); + + if(keyValueChanged) { + mAutoTimeUpdateValue = autoTimeUpdate; + emit autoTimeUpdateChanged(mAutoTimeUpdateValue); + } + } + } +} // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/eabi/clockalarmclientu.def --- a/clock/clockmw/eabi/clockalarmclientu.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/eabi/clockalarmclientu.def Fri May 14 15:51:09 2010 +0300 @@ -24,4 +24,5 @@ _ZNK11AlarmClient10metaObjectEv @ 23 NONAME _ZTI11AlarmClient @ 24 NONAME _ZTV11AlarmClient @ 25 NONAME + _ZN11AlarmClient18deleteSnoozedAlarmEi @ 26 NONAME diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/eabi/clocksettingsutilityu.def --- a/clock/clockmw/eabi/clocksettingsutilityu.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/eabi/clocksettingsutilityu.def Fri May 14 15:51:09 2010 +0300 @@ -1,40 +1,34 @@ EXPORTS - _ZN15SettingsUtility10autoUpdateER11QStringList @ 1 NONAME - _ZN15SettingsUtility10dateFormatER11QStringList @ 2 NONAME - _ZN15SettingsUtility10snoozeTimeER11QStringList @ 3 NONAME - _ZN15SettingsUtility10timeFormatER11QStringList @ 4 NONAME - _ZN15SettingsUtility11qt_metacallEN11QMetaObject4CallEiPPv @ 5 NONAME - _ZN15SettingsUtility11qt_metacastEPKc @ 6 NONAME - _ZN15SettingsUtility11setTimeZoneERK7QString @ 7 NONAME - _ZN15SettingsUtility11setWorkdaysERK7QString @ 8 NONAME - _ZN15SettingsUtility12setClockTypeERK7QString @ 9 NONAME - _ZN15SettingsUtility13dateSeparatorER11QStringList @ 10 NONAME - _ZN15SettingsUtility13setAutoUpdateERK7QString @ 11 NONAME - _ZN15SettingsUtility13setDateFormatERK7QString @ 12 NONAME - _ZN15SettingsUtility13setSnoozeTimeEi @ 13 NONAME - _ZN15SettingsUtility13setTimeFormatERK7QString @ 14 NONAME - _ZN15SettingsUtility13timeSeparatorER11QStringList @ 15 NONAME - _ZN15SettingsUtility14setStartOfWeekEi @ 16 NONAME - _ZN15SettingsUtility15settingsChangedE19SettingsItemChanged7QString @ 17 NONAME - _ZN15SettingsUtility16dateFormatStringEv @ 18 NONAME - _ZN15SettingsUtility16setDateSeparatorERK7QString @ 19 NONAME - _ZN15SettingsUtility16setTimeSeparatorERK7QString @ 20 NONAME - _ZN15SettingsUtility16staticMetaObjectE @ 21 NONAME DATA 16 - _ZN15SettingsUtility16timeFormatStringEv @ 22 NONAME - _ZN15SettingsUtility19getStaticMetaObjectEv @ 23 NONAME - _ZN15SettingsUtility4dateEv @ 24 NONAME - _ZN15SettingsUtility4timeEv @ 25 NONAME - _ZN15SettingsUtility7setDateERK7QString @ 26 NONAME - _ZN15SettingsUtility7setTimeERK7QString @ 27 NONAME - _ZN15SettingsUtility8timeZoneEv @ 28 NONAME - _ZN15SettingsUtility8workdaysER11QStringList @ 29 NONAME - _ZN15SettingsUtility9clockTypeER11QStringList @ 30 NONAME - _ZN15SettingsUtilityC1EP7QObject @ 31 NONAME - _ZN15SettingsUtilityC2EP7QObject @ 32 NONAME - _ZN15SettingsUtilityD0Ev @ 33 NONAME - _ZN15SettingsUtilityD1Ev @ 34 NONAME - _ZN15SettingsUtilityD2Ev @ 35 NONAME - _ZNK15SettingsUtility10metaObjectEv @ 36 NONAME - _ZTI15SettingsUtility @ 37 NONAME - _ZTV15SettingsUtility @ 38 NONAME + _ZN15SettingsUtility10dateFormatER11QStringList @ 1 NONAME + _ZN15SettingsUtility10snoozeTimeER11QStringList @ 2 NONAME + _ZN15SettingsUtility10timeFormatER11QStringList @ 3 NONAME + _ZN15SettingsUtility11qt_metacallEN11QMetaObject4CallEiPPv @ 4 NONAME + _ZN15SettingsUtility11qt_metacastEPKc @ 5 NONAME + _ZN15SettingsUtility11setWorkdaysERK7QString @ 6 NONAME + _ZN15SettingsUtility12setClockTypeERK7QString @ 7 NONAME + _ZN15SettingsUtility13dateSeparatorER11QStringList @ 8 NONAME + _ZN15SettingsUtility13setDateFormatERK7QString @ 9 NONAME + _ZN15SettingsUtility13setSnoozeTimeEi @ 10 NONAME + _ZN15SettingsUtility13setTimeFormatERK7QString @ 11 NONAME + _ZN15SettingsUtility13timeSeparatorER11QStringList @ 12 NONAME + _ZN15SettingsUtility14setStartOfWeekEi @ 13 NONAME + _ZN15SettingsUtility15settingsChangedE19SettingsItemChanged7QString @ 14 NONAME + _ZN15SettingsUtility16dateFormatStringEv @ 15 NONAME + _ZN15SettingsUtility16setDateSeparatorERK7QString @ 16 NONAME + _ZN15SettingsUtility16setTimeSeparatorERK7QString @ 17 NONAME + _ZN15SettingsUtility16staticMetaObjectE @ 18 NONAME DATA 16 + _ZN15SettingsUtility16timeFormatStringEv @ 19 NONAME + _ZN15SettingsUtility19getStaticMetaObjectEv @ 20 NONAME + _ZN15SettingsUtility4dateEv @ 21 NONAME + _ZN15SettingsUtility4timeEv @ 22 NONAME + _ZN15SettingsUtility8workdaysER11QStringList @ 23 NONAME + _ZN15SettingsUtility9clockTypeER11QStringList @ 24 NONAME + _ZN15SettingsUtilityC1EP7QObject @ 25 NONAME + _ZN15SettingsUtilityC2EP7QObject @ 26 NONAME + _ZN15SettingsUtilityD0Ev @ 27 NONAME + _ZN15SettingsUtilityD1Ev @ 28 NONAME + _ZN15SettingsUtilityD2Ev @ 29 NONAME + _ZNK15SettingsUtility10metaObjectEv @ 30 NONAME + _ZTI15SettingsUtility @ 31 NONAME + _ZTV15SettingsUtility @ 32 NONAME diff -r fd30d51f876b -r a949c2543c15 clock/clockmw/eabi/timezoneclientu.def --- a/clock/clockmw/eabi/timezoneclientu.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockmw/eabi/timezoneclientu.def Fri May 14 15:51:09 2010 +0300 @@ -1,47 +1,55 @@ EXPORTS _ZN14TimezoneClient10intToMonthEi @ 1 NONAME - _ZN14TimezoneClient11listUpdatedEv @ 2 NONAME - _ZN14TimezoneClient11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME - _ZN14TimezoneClient11qt_metacastEPKc @ 4 NONAME - _ZN14TimezoneClient11setDateTimeE9QDateTime @ 5 NONAME - _ZN14TimezoneClient11timechangedEv @ 6 NONAME - _ZN14TimezoneClient12getCountriesER4QMapI7QStringiE @ 7 NONAME - _ZN14TimezoneClient12getDstRulesLER9QDateTimeS1_i @ 8 NONAME - _ZN14TimezoneClient12getLocationsEv @ 9 NONAME - _ZN14TimezoneClient12timeUpdateOnEv @ 10 NONAME - _ZN14TimezoneClient13saveLocationsERK5QListI12LocationInfoE @ 11 NONAME - _ZN14TimezoneClient14populateCitiesEv @ 12 NONAME - _ZN14TimezoneClient15getLocationInfoEiiR12LocationInfo @ 13 NONAME - _ZN14TimezoneClient15setTimeUpdateOnEb @ 14 NONAME - _ZN14TimezoneClient16getDstZoneOffsetEi @ 15 NONAME - _ZN14TimezoneClient16getUtcDstOffsetLERiRK5CTzId @ 16 NONAME - _ZN14TimezoneClient16staticMetaObjectE @ 17 NONAME DATA 16 - _ZN14TimezoneClient17checkForDstChangeER9AlarmInfo @ 18 NONAME - _ZN14TimezoneClient17getSavedLocationsEv @ 19 NONAME - _ZN14TimezoneClient17getStandardOffsetEi @ 20 NONAME - _ZN14TimezoneClient19environmentCallbackEPv @ 21 NONAME - _ZN14TimezoneClient19getCitiesForCountryEiR4QMapI7QStringiE @ 22 NONAME - _ZN14TimezoneClient19getCurrentZoneInfoLEv @ 23 NONAME - _ZN14TimezoneClient19getStaticMetaObjectEv @ 24 NONAME - _ZN14TimezoneClient20getCityGroupIdByNameERK7QString @ 25 NONAME - _ZN14TimezoneClient21createWorldClockModelEv @ 26 NONAME - _ZN14TimezoneClient21locationSelectorModelEv @ 27 NONAME - _ZN14TimezoneClient21setAsCurrentLocationLER12LocationInfo @ 28 NONAME - _ZN14TimezoneClient24getCityOffsetByNameAndIdERK7QStringi @ 29 NONAME - _ZN14TimezoneClient5dstOnEi @ 30 NONAME - _ZN14TimezoneClient8isDSTOnLEi @ 31 NONAME - _ZN14TimezoneClientC1EP7QObject @ 32 NONAME - _ZN14TimezoneClientC2EP7QObject @ 33 NONAME - _ZN14TimezoneClientD0Ev @ 34 NONAME - _ZN14TimezoneClientD1Ev @ 35 NONAME - _ZN14TimezoneClientD2Ev @ 36 NONAME - _ZNK14TimezoneClient10metaObjectEv @ 37 NONAME - _ZTI14TimezoneClient @ 38 NONAME - _ZTV14TimezoneClient @ 39 NONAME - _ZThn8_N14TimezoneClientD0Ev @ 40 NONAME - _ZThn8_N14TimezoneClientD1Ev @ 41 NONAME - _ZN14TimezoneClient17getAllTimeZoneIdsEv @ 42 NONAME - _ZN14TimezoneClient21getAllTimeZoneOffsetsEv @ 43 NONAME - _ZN14TimezoneClient24getCountriesForUTCOffsetEi @ 44 NONAME - _ZN14TimezoneClient7addCityEiR7QStringi @ 45 NONAME + _ZN14TimezoneClient11cityUpdatedEv @ 2 NONAME + _ZN14TimezoneClient11getInstanceEv @ 3 NONAME + _ZN14TimezoneClient11listUpdatedEv @ 4 NONAME + _ZN14TimezoneClient11qt_metacallEN11QMetaObject4CallEiPPv @ 5 NONAME + _ZN14TimezoneClient11qt_metacastEPKc @ 6 NONAME + _ZN14TimezoneClient11setDateTimeE9QDateTime @ 7 NONAME + _ZN14TimezoneClient11timechangedEv @ 8 NONAME + _ZN14TimezoneClient12eventMonitorERK13XQSettingsKeyRK8QVariant @ 9 NONAME + _ZN14TimezoneClient12getCountriesER4QMapI7QStringiE @ 10 NONAME + _ZN14TimezoneClient12getDstRulesLER9QDateTimeS1_i @ 11 NONAME + _ZN14TimezoneClient12getLocationsEv @ 12 NONAME + _ZN14TimezoneClient12timeUpdateOnEv @ 13 NONAME + _ZN14TimezoneClient13saveLocationsERK5QListI12LocationInfoE @ 14 NONAME + _ZN14TimezoneClient14deleteInstanceEv @ 15 NONAME + _ZN14TimezoneClient14populateCitiesEv @ 16 NONAME + _ZN14TimezoneClient15getLocationInfoEiiR12LocationInfo @ 17 NONAME + _ZN14TimezoneClient15mReferenceCountE @ 18 NONAME DATA 4 + _ZN14TimezoneClient15mTimezoneClientE @ 19 NONAME DATA 4 + _ZN14TimezoneClient15setTimeUpdateOnEb @ 20 NONAME + _ZN14TimezoneClient16getDstZoneOffsetEi @ 21 NONAME + _ZN14TimezoneClient16getUtcDstOffsetLERiRK5CTzId @ 22 NONAME + _ZN14TimezoneClient16staticMetaObjectE @ 23 NONAME DATA 16 + _ZN14TimezoneClient17checkForDstChangeER9AlarmInfo @ 24 NONAME + _ZN14TimezoneClient17getAllTimeZoneIdsEv @ 25 NONAME + _ZN14TimezoneClient17getSavedLocationsEv @ 26 NONAME + _ZN14TimezoneClient17getStandardOffsetEi @ 27 NONAME + _ZN14TimezoneClient19environmentCallbackEPv @ 28 NONAME + _ZN14TimezoneClient19getCitiesForCountryEiR4QMapI7QStringiE @ 29 NONAME + _ZN14TimezoneClient19getCurrentZoneInfoLEv @ 30 NONAME + _ZN14TimezoneClient19getStaticMetaObjectEv @ 31 NONAME + _ZN14TimezoneClient20getCityGroupIdByNameERK7QString @ 32 NONAME + _ZN14TimezoneClient21autoTimeUpdateChangedEi @ 33 NONAME + _ZN14TimezoneClient21createWorldClockModelEv @ 34 NONAME + _ZN14TimezoneClient21getAllTimeZoneOffsetsEv @ 35 NONAME + _ZN14TimezoneClient21locationSelectorModelEv @ 36 NONAME + _ZN14TimezoneClient21setAsCurrentLocationLER12LocationInfo @ 37 NONAME + _ZN14TimezoneClient24getCityOffsetByNameAndIdERK7QStringi @ 38 NONAME + _ZN14TimezoneClient24getCountriesForUTCOffsetEi @ 39 NONAME + _ZN14TimezoneClient5dstOnEi @ 40 NONAME + _ZN14TimezoneClient6isNullEv @ 41 NONAME + _ZN14TimezoneClient7addCityEiR7QStringi @ 42 NONAME + _ZN14TimezoneClient8isDSTOnLEi @ 43 NONAME + _ZN14TimezoneClientC1Ev @ 44 NONAME + _ZN14TimezoneClientC2Ev @ 45 NONAME + _ZN14TimezoneClientD0Ev @ 46 NONAME + _ZN14TimezoneClientD1Ev @ 47 NONAME + _ZN14TimezoneClientD2Ev @ 48 NONAME + _ZNK14TimezoneClient10metaObjectEv @ 49 NONAME + _ZTI14TimezoneClient @ 50 NONAME + _ZTV14TimezoneClient @ 51 NONAME + _ZThn8_N14TimezoneClientD0Ev @ 52 NONAME + _ZThn8_N14TimezoneClientD1Ev @ 53 NONAME diff -r fd30d51f876b -r a949c2543c15 clock/clockui/bwins/clockalarmeditoru.def --- a/clock/clockui/bwins/clockalarmeditoru.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/bwins/clockalarmeditoru.def Fri May 14 15:51:09 2010 +0300 @@ -1,5 +1,5 @@ EXPORTS ??1ClockAlarmEditor@@UAE@XZ @ 1 NONAME ; ClockAlarmEditor::~ClockAlarmEditor(void) - ??0ClockAlarmEditor@@QAE@HPAVQGraphicsWidget@@@Z @ 2 NONAME ; ClockAlarmEditor::ClockAlarmEditor(int, class QGraphicsWidget *) - ?showAlarmEditor@ClockAlarmEditor@@QAEXXZ @ 3 NONAME ; void ClockAlarmEditor::showAlarmEditor(void) + ?showAlarmEditor@ClockAlarmEditor@@QAEXXZ @ 2 NONAME ; void ClockAlarmEditor::showAlarmEditor(void) + ??0ClockAlarmEditor@@QAE@AAVAlarmClient@@HPAVQObject@@@Z @ 3 NONAME ; ClockAlarmEditor::ClockAlarmEditor(class AlarmClient &, int, class QObject *) diff -r fd30d51f876b -r a949c2543c15 clock/clockui/bwins/clockviewsu.def --- a/clock/clockui/bwins/clockviewsu.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/bwins/clockviewsu.def Fri May 14 15:51:09 2010 +0300 @@ -1,8 +1,11 @@ EXPORTS - ?setupView@ClockMainView@@QAEXAAVClockAppControllerIf@@PAVClockDocLoader@@@Z @ 1 NONAME ; void ClockMainView::setupView(class ClockAppControllerIf &, class ClockDocLoader *) - ??0ClockWorldView@@QAE@PAVQGraphicsItem@@@Z @ 2 NONAME ; ClockWorldView::ClockWorldView(class QGraphicsItem *) - ??1ClockWorldView@@UAE@XZ @ 3 NONAME ; ClockWorldView::~ClockWorldView(void) - ??1ClockMainView@@UAE@XZ @ 4 NONAME ; ClockMainView::~ClockMainView(void) - ?setupView@ClockWorldView@@QAEXAAVClockAppControllerIf@@PAVClockDocLoader@@@Z @ 5 NONAME ; void ClockWorldView::setupView(class ClockAppControllerIf &, class ClockDocLoader *) - ??0ClockMainView@@QAE@PAVQGraphicsItem@@@Z @ 6 NONAME ; ClockMainView::ClockMainView(class QGraphicsItem *) + ??1ClockWorldView@@UAE@XZ @ 1 NONAME ; ClockWorldView::~ClockWorldView(void) + ??1ClockMainView@@UAE@XZ @ 2 NONAME ; ClockMainView::~ClockMainView(void) + ?setupView@ClockWorldView@@QAEXAAVClockAppControllerIf@@PAVClockDocLoader@@@Z @ 3 NONAME ; void ClockWorldView::setupView(class ClockAppControllerIf &, class ClockDocLoader *) + ??0ClockMainView@@QAE@PAVQGraphicsItem@@@Z @ 4 NONAME ; ClockMainView::ClockMainView(class QGraphicsItem *) + ??0ClockWorldView@@QAE@PAVQGraphicsItem@@@Z @ 5 NONAME ; ClockWorldView::ClockWorldView(class QGraphicsItem *) + ?setupView@ClockMainView@@QAEXAAVClockAppControllerIf@@PAVClockDocLoader@@@Z @ 6 NONAME ; void ClockMainView::setupView(class ClockAppControllerIf &, class ClockDocLoader *) + ??0ClockHomeCityItem@@QAE@PAVQGraphicsItem@@@Z @ 7 NONAME ; ClockHomeCityItem::ClockHomeCityItem(class QGraphicsItem *) + ??1ClockHomeCityItem@@UAE@XZ @ 8 NONAME ; ClockHomeCityItem::~ClockHomeCityItem(void) + ?setupAfterViewReady@ClockMainView@@QAEXXZ @ 9 NONAME ; void ClockMainView::setupAfterViewReady(void) diff -r fd30d51f876b -r a949c2543c15 clock/clockui/bwins/clockwidgetprotou.def --- a/clock/clockui/bwins/clockwidgetprotou.def Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -EXPORTS - ??0SkinnableClock@@QAE@PAVQGraphicsItem@@@Z @ 1 NONAME ; SkinnableClock::SkinnableClock(class QGraphicsItem *) - ?updateDisplay@SkinnableClock@@QAEX_N@Z @ 2 NONAME ; void SkinnableClock::updateDisplay(bool) - ?updateClockType@SkinnableClock@@QAEXXZ @ 3 NONAME ; void SkinnableClock::updateClockType(void) - ??1SkinnableClock@@UAE@XZ @ 4 NONAME ; SkinnableClock::~SkinnableClock(void) - ?staticMetaObject@SkinnableClock@@2UQMetaObject@@B @ 5 NONAME ; struct QMetaObject const SkinnableClock::staticMetaObject - ??_ESkinnableClock@@UAE@I@Z @ 6 NONAME ; SkinnableClock::~SkinnableClock(unsigned int) - ?qt_metacast@SkinnableClock@@UAEPAXPBD@Z @ 7 NONAME ; void * SkinnableClock::qt_metacast(char const *) - ?startChangeType@SkinnableClock@@AAEXXZ @ 8 NONAME ; void SkinnableClock::startChangeType(void) - ?trUtf8@SkinnableClock@@SA?AVQString@@PBD0@Z @ 9 NONAME ; class QString SkinnableClock::trUtf8(char const *, char const *) - ?trUtf8@SkinnableClock@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString SkinnableClock::trUtf8(char const *, char const *, int) - ?metaObject@SkinnableClock@@UBEPBUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const * SkinnableClock::metaObject(void) const - ?tr@SkinnableClock@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString SkinnableClock::tr(char const *, char const *, int) - ?qt_metacall@SkinnableClock@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13 NONAME ; int SkinnableClock::qt_metacall(enum QMetaObject::Call, int, void * *) - ?paint@SkinnableClock@@MAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 14 NONAME ; void SkinnableClock::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *) - ?tr@SkinnableClock@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString SkinnableClock::tr(char const *, char const *) - ?getStaticMetaObject@SkinnableClock@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & SkinnableClock::getStaticMetaObject(void) - ?clockTypeAnalog@SkinnableClock@@QAE_NXZ @ 17 NONAME ; bool SkinnableClock::clockTypeAnalog(void) - ?setClockTypeAnalog@SkinnableClock@@AAEX_N@Z @ 18 NONAME ; void SkinnableClock::setClockTypeAnalog(bool) - ?finishChangeType@SkinnableClock@@QAEXABUEffectStatus@HbEffect@@@Z @ 19 NONAME ; void SkinnableClock::finishChangeType(struct HbEffect::EffectStatus const &) - ?clockFormat24@SkinnableClock@@QAE_NXZ @ 20 NONAME ; bool SkinnableClock::clockFormat24(void) - diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockalarmeditor/clockalarmeditor.pro --- a/clock/clockui/clockalarmeditor/clockalarmeditor.pro Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockalarmeditor/clockalarmeditor.pro Fri May 14 15:51:09 2010 +0300 @@ -27,7 +27,8 @@ DEPENDPATH += \ ./inc \ - ./src + ./src \ + ./data symbian: { TARGET.CAPABILITY += ALL -TCB @@ -43,13 +44,14 @@ SOURCES += \ clockalarmeditor.cpp \ - clockalarmcustomitem.cpp + clockalarmcustomitem.cpp HEADERS += \ clockalarmeditor.h \ - clockalarmcustomitem.h\ - clockalarmeditordefines.h + clockalarmcustomitem.h \ + clockalarmeditordefines.h + +RESOURCES += \ + clockalarmeditor.qrc -RESOURCES += \ - data/clockalarmeditor.qrc # End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockalarmeditor/data/clockalarmeditor.qrc --- a/clock/clockui/clockalarmeditor/data/clockalarmeditor.qrc Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockalarmeditor/data/clockalarmeditor.qrc Fri May 14 15:51:09 2010 +0300 @@ -2,5 +2,9 @@ translations/clockalarmeditor.qm + + + xml/clockalarmeditor.docml + - + \ No newline at end of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockalarmeditor/data/translations/clockalarmeditor.qm Binary file clock/clockui/clockalarmeditor/data/translations/clockalarmeditor.qm has changed diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockalarmeditor/data/translations/clockalarmeditor.ts --- a/clock/clockui/clockalarmeditor/data/translations/clockalarmeditor.ts Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockalarmeditor/data/translations/clockalarmeditor.ts Fri May 14 15:51:09 2010 +0300 @@ -2,16 +2,6 @@ - - 1st label in Regional date & time settings view - Time format - Time format - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - Title for Date and time settings view Clock @@ -22,36 +12,6 @@ Co False - - The time and date information will be displayed in 2nd row - %1, %2 - %1, %2 - qtl_list_sec_large_graphic - CP main view_time & date plugin_P11 - list - CP - False - - - Setting item to clock display type. Tap to toggle values. - Digital - Digital - qtl_dataform_button_sec - Clock_Date & time settings_P04_1 - button - Cl - False - - - This text is displayed in 1st row - Time & date - Time & date - qtl_list_pri_large_graphic - CP main view_time & date plugin_P11 - list - CP - False - Note displayed after alarm is set (every week) Alarm occurs every week on %1 at %2 @@ -62,6 +22,26 @@ Cl False + + Default value for Description label in Alarm editor view + Alarm + Alarm + qtl_dataform_description_sec + Clock_Alarm editor_P03 + formlabel_1_val + Cl + False + + + Label for Occurence in Alarm editor + Occurence + Occurence + qtl_dataform_heading_pri + Clock_Alarm editor_P03 + setlabel_1 + Cl + False + Title for the time picker tumbler widget Alarm time @@ -72,13 +52,13 @@ Tu False - - 2nd value in combo box list for Date format label - mm dd yyyy - mm dd yyyy - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_2_val + + When user edits an already existed alarm in Alarm editor form, he can "Discard changes" from Options menu and the prevoius values are saved. + Discard changes + Discard changes + qtl_menu_pri + Clock_Alarm editor_P03 + opt Cl False @@ -92,26 +72,6 @@ Cl False - - 3rd field in Regional date & time settings view - Date format - Date format - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Tapping on this button opens advanced date and time view - Regional date & time settings - Regional date & time settings - qtl_dataform_button_sec - Clock_Date & time settings_P04_1 - button - Cl - False - Popup Information which comes after setting the alarm. Alarm will occur at %1 after automatic daylight saving update @@ -122,6 +82,36 @@ Cl False + + When user taps on "New alarm" toolbar button in Clock main view, alarm editor opens with the subtitle "New alarm". + New alarm + New alarm + qtl_groupbox_simple_sec + Clock_Alarm editor_P03 + subhead + Cl + False + + + When user taps on already existed alarm in the alarm list, the alarm editor opens with subtitle "Alarm" + Alarm + Alarm + qtl_groupbox_simple_sec + Clock_Alarm editor_P03 + subhead + Cl + False + + + 2nd dropdown list value for Occurence label in Alarm editor view + Repeat daily + Repeat daily + qtl_dataform_group_pri + Clock_Alarm editor_P03 + setlabel_2_val + Cl + False + Time @@ -132,36 +122,6 @@ Tu False - - Sub-title for Regiional date & time settings - Regional date & time settings - Regional date & time settings - qtl_groupbox_simple_sec - Clock_Date & time settings_P04_3 - subhead - Cl - False - - - 5th label for Place in Clock settings view - Place - Place - qtl_dataform_heading_pri - Clock_Date & time settings_P04_1 - formlabel_1 - Cl - False - - - 1st Value in combo box list for Time format label - 24 hour - 24 hour - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_1_val - Cl - False - DST @@ -172,6 +132,46 @@ Co False + + Label for Time in Alarm editor view + Time + Time + qtl_dataform_heading_pri + Clock_Alarm editor_P03 + setlabel_1 + Cl + False + + + 1st dropdown list value for Occurence label in Alarm editor view + Once + Once + qtl_dataform_group_pri + Clock_Alarm editor_P03 + setlabel_1_val + Cl + False + + + Label for Alarm sound in Alarm editor view + Alarm sound + Alarm sound + qtl_checkbox_sec + Clock_Alarm editor_P03 + setlabel_1 + Cl + False + + + 1st dropdown list value for Day label in Alarm editor view + Monday + Monday + qtl_dataform_group_pri + Clock_Alarm editor_P03 + setlabel_1_val + Cl + False + Note displayed after alarm is set (Everyday Time) Alarm occurs every day at %1 @@ -182,36 +182,43 @@ Cl False - - Alarm snooze time details in the list box (5mins, 10mins, 15mins, 30mins) - %Ln minutes - - (s)%Ln minutes - (p)%Ln minutes - - qtl_dataform_combobox_sec - Clock_Date & time settings_P04_1 - set + + 4th dropdown list value for Day label in Alarm editor view + Thursday + Thursday + qtl_dataform_group_pri + Clock_Alarm editor_P03 + setlabel_4_val Cl False - - Setting item to clock display type. Tap to toggle values. - Analog - Analog - qtl_dataform_button_sec - Clock_Date & time settings_P04_1 - button + + 5th dropdown list value for Day label in Alarm editor view + Friday + Friday + qtl_dataform_group_pri + Clock_Alarm editor_P03 + setlabel_5_val Cl False - - 6th field in Regional date & time settings view - Week starts on - Week starts on - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 + + 4th dropdown list value for Occurence label in Alarm editor view + Repeat on workdays + Repeat on workdays + qtl_dataform_group_pri + Clock_Alarm editor_P03 + setlabel_4_val + Cl + False + + + 7th dropdown list value for Day label in Alarm editor view + Sunday + Sunday + qtl_dataform_group_pri + Clock_Alarm editor_P03 + setlabel_7_val Cl False @@ -225,13 +232,13 @@ Cl False - - 3rd value in combo box list for Date format label - yyyy mm dd - yyyy mm dd + + 2nd dropdown list value for Day label in Alarm editor view + Tuesday + Tuesday qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_3_val + Clock_Alarm editor_P03 + setlabel_2_val Cl False @@ -285,73 +292,23 @@ Co False - - 1st label in Date and time settings view - Use network date & time - Use network date & time - qtl_checkbox_sec - Clock_Date & time settings_P04_1 - setlabel_1 - Cl - False - - - Subtitle for the time seperator drop down list - Time separator - Time separator - qtl_dataform_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Subtitle for the date seperator drop down list - Date separator - Date separator - qtl_dataform_pri - Clock_Date & time settings_P04_3 + + Label for Day in Alarm editor view + Day + Day + qtl_dataform_heading_pri + Clock_Alarm editor_P03 setlabel_1 Cl False - - Label for Workdays in Alarm editor - Workdays - Workdays - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Label to the date field (picker) in the settings view - Date - Date - qtl_dataform_pri - Clock_Date & time settings_P04_1 - setlabel_1 - Cl - False - - - Label to the time field (picker) in the settings view - Time - Time - qtl_dataform_pri - Clock_Date & time settings_P04_1 - setlabel_1 - Cl - False - - - 2nd value in combo box list for Time format label - 12 hour - 12 hour + + 3rd dropdown list value for Occurence label in Alarm editor view + Repeat weekly + Repeat weekly qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_2_val + Clock_Alarm editor_P03 + setlabel_3_val Cl False @@ -375,33 +332,43 @@ Cl False - - Primary text label for Clock Type - Clock Type - Clock Type - qtl_dataform_pri - Clock_Date & time settings_P04_1 - setlabel_5 + + When user creates a new alarm in Alarm editor form, he can "Delete" this alarm via Options menu. + Delete + Delete + qtl_menu_pri + Clock_Alarm editor_P03 + opt Cl False - - Sub-title for Date & time settings view - Date & time - Date & time - qtl_groupbox_simple_sec - Clock_Date & time settings_P04_1 - subhead + + 6th dropdown list value for Day label in Alarm editor view + Saturday + Saturday + qtl_dataform_group_pri + Clock_Alarm editor_P03 + setlabel_6_val Cl False - - 1st value in combo box list for Date format label - dd mm yyyy - dd mm yyyy + + 3rd dropdown list value for Day label in Alarm editor view + Wednesday + Wednesday qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_1_val + Clock_Alarm editor_P03 + setlabel_3_val + Cl + False + + + Label for Description in Alarm editor view + Description + Description + qtl_dataform_pri + Clock_Alarm editor_P03 + formlabel_1 Cl False diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockalarmeditor/data/xml/clockalarmeditor.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockalarmeditor/data/xml/clockalarmeditor.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockalarmeditor/inc/clockalarmeditor.h --- a/clock/clockui/clockalarmeditor/inc/clockalarmeditor.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockalarmeditor/inc/clockalarmeditor.h Fri May 14 15:51:09 2010 +0300 @@ -43,13 +43,15 @@ class ClockAlarmCustomItem; class QTranslator; -class ClockAlarmEditor : public HbView +class ClockAlarmEditor : public QObject { Q_OBJECT public: CLOCKALARMEDITOR_EXPORT ClockAlarmEditor( - int alarmId = 0, QGraphicsWidget *parent = 0); + AlarmClient& alarmClient, + int alarmId = 0, + QObject *parent = 0); CLOCKALARMEDITOR_EXPORT virtual ~ClockAlarmEditor(); public: @@ -61,10 +63,10 @@ void handleDiscardAction(); void handleTimeChange(const QString &text); void handleOccurenceChanged(int index); - void handleCancelAction(); void handleOkAction(); void launchTimePicker(); - void handleAlarmSoundChanged(); + void handleAlarmSoundChanged(int checkedState); + void selectedAction(HbAction *action); signals: void alarmSet(); @@ -73,7 +75,6 @@ void initModel(); void populateModelItems(); void initAlarmInfo(); - void createMenu(); void createToolbar(); void setAlarm( QString timeInfo, QString descInfo, int repeatType, @@ -85,9 +86,12 @@ void displayRemainingTimeNote(AlarmInfo& alarmInfo); void getDayText(int alarmDay,QString& dayText); int getRemainingSeconds(QDateTime& alarmDateTime); + void launchDialog(QString title, QString text = 0); + void sortAlarmDaysList(QStringList& alarmDays); private: int mAlarmId; + int mStartOfWeek; bool mAlarmDayItemInserted; QString mTimeFormat; @@ -99,7 +103,7 @@ HbDataFormModelItem *mAlarmSoundItem; HbDataFormModelItem *mAlarmDescription; - HbView *mPreviousView; + HbView *mAlarmEditorView; HbAction *mDiscardAction; HbAction *mDeleteAction; HbAction *mDoneAction; @@ -111,7 +115,7 @@ XQSettingsManager *mSettingsManager; XQSettingsKey *mPreviosAlarmTime; - AlarmClient *mAlarmClient; + AlarmClient &mAlarmClient; AlarmInfo mAlarmInfo; TimezoneClient *mTimezoneClient; QTranslator *mTranslator; diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp --- a/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp Fri May 14 15:51:09 2010 +0300 @@ -17,7 +17,6 @@ // System includes #include - #include #include #include @@ -25,14 +24,14 @@ #include #include #include -#include -#include #include -#include -#include #include #include #include +#include +#include +#include +#include #include #include #include @@ -52,6 +51,7 @@ const int KOneMinute(1); const int KOneHour(1); const int KSecondsInOneDay(24 * 60 * 60); +const int KDaysInWeek(7); /*! \class ClockAlarmEditor @@ -68,9 +68,12 @@ edit. \param parent The parent object. */ -ClockAlarmEditor::ClockAlarmEditor(int alarmId, QGraphicsWidget *parent) -:HbView(parent), +ClockAlarmEditor::ClockAlarmEditor( + AlarmClient &alarmClient, int alarmId, + QObject *parent) +:QObject(parent), mAlarmId(alarmId), + mStartOfWeek(0), mAlarmDayItemInserted(false), mAlarmEditorForm(0), mAlarmEditorModel(0), @@ -79,9 +82,8 @@ mAlarmDayItem(0), mAlarmSoundItem(0), mAlarmDescription(0), - mAlarmClient(0) - { - + mAlarmClient(alarmClient) +{ // Load the translation file and install the alarmeditor specific translator mTranslator = new QTranslator; //QString lang = QLocale::system().name(); @@ -91,27 +93,8 @@ //bool loaded = mTranslator->load("caleneditor_" + lang, path); HbApplication::instance()->installTranslator(mTranslator); - // Create the Alarm Editor DataForm. - mAlarmEditorForm = new HbDataForm(this); - - // Set the title text of the Clock Alarm Editor view. - setTitle(hbTrId("txt_common_common_clock")); - - // Create the alarm client object. - mAlarmClient = new AlarmClient(this); - - // Set the heading of the Alarm Editor DataForm. - if (mAlarmId && mAlarmClient) { - mAlarmEditorForm->setHeading( - hbTrId("txt_clock_subhead_alarm")); - } - else - { - mAlarmEditorForm->setHeading(hbTrId("txt_clock_subhead_new_alarm")); - } - // create the timezone client object - mTimezoneClient = new TimezoneClient(this); + mTimezoneClient = TimezoneClient::getInstance(); // Create the settings manager. mSettingsManager = new XQSettingsManager(this); @@ -125,30 +108,67 @@ SettingsUtility *settingsUtil = new SettingsUtility(this); mTimeFormat = settingsUtil->timeFormatString(); + // Get start of week from the locale. + HbExtendedLocale locale = HbExtendedLocale::system(); + mStartOfWeek = locale.startOfWeek(); + + // Create the HbDocumentLoader object. + HbDocumentLoader *loader = new HbDocumentLoader(); + bool success; + loader->load(":/xml/clockalarmeditor.docml", &success); + + mAlarmEditorView = qobject_cast( + loader->findWidget("alarmEditorView")); + + // Get the subtitle groupBox. + HbGroupBox *subtitleGroupBox = qobject_cast( + loader->findWidget("subtitleGroupBox")); + + // Set the heading of the subtitle groupBox. + if (mAlarmId) { + subtitleGroupBox->setHeading(hbTrId("txt_clock_subhead_alarm")); + } else { + subtitleGroupBox->setHeading(hbTrId("txt_clock_subhead_new_alarm")); + } + + // Get the Alarm Editor DataForm. + mAlarmEditorForm = qobject_cast ( + loader->findWidget("alarmEditorForm")); + + // Create the alarm info structure with desired values. initAlarmInfo(); // Creates & initializes the DataFormModel for the AlarmEditor DataForm. initModel(); - + QList prototypes = mAlarmEditorForm->itemPrototypes(); ClockAlarmCustomItem *customItem = new ClockAlarmCustomItem(mAlarmEditorForm); prototypes.append(customItem); mAlarmEditorForm->setItemPrototypes(prototypes); - // Create the menu. - createMenu(); + // Get the menu items for the alarm editor. + mDeleteAction = qobject_cast ( + loader->findObject("deleteAction")); + mDiscardAction = qobject_cast( + loader->findObject("discardChanges")); + + // Connect the signals for the menu item. + connect( + mDeleteAction, SIGNAL(triggered()), + this, SLOT(handleDeleteAction())); + connect( + mDiscardAction, SIGNAL(triggered()), + this, SLOT(handleDiscardAction())); // Add the done soft key action. - mDoneAction = new HbAction(Hb::DoneAction); + mDoneAction = new HbAction(Hb::DoneNaviAction); connect( mDoneAction, SIGNAL(triggered()), this, SLOT(handleDoneAction())); - setNavigationAction(mDoneAction); + mAlarmEditorView->setNavigationAction(mDoneAction); - // Sets the AlarmEditor DataForm to the Clock AlarmEditor view. - setWidget(mAlarmEditorForm); } /*! @@ -156,13 +176,8 @@ */ ClockAlarmEditor::~ClockAlarmEditor() { - if (mAlarmClient) { - delete mAlarmClient; - mAlarmClient = 0; - } - if(mTimezoneClient) { - delete mTimezoneClient; - mTimezoneClient = 0; + if(!mTimezoneClient->isNull()) { + mTimezoneClient->deleteInstance(); } // Remove the translator HbApplication::instance()->removeTranslator(mTranslator); @@ -180,9 +195,8 @@ { // Store the current view and set alarm editor as current view. HbMainWindow *window = hbInstance->allMainWindows().first(); - mPreviousView = window->currentView(); - window->addView(this); - window->setCurrentView(this); + window->addView(mAlarmEditorView); + window->setCurrentView(mAlarmEditorView); } /*! @@ -193,6 +207,10 @@ int alarmDayIndex = -1; if (mAlarmDayItemInserted) { alarmDayIndex = mAlarmDayItem->contentWidgetData("currentIndex").toInt(); + alarmDayIndex += mStartOfWeek; + if(alarmDayIndex >= KDaysInWeek){ + alarmDayIndex -= KDaysInWeek; + } } setAlarm( @@ -229,24 +247,20 @@ // Reset alarm day item. if (mAlarmDayItemInserted) { + int currentIndex = mAlarmInfo.alarmDateTime.dayOfWeek() - 1; + currentIndex -= mStartOfWeek; + if(0 > currentIndex){ + currentIndex += KDaysInWeek; + } mAlarmDayItem->setContentWidgetData( - "currentIndex", - mAlarmInfo.alarmDateTime.dayOfWeek() - 1); + "currentIndex",currentIndex); } // Reset for alarm sound. - QStringList alarmSoundOptions; - alarmSoundOptions << tr("On") - << tr("Off"); - if (AlarmVolumeOn == mAlarmInfo.volumeStatus) { - mAlarmSoundItem->setContentWidgetData("text", alarmSoundOptions[0]); - mAlarmSoundItem->setContentWidgetData( - "additionalText", alarmSoundOptions[1]); + mAlarmSoundItem->setContentWidgetData("checkState", Qt::Checked); } else { - mAlarmSoundItem->setContentWidgetData("text", alarmSoundOptions[1]); - mAlarmSoundItem->setContentWidgetData( - "additionalText", alarmSoundOptions[0]); + mAlarmSoundItem->setContentWidgetData("checkState", Qt::Unchecked); } mAlarmDescription->setContentWidgetData("text", mAlarmInfo.alarmDesc); @@ -280,6 +294,11 @@ alarmDayIndex = 0; } if (mAlarmDayItemInserted) { + alarmDayIndex -= mStartOfWeek; + + if(0 > alarmDayIndex){ + alarmDayIndex += KDaysInWeek; + } mAlarmDayItem->setContentWidgetData( "currentIndex", alarmDayIndex); @@ -320,15 +339,14 @@ QString(hbTrId("txt_clock_formlabel_day")), mAlarmEditorModel->invisibleRootItem()); + // Add the alarm days beginning from the start of week. QStringList alarmDays; - alarmDays << hbTrId("txt_clk_setlabel_val_monday") - << hbTrId("txt_clk_setlabel_val_tuesday") - << hbTrId("txt_clk_setlabel_val_wednesday") - << hbTrId("txt_clk_setlabel_val_thursday") - << hbTrId("txt_clk_setlabel_val_friday") - << hbTrId("txt_clk_setlabel_val_saturday") - << hbTrId("txt_clk_setlabel_val_sunday"); + sortAlarmDaysList(alarmDays); + alarmDayIndex -= mStartOfWeek; + if(0 > alarmDayIndex){ + alarmDayIndex += KDaysInWeek; + } mAlarmDayItem->setContentWidgetData("items", alarmDays); mAlarmDayItem->setContentWidgetData( "currentIndex", @@ -351,16 +369,6 @@ } /*! - Called when `Cancel' is pressed on the Dialog. - */ -void ClockAlarmEditor::handleCancelAction() -{ - // Close the dialog. - mTimePickerDialog->close(); - mTimePickerDialog->deleteLater(); -} - -/*! Called when `OK' is pressed on the Dialog. */ void ClockAlarmEditor::handleOkAction() @@ -372,9 +380,6 @@ // Update the selected time value. mAlarmTimeItem->setContentWidgetData("text",newAlarmTime.toString(mTimeFormat)); - // Close the dialog. - handleCancelAction(); - if (mAlarmInfo.nextDueTime != newAlarmTime ) { handleTimeChange(newAlarmTime.toString(mTimeFormat)); } @@ -385,65 +390,57 @@ */ void ClockAlarmEditor::launchTimePicker() { - + if (mTimePickerDialog) { + delete mTimePickerDialog; + } - if (mTimePickerDialog) { - delete mTimePickerDialog; - } - - // Create the dialog. - mTimePickerDialog = new HbDialog; - mTimePickerDialog->setTimeout(HbDialog::NoTimeout); - mTimePickerDialog->setDismissPolicy(HbDialog::NoDismiss); + // Create the dialog. + mTimePickerDialog = new HbDialog; + mTimePickerDialog->setTimeout(HbDialog::NoTimeout); + mTimePickerDialog->setDismissPolicy(HbDialog::NoDismiss); - // Set the heading for the dialog. - HbLabel * timeLabel = - new HbLabel(hbTrId("txt_tumbler_title_alarm_time"), - mTimePickerDialog); - mTimePickerDialog->setHeadingWidget(timeLabel); + // Set the heading for the dialog. + HbLabel * timeLabel = + new HbLabel(hbTrId("txt_tumbler_title_alarm_time"), + mTimePickerDialog); + mTimePickerDialog->setHeadingWidget(timeLabel); - SettingsUtility *settingsUtil = new SettingsUtility(this); - QStringList timeSeparator; - int index = settingsUtil->timeFormat(timeSeparator); - QString tumblerDisplayFormat = - mTimeFormat.replace(timeSeparator.at(index), QString(".")); + SettingsUtility *settingsUtil = new SettingsUtility(this); + QStringList timeSeparator; + int index = settingsUtil->timeFormat(timeSeparator); + QString tumblerDisplayFormat = + mTimeFormat.replace(timeSeparator.at(index), QString(".")); - // Create the tumbler. - HbDateTimePicker *timePicker = new HbDateTimePicker(mTimePickerDialog); - timePicker->setDisplayFormat(tumblerDisplayFormat); - // Set the tumbler as the content widget. - mTimePickerDialog->setContentWidget(timePicker); - - QString timeString = mAlarmTimeItem->contentWidgetData("text").toString(); - QTime time = QTime::fromString(timeString, mTimeFormat); - timePicker->setTime(time); + // Create the tumbler. + HbDateTimePicker *timePicker = new HbDateTimePicker(mTimePickerDialog); + timePicker->setDisplayFormat(tumblerDisplayFormat); + + mTimePickerDialog->setContentWidget(timePicker); + + QString timeString = mAlarmTimeItem->contentWidgetData("text").toString(); + QTime time = QTime::fromString(timeString, mTimeFormat); + timePicker->setTime(time); - mOkAction = - new HbAction(QString(hbTrId("txt_common_button_ok")), - mTimePickerDialog); - mTimePickerDialog->setPrimaryAction(mOkAction); - connect( - mOkAction, SIGNAL(triggered()), - this, SLOT(handleOkAction())); + mOkAction = + new HbAction(QString(hbTrId("txt_common_button_ok")), + mTimePickerDialog); - mCancelAction = - new HbAction(QString(hbTrId("txt_common_button_cancel")), - mTimePickerDialog); - mTimePickerDialog->setSecondaryAction( mCancelAction ); - connect( - mCancelAction, SIGNAL(triggered()), - this, SLOT(handleCancelAction())); + mCancelAction = + new HbAction(QString(hbTrId("txt_common_button_cancel")), + mTimePickerDialog); - mTimePickerDialog->exec(); + mTimePickerDialog->addAction(mOkAction); + mTimePickerDialog->addAction(mCancelAction); - + mTimePickerDialog->open(this, SLOT(selectedAction(HbAction*))); } /*! Handles the alarm sound change. */ -void ClockAlarmEditor::handleAlarmSoundChanged() +void ClockAlarmEditor::handleAlarmSoundChanged(int checkedState) { + Q_UNUSED(checkedState) if (AlarmVolumeOff == mAlarmInfo.volumeStatus) { mAlarmInfo.volumeStatus = AlarmVolumeOn; } else { @@ -452,6 +449,16 @@ } /*! + Slot to handle the selected action + */ +void ClockAlarmEditor::selectedAction(HbAction *action) +{ + if (action == mOkAction) { + handleOkAction(); + } +} + +/*! Initialises the Model & sets for the AlarmEditorForm. */ void ClockAlarmEditor::initModel() @@ -517,19 +524,18 @@ QString(hbTrId("txt_clk_setlabel_day")), mAlarmEditorModel->invisibleRootItem()); + // Add the alarm days beginning from the start of week. QStringList alarmDays; - alarmDays << hbTrId("txt_clk_setlabel_val_monday") - << hbTrId("txt_clk_setlabel_val_tuesday") - << hbTrId("txt_clk_setlabel_val_wednesday") - << hbTrId("txt_clk_setlabel_val_thursday") - << hbTrId("txt_clk_setlabel_val_friday") - << hbTrId("txt_clk_setlabel_val_saturday") - << hbTrId("txt_clk_setlabel_val_sunday"); + sortAlarmDaysList(alarmDays); + int currentIndex = mAlarmInfo.alarmDateTime.dayOfWeek() - 1; + currentIndex -= mStartOfWeek; + if(0 > currentIndex){ + currentIndex += KDaysInWeek; + } mAlarmDayItem->setContentWidgetData("items", alarmDays); mAlarmDayItem->setContentWidgetData( - "currentIndex", - mAlarmInfo.alarmDateTime.dayOfWeek() - 1); + "currentIndex",currentIndex); mAlarmDayItemInserted = true; }/* else { TODO: check and remove this else block. @@ -543,23 +549,21 @@ // Alarm sound. mAlarmSoundItem = mAlarmEditorModel->appendDataFormItem( - HbDataFormModelItem::ToggleValueItem, - QString(hbTrId("txt_clk_setlabel_alarm_sound")), + HbDataFormModelItem::CheckBoxItem, + QString(hbTrId("")), mAlarmEditorModel->invisibleRootItem()); - QStringList alarmSoundOptions; - alarmSoundOptions << tr("On") - << tr("Off"); + + mAlarmSoundItem->setContentWidgetData( + "text", QString(hbTrId("txt_clk_setlabel_alarm_sound"))); if (AlarmVolumeOn == mAlarmInfo.volumeStatus) { - mAlarmSoundItem->setContentWidgetData("text", alarmSoundOptions[0]); - mAlarmSoundItem->setContentWidgetData( - "additionalText", alarmSoundOptions[1]); - } else { - mAlarmSoundItem->setContentWidgetData("text", alarmSoundOptions[1]); - mAlarmSoundItem->setContentWidgetData( - "additionalText", alarmSoundOptions[0]); + mAlarmSoundItem->setContentWidgetData("checkState",Qt::Checked); } + mAlarmEditorForm->addConnection( + mAlarmSoundItem, SIGNAL(stateChanged(int)), + this,SLOT(handleAlarmSoundChanged(int))); + // Description. mAlarmDescription = mAlarmEditorModel->appendDataFormItem( HbDataFormModelItem::TextItem, @@ -592,36 +596,20 @@ mAlarmInfo.alarmDateTime = mAlarmInfo.alarmDateTime.addDays(1); } - // Set the alarm volume on by default. - mAlarmInfo.volumeStatus = AlarmVolumeOn; + if (!mAlarmId) { + // Set the alarm volume On by default for new alarms.. + mAlarmInfo.volumeStatus = AlarmVolumeOn; + } // If editor state is a reset alarm, then its an already existing alarm // get the alarm details and fill it in mAlarmInfo. - if (mAlarmId && mAlarmClient) { - mAlarmClient->getAlarmInfo(mAlarmId, mAlarmInfo); - mAlarmClient->deleteAlarm(mAlarmId); + if (mAlarmId) { + mAlarmClient.getAlarmInfo(mAlarmId, mAlarmInfo); + mAlarmClient.deleteAlarm(mAlarmId); } } /*! - Creates menu items. - */ -void ClockAlarmEditor::createMenu() -{ - // Set the menu for the alarm editor. - mDeleteAction = menu()->addAction(hbTrId("txt_clock_opt_delete")); - mDiscardAction = menu()->addAction(hbTrId("txt_clock_opt_discard_changes")); - - // Connect the signals for the menu item. - connect( - mDeleteAction, SIGNAL(triggered()), - this, SLOT(handleDeleteAction())); - connect( - mDiscardAction, SIGNAL(triggered()), - this, SLOT(handleDiscardAction())); -} - -/*! Sets the alarm to the alarm server. */ void ClockAlarmEditor::setAlarm( @@ -653,7 +641,7 @@ alarmInfo.volumeStatus = mAlarmInfo.volumeStatus; // Request the listener to set the alarm. - mAlarmClient->setAlarm(alarmInfo); + mAlarmClient.setAlarm(alarmInfo); // Check if DST rule gets applied in 24hrs. // If so we don't display the remaining time. @@ -715,9 +703,8 @@ { // Remove the alarm editor. HbMainWindow *window = hbInstance->allMainWindows().first(); - - window->removeView(this); - window->setCurrentView(mPreviousView); + window->removeView(mAlarmEditorView); + deleteLater(); } /*! @@ -733,7 +720,7 @@ hbTrId("txt_clock_dpopinfo_alarm_will_occur_at_1_after_au"); QString displayText = dstRollOverText.arg(alarmTime); // show the note - HbNotificationDialog::launchDialog(displayText); + launchDialog(displayText); } /*! @@ -797,7 +784,6 @@ break; } if (Enabled == alarmInfo.alarmStatus && !(displayText.isEmpty())) { - //HbNotificationDialog::launchDialog(displayText); showDisplayText = true; } @@ -870,17 +856,16 @@ && !(remainingTimeText.isEmpty())) { if (!(displayText.isEmpty()) ) { - HbNotificationDialog::launchDialog( - displayText, remainingTimeText); + launchDialog(displayText, remainingTimeText); showDisplayText = false; } else { - HbNotificationDialog::launchDialog(remainingTimeText); + launchDialog(remainingTimeText); } } } if (showDisplayText) { - HbNotificationDialog::launchDialog(displayText); + launchDialog(displayText); } } @@ -941,4 +926,35 @@ return remainingSeconds; } +/*! + Launches the soft notification. + */ +void ClockAlarmEditor::launchDialog(QString title, QString text) +{ + HbNotificationDialog *notificationDialog = new HbNotificationDialog(); + notificationDialog->setTitle(title); + + if (!text.isNull()) { + notificationDialog->setText(text); + } + + notificationDialog->setTimeout(HbPopup::ConfirmationNoteTimeout); + notificationDialog->show(); +} + +/*! + Sorts and appends alarm days on the basis of start of week. + */ +void ClockAlarmEditor::sortAlarmDaysList(QStringList& alarmDaysList) + +{ + for(int index=(mStartOfWeek + 1),j=KDaysInWeek;j!=0 ;index++,j--){ + if(index > KDaysInWeek){ + index = index - KDaysInWeek; + } + QString alarmDayText; + getDayText(index, alarmDayText ); + alarmDaysList.append(alarmDayText); + } +} // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockappcontroller/src/clockappcontroller.cpp --- a/clock/clockui/clockappcontroller/src/clockappcontroller.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockappcontroller/src/clockappcontroller.cpp Fri May 14 15:51:09 2010 +0300 @@ -15,9 +15,6 @@ * */ -// System includes -#include - // User includes #include "clockappcontroller.h" #include "clockappcontrollerifimpl.h" @@ -38,8 +35,6 @@ mViewManager(0), mIfImpl(0) { - qDebug() << "clock: ClockAppController::ClockAppController -->"; - // Construct the interface implementation. mIfImpl = new ClockAppControllerIfImpl(this, this); @@ -48,8 +43,6 @@ Q_ASSERT_X( mViewManager, "clockappcontroller.cpp", "ClockViewManager is 0"); - - qDebug() << "clock: ClockAppController::ClockAppController <--"; } /*! @@ -57,8 +50,6 @@ */ ClockAppController::~ClockAppController() { - qDebug() << "clock: ClockAppController::~ClockAppController -->"; - if (mViewManager) { delete mViewManager; mViewManager = 0; @@ -67,8 +58,6 @@ delete mIfImpl; mIfImpl = 0; } - - qDebug() << "clock: ClockAppController::~ClockAppController <--"; } // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockappcontroller/src/clockappcontrollerifimpl.cpp --- a/clock/clockui/clockappcontroller/src/clockappcontrollerifimpl.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockappcontroller/src/clockappcontrollerifimpl.cpp Fri May 14 15:51:09 2010 +0300 @@ -16,9 +16,6 @@ * */ -// System includes -#include - // User includes #include "clockappcontrollerifimpl.h" #include "clockappcontroller.h" @@ -46,16 +43,12 @@ :QObject(parent), mAppController(controller) { - qDebug() << "clock: ClockAppControllerIfImpl::ClockAppControllerIfImpl -->"; - // Construct the timezone client. - mTimeZoneClient = new TimezoneClient(this); + mTimeZoneClient = TimezoneClient::getInstance(); // Construct the settings utility object. mSettingsUtility = new SettingsUtility(this); // Construct the alarm client object. mAlarmClient = new AlarmClient(this); - - qDebug() << "clock: ClockAppControllerIfImpl::ClockAppControllerIfImpl <--"; } /*! @@ -63,11 +56,8 @@ */ ClockAppControllerIfImpl::~ClockAppControllerIfImpl() { - qDebug() << "clock: ClockAppControllerIfImpl::~ClockAppControllerIfImpl -->"; - - if (mTimeZoneClient) { - delete mTimeZoneClient; - mTimeZoneClient = 0; + if (!mTimeZoneClient->isNull()) { + mTimeZoneClient->deleteInstance(); } if (mSettingsUtility) { delete mSettingsUtility; @@ -77,8 +67,6 @@ delete mAlarmClient; mAlarmClient = 0; } - - qDebug() << "clock: ClockAppControllerIfImpl::~ClockAppControllerIfImpl <--"; } @@ -91,10 +79,6 @@ */ TimezoneClient* ClockAppControllerIfImpl::timezoneClient() { - qDebug() << "clock: ClockAppControllerIfImpl::timezoneClient -->"; - - qDebug() << "clock: ClockAppControllerIfImpl::timezoneClient <--"; - return mTimeZoneClient; } @@ -107,10 +91,6 @@ */ SettingsUtility* ClockAppControllerIfImpl::settingsUtility() { - qDebug() << "clock: ClockAppControllerIfImpl::settingsUtility -->"; - - qDebug() << "clock: ClockAppControllerIfImpl::settingsUtility <--"; - return mSettingsUtility; } @@ -123,10 +103,6 @@ */ AlarmClient* ClockAppControllerIfImpl::alarmClient() { - qDebug() << "clock: ClockAppControllerIfImpl::alarmClient -->"; - - qDebug() << "clock: ClockAppControllerIfImpl::alarmClient <--"; - return mAlarmClient; } @@ -139,11 +115,7 @@ */ void ClockAppControllerIfImpl::switchToView(ClockViews viewId) { - qDebug() << "clock: ClockAppControllerIfImpl::switchToView -->"; - mAppController->mViewManager->showView(viewId); - - qDebug() << "clock: ClockAppControllerIfImpl::switchToView <--"; } // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockapplication/src/main.cpp --- a/clock/clockui/clockapplication/src/main.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockapplication/src/main.cpp Fri May 14 15:51:09 2010 +0300 @@ -32,8 +32,6 @@ */ int main(int argc, char *argv[]) { - qDebug("clock: main() -->"); - // Initialization HbApplication app(argc, argv); @@ -56,8 +54,6 @@ // Show widget window.show(); - qDebug("clock: main() <--"); - // Enter event loop return app.exec(); } diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockcityselectionlist/data/translations/clockcityselectionlist.qm Binary file clock/clockui/clockcityselectionlist/data/translations/clockcityselectionlist.qm has changed diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockcityselectionlist/data/translations/clockcityselectionlist.ts --- a/clock/clockui/clockcityselectionlist/data/translations/clockcityselectionlist.ts Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockcityselectionlist/data/translations/clockcityselectionlist.ts Fri May 14 15:51:09 2010 +0300 @@ -2,16 +2,6 @@ - - 1st label in Regional date & time settings view - Time format - Time format - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - Title for Date and time settings view Clock @@ -22,143 +12,23 @@ Co False - - The time and date information will be displayed in 2nd row - %1, %2 - %1, %2 - qtl_list_sec_large_graphic - CP main view_time & date plugin_P11 - list - CP - False - - - Setting item to clock display type. Tap to toggle values. - Digital - Digital - qtl_dataform_button_sec - Clock_Date & time settings_P04_1 - button - Cl - False - - - This text is displayed in 1st row - Time & date - Time & date - qtl_list_pri_large_graphic - CP main view_time & date plugin_P11 - list - CP - False - - - Note displayed after alarm is set (every week) - Alarm occurs every week on %1 at %2 - Alarm occurs every week on %1 at %2 - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Title for the time picker tumbler widget - Alarm time - Alarm time - qtl_dialog_pri_heading - Tumbler - title - Tu - False - - - 2nd value in combo box list for Date format label - mm dd yyyy - mm dd yyyy - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_2_val - Cl - False - - - Note displayed after alarm is set (time remaining) (hrs, min) - Time to alarm %1 hours and %2 minute - Time to alarm %1 hours and %2 minute - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - 3rd field in Regional date & time settings view - Date format - Date format + + Form label for city name in add own city (popup) data entry form + City name + City name qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Tapping on this button opens advanced date and time view - Regional date & time settings - Regional date & time settings - qtl_dataform_button_sec - Clock_Date & time settings_P04_1 - button - Cl - False - - - Popup Information which comes after setting the alarm. - Alarm will occur at %1 after automatic daylight saving update - Alarm will occur at %1 after automatic daylight saving update - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - - Time - Time - qtl_dialog_pri_heading - Tumbler - title - Tu - False - - - Sub-title for Regiional date & time settings - Regional date & time settings - Regional date & time settings - qtl_groupbox_simple_sec - Clock_Date & time settings_P04_3 - subhead - Cl - False - - - 5th label for Place in Clock settings view - Place - Place - qtl_dataform_heading_pri - Clock_Date & time settings_P04_1 + Clock_City list_P07 formlabel_1 Cl False - - 1st Value in combo box list for Time format label - 24 hour - 24 hour - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_1_val + + Form label for timezone in add own city (popup) data entry form + Timezone + Timezone + qtl_dataform_heading_pri + Clock_City list_P07 + formlabel_1 Cl False @@ -182,129 +52,16 @@ Co False - - Note displayed after alarm is set (Everyday Time) - Alarm occurs every day at %1 - Alarm occurs every day at %1 - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Alarm snooze time details in the list box (5mins, 10mins, 15mins, 30mins) - %Ln minutes - - (s)%Ln minutes - (p)%Ln minutes - - qtl_dataform_combobox_sec - Clock_Date & time settings_P04_1 - set - Cl - False - - - Setting item to clock display type. Tap to toggle values. - Analog - Analog - qtl_dataform_button_sec - Clock_Date & time settings_P04_1 - button - Cl - False - - - 6th field in Regional date & time settings view - Week starts on - Week starts on - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Note displayed after alarm is set (time remaining) - Time to alarm %1 hour and %2 minute - Time to alarm %1 hour and %2 minute - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - 3rd value in combo box list for Date format label - yyyy mm dd - yyyy mm dd - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_3_val + + Subtitle for City list + City list + City list + qtl_groupbox_simple_sec + Clock_City list_P07 + subhead Cl False - - Note displayed after alarm is set (only once) - Alarm occurs once only on next %1 at %2 - Alarm occurs once only on next %1 at %2 - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Note displayed after alarm is set (time remaining) (hr, mins) - Time to alarm %1 hour and %2 minutes - Time to alarm %1 hour and %2 minutes - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Form label for city name in add own city (popup) data entry form - City name - City name - qtl_dataform_heading_pri - Clock_City list_P07 - formlabel_1 - Cl - False - - - Title for the date picker tumbler widget - Alarm date - Alarm date - qtl_dialog_pri_heading - Tumbler - title - Tu - False - - - Form label for timezone in add own city (popup) data entry form - Timezone - Timezone - qtl_dataform_heading_pri - Clock_City list_P07 - formlabel_1 - Cl - False - - - - Date - Date - qtl_dialog_pri_heading - Tumbler - title - Tu - False - GMT @@ -325,135 +82,5 @@ Cl False - - 1st label in Date and time settings view - Use network date & time - Use network date & time - qtl_checkbox_sec - Clock_Date & time settings_P04_1 - setlabel_1 - Cl - False - - - Subtitle for the time seperator drop down list - Time separator - Time separator - qtl_dataform_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Subtitle for the date seperator drop down list - Date separator - Date separator - qtl_dataform_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Label for Workdays in Alarm editor - Workdays - Workdays - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Label to the date field (picker) in the settings view - Date - Date - qtl_dataform_pri - Clock_Date & time settings_P04_1 - setlabel_1 - Cl - False - - - Label to the time field (picker) in the settings view - Time - Time - qtl_dataform_pri - Clock_Date & time settings_P04_1 - setlabel_1 - Cl - False - - - 2nd value in combo box list for Time format label - 12 hour - 12 hour - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_2_val - Cl - False - - - Note displayed after alarm is set (time remaining) (hrs, mins) - Time to alarm %1 hours and %2 minutes - Time to alarm %1 hours and %2 minutes - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Note displayed after alarm is set (workdays) - Alarm occurs workdays at %1 - Alarm occurs workdays at %1 - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Primary text label for Clock Type - Clock Type - Clock Type - qtl_dataform_pri - Clock_Date & time settings_P04_1 - setlabel_5 - Cl - False - - - Subtitle for City list - City list - City list - qtl_groupbox_simple_sec - Clock_City list_P07 - subhead - Cl - False - - - Sub-title for Date & time settings view - Date & time - Date & time - qtl_groupbox_simple_sec - Clock_Date & time settings_P04_1 - subhead - Cl - False - - - 1st value in combo box list for Date format label - dd mm yyyy - dd mm yyyy - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_1_val - Cl - False - diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockcityselectionlist/data/xml/clockcityselectionlist.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockcityselectionlist/data/xml/clockcityselectionlist.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockcityselectionlist/inc/clockcityselectionlist_p.h --- a/clock/clockui/clockcityselectionlist/inc/clockcityselectionlist_p.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockcityselectionlist/inc/clockcityselectionlist_p.h Fri May 14 15:51:09 2010 +0300 @@ -58,8 +58,8 @@ void updateSearchCriteria(const QString &criteria); void handleAddOwnCityAction(); void handleOkAction(); - void handleCancelAction(); void handleTimeZoneSelection(int index); + void selectedAction(HbAction *action); private: void showCityList(); @@ -81,6 +81,9 @@ QPointer mTimeZoneComboBox; QPointer mCountryComboBox; + HbAction *mOkAction; + HbAction *mCancelAction; + ClockCitySelectionList *q_ptr; TimezoneClient *mClient; ClockCityListProxyModel *mProxyModel; diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockcityselectionlist/src/clockcityselectionlist_p.cpp --- a/clock/clockui/clockcityselectionlist/src/clockcityselectionlist_p.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockcityselectionlist/src/clockcityselectionlist_p.cpp Fri May 14 15:51:09 2010 +0300 @@ -67,7 +67,7 @@ mClient = client; if (!mClient) { - mClient = new TimezoneClient(this); + mClient = TimezoneClient::getInstance(); mOwnsClient = true; } } @@ -77,8 +77,8 @@ */ ClockCitySelectionListPrivate::~ClockCitySelectionListPrivate() { - if (mOwnsClient) { - delete mClient; + if (mOwnsClient && !mClient->isNull()) { + mClient->deleteInstance(); } if (mLoader) { mLoader->reset(); @@ -103,7 +103,7 @@ void ClockCitySelectionListPrivate::populateListModel() { // First get the data from the timezone client. - QList infoList = mClient->getLocations(); + QList &infoList = mClient->getLocations(); // Sanity check. if (!mListModel) { @@ -135,6 +135,9 @@ mListModel->setData( index, info.countryName, Qt::UserRole + 104); } + + // Cleanup. + infoList.clear(); } /*! @@ -273,20 +276,14 @@ widget->setLayout(layout); // Add actions to the dialog - HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok")); - mAddOwnCityDialog->setPrimaryAction(okAction); - connect( - okAction, SIGNAL(triggered()), - this, SLOT(handleOkAction())); + mOkAction = new HbAction(hbTrId("txt_common_button_ok")); + mCancelAction = new HbAction(hbTrId("txt_common_button_cancel")); - HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); - mAddOwnCityDialog->setSecondaryAction(cancelAction); - connect( - cancelAction, SIGNAL(triggered()), - this, SLOT(handleCancelAction())); + mAddOwnCityDialog->addAction(mOkAction); + mAddOwnCityDialog->addAction(mCancelAction); mAddOwnCityDialog->setContentWidget(widget); - mAddOwnCityDialog->exec(); + mAddOwnCityDialog->open(this, SLOT(selectedAction(HbAction*))); } /*! @@ -321,21 +318,6 @@ populateListModel(); } } - - // Close the popup - handleCancelAction(); -} - -/*! - Handles Cancel action of add own city dialog - */ -void ClockCitySelectionListPrivate::handleCancelAction() -{ - // Close the dialog. - if (mAddOwnCityDialog) { - mAddOwnCityDialog->close(); - mAddOwnCityDialog->deleteLater(); - } } /*! @@ -364,6 +346,15 @@ } /*! + Slot to handle the selected action + */ +void ClockCitySelectionListPrivate::selectedAction(HbAction *action) +{ + if (action==mOkAction) { + handleOkAction(); + } +} +/*! Displays the city selection list. */ void ClockCitySelectionListPrivate::showCityList() @@ -399,7 +390,7 @@ connect( mSearchBox, SIGNAL(criteriaChanged(QString)), this, SLOT(updateSearchCriteria(QString))); - + // Construct the source model. if (!mListModel) { mListModel = new QStandardItemModel(0, 1, this); @@ -441,7 +432,7 @@ // Add the view to the main window and show it. HbMainWindow *window = hbInstance->allMainWindows().at(0); - mBackAction = new HbAction(Hb::BackAction, this); + mBackAction = new HbAction(Hb::BackNaviAction, this); mView->setNavigationAction(mBackAction); connect( mBackAction, SIGNAL(triggered()), diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockplugins/datetimesettingsplugin/datetimesettingsplugin.pro --- a/clock/clockui/clockplugins/datetimesettingsplugin/datetimesettingsplugin.pro Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockplugins/datetimesettingsplugin/datetimesettingsplugin.pro Fri May 14 15:51:09 2010 +0300 @@ -17,31 +17,35 @@ TEMPLATE = lib TARGET = datetimesettingsplugin +CONFIG += hb plugin + DEPENDPATH += . \ ./inc \ ./src + INCLUDEPATH += . \ - ../../clocksettingsview/inc - -CONFIG += hb plugin - -LIBS += -lcpframework + ../../../inc \ + ../../../clockmw/clocktimezone/inc \ + ../../clocksettingsview/inc -# Input -HEADERS += datetimesettingsplugin.h \ - datetimesettingsview.h +LIBS += \ + -lcpframework \ + -ltimezoneclient \ + -lclocksettingsview \ + +HEADERS += \ + datetimesettingsplugin.h \ + datetimesettingsview.h -SOURCES += datetimesettingsplugin.cpp \ - datetimesettingsview.cpp +SOURCES += \ + datetimesettingsplugin.cpp \ + datetimesettingsview.cpp symbian: { TARGET.EPOCALLOWDLLDATA = 1 TARGET.UID3 = 0x102818E9 + TARGET.CAPABILITY = CAP_GENERAL_DLL - LIBS += -lclocksettingsview -} - -symbian { deploy.path = C: headers.sources = qmakepluginstubs/datetimesettingsplugin.qtplugin headers.path = /resource/qt/plugins/controlpanel @@ -49,9 +53,9 @@ # This is for new exporting system coming in garden for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" } - -TARGET.CAPABILITY = CAP_GENERAL_DLL plugin.sources = datetimesettingsplugin.dll plugin.path = \resource\qt\plugins\controlpanel -DEPLOYMENT += plugin \ No newline at end of file +DEPLOYMENT += plugin + +# End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsplugin.h --- a/clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsplugin.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsplugin.h Fri May 14 15:51:09 2010 +0300 @@ -10,29 +10,35 @@ * Nokia Corporation - initial contribution. * * Contributors: - * - * Description: - * +* +* Description: +* Header file for DateTimeSettingsPlugin class. +* */ #ifndef DATETIMESETTINGSPLUGIN_H_ #define DATETIMESETTINGSPLUGIN_H_ -#include -#include +// System includes +#include -class DateTimeSettingsPlugin : public QObject, public CpPluginPlatInterface +// User includes +#include + +class DateTimeSettingsPlugin : public QObject, public CpPluginInterface { Q_OBJECT - Q_INTERFACES(CpPluginPlatInterface) + Q_INTERFACES(CpPluginInterface) public: DateTimeSettingsPlugin(); - virtual ~DateTimeSettingsPlugin(); + virtual ~DateTimeSettingsPlugin(); - virtual int uid() const; - virtual CpSettingFormItemData *createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; + virtual int uid() const; + QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; }; #endif /* DATETIMESETTINGSPLUGIN_H_ */ + +// End of file --Don't remove this diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsview.h --- a/clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsview.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockplugins/datetimesettingsplugin/inc/datetimesettingsview.h Fri May 14 15:51:09 2010 +0300 @@ -10,22 +10,46 @@ * Nokia Corporation - initial contribution. * * Contributors: - * - * Description: - * +* +* Description: +* Header file for DateTimeSettingsView class. +* */ #ifndef DATETIMESETTINGSVIEW_H_ #define DATETIMESETTINGSVIEW_H_ -#include +// User includes +#include -class DateTimeSettingsView : public CpBaseSettingView +// Forward declarations +class QTimer; +class TimezoneClient; + +class DateTimeSettingsView : public CpSettingFormEntryItemData { - Q_OBJECT + Q_OBJECT public: - explicit DateTimeSettingsView(QGraphicsItem *parent = 0); - virtual ~DateTimeSettingsView(); + explicit DateTimeSettingsView( + CpItemDataHelper &itemDataHelper, const QString &text = QString(), + const QString &description = QString(), + const HbIcon &icon = HbIcon(), + const HbDataFormModelItem *parent = 0); + virtual ~DateTimeSettingsView(); + +private slots: + void onLaunchView(); + void updateDisplayTime(); + +private: + virtual CpBaseSettingView *createSettingView() const; + +private: + QTimer *mTickTimer; + TimezoneClient *mTimezoneClient; }; -#endif// DATETIMESETTINGSVIEW_H_ + +#endif // DATETIMESETTINGSVIEW_H_ + +// End of file --Don't remove this diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsplugin.cpp --- a/clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsplugin.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsplugin.cpp Fri May 14 15:51:09 2010 +0300 @@ -10,40 +10,69 @@ * Nokia Corporation - initial contribution. * * Contributors: - * - * Description: - * +* +* Description: +* Definition file for class DateTimeSettingsPlugin. +* */ - +// System includes +#include #include +#include +// User includes #include "datetimesettingsplugin.h" #include "datetimesettingsview.h" +/*! + Constructor. + */ DateTimeSettingsPlugin::DateTimeSettingsPlugin() { } +/*! + Destructor. + */ DateTimeSettingsPlugin::~DateTimeSettingsPlugin() { } +/*! + Returns the uid of the plugin. + */ int DateTimeSettingsPlugin::uid() const { // UID of the plugin. - return 0x102818E9; + return 0x102818E9; } -CpSettingFormItemData *DateTimeSettingsPlugin:: - createSettingFormItemData( - CpItemDataHelper &itemDataHelper) const +/*! + Creates the object of DateTimeSettingsView class. + */ +QList DateTimeSettingsPlugin:: + createSettingFormItemData( + CpItemDataHelper &itemDataHelper) const { - HbIcon* icon = new HbIcon(); - return new CpSettingFormEntryItemDataImpl( - itemDataHelper, - QString("Clock application"), - QString("Date & Time settings plugin"), - *icon); + HbIcon* icon = new HbIcon(); + HbExtendedLocale locale = HbExtendedLocale::system(); + QString timeInfo = locale.format( + QTime::currentTime(), r_qtn_time_usual_with_zero); + QString dateinfo = locale.format( + QDate::currentDate(), r_qtn_date_usual_with_zero); + QString displayString; + displayString.append(timeInfo); + displayString.append(" "); + displayString.append(dateinfo); + + QList entryItemList; + CpSettingFormItemData *entryItem = new DateTimeSettingsView( + itemDataHelper,hbTrId("txt_cp_main_view_list_time_date"), + displayString,*icon); + entryItemList.append(entryItem); + return entryItemList; } Q_EXPORT_PLUGIN2(DateTimeSettingsPlugin, DateTimeSettingsPlugin) + +// End of file --Don't remove this diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsview.cpp --- a/clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockplugins/datetimesettingsplugin/src/datetimesettingsview.cpp Fri May 14 15:51:09 2010 +0300 @@ -12,28 +12,108 @@ * Contributors: * * Description: -* Definition file for class ClockSettingsView. +* Definition file for class DateTimeSettingsView. * */ +// System includes +#include +#include +#include +#include -#include +// User includes #include "datetimesettingsview.h" #include "clocksettingsview.h" +#include "timezoneclient.h" -DateTimeSettingsView::DateTimeSettingsView(QGraphicsItem *parent) -:CpBaseSettingView(0, parent) -{ - HbDataForm *form = settingForm(); +/*! + \class DateTimeSettingsView + + This class launches the clock settings view from control panel. + */ + +/*! + Constructor. - if (form) { - form->setHeading(tr("Date & Time Settings")); + \param itemDataHelper CpItemDataHelper object. + \param text text to be displayed in first line. + \param description test to be displayed in second line. + \param icon to be displayed. + \param parent Parent of type HbDataFormModelItem + */ +DateTimeSettingsView::DateTimeSettingsView( + CpItemDataHelper &itemDataHelper, const QString &text, + const QString &description, const HbIcon &icon, + const HbDataFormModelItem *parent): + CpSettingFormEntryItemData( + itemDataHelper, text, description, icon, parent) +{ + // Construct the timezone client. + mTimezoneClient = TimezoneClient::getInstance(); + connect( + mTimezoneClient, SIGNAL(timechanged()), + this, SLOT(updateDisplayTime())); - ClockSettingsView *settingsView = new ClockSettingsView(this); - settingsView->loadSettingsView(); - } + // Start a timer. For updating the displayed time. + mTickTimer = new QTimer(this); + // Start the Timer for 1 minute. + mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); + connect( + mTickTimer, SIGNAL(timeout()), + this, SLOT(updateDisplayTime())); } +/*! + Destructor. + */ DateTimeSettingsView::~DateTimeSettingsView() { + if (mTickTimer) { + mTickTimer->stop(); + delete mTickTimer; + mTickTimer = 0; + } + + if (!mTimezoneClient->isNull()) { + mTimezoneClient->deleteInstance(); + } } + +/*! + Launches the clock settings view. + */ +void DateTimeSettingsView::onLaunchView() +{ + ClockSettingsView *settingsView = new ClockSettingsView(this); + settingsView->loadSettingsView(); +} + +/*! + Updates the second line i.e date & time. + */ +void DateTimeSettingsView::updateDisplayTime() +{ + HbExtendedLocale locale = HbExtendedLocale::system(); + QString timeInfo = locale.format( + QTime::currentTime(), r_qtn_time_usual_with_zero); + QString dateinfo = locale.format( + QDate::currentDate(), r_qtn_date_usual_with_zero); + QString displayString; + displayString.append(timeInfo); + displayString.append(" "); + displayString.append(dateinfo); + setDescription(displayString); + // Start the Timer for 1 minute. + mTickTimer->start(60000); +} + +/*! + createSettingView() + */ +CpBaseSettingView *DateTimeSettingsView::createSettingView() const +{ + return 0; +} + +// End of file --Don't remove this diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/clocksettingsview.pro --- a/clock/clockui/clocksettingsview/clocksettingsview.pro Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clocksettingsview/clocksettingsview.pro Fri May 14 15:51:09 2010 +0300 @@ -23,7 +23,6 @@ INCLUDEPATH += \ ./inc \ - ../clockwidget/inc \ ../../clockmw/clocksettingsutility/inc \ ../../clockmw/clocktimezone/inc \ ../clockcityselectionlist/inc \ @@ -43,7 +42,7 @@ -ltimezoneclient \ -lclocksettingsutility \ -lclockcityselectionlist \ - -lclockwidgetproto + -lxqsettingsmanager } SOURCES += \ diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/data/translations/clocksettingsview.qm Binary file clock/clockui/clocksettingsview/data/translations/clocksettingsview.qm has changed diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/data/translations/clocksettingsview.ts --- a/clock/clockui/clocksettingsview/data/translations/clocksettingsview.ts Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clocksettingsview/data/translations/clocksettingsview.ts Fri May 14 15:51:09 2010 +0300 @@ -2,6 +2,16 @@ + + Title for Date and time settings view + Clock + Clock + + Common + Common + Co + False + 1st label in Regional date & time settings view Time format @@ -12,16 +22,6 @@ Cl False - - Title for Date and time settings view - Clock - Clock - - Common - Common - Co - False - The time and date information will be displayed in 2nd row %1, %2 @@ -127,7 +127,7 @@ Monday Monday qtl_dataform_group_pri - Clock_Date & time settings_P04_1 + Clock_Alarm editor_P03 setlabel_1_val Cl False @@ -137,30 +137,17 @@ Thursday Thursday qtl_dataform_group_pri - Clock_Date & time settings_P04_1 + Clock_Alarm editor_P03 setlabel_4_val Cl False - - Alarm snooze time details in the list box (5mins, 10mins, 15mins, 30mins) - %Ln minutes - - (s)%Ln minutes - (p)%Ln minutes - - qtl_dataform_combobox_sec - Clock_Date & time settings_P04_1 - set - Cl - False - 5th dropdown list value for Day label in Alarm editor view Friday Friday qtl_dataform_group_pri - Clock_Date & time settings_P04_1 + Clock_Alarm editor_P03 setlabel_5_val Cl False @@ -190,7 +177,7 @@ Sunday Sunday qtl_dataform_group_pri - Clock_Date & time settings_P04_1 + Clock_Alarm editor_P03 setlabel_7_val Cl False @@ -210,7 +197,7 @@ Tuesday Tuesday qtl_dataform_group_pri - Clock_Date & time settings_P04_1 + Clock_Alarm editor_P03 setlabel_2_val Cl False @@ -245,6 +232,16 @@ Cl False + + Sub-title for Settings view + Settings + Settings + qtl_groupbox_simple_sec + Clock_Date & time settings_P04_1 + subhead + Cl + False + Subtitle for the date seperator drop down list Date separator @@ -295,6 +292,29 @@ Cl False + + Primary text label for Clock Type + Alarm snooze time + Alarm snooze time + qtl_dataform_pri_graphic + Clock_Date & time settings_P04_1 + setlabel_1 + Cl + False + + + Alarm snooze time details in the list box (5mins, 10mins, 15mins, 30mins) + %Ln mins + + %Ln mins + %Ln mins + + qtl_dataform_combobox_sec + Clock_Date & time settings_P04_1 + set + Cl + False + Primary text label for Clock Type Clock Type @@ -320,7 +340,7 @@ Saturday Saturday qtl_dataform_group_pri - Clock_Date & time settings_P04_1 + Clock_Alarm editor_P03 setlabel_6_val Cl False @@ -330,7 +350,7 @@ Wednesday Wednesday qtl_dataform_group_pri - Clock_Date & time settings_P04_1 + Clock_Alarm editor_P03 setlabel_3_val Cl False diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/data/xml/clockregionalsettingsview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clocksettingsview/data/xml/clockregionalsettingsview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/data/xml/clocksettingsview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clocksettingsview/data/xml/clocksettingsview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+ + + + + + + + + + + +
+ + + + + +
diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/inc/clocksettingsview.h --- a/clock/clockui/clocksettingsview/inc/clocksettingsview.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clocksettingsview/inc/clocksettingsview.h Fri May 14 15:51:09 2010 +0300 @@ -33,14 +33,13 @@ class HbDataFormModel; class HbDataFormModelItem; class HbLabel; - class TimezoneClient; class SettingsUtility; -class SkinnableClock; class ClockSettingsDocLoader; class ClockSettingsView; -class SkinnableClock; class QTranslator; +class XQSettingsManager; +class XQSettingsKey; class ClockSettingsView : public QObject { @@ -55,13 +54,14 @@ private slots: void handleBackAction(); - void updateDateLabel(); - void updatePlaceInfo(); - void updateClockWidget(); + void updatePlaceItem(); void updateDateItem(); void updateTimeItem(); void handleOrientationChanged(Qt::Orientation orientation); void handleNetworkTimeStateChange(int state); + void handleAutoTimeUpdateChange(int value); + void handleAlarmSnoozeTimeChanged(int index); + void eventMonitor(const XQSettingsKey& key, const QVariant& value); private: void setupView(); @@ -78,19 +78,18 @@ QPointer mSettingsModel; - - HbLabel *mDayDateLabel; - HbLabel *mPlaceLabel; - HbDataFormModelItem *mNetworkTimeItem; HbDataFormModelItem *mTimeDataFormItem; HbDataFormModelItem *mDateDataFormItem; HbDataFormModelItem *mPlaceDataFormItem; + HbDataFormModelItem *mAlarmSnoozeItem; ClockSettingsDocLoader *mDocLoader; SettingsUtility *mSettingsUtility; - TimezoneClient *mTimezoneClient; - SkinnableClock *mClockWidget; + TimezoneClient *mTimezoneClient; + XQSettingsManager *mSettingsManager; + XQSettingsKey *mAlarmSnoozeTimeKey; + QHash mAlarmSnoozeTimeHash; QTranslator *mTranslator; }; diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/inc/settingscustomitem.h --- a/clock/clockui/clocksettingsview/inc/settingscustomitem.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clocksettingsview/inc/settingscustomitem.h Fri May 14 15:51:09 2010 +0300 @@ -53,21 +53,13 @@ private slots: void launchTimePicker(); - void handleTimeOkAction(); - void handleTimeCancelAction(); - + void handleOkAction(); void launchDatePicker(); - void handleDateOkAction(); - void handleDateCancelAction(); - void launchCitySelectionList(); void updatePlaceItem(LocationInfo info); + void launchRegSettingsView(); + void selectedAction(HbAction *action); - void launchRegSettingsView(); - -private: - - private: QStringList mWeekdaysList; @@ -77,6 +69,9 @@ QPointer mDateWidget; QPointer mPlaceWidget; + HbAction *mOkAction; + HbAction *mCancelAction; + SettingsUtility *mSettingsUtility; ClockCitySelectionList *mCitySelectionList; TimezoneClient *mTimezoneClient; diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/src/clockregionalsettingsview.cpp --- a/clock/clockui/clocksettingsview/src/clockregionalsettingsview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clocksettingsview/src/clockregionalsettingsview.cpp Fri May 14 15:51:09 2010 +0300 @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -134,7 +134,7 @@ window->setCurrentView(mView); // Add the back softkey. - mBackAction = new HbAction(Hb::BackAction); + mBackAction = new HbAction(Hb::BackNaviAction); mView->setNavigationAction(mBackAction); connect( mBackAction, SIGNAL(triggered()), @@ -271,8 +271,6 @@ void ClockRegionalSettingsView::handleDataChanged( const QModelIndex& topLeft, const QModelIndex& bottomRight) { - qDebug("clock: ClockRegionalSettingsView::handleDataChanged() -->"); - Q_UNUSED(bottomRight) diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/src/clocksettingsdocloader.cpp --- a/clock/clockui/clocksettingsview/src/clocksettingsdocloader.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clocksettingsview/src/clocksettingsdocloader.cpp Fri May 14 15:51:09 2010 +0300 @@ -16,13 +16,9 @@ * */ -// System includes. -#include - // User includes #include "clocksettingsdocloader.h" #include "clocksettingsdefines.h" -#include "skinnableclock.h" #include "clocksettingsview.h" /*! @@ -39,16 +35,6 @@ */ QObject *ClockSettingsDocLoader::createObject(const QString &type, const QString &name) { - qDebug() << "clock: ClockSettingsDocLoader::createObject -->"; - - if (CLOCK_WIDGET == name) { - QObject *object = new SkinnableClock(); - object->setObjectName(name); - return object; - } - - qDebug() << "clock: ClockSettingsDocLoader::createObject <--"; - return HbDocumentLoader::createObject(type, name); } diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/src/clocksettingsview.cpp --- a/clock/clockui/clocksettingsview/src/clocksettingsview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clocksettingsview/src/clocksettingsview.cpp Fri May 14 15:51:09 2010 +0300 @@ -17,7 +17,6 @@ */ // System includes -#include #include #include #include @@ -28,6 +27,8 @@ #include #include #include +#include +#include // User includes #include "clocksettingsview.h" @@ -35,9 +36,9 @@ #include "clocksettingsdocloader.h" #include "settingsutility.h" #include "timezoneclient.h" -#include "skinnableclock.h" #include "settingsdatatypes.h" #include "settingscustomitem.h" +#include "clockcommon.h" /*! \class ClockSettingsView @@ -69,22 +70,22 @@ mSettingsUtility = new SettingsUtility(); // Construct the timezone client. - mTimezoneClient = new TimezoneClient(); + mTimezoneClient = TimezoneClient::getInstance(); connect( mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updatePlaceInfo())); - connect( - mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updateDateLabel())); - connect( - mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updateClockWidget())); + this, SLOT(updatePlaceItem())); connect( mTimezoneClient, SIGNAL(timechanged()), this, SLOT(updateDateItem())); connect( mTimezoneClient, SIGNAL(timechanged()), this, SLOT(updateTimeItem())); + connect( + mTimezoneClient, SIGNAL(autoTimeUpdateChanged(int)), + this, SLOT(handleAutoTimeUpdateChange(int))); + connect( + mTimezoneClient, SIGNAL(cityUpdated()), + this, SLOT(updatePlaceItem())); // Start a timer. For updating the remaining alarm time. mTickTimer = new QTimer(this); @@ -92,7 +93,22 @@ mTickTimer, SIGNAL(timeout()), this, SLOT(updateTimeItem())); - qDebug("clock: ClockSettingsView::ClockSettingsView() <--"); + // Create the settings manager. + mSettingsManager = new XQSettingsManager(this); + + // Create the key for alarm snooze time. + mAlarmSnoozeTimeKey = new XQSettingsKey( + XQSettingsKey::TargetCentralRepository, + KCRUidClockApp, + KClockAppSnoozeTime); + + // Start the monitoring for the alarm snooze time key. + mSettingsManager->startMonitoring(*mAlarmSnoozeTimeKey); + + // Listen to the key value changes. + connect( + mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)), + this, SLOT(eventMonitor(XQSettingsKey, QVariant))); } /*! @@ -100,8 +116,6 @@ */ ClockSettingsView::~ClockSettingsView() { - qDebug("clock: ClockSettingsView::~ClockSettingsView() -->"); - if (mDocLoader) { delete mDocLoader; } @@ -113,7 +127,10 @@ mTranslator = 0; } - qDebug("clock: ClockSettingsView::~ClockSettingsView() <--"); + if (!mTimezoneClient->isNull()) { + mTimezoneClient->deleteInstance(); + } + } /*! @@ -121,8 +138,6 @@ */ void ClockSettingsView::loadSettingsView() { - qDebug() << "clock: ClockViewManager::loadMainView -->"; - bool loadSuccess; // Construct the document loader instance @@ -161,7 +176,6 @@ // Setup the view. setupView(); - qDebug() << "clock: ClockViewManager::loadMainView <--"; } /*! @@ -175,109 +189,21 @@ } /*! - Updates the day and date in the day label. + Updates the zone info in the place item field. */ -void ClockSettingsView::updateDateLabel() +void ClockSettingsView::updatePlaceItem() { - qDebug() << "clock: ClockSettingsView::updateDateLabel -->"; - - // Get the current datetime. - QDateTime dateTime = QDateTime::currentDateTime(); - // Get the day name. - QString dayName = dateTime.toString("dddd"); - // Get the date in correct format. - QString currentDate = mSettingsUtility->date(); - // Construct the day + date string. - QString dayDateString; - dayDateString+= dayName; - dayDateString += " "; - dayDateString += currentDate; - - mDayDateLabel->clear(); - mDayDateLabel->setPlainText(dayDateString); - - qDebug() << "clock: ClockSettingsView::updateDateLabel <--"; -} - -/*! - Updates the zone info in the place label. - */ -void ClockSettingsView::updatePlaceInfo() -{ - qDebug() << "clock: ClockSettingsView::updateClockZoneInfo -->"; - // Get the current zone info. LocationInfo currentZoneInfo = mTimezoneClient->getCurrentZoneInfoL(); - // Construct the GMT +/- X string. - QString gmtOffset; - - int utcOffset = currentZoneInfo.zoneOffset; - int offsetInHours (utcOffset/60); - int offsetInMinutes (utcOffset%60); - - // Check wether the offset is +ve or -ve. - if (0 < utcOffset) { - // We have a positive offset. Append the '+' character. - gmtOffset += tr(" +"); - } else if (0 > utcOffset) { - // We have a negative offset. Append the '-' character. - gmtOffset += tr(" -"); - offsetInHours = -offsetInHours; - } else { - // We dont have an offset. We are at GMT zone. - } - - // Append the hour component. - gmtOffset += QString::number(offsetInHours); - - // Get the time separator from settings and append it. - QStringList timeSeparatorList; - int index = mSettingsUtility->timeSeparator(timeSeparatorList); - gmtOffset += timeSeparatorList.at(index); - - // Append the minute component. - // If minute component is less less than 10, append a '00' - if (0 <= offsetInMinutes && offsetInMinutes < 10) { - gmtOffset += tr("00"); - } else { - gmtOffset += QString::number(offsetInMinutes); - } - - gmtOffset += tr(" GMT "); - - // Append DST info. - if (currentZoneInfo.dstOn) { - gmtOffset += tr(" DST"); - } - - // Update the labels with the correct info. - mPlaceLabel->clear(); if (mTimezoneClient->timeUpdateOn()) { - mPlaceLabel->setPlainText( - currentZoneInfo.countryName + tr(" ") + gmtOffset); mPlaceDataFormItem->setContentWidgetData( "text", currentZoneInfo.countryName); } else { QString placeInfo = currentZoneInfo.cityName + tr(", ") + currentZoneInfo.countryName; - mPlaceLabel->setPlainText(placeInfo + tr(" ") + gmtOffset); mPlaceDataFormItem->setContentWidgetData("text", placeInfo); } - - qDebug() << "clock: ClockSettingsView::updateDayDateInfo <--"; -} - -/*! - Updates the clock widget display. - */ -void ClockSettingsView::updateClockWidget() -{ - qDebug() << "clock: ClockSettingsView::updateClockWidget -->"; - - mClockWidget->updateDisplay(true); - - qDebug() << "clock: ClockSettingsView::updateClockWidget <--"; } /*! @@ -307,8 +233,6 @@ */ void ClockSettingsView::handleOrientationChanged(Qt::Orientation orientation) { - qDebug() << "clock: ClockSettingsView::handleOrientationChanged -->"; - bool success; // If horizontal, load the landscape section. if (Qt::Horizontal == orientation) { @@ -322,9 +246,6 @@ CLOCK_SETTINGS_VIEW_PORTRAIT_SECTION, &success); } - - qDebug() << "clock: ClockSettingsView::handleOrientationChanged <--"; - } void ClockSettingsView::handleNetworkTimeStateChange(int state) @@ -333,36 +254,13 @@ if ((Qt::Checked == state && !cenrepValue) || (Qt::Unchecked == state && cenrepValue)) { if (Qt::Checked == state) { - // Disable the time, date and place item. - if (mTimeDataFormItem) { - mTimeDataFormItem->setEnabled(false); - } - if (mDateDataFormItem) { - mDateDataFormItem->setEnabled(false); - } - if (mPlaceDataFormItem) { - mPlaceDataFormItem->setEnabled(false); - } // Update the cenrep value. mTimezoneClient->setTimeUpdateOn(true); } else if (Qt::Unchecked == state) { - // Enable the time, date and place item. - if (mTimeDataFormItem) { - mTimeDataFormItem->setEnabled(true); - } - if (mDateDataFormItem) { - mDateDataFormItem->setEnabled(true); - } - if (mPlaceDataFormItem) { - mPlaceDataFormItem->setEnabled(true); - } - // Update the cenrep value. mTimezoneClient->setTimeUpdateOn(false); } - - updatePlaceInfo(); } } @@ -374,14 +272,12 @@ */ void ClockSettingsView::setupView() { - qDebug("clock: ClockSettingsView::setupView() -->"); - HbMainWindow *window = hbInstance->allMainWindows().first(); window->addView(mSettingsView); window->setCurrentView(mSettingsView); // Add the back softkey. - mBackAction = new HbAction(Hb::BackAction); + mBackAction = new HbAction(Hb::BackNaviAction); mSettingsView->setNavigationAction(mBackAction); connect( mBackAction, SIGNAL(triggered()), @@ -391,18 +287,6 @@ mSettingsForm = static_cast ( mDocLoader->findWidget(CLOCK_SETTINGS_DATA_FORM)); - // Get the day-date label. - mDayDateLabel = static_cast ( - mDocLoader->findWidget(CLOCK_SETTINGS_DATE_LABEL)); - - // Get the place label. - mPlaceLabel = static_cast ( - mDocLoader->findWidget(CLOCK_SETTINGS_PLACE_LABEL)); - - // Get the clock widget. - mClockWidget = static_cast ( - mDocLoader->findObject(CLOCK_WIDGET)); - // Create the custom prototype. QList prototypes = mSettingsForm->itemPrototypes(); SettingsCustomItem *customPrototype = new SettingsCustomItem(); @@ -411,14 +295,9 @@ // Create the model. createModel(); - // Update the relevant info. - updateDateLabel(); - updateClockWidget(); - updatePlaceInfo(); + updatePlaceItem(); mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); - - qDebug("clock: ClockSettingsView::setupView() <--"); } /*! @@ -514,6 +393,117 @@ (HbDataFormModelItem::CustomItemBase + RegionalSettingsItem); mSettingsModel->appendDataFormItem(regionalSettingsItem); + // Add the alarm snooze time item. + mAlarmSnoozeItem = mSettingsModel->appendDataFormItem( + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_clock_setlabel_alarm_snooze_time")); + QStringList alramSnoozeTimes; + alramSnoozeTimes << hbTrId("txt_clock_set_ln_mins", 5) + << hbTrId("txt_clock_set_ln_mins", 10) + << hbTrId("txt_clock_set_ln_mins", 15) + << hbTrId("txt_clock_set_ln_mins", 30); + + // Build the hash map for the reminder. + mAlarmSnoozeTimeHash[0] = 5; + mAlarmSnoozeTimeHash[1] = 10; + mAlarmSnoozeTimeHash[2] = 15; + mAlarmSnoozeTimeHash[3] = 30; + + mAlarmSnoozeItem->setContentWidgetData("items", alramSnoozeTimes); + QVariant value = mSettingsManager->readItemValue(*mAlarmSnoozeTimeKey); + bool success; + int index; + int alarmSnoozeTime = value.toInt(&success); + if (success) { + index = mAlarmSnoozeTimeHash.key(alarmSnoozeTime); + } else { + index = mAlarmSnoozeTimeHash.key(15); + } + mAlarmSnoozeItem->setContentWidgetData("currentIndex", index); + mSettingsForm->addConnection( + mAlarmSnoozeItem, SIGNAL(currentIndexChanged(int)), + this, SLOT(handleAlarmSnoozeTimeChanged(int))); + +} + +/*! + Slot which handles the auto time update value changes in cenrep. + + /param value New value of the auto time update. + */ +void ClockSettingsView::handleAutoTimeUpdateChange(int value) +{ + int state = (mNetworkTimeItem->contentWidgetData("checkState")).toInt(); + + if (value) { + // Disable the time, date and place item. + if (mTimeDataFormItem) { + mTimeDataFormItem->setEnabled(false); + } + if (mDateDataFormItem) { + mDateDataFormItem->setEnabled(false); + } + if (mPlaceDataFormItem) { + mPlaceDataFormItem->setEnabled(false); + } + if (Qt::Unchecked == state) { + mNetworkTimeItem->setContentWidgetData( + "checkState", Qt::Checked); + } + } else { + // Enable the time, date and place item. + if (mTimeDataFormItem) { + mTimeDataFormItem->setEnabled(true); + } + if (mDateDataFormItem) { + mDateDataFormItem->setEnabled(true); + } + if (mPlaceDataFormItem) { + mPlaceDataFormItem->setEnabled(true); + } + if (Qt::Checked == state) { + mNetworkTimeItem->setContentWidgetData( + "checkState", Qt::Unchecked); + } + } + updatePlaceItem(); +} + +/*! + Slot which handles the alarm snooze time changes. + + /param value New index of the alarm snooze time. + */ +void ClockSettingsView::handleAlarmSnoozeTimeChanged(int index) +{ + if (mAlarmSnoozeTimeHash.value(index)) { + mSettingsManager->writeItemValue( + *mAlarmSnoozeTimeKey, mAlarmSnoozeTimeHash.value(index)); + } +} + +/*! + Slot which is called when the value changes in cenrep. + + \param key The key which got changed in cenrep. + \param value The new value of that key. + */ +void ClockSettingsView::eventMonitor( + const XQSettingsKey& key, const QVariant& value) +{ + if (key.uid() == KCRUidClockApp && key.key() == KClockAppSnoozeTime) { + if (mSettingsManager->error() == XQSettingsManager::NoError) { + + bool success; + int alarmSnoozeTime = value.toInt(&success); + + if (success) { + mAlarmSnoozeItem->setContentWidgetData( + "currentIndex", mAlarmSnoozeTimeHash.key( + alarmSnoozeTime)); + } + } + } } // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clocksettingsview/src/settingscustomitem.cpp --- a/clock/clockui/clocksettingsview/src/settingscustomitem.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clocksettingsview/src/settingscustomitem.cpp Fri May 14 15:51:09 2010 +0300 @@ -54,6 +54,8 @@ { // Construct the settignsutility. mSettingsUtility = new SettingsUtility(); + // Construct the timezone client. + mTimezoneClient = TimezoneClient::getInstance(); } /*! @@ -61,7 +63,9 @@ */ SettingsCustomItem::~SettingsCustomItem() { - + if (!mTimezoneClient->isNull()) { + mTimezoneClient->deleteInstance(); + } } /*! @@ -74,16 +78,16 @@ } /*! - + \sa */ bool SettingsCustomItem::canSetModelIndex(const QModelIndex &index) const { - HbDataFormModelItem::DataItemType itemType = + HbDataFormModelItem::DataItemType itemType = static_cast( index.data(HbDataFormModelItem::ItemTypeRole).toInt()); - if(itemType >= HbDataFormModelItem::CustomItemBase && + if(itemType >= HbDataFormModelItem::CustomItemBase && itemType <= (HbDataFormModelItem::CustomItemBase + 50)) { return true; } else { @@ -97,21 +101,21 @@ HbDataFormModelItem::DataItemType itemType = static_cast( modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); - + HbDataFormModel* model = static_cast( static_cast(this)->itemView()->model()); - HbDataFormModelItem* modlItem = model->itemFromIndex(modelIndex()); - + HbDataFormModelItem* modlItem = model->itemFromIndex(modelIndex()); + switch (itemType) { case (TimeItemOffset + HbDataFormModelItem::CustomItemBase): mTimeWidget->setProperty("text", modlItem->contentWidgetData("text")); break; - + case (DateItemOffset + HbDataFormModelItem::CustomItemBase): mDateWidget->setProperty("text", modlItem->contentWidgetData("text")); break; - + case (PlaceItemOffset + HbDataFormModelItem::CustomItemBase): mPlaceWidget->setProperty("text", modlItem->contentWidgetData("text")); break; @@ -176,7 +180,7 @@ this, SLOT(launchRegSettingsView())); return regSettingsItem; } - + case (50 + HbDataFormModelItem::CustomItemBase): { HbListWidget *workdaysItem = new HbListWidget(); @@ -186,7 +190,7 @@ for (int index = 0; index < mWeekdaysList.count(); ++index) { workdaysItem->addItem(mWeekdaysList.at(index)); } - + QString workdaysString = workdaysSetting(); for (int i = 0, index = workdaysString.size() - 1; index >= 0; ++i, index--) { @@ -202,7 +206,7 @@ QItemSelectionModel::Select); } } - + return workdaysItem; } @@ -242,50 +246,51 @@ mTimePickerDialog->setContentWidget(timePicker); timePicker->setTime(QTime::currentTime()); - HbAction *okAction = - new HbAction(QString(hbTrId("txt_common_button_ok")), mTimePickerDialog); - mTimePickerDialog->setPrimaryAction(okAction); - connect( - okAction, SIGNAL(triggered()), - this, SLOT(handleTimeOkAction())); + mOkAction = new HbAction( + QString(hbTrId("txt_common_button_ok")), mTimePickerDialog); + mCancelAction = new HbAction( + QString(hbTrId("txt_common_button_cancel")), mTimePickerDialog); - HbAction *cancelAction = - new HbAction(QString(hbTrId("txt_common_button_cancel")), - mTimePickerDialog); - mTimePickerDialog->setSecondaryAction( cancelAction ); - connect( - cancelAction, SIGNAL(triggered()), - this, SLOT(handleTimeCancelAction())); + mTimePickerDialog->addAction(mOkAction); + mTimePickerDialog->addAction(mCancelAction); - mTimePickerDialog->exec(); + mTimePickerDialog->open(this, SLOT(selectedAction(HbAction*))); } /*! - Handles the ok action of time picker dialog. + Handles the ok action of time/date picker dialog. */ -void SettingsCustomItem::handleTimeOkAction() +void SettingsCustomItem::handleOkAction() { - // Get the time from the time picker. - QTime newTime = static_cast ( - mTimePickerDialog->contentWidget())->time(); + if (mTimePickerDialog) { + // Get the time from the time picker. + QTime newTime = static_cast ( + mTimePickerDialog->contentWidget())->time(); - QString timeFormatString = mSettingsUtility->timeFormatString(); - // Update the display text on form item. - mTimeWidget->setText(newTime.toString(timeFormatString)); - mSettingsUtility->setTime(newTime.toString(timeFormatString)); + QString timeFormatString = mSettingsUtility->timeFormatString(); - // Close the dialog. - handleTimeCancelAction(); -} + // If time returned by the picker is valid, then only update. + if (newTime.isValid()) { + // Update the display text on form item. + mTimeWidget->setText(newTime.toString(timeFormatString)); + // Update the system time. + mTimezoneClient->setDateTime(QDateTime(QDate::currentDate(), newTime)); + } + } else if(mDatePickerDialog) { + // Get the time from the time picker. + QDate newDate = static_cast ( + mDatePickerDialog->contentWidget())->date(); -/*! - Handles the cancel action of time picker dialog. - */ -void SettingsCustomItem::handleTimeCancelAction() -{ - // Close the dialog. - mTimePickerDialog->close(); - mTimePickerDialog->deleteLater(); + QString dateFormatString = mSettingsUtility->dateFormatString(); + + // If date returned by the picker is valid, then only update. + if (newDate.isValid()) { + // Update the display text on form item. + mDateWidget->setText(newDate.toString(dateFormatString)); + // Update the system date. + mTimezoneClient->setDateTime(QDateTime(newDate, QTime::currentTime())); + } + } } /*! @@ -315,50 +320,16 @@ mDatePickerDialog->setContentWidget(datePicker); datePicker->setDate(QDate::currentDate()); - HbAction *okAction = - new HbAction(QString(hbTrId("txt_common_button_ok")), mDatePickerDialog); - mDatePickerDialog->setPrimaryAction(okAction); - connect( - okAction, SIGNAL(triggered()), - this, SLOT(handleDateOkAction())); - - HbAction *cancelAction = - new HbAction(QString(hbTrId("txt_common_button_cancel")), - mDatePickerDialog); - mDatePickerDialog->setSecondaryAction( cancelAction ); - connect( - cancelAction, SIGNAL(triggered()), - this, SLOT(handleDateCancelAction())); - - mDatePickerDialog->exec(); -} + mOkAction = new HbAction( + QString(hbTrId("txt_common_button_ok")), mDatePickerDialog); -/*! - Handles the ok action of date picker dialog. - */ -void SettingsCustomItem::handleDateOkAction() -{ - // Get the time from the time picker. - QDate newDate = static_cast ( - mDatePickerDialog->contentWidget())->date(); + mCancelAction = new HbAction( + QString(hbTrId("txt_common_button_cancel")),mDatePickerDialog); - QString dateFormatString = mSettingsUtility->dateFormatString(); - // Update the display text on form item. - mDateWidget->setText(newDate.toString(dateFormatString)); - mSettingsUtility->setDate(newDate.toString(dateFormatString)); - - // Close the dialog. - handleDateCancelAction(); -} + mDatePickerDialog->addAction(mOkAction); + mDatePickerDialog->addAction(mCancelAction); -/*! - Handles the ok action of date picker dialog. - */ -void SettingsCustomItem::handleDateCancelAction() -{ - // Close the dialog. - mDatePickerDialog->close(); - mDatePickerDialog->deleteLater(); + mDatePickerDialog->open(this, SLOT(selectedAction(HbAction*))); } /*! @@ -382,8 +353,6 @@ void SettingsCustomItem::updatePlaceItem(LocationInfo info) { if (-1 != info.timezoneId) { - // Construct the timezone client. - mTimezoneClient = new TimezoneClient(); mTimezoneClient->setAsCurrentLocationL(info); } } @@ -399,6 +368,16 @@ } /*! + Slot to handle the selected action. + */ +void SettingsCustomItem::selectedAction(HbAction *action) +{ + if (action==mOkAction) { + handleOkAction(); + } +} + +/*! Returns the workdays setting string based on start of week setting. */ QString SettingsCustomItem::workdaysSetting() diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviewmanager/clockviewmanager.pro --- a/clock/clockui/clockviewmanager/clockviewmanager.pro Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviewmanager/clockviewmanager.pro Fri May 14 15:51:09 2010 +0300 @@ -29,7 +29,7 @@ ./inc \ ../clockviews/inc \ ../clockappcontroller/inc \ - ../clockwidget/inc \ + ../clockwidget/clockwidgetimpl/inc \ ../../inc symbian: { @@ -39,7 +39,7 @@ LIBS += \ -lclockviews \ - -lclockwidgetproto + -lclockwidget } SOURCES += \ diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviewmanager/inc/clockviewmanager.h --- a/clock/clockui/clockviewmanager/inc/clockviewmanager.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviewmanager/inc/clockviewmanager.h Fri May 14 15:51:09 2010 +0300 @@ -44,10 +44,12 @@ CLOCKVIEWMANAGER_EXPORT void showView(ClockViews view); private: - void loadViews(); void loadMainView(); void loadWorldClockView(); +private slots: + void loadOtherViews(); + private: ClockAppControllerIf &mAppControllerIf; ClockMainView *mMainView; diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviewmanager/src/clockdocloader.cpp --- a/clock/clockui/clockviewmanager/src/clockdocloader.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviewmanager/src/clockdocloader.cpp Fri May 14 15:51:09 2010 +0300 @@ -15,15 +15,13 @@ * */ -// System includes. -#include - // User includes #include "clockdocloader.h" #include "clockcommon.h" #include "clockmainview.h" -#include "skinnableclock.h" +#include "clockwidget.h" #include "clockworldview.h" +#include "clockhomecityitem.h" /*! \class ClockDocLoader @@ -39,23 +37,23 @@ */ QObject *ClockDocLoader::createObject(const QString &type, const QString &name) { - qDebug() << "clock: ClockDocLoader::createObject -->"; - if (CLOCK_MAIN_VIEW == name) { QObject *object = new ClockMainView(); object->setObjectName(name); return object; } else if (CLOCK_WIDGET == name) { - QObject *object = new SkinnableClock(); + QObject *object = new ClockWidget(); object->setObjectName(name); return object; - } else if (WORLD_CLOCK_VIEW == name) { + } else if (CLOCK_WORLD_VIEW == name) { QObject *object = new ClockWorldView(); object->setObjectName(name); return object; - } - - qDebug() << "clock: ClockDocLoader::createObject <--"; + } else if (CLOCK_WORLD_HOMECITY == name) { + QObject *object = new ClockHomeCityItem(); + object->setObjectName(name); + return object; + } return HbDocumentLoader::createObject(type, name); } diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviewmanager/src/clockviewmanager.cpp --- a/clock/clockui/clockviewmanager/src/clockviewmanager.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviewmanager/src/clockviewmanager.cpp Fri May 14 15:51:09 2010 +0300 @@ -17,7 +17,6 @@ */ // System includes -#include #include #include @@ -44,14 +43,17 @@ ClockViewManager::ClockViewManager( ClockAppControllerIf &controllerIf, QObject *parent) :QObject(parent), - mAppControllerIf(controllerIf) + mAppControllerIf(controllerIf), + mWorldClockView(0) { - qDebug("clock: ClockViewManager::ClockViewManager() -->"); + // Load the main view at the start up. + loadMainView(); - // Load the document and the views. - loadViews(); - - qDebug("clock: ClockViewManager::ClockViewManager() <--"); + // Delay loading of other views till main view is loaded. + HbMainWindow *window = hbInstance->allMainWindows().first(); + connect( + window, SIGNAL(viewReady()), + this, SLOT(loadOtherViews())); } /*! @@ -90,30 +92,10 @@ } /*! - Loads the views from the docml file. - */ -void ClockViewManager::loadViews() -{ - qDebug() << "clock: ClockViewManager::loadViews -->"; - - // Load the main view. - loadMainView(); - // Load the world clock view. - loadWorldClockView(); - - // Set the main view to the window - hbInstance->allMainWindows().first()->addView(mMainView); - - qDebug() << "clock: ClockViewManager::loadViews <--"; -} - -/*! Loads the clock main view. */ void ClockViewManager::loadMainView() { - qDebug() << "clock: ClockViewManager::loadMainView -->"; - bool loadSuccess; // Construct the document loader instance @@ -121,10 +103,6 @@ // Load the application xml. docLoader->load(CLOCK_MAIN_VIEW_DOCML, &loadSuccess); - Q_ASSERT_X( - loadSuccess, - "viewmanager.cpp", - "Unable to load the main view app xml"); // Find the main view. mMainView = static_cast ( @@ -133,7 +111,8 @@ // Setup the view. mMainView->setupView(mAppControllerIf, docLoader); - qDebug() << "clock: ClockViewManager::loadMainView <--"; + // Set the main view to the window + hbInstance->allMainWindows().first()->addView(mMainView); } /*! @@ -147,20 +126,30 @@ bool loadSuccess; // Construct the world list view from doc loader. - docLoader->load(":/xml/worldclockview.docml", &loadSuccess); + docLoader->load(CLOCK_WORLD_VIEW_DOCML, &loadSuccess); // Get the world list view. - mWorldClockView = - static_cast (docLoader->findWidget("worldClockView")); + mWorldClockView = static_cast ( + docLoader->findWidget(CLOCK_WORLD_VIEW)); mWorldClockView->setupView(mAppControllerIf, docLoader); +} -/* // Get the world list widget. - WorldListWidget *listWidget = - qobject_cast (docLoader->findWidget("worldListWidget")); - Q_ASSERT_X(listWidget, - "viewmanager.cpp", "Unable to load the world list widget"); - listWidget->setupWidget(mWorldListView, docLoader);*/ +/*! + Load other views + */ +void ClockViewManager::loadOtherViews() +{ + mMainView->setupAfterViewReady(); + + // Load world clock view + loadWorldClockView(); + + // Disconnect the signal viewReady as all the views are loaded. + HbMainWindow *window = hbInstance->allMainWindows().first(); + disconnect( + window, SIGNAL(viewReady()), + this, SLOT(loadOtherViews())); } // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/clockviews.pro --- a/clock/clockui/clockviews/clockviews.pro Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviews/clockviews.pro Fri May 14 15:51:09 2010 +0300 @@ -30,7 +30,7 @@ ../../clockmw/clocksettingsutility/inc \ ../clocksettingsview/inc \ ../clockalarmeditor/inc \ - ../clockwidget/inc \ + ../clockwidget/clockwidgetimpl/inc \ ../clockcityselectionlist/inc \ ../inc @@ -51,7 +51,8 @@ -lclocksettingsutility \ -lclocksettingsview \ -lclockcityselectionlist \ - -lclockwidgetproto + -lclockwidget \ + -lclockwidgetplugin } SOURCES += \ @@ -59,14 +60,14 @@ clockalarmlistmodel.cpp \ clockalarmlistitemprototype.cpp \ clockworldview.cpp \ - listitemprototype.cpp + clockhomecityitem.cpp HEADERS += \ clockmainview.h \ clockalarmlistmodel.h \ clockalarmlistitemprototype.h \ clockworldview.h \ - listitemprototype.h + clockhomecityitem.h RESOURCES += \ clockviews.qrc diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/data/clockviews.qrc --- a/clock/clockui/clockviews/data/clockviews.qrc Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviews/data/clockviews.qrc Fri May 14 15:51:09 2010 +0300 @@ -2,11 +2,13 @@ style/clockalarmlistitemprototype.css style/clockalarmlistitemprototype.widgetml - style/listitemprototype.css - style/listitemprototype.widgetml + style/clockhomecityitem.css + style/clockhomecityitem.widgetml + style/hblistviewitem.css + style/hblistviewitem.widgetml xml/clockmainview.docml - xml/worldclockview.docml + xml/clockworldview.docml \ No newline at end of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/data/style/clockhomecityitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockviews/data/style/clockhomecityitem.css Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,44 @@ +ClockHomeCityItem{ + layout: homecity-portrait; +} +ClockHomeCityItem:landscape{ + layout: homecity-landscape; +} +ClockHomeCityItem::dayNightIcon{ + top: -var(hb-param-margin-gene-top); + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-middle-horizontal); + bottom: var(hb-param-margin-gene-bottom); + + fixed-height: var(hb-param-graphic-size-primary-large); + fixed-width: var(hb-param-graphic-size-primary-large); +} + +ClockHomeCityItem::dateText{ + top: -var(hb-param-margin-gene-top); + right: var(hb-param-margin-gene-middle-horizontal); + text-height: var(hb-param-text-height-tiny); + text-align: left; +} + +ClockHomeCityItem::cityText{ + top: -var(hb-param-margin-gene-middle-vertical); + right: var(hb-param-margin-gene-middle-horizontal); + text-height: var(hb-param-text-height-primary); + text-align: left; +} + +ClockHomeCityItem::dstIcon{ + top: -var(hb-param-margin-gene-top); + right: var(hb-param-margin-gene-right); + + fixed-height: var(hb-param-graphic-size-secondary); + fixed-width: var(hb-param-graphic-size-secondary); +} + +ClockHomeCityItem::timeText{ + right: var(hb-param-margin-gene-right); + text-height: var(hb-param-text-height-tiny); + text-align: right; + fixed-width: 16un; +} diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/data/style/clockhomecityitem.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockviews/data/style/clockhomecityitem.widgetml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/data/style/hblistviewitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockviews/data/style/hblistviewitem.css Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,64 @@ + +HbListViewItem:portrait{ + layout: citylist-portrait; +} + +HbListViewItem:landscape{ + layout: citylist-landscape; +} + +HbListViewItem::icon-1{ + top: -var(hb-param-margin-gene-top); + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-middle-horizontal); + bottom: var(hb-param-margin-gene-bottom); + + fixed-height: var(hb-param-graphic-size-primary-large); + fixed-width: var(hb-param-graphic-size-primary-large); +} + +HbListViewItem::text-1{ + top: -var(hb-param-margin-gene-top); + right: var(hb-param-margin-gene-middle-horizontal); + text-height: var(hb-param-text-height-tiny); + text-align: left; +} + +HbListViewItem::text-2{ + top: -var(hb-param-margin-gene-middle-vertical); + right: var(hb-param-margin-gene-middle-horizontal); + text-height: var(hb-param-text-height-primary); + text-align: left; +} + +HbListViewItem::text-3:portrait{ + top: -var(hb-param-margin-gene-middle-vertical); + right: var(hb-param-margin-gene-right); + bottom: var(hb-param-margin-gene-bottom); + + text-height: var(hb-param-text-height-tiny); + text-align: left; +} + +HbListViewItem::text-3:landscape{ + right: var(hb-param-margin-gene-right); + + text-height: var(hb-param-text-height-tiny); + text-align: right; + fixed-width: 24un; +} + +HbListViewItem::icon-2{ + top: -var(hb-param-margin-gene-top); + right: var(hb-param-margin-gene-right); + + fixed-height: var(hb-param-graphic-size-secondary); + fixed-width: var(hb-param-graphic-size-secondary); +} + +HbListViewItem::text-4{ + right: var(hb-param-margin-gene-right); + text-height: var(hb-param-text-height-tiny); + text-align: right; + fixed-width: 16un; +} diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/data/style/hblistviewitem.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockviews/data/style/hblistviewitem.widgetml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/data/style/listitemprototype.css --- a/clock/clockui/clockviews/data/style/listitemprototype.css Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -ListItemPrototype[layoutName="custom"]{ - layout: custom; -} - -ListItemPrototype::dayNightIcon[layoutName="custom"]{ - top: -var(hb-param-margin-gene-top); - left: -var(hb-param-margin-gene-left); - - fixed-height: var(hb-param-graphic-size-secondary); - fixed-width: var(hb-param-graphic-size-secondary); -} - -ListItemPrototype::dateText[layoutName="custom"]{ - left: -var(hb-param-margin-gene-left); - top: -var(hb-param-margin-gene-top); - right: var(hb-param-margin-gene-right); - bottom: var(hb-param-margin-gene-bottom); - - text-height: var(hb-param-text-height-tiny); - min-width: 29.7un; -} - -ListItemPrototype::cityText[layoutName="custom"]{ - top: -var(hb-param-margin-gene-middle-vertical); - right: var(hb-param-margin-gene-right); - - text-height: var(hb-param-text-height-primary); - font-variant: primary; - fixed-width: 29.7un; -} - -ListItemPrototype::offsetText[layoutName="custom"]{ - top: -var(hb-param-margin-gene-middle-vertical); - right: 11.5un; - bottom: var(hb-param-margin-gene-bottom); - - text-height: var(hb-param-text-height-tiny); - min-width: 29.7un; -} - -ListItemPrototype::dstIcon[layoutName="custom"]{ - top: -var(hb-param-margin-gene-top); - right: 6.4un; - - fixed-height: var(hb-param-graphic-size-secondary); - fixed-width: var(hb-param-graphic-size-secondary); -} - -ListItemPrototype::timText[layoutName="custom"]{ - top: -var(hb-param-margin-gene-middle-vertical); - right: var(hb-param-margin-gene-right); - - text-height: var(hb-param-text-height-tiny); -} \ No newline at end of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/data/style/listitemprototype.widgetml --- a/clock/clockui/clockviews/data/style/listitemprototype.widgetml Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/data/xml/clockmainview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockviews/data/xml/clockmainview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/data/xml/clockworldview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockviews/data/xml/clockworldview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
+ + + + + + + + +
diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/inc/clockalarmlistitemprototype.h --- a/clock/clockui/clockviews/inc/clockalarmlistitemprototype.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviews/inc/clockalarmlistitemprototype.h Fri May 14 15:51:09 2010 +0300 @@ -21,7 +21,8 @@ // System includes #include -#include +#include +#include // Forward declarations class QGraphicsItem; @@ -48,7 +49,7 @@ private: QGraphicsItem *mParent; - HbPushButton *malarmIconItem; + QPointer malarmIconItem; }; #endif // CLOCKALARMLISTITEMPROTOTYPE_H diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/inc/clockhomecityitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockviews/inc/clockhomecityitem.h Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Header file for ClockHomeCityItem Itemclass + * + */ + +#ifndef CLOCKHOMECITYITEM_H +#define CLOCKHOMECITYITEM_H + +// System includes +#include +#include + +// User include. +#include "clockviewsdefines.h" + +// Forward declaration +class QGraphicsItem; +class HbTextItem; +class HbIconItem; + +class ClockHomeCityItem : public HbWidget +{ + Q_OBJECT + +public: + enum { + DayNightIndicator, + Date, + City, + Dst, + Time + }; + +public: + CLOCKVIEWS_EXPORT ClockHomeCityItem(QGraphicsItem *parent = 0); + CLOCKVIEWS_EXPORT ~ClockHomeCityItem(); + +public: + void setHomeCityItemData(const QVariantMap & itemData); + +private: + QPointer mDateText; + QPointer mCityText; + QPointer mTimeText; + QPointer mDayNightIcon; + QPointer mDstIcon; + +}; + +#endif // CLOCKHOMECITYITEM_H + +// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/inc/clockmainview.h --- a/clock/clockui/clockviews/inc/clockmainview.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviews/inc/clockmainview.h Fri May 14 15:51:09 2010 +0300 @@ -38,8 +38,8 @@ class AlarmClient; class TimezoneClient; class SettingsUtility; -class SkinnableClock; class ClockAlarmListModel; +class ClockWidget; class ClockMainView : public HbView { @@ -52,11 +52,10 @@ public: CLOCKVIEWS_EXPORT void setupView( ClockAppControllerIf &controllerIf, ClockDocLoader *docLoader); - -public slots: - void handleAlarmStatusChanged(int row); + CLOCKVIEWS_EXPORT void setupAfterViewReady(); private slots: + void handleAlarmStatusChanged(int row); void refreshMainView(); void displayWorldClockView(); void addNewAlarm(); @@ -64,15 +63,19 @@ void handleActivated(const QModelIndex &index); void handleLongPress(HbAbstractViewItem *item, const QPointF &coords); void deleteAlarm(); - void updateDateLabel(); - void updatePlaceLabel(); - void updateClockWidget(); + void updateView(); + void updatePlaceLabel(int autoTimeUpdate = -1); void handleAlarmListDisplay(); void checkOrientationAndLoadSection(Qt::Orientation orientation); + void selectedMenuAction(HbAction *action); + void handleMenuClosed(); private: void setmodel(); void hideAlarmList(bool show); + void removeSnoozedAlarm(); + void updateDateLabel(); + void updateClockWidget(); private: QTimer *mTickTimer; @@ -81,10 +84,11 @@ HbAction *mDisplayWorldClockView; HbAction *mAddNewAlarm; HbAction *mSettingsAction; + HbAction *mDeleteAction; HbLabel *mDayLabel; HbLabel *mPlaceLabel; - SkinnableClock *mClockWidget; + ClockWidget *mClockWidget; HbLabel *mNoAlarmLabel; HbListView *mAlarmList; @@ -97,6 +101,7 @@ int mSelectedItem; bool mHideAlarmList; + bool mIsLongTop; }; #endif // CLOCKMAINVIEW_H diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/inc/clockworldview.h --- a/clock/clockui/clockviews/inc/clockworldview.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviews/inc/clockworldview.h Fri May 14 15:51:09 2010 +0300 @@ -32,8 +32,6 @@ class QGraphicsItem; class QStandardItemModel; class QTimer; -class HbLabel; -class HbPushButton; class HbListView; class HbListWidgetItem; class HbAbstractViewItem; @@ -42,6 +40,8 @@ class TimezoneClient; class SettingsUtility; class ClockCitySelectionList; +class HbGroupBox; +class ClockHomeCityItem; class ClockWorldView : public HbView { @@ -57,22 +57,24 @@ private slots: void refreshCityList(); - void updateClockDisplay(); - void updateDayDateInfo(); - void updateCurrentLocationInfo(); + void updateCurrentLocationInfo(int networkTime); void handleItemLongPressed(HbAbstractViewItem *item, const QPointF &coord); void handleAddLocation(); void handleDeleteAction(); void handleSetAsCurrentLocationAction(); void handleCitySelected(LocationInfo info); void showAlarmsView(); - void updateOffsetDifferences(); void refreshWorldView(); - void updateToolbarTexts(Qt::Orientation currentOrientation); + void loadSection(Qt::Orientation orientation); + void updateAllLocationInfo(); + void selectedMenuAction(HbAction *action); private: QModelIndex addCityToList(const LocationInfo& locationInfo); bool isDay(QDateTime dateTime); + QVariantList getCityListDisplayString(const LocationInfo& locationInfo); + QVariantList getCityListDecorationString(const LocationInfo& locationInfo); + void updateCityList(); private: QTimer *mRefreshTimer; @@ -80,14 +82,14 @@ QStandardItemModel *mCityListModel; QPointer mCityListView; - HbLabel *mDayDateLabel; - HbLabel *mPlaceLabel; + ClockHomeCityItem *mHomeCityWidget; HbAction *mAddCityAction; HbAction *mSetCurrentLocationAction; HbAction *mRemoveCityAction; HbAction *mBackAction; HbAction *mShowAlarmsViewAction; HbAction *mDisplayWorldClockView; + HbAction *mAddCityMenuAction; ClockDocLoader *mDocLoader; ClockAppControllerIf *mAppControllerIf; diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/inc/listitemprototype.h --- a/clock/clockui/clockviews/inc/listitemprototype.h Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Header file for class ListItemPrototype. -* -*/ - -#ifndef LISTITEMPROTOTYPE_H -#define LISTITEMPROTOTYPE_H - -// System includes -#include - -// Forward declarations -class QGraphicsItem; -class HbIconItem; -class HbAbstractViewItem; -class HbTextItem; - -class ListItemPrototype : public HbListViewItem -{ - Q_OBJECT - -public: - explicit ListItemPrototype(QGraphicsItem *parent = 0); - virtual ~ListItemPrototype(); - -public: - HbAbstractViewItem* createItem(); - void updateChildItems(); - -private: - HbIconItem *mDayNightIcon; - HbTextItem *mDateText; - HbTextItem *mCityText; - HbTextItem *mOffsetText; - HbIconItem *mDstIcon; - HbTextItem *mTimeText; -}; - -#endif // LISTITEMPROTOTYPE_H - -// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/src/clockalarmlistitemprototype.cpp --- a/clock/clockui/clockviews/src/clockalarmlistitemprototype.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviews/src/clockalarmlistitemprototype.cpp Fri May 14 15:51:09 2010 +0300 @@ -17,7 +17,6 @@ */ // System includes -#include #include // User includes @@ -37,9 +36,7 @@ \parent of type QGraphicsItem. */ ClockAlarmListItemPrototype::ClockAlarmListItemPrototype(QGraphicsItem *parent) -:HbListViewItem(parent), - mParent(parent), - malarmIconItem(0) +:HbListViewItem(parent) { // Nothing yet. } @@ -68,19 +65,11 @@ QString alarmIconPath = alarmIconRole.toString(); if (!malarmIconItem) { malarmIconItem = new HbPushButton(this); - HbStyle::setItemName(malarmIconItem, - QLatin1String("alarmIconItem")); + HbStyle::setItemName( + malarmIconItem, QLatin1String("alarmIconItem")); connect( malarmIconItem, SIGNAL(clicked()), this, SLOT(handleAlarmStatusChanged())); - if (mParent) { - connect( - this, - SIGNAL(alarmStatusHasChanged(int)), - qobject_cast( - static_cast(mParent)), - SLOT(handleAlarmStatusChanged(int))); - } } malarmIconItem->setIcon(alarmIconPath); } @@ -94,7 +83,7 @@ */ ClockAlarmListItemPrototype *ClockAlarmListItemPrototype::createItem() { - return new ClockAlarmListItemPrototype(mParent); + return new ClockAlarmListItemPrototype(*this); } /*! @@ -103,7 +92,8 @@ void ClockAlarmListItemPrototype::handleAlarmStatusChanged() { int row = modelIndex().row(); - emit alarmStatusHasChanged(row); + emit static_cast( + prototype())->alarmStatusHasChanged(row); } // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/src/clockalarmlistmodel.cpp --- a/clock/clockui/clockviews/src/clockalarmlistmodel.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviews/src/clockalarmlistmodel.cpp Fri May 14 15:51:09 2010 +0300 @@ -17,7 +17,6 @@ */ // System includes -#include #include #include @@ -55,8 +54,6 @@ mSourceModel(0), mAppControllerIf(controllerIf) { - qDebug() << "clock: ClockAlarmListModel::ClockAlarmListModel -->"; - // Construct the source model. mSourceModel = new QStandardItemModel(0, 1, this); @@ -74,8 +71,6 @@ connect( mTickTimer, SIGNAL(timeout()), this, SLOT(updateRemainingTime())); - - qDebug() << "clock: ClockAlarmListModel::ClockAlarmListModel <--"; } /*! @@ -83,14 +78,10 @@ */ ClockAlarmListModel::~ClockAlarmListModel() { - qDebug() << "clock: ClockAlarmListModel::~ClockAlarmListModel -->"; - if (mSourceModel) { delete mSourceModel; mSourceModel = 0; } - - qDebug() << "clock: ClockAlarmListModel::~ClockAlarmListModel <--"; } /*! @@ -109,10 +100,6 @@ */ QAbstractItemModel *ClockAlarmListModel::sourceModel() { - qDebug() << "clock: ClockAlarmListModel::sourceModel -->"; - - qDebug() << "clock: ClockAlarmListModel::sourceModel <--"; - return mSourceModel; } @@ -121,8 +108,6 @@ */ void ClockAlarmListModel::populateSourceModel() { - qDebug() << "clock: ClockAlarmListModel::populateSourceModel -->"; - // Clear the model if it has any data already. mSourceModel->clear(); mSourceModel->setColumnCount(1); @@ -153,7 +138,6 @@ // Start the Timer for 1 minute. mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); } - qDebug() << "clock: ClockAlarmListModel::populateSourceModel <--"; } /*! @@ -163,8 +147,6 @@ */ QString ClockAlarmListModel::calculateRemainingTime(AlarmInfo alarmInfo) { - qDebug() << "clock: ClockAlarmListModel::calculateRemainingTime -->"; - QDateTime currentDateTime = QDateTime::currentDateTime(); QDateTime alarmTime = QDateTime( alarmInfo.alarmDateTime, alarmInfo.nextDueTime); @@ -217,8 +199,6 @@ formatTimeNote = hbTrId("txt_clock_main_view_setlabel_in_1days"); timeNote = formatTimeNote.arg(QString::number(dayleft)); } - qDebug() << "clock: ClockAlarmListModel::calculateRemainingTime <--"; - return timeNote; } @@ -264,8 +244,6 @@ */ void ClockAlarmListModel::updateSourceModel(int alarmId) { - qDebug() << "clock: ClockAlarmListModel::updateSourceModel -->"; - Q_UNUSED(alarmId) int alarmInfoCount; int modelCount; @@ -353,8 +331,6 @@ mTickTimer->stop(); } } - - qDebug() << "clock: ClockAlarmListModel::updateSourceModel <--"; } /*! @@ -401,8 +377,6 @@ QStringList ClockAlarmListModel::getDisplayStringListforAlarmItem( AlarmInfo alarmInfo) { - qDebug() << "clock: ClockAlarmListModel::getDisplayStringforAlarmItem -->"; - QStringList displayStringList; QString timeString; if (Snoozed == alarmInfo.alarmState) { @@ -426,7 +400,8 @@ QString remainingTime = calculateRemainingTime(alarmInfo); displayStringList.append(remainingTime); } else { - displayStringList.append(QString(" ")); + // TODO: localization + displayStringList.append(QString("In-active")); } QString alarmDescription = alarmInfo.alarmDesc; @@ -453,9 +428,6 @@ } } displayStringList.append(repeatTypeString); - - qDebug() << "clock: ClockAlarmListModel::getDisplayStringforAlarmItem <--"; - return displayStringList; } @@ -479,22 +451,21 @@ if (Weekly == alarmInfo.repeatType || Daily == alarmInfo.repeatType || Workday == alarmInfo.repeatType) { - displayiconList.append(HbIcon(":/clock/alarm_repeat")); + displayiconList.append(HbIcon("qtg_mono_repeat")); } else { displayiconList.append(QVariant()); } item->setData(displayiconList, Qt::DecorationRole); - // The status. - if (Enabled == alarmInfo.alarmStatus) { - item->setData(QString(":/clock/alarm_active"), AlarmIcon); + + // Set the icon for active/in-active/snoozed alarm. + if (Disabled == alarmInfo.alarmStatus) { + item->setData(QString("qtg_mono_alarm_inactive"), AlarmIcon); + } else if (Snoozed == alarmInfo.alarmState) { + // Change the alarm icon also to alarm snooze icon + item->setData(QString("qtg_mono_alarm_snooze"), AlarmIcon); } else { - item->setData(QString(":/clock/alarm_inactive"), AlarmIcon); - } - - // If the alarm is snoozed. - if (Snoozed == alarmInfo.alarmState) { - // TODO : Change the alarm icon also to alarm snooze icon + item->setData(QString("qtg_mono_alarm"), AlarmIcon); } // The model for the list item will have: @@ -534,24 +505,23 @@ if (Weekly == alarmInfo.repeatType || Daily == alarmInfo.repeatType || Workday == alarmInfo.repeatType) { - displayiconList.append(HbIcon(":/clock/alarm_repeat")); + displayiconList.append(HbIcon("qtg_mono_repeat")); } else { displayiconList.append(QVariant()); } mSourceModel->setData( modelIndex, displayiconList, Qt::DecorationRole); - // The status. - if (Enabled == alarmInfo.alarmStatus) { - mSourceModel->setData( - modelIndex, QString(":/clock/alarm_active"), AlarmIcon); + + // Set the icon for active/in-active/snoozed alarm. + if (Disabled == alarmInfo.alarmStatus) { + mSourceModel->setData(modelIndex, + QString("qtg_mono_alarm_inactive"), AlarmIcon); + } else if (Snoozed == alarmInfo.alarmState) { + // Change the alarm icon also to alarm snooze icon + mSourceModel->setData(modelIndex, + QString("qtg_mono_alarm_snooze"), AlarmIcon); } else { - mSourceModel->setData( - modelIndex, QString(":/clock/alarm_inactive"), AlarmIcon); - } - - // If the alarm is snoozed. - if (Snoozed == alarmInfo.alarmState) { - // TODO : Change the alarm icon also to alarm snooze icon + mSourceModel->setData(modelIndex, QString("qtg_mono_alarm"), AlarmIcon); } // The model for the list item will have: diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/src/clockhomecityitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockviews/src/clockhomecityitem.cpp Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition file for class ClockHomeCityItem. +* +*/ + +// System Includes. +#include +#include +#include +#include +#include +#include + +// User Includes. +#include "clockhomecityitem.h" + +/*! + \class ClockHomeCityItem + + This class creates all the primitives for ClockHomeCityItem item. + */ + +/*! + Constructor. + + \param parent Pointer to QGraphicsItem. + */ +ClockHomeCityItem::ClockHomeCityItem(QGraphicsItem *parent) : +HbWidget(parent) +{ + // Path for widgetml and css files. + HbStyleLoader::registerFilePath(":/style/clockhomecityitem.css"); + HbStyleLoader::registerFilePath(":/style/clockhomecityitem.widgetml"); + + // Set the frame to the homecity widget. + HbFrameItem *frame = new HbFrameItem(); + frame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + frame->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox"); + setBackgroundItem(frame->graphicsItem(), -2); + +} + +/*! + Destructor. + */ +ClockHomeCityItem::~ClockHomeCityItem() +{ + HbStyleLoader::unregisterFilePath(":/style/clockhomecityitem.css"); + HbStyleLoader::unregisterFilePath(":/style/clockhomecityitem.widgetml"); +} + +/*! + Sets the data for HomeCity items. + To set textitem data use Qt::DisplayRole + To set iconitem data use Qt::DecorationRole + \param itemData contains the data for all the primitives. + */ +void ClockHomeCityItem::setHomeCityItemData(const QVariantMap &itemData) +{ + if (!itemData.isEmpty()) { + QMapIterator iter(itemData); + while (iter.hasNext()) { + iter.next(); + int value = iter.key().toInt(); + switch(value) { + case Date: + if (!mDateText) { + mDateText = new HbTextItem(this); + HbStyle::setItemName(mDateText, "dateText"); + } + mDateText->setText(iter.value().toString()); + break; + case City: + if (!mCityText) { + mCityText = new HbTextItem(this); + HbStyle::setItemName(mCityText, "cityText"); + mCityText->setTextWrapping(Hb::TextNoWrap); + } + mCityText->setText(iter.value().toString()); + break; + case Time: + if (!mTimeText) { + mTimeText = new HbTextItem(this); + HbStyle::setItemName(mTimeText, "timeText"); + mTimeText->setTextWrapping(Hb::TextNoWrap); + } + mTimeText->setText(iter.value().toString()); + break; + case DayNightIndicator: + if (!mDayNightIcon) { + mDayNightIcon = new HbIconItem(this); + HbStyle::setItemName(mDayNightIcon, "dayNightIcon"); + } + mDayNightIcon->setIconName(iter.value().toString()); + break; + case Dst: + if (!mDstIcon) { + mDstIcon = new HbIconItem(this); + HbStyle::setItemName(mDstIcon, "dstIcon"); + } + mDstIcon->setIconName(iter.value().toString()); + break; + default: + break; + } + } + repolish(); + } +} + +// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/src/clockmainview.cpp --- a/clock/clockui/clockviews/src/clockmainview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviews/src/clockmainview.cpp Fri May 14 15:51:09 2010 +0300 @@ -18,7 +18,6 @@ // System includes #include -#include #include #include #include @@ -39,8 +38,8 @@ #include "settingsutility.h" #include "timezoneclient.h" #include "clockalarmlistitemprototype.h" -#include "skinnableclock.h" #include "clockalarmlistmodel.h" +#include "clockwidget.h" /*! \class ClockMainView @@ -56,11 +55,10 @@ ClockMainView::ClockMainView(QGraphicsItem *parent) :HbView(parent), mAlarmList(0), - mSelectedItem(-1) + mSelectedItem(-1), + mIsLongTop(false) { - qDebug("clock: ClockMainView::ClockMainView() -->"); - - qDebug("clock: ClockMainView::ClockMainView() <--"); + // Nothing yet. } /*! @@ -68,8 +66,6 @@ */ ClockMainView::~ClockMainView() { - qDebug("clock: ClockMainView::~ClockMainView() -->"); - if (mDocLoader) { delete mDocLoader; mDocLoader = 0; @@ -78,8 +74,11 @@ delete mAlarmListModel; mAlarmListModel = 0; } + HbStyleLoader::unregisterFilePath( + ":/style/clockalarmlistitemprototype.css"); + HbStyleLoader::unregisterFilePath( + ":/style/clockalarmlistitemprototype.widgetml"); - qDebug("clock: ClockMainView::~ClockMainView() <--"); } /*! @@ -92,8 +91,6 @@ void ClockMainView::setupView( ClockAppControllerIf &controllerIf, ClockDocLoader *docLoader) { - qDebug("clock: ClockMainView::setupView() -->"); - mDocLoader = docLoader; mAppControllerIf = &controllerIf; @@ -121,17 +118,6 @@ } int alarmCount = displayInfoList.count(); - - connect( - mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updatePlaceLabel())); - connect( - mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updateDateLabel())); - connect( - mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updateClockWidget())); - HbMainWindow *window = hbInstance->allMainWindows().first(); bool loadSuccess = false; @@ -155,7 +141,9 @@ this, SLOT(handleLongPress(HbAbstractViewItem*, const QPointF&))); - HbStyleLoader::registerFilePath(CLOCK_VIEWS_STYLE_PATH); + HbStyleLoader::registerFilePath(":/style/clockalarmlistitemprototype.css"); + HbStyleLoader::registerFilePath( + ":/style/clockalarmlistitemprototype.widgetml"); setmodel(); // Load the correct section based on orientation. @@ -179,6 +167,36 @@ } } + mDayLabel = static_cast ( + mDocLoader->findObject("dateLabel")); + + mPlaceLabel = static_cast ( + mDocLoader->findObject("placeLabel")); + + + + mClockWidget = static_cast ( + mDocLoader->findObject(CLOCK_WIDGET)); + + // Update the date info. + updateDateLabel(); + // Update the place info. + updatePlaceLabel(mTimezoneClient->timeUpdateOn()); + // Update clock widget display. + updateClockWidget(); + + // Connect to orientation change and load appropriate section. + connect( + window, SIGNAL(orientationChanged(Qt::Orientation)), + this, SLOT(checkOrientationAndLoadSection(Qt::Orientation))); +} + +/*! + To defer the connects and initialization. To be done after the view is drawn. + Should be called in the slot of view ready. + */ +void ClockMainView::setupAfterViewReady() +{ // Get the toolbar/menu actions. mRefreshMainView = static_cast ( mDocLoader->findObject("alarmsAction")); @@ -202,48 +220,23 @@ mAddNewAlarm, SIGNAL(triggered()), this, SLOT(addNewAlarm())); - if (Qt::Vertical == currentOrienation) { - // Remove toolbar item's texts as only icons are shown. - // TODO to use text ids from ts file. - mRefreshMainView->setText(tr("")); - mDisplayWorldClockView->setText(tr("")); - mAddNewAlarm->setText(""); - } else if (Qt::Horizontal == currentOrienation) { - // Display toolbar item's texts - // TODO to use text ids from ts file. - mRefreshMainView->setText(tr("Alarms")); - mDisplayWorldClockView->setText(tr("World clock")); - mAddNewAlarm->setText("New alarm"); - } - mSettingsAction = static_cast ( mDocLoader->findObject("settingsAction")); connect( mSettingsAction, SIGNAL(triggered()), this, SLOT(openSettings())); - mDayLabel = static_cast ( - mDocLoader->findObject("dateLabel")); - - mPlaceLabel = static_cast ( - mDocLoader->findObject("placeLabel")); - - mClockWidget = static_cast ( - mDocLoader->findObject("clockWidget")); - - // Update the date info. - updateDateLabel(); - // Update the place info. - updatePlaceLabel(); - // Update clock widget display. - updateClockWidget(); - - // Connect to orientation change and load appropriate section. + // Connect the necessary timezone client call backs. + connect( + mTimezoneClient, SIGNAL(timechanged()), + this, SLOT(updateView())); connect( - window, SIGNAL(orientationChanged(Qt::Orientation)), - this, SLOT(checkOrientationAndLoadSection(Qt::Orientation))); - - qDebug("clock: ClockMainView::setupView() <--"); + mTimezoneClient, SIGNAL(autoTimeUpdateChanged(int)), + this, SLOT(updatePlaceLabel(int))); + connect( + mTimezoneClient, SIGNAL(cityUpdated()), + this, SLOT(updatePlaceLabel())); + } /*! @@ -254,13 +247,15 @@ */ void ClockMainView::handleAlarmStatusChanged(int row) { - qDebug() << "clock: ClockMainView::handleAlarmStatusChanged -->"; + AlarmInfo alarmInfo; // Get the data for the alarm. QList alarmData = mAlarmListModel->sourceModel()->index(row, 0).data( AlarmDetails).toList(); - int alarmStatus = alarmData.at(2).value(); + int alarmId = alarmData.at(0).value(); + + mAlarmClient->getAlarmInfo(alarmId, alarmInfo); mSelectedItem = row; @@ -272,19 +267,27 @@ QString displayNote; // Activate or deactivate the alarm depending on the alarm status. // Display the NotificationDialog with appropriate message. - if (!alarmStatus) { + if (Snoozed == alarmInfo.alarmState && Enabled == alarmInfo.alarmStatus + && Once != alarmInfo.repeatType) { + removeSnoozedAlarm(); + displayNote.append(tr("Snoozed alarm removed")); + }else if (Enabled == alarmInfo.alarmStatus) { mAlarmClient->toggleAlarmStatus(alarmId, Disabled); - displayNote.append(hbTrId("txt_clock_main_view_dpopinfo_alarm_deactivated")); - HbNotificationDialog::launchDialog(displayNote); + displayNote.append( + hbTrId("txt_clock_main_view_dpopinfo_alarm_deactivated")); } else { mAlarmClient->toggleAlarmStatus(alarmId, Enabled); - displayNote.append(hbTrId("txt_clock_main_view_dpopinfo_alarm_activated")); - HbNotificationDialog::launchDialog(displayNote); + displayNote.append( + hbTrId("txt_clock_main_view_dpopinfo_alarm_activated")); } + + HbNotificationDialog *dialog = new HbNotificationDialog(); + dialog->setTitle(displayNote); + dialog->setTimeout(HbPopup::ConfirmationNoteTimeout); + dialog->show(); + mSelectedItem = -1; } - - qDebug() << "clock: ClockMainView::handleAlarmStatusChanged <--"; } /*! @@ -293,10 +296,8 @@ */ void ClockMainView::refreshMainView() { - qDebug() << "clock: ClockMainView::refreshMainView -->"; mRefreshMainView->setChecked(true); - qDebug() << "clock: ClockMainView::refreshMainView <--"; } /*! @@ -305,11 +306,8 @@ */ void ClockMainView::displayWorldClockView() { - qDebug() << "clock: ClockMainView::displayWorldClockView -->"; - mAppControllerIf->switchToView(WorldClock); - qDebug() << "clock: ClockMainView::displayWorldClockView <--"; } /*! @@ -318,16 +316,8 @@ */ void ClockMainView::addNewAlarm() { - qDebug() << "clock: ClockMainView::addNewAlarm -->"; - - ClockAlarmEditor *alarmEditor = new ClockAlarmEditor(); + ClockAlarmEditor *alarmEditor = new ClockAlarmEditor(*mAlarmClient); alarmEditor->showAlarmEditor(); - - connect( - alarmEditor, SIGNAL(alarmSet()), - this, SLOT(handleAlarmSet())); - - qDebug() << "clock: ClockMainView::addNewAlarm <--"; } /*! @@ -336,13 +326,9 @@ */ void ClockMainView::openSettings() { - qDebug() << "clock: ClockMainView::openSettings -->"; - // Create the settings view. ClockSettingsView *settingsView = new ClockSettingsView(this); settingsView->loadSettingsView(); - - qDebug() << "clock: ClockMainView::openSettings <--"; } /*! @@ -352,23 +338,18 @@ */ void ClockMainView::handleActivated(const QModelIndex &index) { - qDebug() << "clock: ClockMainView::handleActivated -->"; - - // Get the data for the alarm. - int row = index.row(); - QList alarmData = - mAlarmListModel->sourceModel()->index(row, 0).data( - AlarmDetails).toList(); - int alarmId = alarmData.at(0).value(); + if(!mIsLongTop) {// Get the data for the alarm. + int row = index.row(); + QList alarmData = + mAlarmListModel->sourceModel()->index(row, 0).data( + AlarmDetails).toList(); + int alarmId = alarmData.at(0).value(); - // Construct the alarm editor. - ClockAlarmEditor *alarmEditor = new ClockAlarmEditor(alarmId); - alarmEditor->showAlarmEditor(); - connect( - alarmEditor, SIGNAL(alarmSet()), - this, SLOT(handleAlarmSet())); - - qDebug() << "clock: ClockMainView::handleActivated <--"; + // Construct the alarm editor. + ClockAlarmEditor *alarmEditor = new ClockAlarmEditor( + *mAlarmClient, alarmId); + alarmEditor->showAlarmEditor(); + } } /*! @@ -381,8 +362,7 @@ void ClockMainView::handleLongPress( HbAbstractViewItem *item, const QPointF &coords) { - qDebug() << "clock: ClockMainView::handleLongPress -->"; - + mIsLongTop = true; AlarmInfo alarmInfo; // Save the item row number where the long press was made. @@ -398,16 +378,17 @@ // On long press we display item specific context menu. HbMenu *itemContextMenu = new HbMenu(); + connect( + itemContextMenu,SIGNAL(aboutToClose()), + this, SLOT(handleMenuClosed())); // Add the delete action to the context menu. - HbAction *deleteAction = itemContextMenu->addAction( - hbTrId("txt_clk_main_view_menu_delete_alarm")); - connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteAlarm())); + mDeleteAction = itemContextMenu->addAction( + hbTrId("txt_clk_main_view_menu_delete_alarm")); // Show the menu. - itemContextMenu->exec(coords); - - qDebug() << "clock: ClockMainView::handleLongPress <--"; + itemContextMenu->open(this, SLOT(selectedMenuAction(HbAction*))); + itemContextMenu->setPreferredPos(coords); } /*! @@ -416,8 +397,6 @@ */ void ClockMainView::deleteAlarm() { - qDebug() << "clock: ClockMainView::deleteAlarm -->"; - if (-1 < mSelectedItem) { // Get the data for the alarm. QList alarmData = mAlarmListModel->sourceModel()-> @@ -426,41 +405,44 @@ mAlarmClient->deleteAlarm(alarmId); mSelectedItem = -1; } - - qDebug() << "clock: ClockMainView::deleteAlarm <--"; } /*! - Updates the day and date in the day label. + Deltes the snoozed alarm. */ -void ClockMainView::updateDateLabel() +void ClockMainView::removeSnoozedAlarm() { - qDebug() << "clock: ClockMainView::updateDateLabel -->"; + if (-1 < mSelectedItem) { + // Get the data for the alarm. + QList alarmData = mAlarmListModel->sourceModel()-> + index(mSelectedItem, 0).data(AlarmDetails).toList(); + int alarmId = alarmData.at(0).value(); + mAlarmClient->deleteSnoozedAlarm(alarmId); + mSelectedItem = -1; + } +} - // Get the current datetime. - QDateTime dateTime = QDateTime::currentDateTime(); - // Get the day name. - QString dayName = dateTime.toString("dddd"); - // Get the date in correct format. - QString currentDate = mSettingsUtility->date(); - // Construct the day + date string. - QString dayDateString; - dayDateString+= dayName; - dayDateString += " "; - dayDateString += currentDate; - - mDayLabel->setPlainText(dayDateString); - - qDebug() << "clock: ClockMainView::updateDateLabel <--"; +void ClockMainView::updateView() +{ + // Update the place label. + updatePlaceLabel(mTimezoneClient->timeUpdateOn()); + // Update date label. + updateDateLabel(); + // Update clock widget. + updateClockWidget(); } /*! - Updates the zone info in the place label. + Slot which gets called for value change in auto time update in cenrep. + + \param autoTimeUpdate Value of auto time update. */ -void ClockMainView::updatePlaceLabel() +void ClockMainView::updatePlaceLabel(int autoTimeUpdate) { - qDebug() << "clock: MainViewWidget::updateClockZoneInfo -->"; - + if (-1 == autoTimeUpdate) { + autoTimeUpdate = mTimezoneClient->timeUpdateOn(); + } + // Get the current zone info. LocationInfo currentZoneInfo = mTimezoneClient->getCurrentZoneInfoL(); @@ -498,13 +480,13 @@ } else { gmtOffset += QString::number(offsetInMinutes); } - + // Append space. gmtOffset += tr(" "); - + // Append GMT sting. gmtOffset += hbTrId("txt_common_common_gmt"); - + // Append space. gmtOffset += tr(" "); @@ -515,7 +497,7 @@ // Update the labels with the correct info. mPlaceLabel->clear(); - if (mTimezoneClient->timeUpdateOn()) { + if(autoTimeUpdate) { mPlaceLabel->setPlainText( currentZoneInfo.countryName + tr(" ") + gmtOffset); } else { @@ -523,20 +505,6 @@ currentZoneInfo.cityName + tr(", ") + currentZoneInfo.countryName + tr(" ") + gmtOffset); } - - qDebug() << "clock: MainViewWidget::updateDayDateInfo <--"; -} - -/*! - Updates the clock widget display. - */ -void ClockMainView::updateClockWidget() -{ - qDebug() << "clock: ClockMainView::updateClockWidget -->"; - - mClockWidget->updateDisplay(true); - - qDebug() << "clock: ClockMainView::updateClockWidget <--"; } /*! @@ -544,8 +512,6 @@ */ void ClockMainView::handleAlarmListDisplay() { - qDebug() << "clock: ClockMainView::handleAlarmListDisplay -->"; - // Get the list of pending clock alarms from server. QList alarmInfoList; QList displayInfoList; @@ -567,48 +533,6 @@ } } - qDebug() << "clock: ClockMainView::handleAlarmListDisplay <--"; -} - -/*! - Sets the model to the alarm list. - */ -void ClockMainView::setmodel() -{ - qDebug() << "clock: ClockMainView::setmodel -->"; - - // Set the model. - if (mAlarmList) { - mAlarmList->setModel(mAlarmListModel->sourceModel()); - ClockAlarmListItemPrototype *listItemPrototype = - new ClockAlarmListItemPrototype(this); - mAlarmList->setItemPrototype(listItemPrototype); - mAlarmList->setLayoutName("layout-alarmlist"); - } - - qDebug() << "clock: ClockMainView::setmodel <--"; -} - -/*! - Hides the alarmlist in the main view. - - \param hide 'true' if alarm list is to be hidden. - */ -void ClockMainView::hideAlarmList(bool hide) -{ - qDebug() << "clock: ClockMainView::hideAlarmList -->"; - - if (hide) { - mNoAlarmLabel->show(); - mAlarmList->hide(); - mHideAlarmList = true; - } else { - mAlarmList->show(); - mNoAlarmLabel->hide(); - mHideAlarmList = false; - } - - qDebug() << "clock: ClockMainView::hideAlarmList <--"; } /*! @@ -619,31 +543,16 @@ void ClockMainView::checkOrientationAndLoadSection( Qt::Orientation orientation) { - qDebug() << "clock: ClockMainView::checkOrientationAndLoadSection -->"; - bool success; // If horizontal, load the landscape section. if (Qt::Horizontal == orientation) { mDocLoader->load( CLOCK_MAIN_VIEW_DOCML, CLOCK_MAIN_VIEW_LANDSCAPE_SECTION, &success); - - // Display toolbar item's texts - // TODO have to use text ids from ts file. - mRefreshMainView->setText(tr("Alarms")); - mDisplayWorldClockView->setText(tr("World clock")); - mAddNewAlarm->setText("New alarm"); - } else { mDocLoader->load( CLOCK_MAIN_VIEW_DOCML, CLOCK_MAIN_VIEW_PORTRAIT_SECTION, &success); - - // Remove toolbar item's texts as only icons are shown. - // TODO have to use text ids from ts file. - mRefreshMainView->setText(tr("")); - mDisplayWorldClockView->setText(tr("")); - mAddNewAlarm->setText(""); } if(success) { @@ -656,8 +565,96 @@ hideAlarmList(false); } } +} - qDebug() << "clock: ClockMainView::checkOrientationAndLoadSection <--"; +/*! + Slot to handle context menu actions. + */ +void ClockMainView::selectedMenuAction(HbAction *action) +{ + if (action == mDeleteAction) { + deleteAlarm(); + } +} + +/*! + Slot to handle the context menu closed. + */ +void ClockMainView::handleMenuClosed() +{ + mIsLongTop = false; +} +/*! + Sets the model to the alarm list. + */ +void ClockMainView::setmodel() +{ + // Set the model. + if (mAlarmList) { + mAlarmList->setModel(mAlarmListModel->sourceModel()); + ClockAlarmListItemPrototype *listItemPrototype = + new ClockAlarmListItemPrototype(); + connect( + listItemPrototype, SIGNAL(alarmStatusHasChanged(int)), + this, SLOT(handleAlarmStatusChanged(int))); + mAlarmList->setItemPrototype(listItemPrototype); + mAlarmList->setLayoutName("layout-alarmlist"); + } + +} + +/*! + Hides the alarmlist in the main view. + + \param hide 'true' if alarm list is to be hidden. + */ +void ClockMainView::hideAlarmList(bool hide) +{ + if (hide) { + mNoAlarmLabel->show(); + mAlarmList->hide(); + mHideAlarmList = true; + } else { + mAlarmList->show(); + mNoAlarmLabel->hide(); + mHideAlarmList = false; + } +} + +/*! + Updates the day and date in the day label. + */ +void ClockMainView::updateDateLabel() +{ + // Get the current datetime. + QDateTime dateTime = QDateTime::currentDateTime(); + // Get the day name. + QString dayName = dateTime.toString("ddd"); + // Get the date in correct format. + QString currentDate = mSettingsUtility->date(); + // Construct the day + date string. + QString dayDateString; + dayDateString+= dayName; + dayDateString += " "; + dayDateString += currentDate; + + mDayLabel->setPlainText(dayDateString); +} + +/*! + Updates the zone info in the place label. + */ +/*void ClockMainView::updatePlaceLabel() +{ + updatePlaceLabel(mTimezoneClient->timeUpdateOn()); +}*/ + +/*! + Updates the clock widget display. + */ +void ClockMainView::updateClockWidget() +{ + mClockWidget->updateTime(); } // End of file --Don't remove. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/src/clockworldview.cpp --- a/clock/clockui/clockviews/src/clockworldview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockviews/src/clockworldview.cpp Fri May 14 15:51:09 2010 +0300 @@ -20,10 +20,7 @@ #include #include #include -#include #include -#include -#include #include #include #include @@ -38,7 +35,7 @@ #include "settingsutility.h" #include "timezoneclient.h" #include "clockcityselectionlist.h" -#include "listitemprototype.h" +#include "clockhomecityitem.h" /*! \class ClockWorldView @@ -55,8 +52,6 @@ :HbView(parent), mSelectedItem(-1) { - qDebug("clock: ClockWorldView::ClockWorldView() -->"); - // Timer for updating list data upon time change/update. mRefreshTimer = new QTimer(); connect( @@ -65,8 +60,6 @@ // Create the model. mCityListModel = new QStandardItemModel(); - - qDebug("clock: ClockWorldView::ClockWorldView() <--"); } /*! @@ -74,13 +67,13 @@ */ ClockWorldView::~ClockWorldView() { - qDebug("clock: ClockWorldView::~ClockWorldView() -->"); - if (mDocLoader) { delete mDocLoader; + mDocLoader = 0; } - - qDebug("clock: ClockWorldView::~ClockWorldView() <--"); + HbStyleLoader::unregisterFilePath(":/style/hblistviewitem.css"); + HbStyleLoader::unregisterFilePath( + ":/style/hblistviewitem.widgetml"); } /*! @@ -94,8 +87,6 @@ ClockAppControllerIf &controllerIf, ClockDocLoader *docLoader) { - qDebug("clock: ClockWorldView::setupView() <--"); - mDocLoader = docLoader; mAppControllerIf = &controllerIf; @@ -105,50 +96,43 @@ // Establish required connections. connect( mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updateClockDisplay())); - connect( - mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updateDayDateInfo())); + this, SLOT(updateAllLocationInfo())); connect( - mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updateCurrentLocationInfo())); + mTimezoneClient, SIGNAL(autoTimeUpdateChanged(int)), + this, SLOT(updateCurrentLocationInfo(int))); connect( - mTimezoneClient, SIGNAL(timechanged()), - this, SLOT(updateCurrentZoneInfo())); + mTimezoneClient, SIGNAL(cityUpdated()), + this, SLOT(updateAllLocationInfo())); mDisplayWorldClockView = static_cast ( - mDocLoader->findObject("worldClockAction")); + mDocLoader->findObject("worldClockAction")); mDisplayWorldClockView->setCheckable(true); mDisplayWorldClockView->setChecked(true); connect( - mDisplayWorldClockView, SIGNAL(changed()), - this, SLOT(refreshWorldView())); + mDisplayWorldClockView, SIGNAL(changed()), + this, SLOT(refreshWorldView())); // Get the currently added locations to the list. mCityInfoList = mTimezoneClient->getSavedLocations(); - // Create the custom prototype. - ListItemPrototype *customPrototype = new ListItemPrototype(); + // Get the homecity widget. + mHomeCityWidget = qobject_cast( + mDocLoader->findWidget(CLOCK_WORLD_HOMECITY)); + + // Get the city list item. mCityListView = qobject_cast ( - mDocLoader->findWidget("worldClockCityListView")); - HbStyleLoader::registerFilePath(":/style/"); + mDocLoader->findWidget(CLOCK_WORLD_CITYLIST)); + HbStyleLoader::registerFilePath(":/style/hblistviewitem.css"); + HbStyleLoader::registerFilePath( + ":/style/hblistviewitem.widgetml"); + mCityListView->setLayoutName("citylist-portrait"); mCityListView->setModel(mCityListModel); - mCityListView->setItemPrototype(customPrototype); - mCityListView->setLayoutName("custom"); - - mPlaceLabel = - qobject_cast (mDocLoader->findWidget("placeLabel")); -// mPlaceLabel->setTextWrapping(Hb::TextWordWrap); - - mDayDateLabel = - qobject_cast (mDocLoader->findWidget("dateLabel")); - + // Get the toolbar/menu actions. mAddCityAction = static_cast ( mDocLoader->findObject("addCityAction")); - mAddCityAction->setIcon(HbIcon(":/clock/add_new_city.svg")); connect( mAddCityAction, SIGNAL(triggered()), this, SLOT(handleAddLocation())); @@ -159,13 +143,11 @@ mShowAlarmsViewAction, SIGNAL(triggered()), this, SLOT(showAlarmsView())); - HbMainWindow *window; - window = hbInstance->allMainWindows().first(); - updateToolbarTexts(window->orientation()); + HbMainWindow *window = hbInstance->allMainWindows().first(); connect( window, SIGNAL(orientationChanged(Qt::Orientation)), - this, SLOT(updateToolbarTexts(Qt::Orientation))); + this, SLOT(loadSection(Qt::Orientation))); if (mCityInfoList.count() > 0) { // There is atleast one city. Refresh needed. @@ -175,25 +157,34 @@ mRefreshTimer->start(after * 1000); } - // Update the date and day info. - updateDayDateInfo(); - connect( mCityListView, SIGNAL(longPressed(HbAbstractViewItem *, const QPointF &)), this, SLOT(handleItemLongPressed(HbAbstractViewItem *, const QPointF &))); + // Update current location info. + updateCurrentLocationInfo(mTimezoneClient->timeUpdateOn()); + // Populate the list. - int index = 0; - // Update current location info. - updateCurrentLocationInfo(); - - for (; index < mCityInfoList.count(); index++) { + for (int index = 0; index < mCityInfoList.count(); index++) { addCityToList(mCityInfoList.at(index)); } + + // Adding the "Add city" in options menu. + mAddCityMenuAction = new HbAction( + QString(hbTrId("txt_clock_opt_add_city")),this); + menu()->addAction(mAddCityMenuAction); + mAddCityMenuAction->setVisible(true); + connect( + mAddCityMenuAction, SIGNAL(triggered()), + this, SLOT(handleAddLocation())); - qDebug("clock: ClockWorldView::setupView() <--"); + // Check for disabling of addCityAction in view toolbar. + if ((KMaximumCityListCount-1) == mCityInfoList.count()) { + mAddCityAction->setEnabled(false); + mAddCityMenuAction->setVisible(false); + } } /*! @@ -201,46 +192,19 @@ */ void ClockWorldView::refreshCityList() { + updateCurrentLocationInfo(mTimezoneClient->timeUpdateOn()); int cityInfoCount = mCityInfoList.count(); if (cityInfoCount) { QStandardItem *item = 0; for (int infoIndex = 0; infoIndex < cityInfoCount; infoIndex++) { item = mCityListModel->item(infoIndex); - - QDateTime dateTime = QDateTime::currentDateTime(); - dateTime = dateTime.toUTC(); - dateTime = dateTime.addSecs( - mCityInfoList.at(infoIndex).zoneOffset * 60); - - // Display day/night indicators. - QString dayNightIconPath = ""; - if (isDay(dateTime)) { - dayNightIconPath = ":/clock/day"; - } else { - dayNightIconPath = ":/clock/night"; - } - item->setData(dayNightIconPath, Qt::UserRole + 1000); - - // Update the date info. - QString dateInfo = dateTime.toString( - mSettingsUtility->dateFormatString()); - if (dateTime.date() == QDate::currentDate()) { - dateInfo = tr("Today"); - } - item->setData(dateInfo, Qt::UserRole + 1001); - - // Set the DST icon. - QString dstIconPath = ""; - if (mCityInfoList.at(infoIndex).dstOn) { - dstIconPath = ":/clock/dst_icon"; - } - item->setData(dstIconPath, Qt::UserRole + 1004); - - // Update the time info. - QString timeInfo = dateTime.toString( - mSettingsUtility->timeFormatString()); - item->setData(timeInfo, Qt::UserRole + 1005); + item->setData( + getCityListDisplayString(mCityInfoList.at(infoIndex)), + Qt::DisplayRole); + item->setData( + getCityListDecorationString(mCityInfoList.at(infoIndex)), + Qt::DecorationRole); } // Start the timer again for one minute. @@ -249,101 +213,64 @@ } /*! - Updates the clock display. + Updates the current location info. */ -void ClockWorldView::updateClockDisplay() -{ -// mSkinnableClock->updateDisplay(true); -} - -/*! - Updates the day-date info. - */ -void ClockWorldView::updateDayDateInfo() +void ClockWorldView::updateCurrentLocationInfo(int networkTime) { - // Get the current datetime. - QDateTime dateTime = QDateTime::currentDateTime(); - QString dayName = dateTime.toString("dddd"); + HbMainWindow *window = hbInstance->allMainWindows().first(); + Qt::Orientation currentOrienation = window->orientation(); + loadSection(currentOrienation); + + if (!networkTime) { + // Get the updated home city. + LocationInfo homeCity = mTimezoneClient->getCurrentZoneInfoL(); + + QMap itemList; + QString value; + QDateTime dateTime = QDateTime::currentDateTime(); + + // Show the date. If date is current date then show 'today'. + QString dateInfo = dateTime.toString( + mSettingsUtility->dateFormatString()); + itemList.insert(value.setNum(ClockHomeCityItem::Date), dateInfo); + + // Show the city and country name. + QString placeInfo = + homeCity.cityName + tr(", ") + homeCity.countryName; + itemList.insert(value.setNum(ClockHomeCityItem::City), placeInfo); - QString currentDate = mSettingsUtility->date(); - // Construct the day + date string. - QString dayDateString; - dayDateString+= dayName; - dayDateString += " "; - dayDateString += currentDate; + // Show the time at that location. + QString timeInfo = dateTime.toString( + mSettingsUtility->timeFormatString()); + itemList.insert(value.setNum(ClockHomeCityItem::Time), timeInfo); - mDayDateLabel->clear(); - mDayDateLabel->setPlainText(dayDateString); + // TODO: Use the home city specific icons. + // Display day/night indicators. + QString dayNightIconPath = ""; + if (isDay(dateTime)) { + dayNightIconPath = "qtg_large_clock"; + } else { + dayNightIconPath = "qtg_large_clock"; + } + itemList.insert(value.setNum( + ClockHomeCityItem::DayNightIndicator), dayNightIconPath); + + // Show dst icon when needed. + if (homeCity.dstOn) { + QString dstIconPath = "qtg_mono_day_light_saving_time"; + itemList.insert(value.setNum(ClockHomeCityItem::Dst), dstIconPath); + } + mHomeCityWidget->setHomeCityItemData(itemList); + } } /*! - Updates the current location info. - */ -void ClockWorldView::updateCurrentLocationInfo() -{ - // Get the updated home city. - LocationInfo homeCity = mTimezoneClient->getCurrentZoneInfoL(); - - // Construct the GMT +/- X string. - QString gmtOffset; - - int utcOffset = homeCity.zoneOffset; - int offsetInHours (utcOffset/60); - int offsetInMinutes (utcOffset%60); - - // Check wether the offset is +ve or -ve. - if (0 < utcOffset) { - // We have a positive offset. Append the '+' character. - gmtOffset += tr(" +"); - } else if (0 > utcOffset) { - // We have a negative offset. Append the '-' character. - gmtOffset += tr(" -"); - offsetInHours = -offsetInHours; - } else { - // We dont have an offset. We are at GMT zone. - } - - // Append the hour component. - gmtOffset += QString::number(offsetInHours); - - // Get the time separator from settings and append it. - QStringList timeSeparatorList; - int index = mSettingsUtility->timeSeparator(timeSeparatorList); - gmtOffset += timeSeparatorList.at(index); + Handles the long press on each item in the citylist. + Displays a list item specific context menu. - // Append the minute component. - // If minute component is less less than 10, append a '00' - if (0 <= offsetInMinutes && offsetInMinutes < 10) { - gmtOffset += tr("00"); - } else { - gmtOffset += QString::number(offsetInMinutes); - } - - // Append space. - gmtOffset += tr(" "); - - // Append GMT sting. - gmtOffset += hbTrId("txt_common_common_gmt"); - - // Append space. - gmtOffset += tr(" "); - - // Append DST info. - if (homeCity.dstOn) { - gmtOffset += hbTrId("txt_common_setlabel_dst"); - } - - // Set the city and country name . - mPlaceLabel->clear(); - if (mTimezoneClient->timeUpdateOn()) { - mPlaceLabel->setPlainText(homeCity.countryName + tr(" ") + gmtOffset); - } else { - mPlaceLabel->setPlainText( - homeCity.cityName + tr(", ") + homeCity.countryName - + tr(" ") + gmtOffset); - } -} - + \param item The HbAbstractViewItem that was long pressed. + \param coords The position where mouse was pressed. + */ void ClockWorldView::handleItemLongPressed( HbAbstractViewItem *item, const QPointF &coords) { @@ -355,19 +282,13 @@ // Add the actions to the context menu. mSetCurrentLocationAction = itemContextMenu->addAction( - hbTrId("txt_clk_menu_set_as_current_location")); + hbTrId("txt_clk_menu_set_as_current_location")); mRemoveCityAction = itemContextMenu->addAction( - hbTrId("txt_clk_menu_delete")); - - connect( - mSetCurrentLocationAction, SIGNAL(triggered()), - this, SLOT(handleSetAsCurrentLocationAction())); - connect( - mRemoveCityAction, SIGNAL(triggered()), - this, SLOT(handleDeleteAction())); + hbTrId("txt_clk_menu_delete")); // Show the menu. - itemContextMenu->exec(coords); + itemContextMenu->open(this, SLOT(selectedMenuAction(HbAction*))); + itemContextMenu->setPreferredPos(coords); } /*! @@ -393,14 +314,10 @@ void ClockWorldView::handleDeleteAction() { if (-1 != mSelectedItem) { - int temp = mCityListModel->rowCount(); - QStandardItem *item = mCityListModel->takeItem(mSelectedItem); mCityListModel->removeRow(mSelectedItem); delete item; - temp = mCityListModel->rowCount(); - mCityInfoList.removeAt(mSelectedItem); mSelectedItem = -1; @@ -410,6 +327,10 @@ if (mCityInfoList.count() <= 0) { // No need to refresh the list anymore. mRefreshTimer->stop(); + } else if (mCityInfoList.count() < (KMaximumCityListCount-1) && + !mAddCityAction->isEnabled()) { + mAddCityAction->setEnabled(true); + mAddCityMenuAction->setVisible(true); } } } @@ -419,66 +340,37 @@ */ void ClockWorldView::handleSetAsCurrentLocationAction() { + // Get the info of the selected item. + LocationInfo newHomeCity = mCityInfoList[mSelectedItem]; + // Check if time update is set to ON. // If yes, reset it to OFF and change the home location. if (mTimezoneClient->timeUpdateOn()) { mTimezoneClient->setTimeUpdateOn(false); + + QStandardItem *item = mCityListModel->takeItem(mSelectedItem); + mCityListModel->removeRow(mSelectedItem); + delete item; + + mCityInfoList.removeAt(mSelectedItem); } else { // The current location and home city should be swapped. // Store the info of current home city. LocationInfo oldHomeCity = mTimezoneClient->getCurrentZoneInfoL(); - // Get the info of the selected item. - LocationInfo newHomeCity = mCityInfoList[mSelectedItem]; - - QStandardItem *cityItem = mCityListModel->item(mSelectedItem); - QDateTime dateTime = QDateTime::currentDateTime(); - - // Display day/night indicators. - QString dayNightIconPath = ""; - if (isDay(dateTime)) { - dayNightIconPath = ":/clock/day"; - } else { - dayNightIconPath = ":/clock/night"; - } - cityItem->setData(dayNightIconPath, Qt::UserRole + 1000); - - // Date. - QString dateString = dateTime.toString( - mSettingsUtility->dateFormatString()); - if (dateTime.date() == QDate::currentDate()) { - dateString = tr("Today"); - } - cityItem->setData(dateString, Qt::UserRole + 1001); - - // The city/country name. - QString placeInfo = - oldHomeCity.cityName + tr(", ") + oldHomeCity.countryName; - cityItem->setData(placeInfo, Qt::UserRole + 1002); - - // Dst icon. - QString dstIconPath = ""; - if (oldHomeCity.dstOn) { - dstIconPath = ":/clock/dst_icon"; - } - cityItem->setData(dstIconPath, Qt::UserRole + 1004); - - // Time. - QString timeString = dateTime.toString( - mSettingsUtility->timeFormatString()); - cityItem->setData(timeString, Qt::UserRole + 1005); // Update the info list. mCityInfoList.removeAt(mSelectedItem); mCityInfoList.insert(mSelectedItem, oldHomeCity); - // Update the home city with the timezone server. - mTimezoneClient->setAsCurrentLocationL(newHomeCity); + + } + // Update the home city with the timezone server. + mTimezoneClient->setAsCurrentLocationL(newHomeCity); - // Update the current location info. - updateCurrentLocationInfo(); + // Update the current location info. + updateCurrentLocationInfo(mTimezoneClient->timeUpdateOn()); - // Update the offset difference in each list item. - updateOffsetDifferences(); - } + // Update the offset difference in each list item. + refreshCityList(); // Update the data file. mTimezoneClient->saveLocations(mCityInfoList); @@ -499,15 +391,20 @@ // Now we check if the city is already added in the list. bool proceed = true; for (int i = 0; i < mCityInfoList.count(); i++) { - if (info.timezoneId == mCityInfoList.at(i).timezoneId) { + if (info.timezoneId == mCityInfoList.at(i).timezoneId + && (info.cityName == mCityInfoList.at(i).cityName) + && (info.countryName == mCityInfoList.at(i).countryName) ) { proceed = false; break; } } + LocationInfo currentCity = mTimezoneClient->getCurrentZoneInfoL(); // Check if the selected city is not the home city. - if (info.timezoneId - == mTimezoneClient->getCurrentZoneInfoL().timezoneId) { + if ( + (info.timezoneId == currentCity.timezoneId) + && (info.cityName == currentCity.cityName) + && (info.countryName == currentCity.countryName)) { proceed = false; } @@ -528,7 +425,11 @@ } } } - + if ((KMaximumCityListCount-1) == mCityInfoList.count() && + mAddCityAction->isEnabled()) { + mAddCityAction->setEnabled(false); + mAddCityMenuAction->setVisible(false); + } // Cleanup. mCitySelectionList->deleteLater(); } @@ -536,87 +437,82 @@ /*! Navigates to the clock alarms view. */ - void ClockWorldView::showAlarmsView() { - qDebug() << "clock: ClockWorldView::showAlarmsView -->"; + mAppControllerIf->switchToView(MainView); +} - mAppControllerIf->switchToView(MainView); - - qDebug() << "clock: ClockWorldView::showAlarmsView <--"; +/*! + Slot which gets called when `World Clock' action is triggered from the view + toolbar. This is responsible for reloading the content of worldclock view. + */ +void ClockWorldView::refreshWorldView() +{ + mDisplayWorldClockView->setChecked(true); } /*! - Updates the offset difference shown in each item with respect to the home - city. + Loads the appropriate section based on window orientaion. */ -void ClockWorldView::updateOffsetDifferences() +void ClockWorldView::loadSection(Qt::Orientation orientation) { - // Get the home city information. - LocationInfo homeCityInfo = mTimezoneClient->getCurrentZoneInfoL(); - - for (int iter = 0; iter < mCityListModel->rowCount(); iter++) { - QModelIndex index = mCityListModel->index(iter, 0); - LocationInfo cityInfo = mCityInfoList[iter]; - - // Find out if the city being added has an offset greater than or less - // than the homecity offset. - QString offsetDifference; - if (cityInfo.zoneOffset < homeCityInfo.zoneOffset) { - offsetDifference += "-"; - } else if (cityInfo.zoneOffset > homeCityInfo.zoneOffset) { - offsetDifference += "+"; + bool networkTime = mTimezoneClient->timeUpdateOn(); + bool loadSuccess; + if (Qt::Horizontal == orientation) { + if (networkTime) { + // Do not show home city. + mDocLoader->load( + CLOCK_WORLD_VIEW_DOCML, + CLOCK_WORLD_VIEW_LANDSCAPE_NOHOMECITY_SECTION, + &loadSuccess); + mHomeCityWidget->hide(); + } else { + mDocLoader->load( + CLOCK_WORLD_VIEW_DOCML, + CLOCK_WORLD_VIEW_LANDSCAPE_HOMECITY_SECTION, + &loadSuccess); + mHomeCityWidget->show(); } - // Now get the hours and minutes. - int difference = - qAbs(homeCityInfo.zoneOffset - cityInfo.zoneOffset); - int hours = difference / 60; - int minutes = difference % 60; - offsetDifference += QString::number(hours); - offsetDifference += "hrs"; - if (minutes) { - offsetDifference += ", "; - offsetDifference += QString::number(minutes); - offsetDifference += "mins"; + } else if (Qt::Vertical == orientation) { + if (networkTime) { + // Do not show home city. + mDocLoader->load( + CLOCK_WORLD_VIEW_DOCML, + CLOCK_WORLD_VIEW_PORTRAIT_NOHOMECITY_SECTION, + &loadSuccess); + mHomeCityWidget->hide(); + } else { + // Show home city. + mDocLoader->load( + CLOCK_WORLD_VIEW_DOCML, + CLOCK_WORLD_VIEW_PORTRAIT_HOMECITY_SECTION, + &loadSuccess); + mHomeCityWidget->show(); } - // TODO : Need to enable these code once we recieve the localisation. - /*QString displayFormat = tr("%1hrs, %2mins"); - QString offsetString = displayFormat.arg(hours, minutes); - offsetDifference += offsetString;*/ - mCityListModel->setData(index, offsetDifference, Qt::UserRole + 1003); } + mCityListView->update(); } /*! - Slot which gets called when `World Clock' action is triggered from the view - toolbar. This is responsible for reloading the content of the world clock view. + Slot which gets called for timeChanged signal of timezone client. + Refreshes both homecity & city list. */ -void ClockWorldView::refreshWorldView() +void ClockWorldView::updateAllLocationInfo() { - qDebug() << "clock: ClockWorldView::refreshWorldView -->"; - - mDisplayWorldClockView->setChecked(true); - - qDebug() << "clock: ClockWorldView::refreshWorldView <--"; + updateCurrentLocationInfo(mTimezoneClient->timeUpdateOn()); + updateCityList(); + refreshCityList(); } /*! - Slot to handle orientation changes + Slot to handle the selected context menu actions */ -void ClockWorldView::updateToolbarTexts(Qt::Orientation currentOrientation) +void ClockWorldView::selectedMenuAction(HbAction *action) { - if (Qt::Horizontal == currentOrientation) { - // Display toolbar item's texts - // TODO to use text ids from ts file. - mShowAlarmsViewAction->setText(tr("Alarms")); - mDisplayWorldClockView->setText(tr("World clock")); - mAddCityAction->setText(tr("Add city")); - } else if(Qt::Vertical == currentOrientation){ - // Remove toolbar item's texts as only icons are shown. - // TODO to use text ids from ts file. - mShowAlarmsViewAction->setText(tr("")); - mDisplayWorldClockView->setText(tr("")); - mAddCityAction->setText(""); + if (action == mSetCurrentLocationAction) { + handleSetAsCurrentLocationAction(); + } else if (action == mRemoveCityAction) { + handleDeleteAction(); } } @@ -630,95 +526,17 @@ // Here we construct a model item and add it to the list model. QStandardItem *modelItem = new QStandardItem(); - QDateTime dateTime = QDateTime::currentDateTime(); - dateTime = dateTime.toUTC(); - dateTime = dateTime.addSecs(locationInfo.zoneOffset * 60); - - // Display day/night indicators. - QString dayNightIconPath = ""; - if (isDay(dateTime)) { - dayNightIconPath = ":/clock/day"; - } else { - dayNightIconPath = ":/clock/night"; - } - modelItem->setData(dayNightIconPath, Qt::UserRole + 1000); - - // Show the date. If date is current date then show 'today'. - QString dateInfo = dateTime.toString(mSettingsUtility->dateFormatString()); - if (dateTime.date() == QDate::currentDate()) { - dateInfo = tr("Today"); - } - modelItem->setData(dateInfo, Qt::UserRole + 1001); - - // Show the city and country name. - QString placeInfo = - locationInfo.cityName + tr(", ") + locationInfo.countryName; - modelItem->setData(placeInfo, Qt::UserRole + 1002); - - // Get the homecity information. - LocationInfo homeCityInfo = mTimezoneClient->getCurrentZoneInfoL(); - // Find out if the city being added has an offset greater than or less than - // the homecity offset. - QString offsetDifference; - if (locationInfo.zoneOffset < homeCityInfo.zoneOffset) { - offsetDifference += "-"; - } else if (locationInfo.zoneOffset > homeCityInfo.zoneOffset) { - offsetDifference += "+"; - } - // Now get the hours and minutes. - int difference = qAbs(homeCityInfo.zoneOffset - locationInfo.zoneOffset); - int hours = difference / 60; - int minutes = difference % 60; - - if ( hours && minutes ) { - if (hours == 1) { - QString displayFormat = - hbTrId("txt_clock_dblist_daily_val_1_hr_2_mins"); - QString offsetString = displayFormat.arg(hours).arg(minutes); - offsetDifference += offsetString; - } - else { - QString displayFormat = - hbTrId("txt_clock_dblist_daily_val_1_hrs_2_mins"); - QString offsetString = displayFormat.arg(hours).arg(minutes); - offsetDifference += offsetString; - } - } - else if ( hours ){ - if(hours == 1 ) { - QString displayFormat = hbTrId("txt_clock_dblist_val_1_hr"); - QString offsetString = displayFormat.arg(hours); - offsetDifference += offsetString; - } - else { - QString displayFormat = hbTrId("txt_clock_dblist_val_1_hrs"); - QString offsetString = displayFormat.arg(hours); - offsetDifference += offsetString; - } - } - else if (minutes){ - QString displayFormat = hbTrId("txt_clock_dblist_val_1_mins"); - QString offsetString = displayFormat.arg(minutes); - offsetDifference += offsetString; - } - - modelItem->setData(offsetDifference, Qt::UserRole + 1003); - - // Show dst icon when needed. - QString dstIconPath = ""; - if (locationInfo.dstOn) { - dstIconPath = ":/clock/dst_icon"; - } - modelItem->setData(dstIconPath, Qt::UserRole + 1004); - - // Show the time at that location. - QString timeInfo = dateTime.toString(mSettingsUtility->timeFormatString()); - modelItem->setData(timeInfo, Qt::UserRole + 1005); - // Add the item to the model. mCityListModel->appendRow(modelItem); - return(mCityListModel->indexFromItem(modelItem)); + QModelIndex index = mCityListModel->indexFromItem(modelItem); + mCityListModel->setData( + index, getCityListDisplayString(locationInfo), Qt::DisplayRole); + mCityListModel->setData( + index, getCityListDecorationString(locationInfo), + Qt::DecorationRole); + + return index; } /*! @@ -737,4 +555,167 @@ return true; } +/*! + Returns the QVariantList for citylist to be set for DisplayRole. + + /param locationInfo Details of the city to be added to the list. + */ +QVariantList ClockWorldView::getCityListDisplayString( + const LocationInfo& locationInfo) +{ + QVariantList displayString; + QDateTime dateTime = QDateTime::currentDateTime(); + dateTime = dateTime.toUTC(); + dateTime = dateTime.addSecs(locationInfo.zoneOffset * 60); + + // Show the date. If date is current date then show 'today'. + QString dateInfo = dateTime.toString(mSettingsUtility->dateFormatString()); + if (dateTime.date() == QDate::currentDate()) { + dateInfo = hbTrId("txt_clock_main_view_dblist_daily_val_today"); + } + displayString.append(dateInfo); + + // Show the city and country name. + QString placeInfo = + locationInfo.cityName + tr(", ") + locationInfo.countryName; + displayString.append(placeInfo); + + // Get the homecity information. + LocationInfo homeCityInfo = mTimezoneClient->getCurrentZoneInfoL(); + // Find out if the city being added has an offset greater than or less than + // the homecity offset. + QString offsetDifference; + if (locationInfo.zoneOffset < homeCityInfo.zoneOffset) { + offsetDifference += "-"; + } else if (locationInfo.zoneOffset > homeCityInfo.zoneOffset) { + offsetDifference += "+"; + } + // Now get the hours and minutes. + int difference = qAbs(homeCityInfo.zoneOffset - locationInfo.zoneOffset); + int hours = difference / 60; + int minutes = difference % 60; + QString displayFormat(""); + QString offsetString(""); + + if ( hours && minutes ) { + if (hours == 1) { + displayFormat = + hbTrId("txt_clock_dblist_daily_val_1_hr_2_mins"); + offsetString = displayFormat.arg(hours).arg(minutes); + offsetDifference += offsetString; + } + else { + displayFormat = + hbTrId("txt_clock_dblist_daily_val_1_hrs_2_mins"); + offsetString = displayFormat.arg(hours).arg(minutes); + offsetDifference += offsetString; + } + } + else if ( hours ){ + if(hours == 1 ) { + displayFormat = hbTrId("txt_clock_dblist_val_1_hr"); + offsetString = displayFormat.arg(hours); + offsetDifference += offsetString; + } + else { + displayFormat = hbTrId("txt_clock_dblist_val_1_hrs"); + offsetString = displayFormat.arg(hours); + offsetDifference += offsetString; + } + } + else if (minutes){ + displayFormat = hbTrId("txt_clock_dblist_val_1_mins"); + offsetString = displayFormat.arg(minutes); + offsetDifference += offsetString; + } else { + displayFormat = hbTrId("txt_clock_dblist_val_1_hrs"); + offsetString = displayFormat.arg(0); + offsetDifference += offsetString; + } + displayString.append(offsetDifference); + + // Show the time at that location. + QString timeInfo = dateTime.toString(mSettingsUtility->timeFormatString()); + displayString.append(timeInfo); + + return displayString; +} + +/*! + Returns the QVariantList for citylist to be set for DecorationRole. + + /param locationInfo Details of the city to be added to the list. + */ +QVariantList ClockWorldView::getCityListDecorationString( + const LocationInfo& locationInfo) +{ + QVariantList decorationString; + QDateTime dateTime = QDateTime::currentDateTime(); + dateTime = dateTime.toUTC(); + dateTime = dateTime.addSecs(locationInfo.zoneOffset * 60); + + // Display day/night indicators. + // TODO: change the icon name for night when available. + QString dayNightIconPath = ""; + if (isDay(dateTime)) { + dayNightIconPath = "qtg_large_clock"; + } else { + dayNightIconPath = "qtg_large_clock"; + } + decorationString.append(HbIcon(dayNightIconPath)); + + // Show dst icon when needed. + if (locationInfo.dstOn) { + QString dstIconPath = "qtg_mono_day_light_saving_time"; + decorationString.append(HbIcon(dstIconPath)); + } + return decorationString; + +} + +/*! + Updates the city list according to the home city. + */ +void ClockWorldView::updateCityList() +{ + int cityInfoCount = mCityInfoList.count(); + + if (cityInfoCount) { + bool deletion = false; + int index; + LocationInfo currentCity = mTimezoneClient->getCurrentZoneInfoL(); + for (index = 0; index < cityInfoCount; index++) { + if (currentCity.timezoneId == mCityInfoList.at(index).timezoneId + && (currentCity.cityName == + mCityInfoList.at(index).cityName) + && (currentCity.countryName == + mCityInfoList.at(index).countryName) ) { + deletion = true; + break; + } + } + if (deletion) { + QStandardItem *item = mCityListModel->takeItem(index); + mCityListModel->removeRow(index); + delete item; + + mCityInfoList.removeAt(index); + index = -1; + + // Update the data file. + mTimezoneClient->saveLocations(mCityInfoList); + + if (mCityInfoList.count() <= 0) { + // No need to refresh the list anymore. + mRefreshTimer->stop(); + } else if (mCityInfoList.count() < (KMaximumCityListCount-1) && + !mAddCityAction->isEnabled()) { + mAddCityAction->setEnabled(true); + mAddCityMenuAction->setVisible(true); + } + + } + } +} + // End of file-- Don't delete. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockviews/src/listitemprototype.cpp --- a/clock/clockui/clockviews/src/listitemprototype.cpp Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Definition file for class ListItemPrototype. -* -*/ - -// System includes -#include -#include -#include -#include -#include -#include - -// User includes -#include "listitemprototype.h" - -/*! - \class ListItemPrototype - - Prototype class for the World clock city list. - */ - -/*! - Default constructor. - - \parent of type QGraphicsItem. - */ -ListItemPrototype::ListItemPrototype(QGraphicsItem *parent) -:HbListViewItem(parent), - mDayNightIcon(0), - mDateText(0), - mCityText(0), - mOffsetText(0), - mDstIcon(0), - mTimeText(0) -{ - // Nothing yet. -} - -/*! - Destructor. - */ -ListItemPrototype::~ListItemPrototype() -{ - // Nothing yet. -} - -/*! - From HbListViewItem. - - \sa HbAbstractViewItem, HbListViewItem. - */ -HbAbstractViewItem *ListItemPrototype::createItem() -{ - return new ListItemPrototype(*this); -} - -/*! - Called for every view item in the list. - - \sa HbAbstractViewItem, HbListViewItem. - */ -void ListItemPrototype::updateChildItems() -{ - // First allow the base class to update. - HbListViewItem::updateChildItems(); - - // Create the individual items. - // Create day-night icon. - if (!mDayNightIcon) { - mDayNightIcon = new HbIconItem(this); - style()->setItemName(mDayNightIcon, "dayNightIcon"); - } - mDayNightIcon->setIconName( - modelIndex().data(Qt::UserRole + 1000).value()); - - // Create the date text item. - if (!mDateText) { - mDateText = new HbTextItem(this); - style()->setItemName(mDateText, "dateText"); - } - mDateText->setText(modelIndex().data(Qt::UserRole + 1001).toString()); - - // Create the city, country name text item. - if (!mCityText) { - mCityText = new HbTextItem(this); - mCityText->setTextWrapping(Hb::TextNoWrap); - style()->setItemName(mCityText, "cityText"); - } - mCityText->setText(modelIndex().data(Qt::UserRole + 1002).toString()); - - // Create the offset text item. - if (!mOffsetText) { - mOffsetText = new HbTextItem(this); - style()->setItemName(mOffsetText, "offsetText"); - } - mOffsetText->setText(modelIndex().data(Qt::UserRole + 1003).toString()); - - // Create dst icon. - if (!mDstIcon) { - mDstIcon = new HbIconItem(this); - style()->setItemName(mDstIcon, "dstIcon"); - } - mDstIcon->setIconName( - modelIndex().data(Qt::UserRole + 1004).value()); - - // Create the time text item. - if (!mTimeText) { - mTimeText = new HbTextItem(this); - style()->setItemName(mTimeText, "timeText"); - } - mTimeText->setText(modelIndex().data(Qt::UserRole + 1005).toString()); -} - -// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/bwins/clockwidgetu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/bwins/clockwidgetu.def Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,18 @@ +EXPORTS + ?tr@ClockWidget@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString ClockWidget::tr(char const *, char const *, int) + ?staticMetaObject@ClockWidget@@2UQMetaObject@@B @ 2 NONAME ; struct QMetaObject const ClockWidget::staticMetaObject + ??1ClockWidget@@UAE@XZ @ 3 NONAME ; ClockWidget::~ClockWidget(void) + ??0ClockWidget@@QAE@PAVQGraphicsItem@@V?$QFlags@W4WindowType@Qt@@@@@Z @ 4 NONAME ; ClockWidget::ClockWidget(class QGraphicsItem *, class QFlags) + ?qt_metacast@ClockWidget@@UAEPAXPBD@Z @ 5 NONAME ; void * ClockWidget::qt_metacast(char const *) + ?updateTime@ClockWidget@@QAEXXZ @ 6 NONAME ; void ClockWidget::updateTime(void) + ?setClockType@ClockWidget@@QAEXABW4ClockType@1@@Z @ 7 NONAME ; void ClockWidget::setClockType(enum ClockWidget::ClockType const &) + ?metaObject@ClockWidget@@UBEPBUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const * ClockWidget::metaObject(void) const + ?loadClockWidget@ClockWidget@@QAEXXZ @ 9 NONAME ; void ClockWidget::loadClockWidget(void) + ?trUtf8@ClockWidget@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString ClockWidget::trUtf8(char const *, char const *, int) + ?tr@ClockWidget@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString ClockWidget::tr(char const *, char const *) + ??_EClockWidget@@UAE@I@Z @ 12 NONAME ; ClockWidget::~ClockWidget(unsigned int) + ?trUtf8@ClockWidget@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString ClockWidget::trUtf8(char const *, char const *) + ?getStaticMetaObject@ClockWidget@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & ClockWidget::getStaticMetaObject(void) + ?qt_metacall@ClockWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 15 NONAME ; int ClockWidget::qt_metacall(enum QMetaObject::Call, int, void * *) + ?clockType@ClockWidget@@QBE?AW4ClockType@1@XZ @ 16 NONAME ; enum ClockWidget::ClockType ClockWidget::clockType(void) const + diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidget.pro --- a/clock/clockui/clockwidget/clockwidget.pro Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/clockwidget/clockwidget.pro Fri May 14 15:51:09 2010 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available # under the terms of "Eclipse Public License v1.0" @@ -11,40 +11,12 @@ # # Contributors: # -# Description: Project definition file for clockui -# - -TEMPLATE = lib -TARGET = clockwidgetproto -DEFINES += CLOCKWIDGET_LIB -CONFIG += hb - -DEPENDPATH += . \ - ./src \ - ./inc \ - ../../data -INCLUDEPATH += . \ - ../../clockmw/clocktimezone/inc \ - ../../clockmw/clocksettingsutility/inc \ - ../../inc +# Description: +# -symbian: { - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCALLOWDLLDATA = 1 - TARGET.UID3 = 0x2002E6B4 - - LIBS += -ltimezoneclient \ - -lclocksettingsutility -} - -SOURCES += skinnableclock.cpp \ - analogclock.cpp \ - digitalclock.cpp - -HEADERS += skinnableclock.h \ - analogclock.h \ - digitalclock.h - -RESOURCES += ../../data/clockwidget.qrc - -# End of file --Don't remove this. + + +TEMPLATE = subdirs +SUBDIRS += clockwidgetimpl +SUBDIRS += clockwidgetplugin +CONFIG += ordered \ No newline at end of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetimpl/clockwidgetimpl.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetimpl/clockwidgetimpl.pro Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,59 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# programs, is protected by copyright controlled by Nokia. All +# rights are reserved. Copying, including reproducing, storing, +# adapting or translating, any or all of this material requires the +# prior written consent of Nokia. This material also contains +# confidential information which may not be disclosed to others +# without the prior written consent of Nokia. +# ============================================================================ +# +# Description: +# + +TEMPLATE = lib +TARGET = clockwidget +CONFIG += hb +DEFINES += CLOCKWIDGET_LIB + +win32{ +CONFIG(release, debug|release){ + TARGET = clockwidget + DESTDIR = ../release # for easy plugin loading +}else{ + TARGET = clockwidgetd + DESTDIR = ../debug # for easy plugin loading + } +} + +DEPENDPATH += ./inc \ + ./src + +INCLUDEPATH += ./inc + +SOURCES += \ + clockwidget.cpp \ + analogclockwidget.cpp + +HEADERS += \ + clockwidgetdefines.h \ + clockwidget.h \ + analogclockwidget.h + +symbian { + TARGET.UID3 = 0x2002E715 + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = CAP_GENERAL_DLL + LIBS += -lbafl +} + +RESOURCES = clockwidgetimpl.qrc + +# End of file --Don't remove this diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetimpl/clockwidgetimpl.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetimpl/clockwidgetimpl.qrc Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,6 @@ + + + resource/analogclockwidget.widgetml + resource/analogclockwidget.css + + diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetimpl/inc/analogclockwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetimpl/inc/analogclockwidget.h Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Clock widget +* +*/ + +#ifndef ANALOGCLOCKWIDGET_H +#define ANALOGCLOCKWIDGET_H + +// User includes +#include +#include + +// Forward declarations +class HbIconItem; +class QTimer; + +class AnalogClockWidget : public HbWidget +{ + Q_OBJECT + +public: + AnalogClockWidget(QGraphicsItem *parent = 0); + virtual ~AnalogClockWidget(); + +public slots: + void tick(); + +protected: + void resizeEvent(QGraphicsSceneResizeEvent *event); + void polish(HbStyleParameters& params); + +private: + void updatePrimitives(); + +private: + QPointer mTimer; + QPointer mClockBackground; + QPointer mClockHourHand; + QPointer mClockMinuteHand; + QPointer mClockSecondHand; +}; + +#endif + +// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetimpl/inc/clockwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetimpl/inc/clockwidget.h Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Clock widget +* +*/ + +#ifndef CLOCKWIDGET_H +#define CLOCKWIDGET_H + +// System includes +#include + +// User includes +#include "clockwidgetdefines.h" + +//Forward declarations + +class QGraphicsLinearLayout; +class AnalogClockWidget; + +class CLOCKWIDGET_EXPORT ClockWidget : public HbWidget +{ + Q_OBJECT + Q_PROPERTY(ClockType clockType READ clockType WRITE setClockType) + +public: + enum ClockType + { + ClockTypeAnalog, + ClockTypeDigital + }; + + ClockWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); + ~ClockWidget(); + ClockType clockType() const; + void setClockType(const ClockType &type); + void loadClockWidget(); + +public slots: + void updateTime(); + +private: + ClockType mClockType; + AnalogClockWidget *mAnalogClock; + QGraphicsLinearLayout *mLayout; +}; + +#endif // CLOCKWIDGET_H + +// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetimpl/inc/clockwidgetdefines.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetimpl/inc/clockwidgetdefines.h Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The dll header file. +* +*/ + + +#ifndef CLOCKWIDGETDEFINES_H +#define CLOCKWIDGETDEFINES_H + +#include + +#ifdef CLOCKWIDGET_LIB +# define CLOCKWIDGET_EXPORT Q_DECL_EXPORT +#else +# define CLOCKWIDGET_EXPORT Q_DECL_IMPORT +#endif + +#endif // CLOCKWIDGETDEFINES_H + +// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetimpl/resource/analogclockwidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetimpl/resource/analogclockwidget.css Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,23 @@ +AnalogClockWidget { + layout: layout_1; +} + +AnalogClockWidget::clock_background { + size-policy: expanding expanding; + zvalue: 0; +} + +AnalogClockWidget::clock_minute_hand { + size-policy:expanding expanding; + zvalue: 1; +} + +AnalogClockWidget::clock_hour_hand { + size-policy:expanding expanding; + zvalue: 2; +} + +AnalogClockWidget::clock_second_hand { + size-policy:expanding expanding; + zvalue: 3; +} diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetimpl/resource/analogclockwidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetimpl/resource/analogclockwidget.widgetml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetimpl/src/analogclockwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetimpl/src/analogclockwidget.cpp Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AnalogClockWidget +* +*/ + +// System includes +#include +#include +#include +#include + +// User includes +#include "analogclockwidget.h" + +// Constants +const int clockUpdateInterval (1000); // msec + +/*! + \class AnalogClockWidget + + This class implements the analogclock widget which gets displayed + in the clockmainview when the clocktype is set to analog type. +*/ + +/*! + Constructor. + \param parent The parent of type QGraphicsItem. +*/ +AnalogClockWidget::AnalogClockWidget(QGraphicsItem *parent) + : HbWidget(parent) +{ + HbStyleLoader::registerFilePath(":/resource"); + updatePrimitives(); + mTimer = new QTimer(this); + connect(mTimer, SIGNAL(timeout()), SLOT(tick())); + mTimer->start(clockUpdateInterval); +} + +/*! + Destructor. + */ +AnalogClockWidget::~AnalogClockWidget() +{ + mTimer->stop(); + HbStyleLoader::unregisterFilePath(":/resource"); +} + +/*! + Handles resize event from HbWidget + */ +void AnalogClockWidget::resizeEvent(QGraphicsSceneResizeEvent *event) +{ + QGraphicsWidget::resizeEvent(event); + updatePrimitives(); +} + +/*! + @copydoc HbWidget::updatePrimitives() + */ +void AnalogClockWidget::updatePrimitives() +{ + if (!mClockBackground) { + mClockBackground = new HbIconItem(QLatin1String("qtg_graf_clock_day_bg"), this); + HbStyle::setItemName(mClockBackground, QLatin1String("clock_background")); + } + + // Calculate angles for clock hands. + QTime time = QTime::currentTime(); + qreal s = 6 * time.second(); + qreal m = 6 * (time.minute() + s/360); + qreal h = 30 * ((time.hour() % 12) + m/360); + + if (!mClockHourHand) { + mClockHourHand = new HbIconItem(QLatin1String("qtg_graf_clock_day_hour"), this); + HbStyle::setItemName(mClockHourHand, QLatin1String("clock_hour_hand")); + } + + int x = mClockHourHand->geometry().width()/2; + int y = mClockHourHand->geometry().height()/2; + mClockHourHand->setTransform(QTransform().translate(x, y).rotate(h).translate(-x, -y)); + + if (!mClockMinuteHand) { + mClockMinuteHand = new HbIconItem(QLatin1String("qtg_graf_clock_day_min"), this); + HbStyle::setItemName(mClockMinuteHand, QLatin1String("clock_minute_hand")); + } + + x = mClockMinuteHand->geometry().width()/2; + y = mClockMinuteHand->geometry().height()/2; + mClockMinuteHand->setTransform(QTransform().translate(x, y).rotate(m).translate(-x, -y)); + + + if (!mClockSecondHand) { + mClockSecondHand = new HbIconItem(QLatin1String("qtg_graf_clock_day_sec"), this); + HbStyle::setItemName(mClockSecondHand, QLatin1String("clock_second_hand")); + } + + x = mClockSecondHand->geometry().width()/2; + y = mClockSecondHand->geometry().height()/2; + mClockSecondHand->setTransform(QTransform().translate(x, y).rotate(s).translate(-x, -y)); + +} + +/*! + Updates clock visualization according to current time + */ +void AnalogClockWidget::tick() +{ + updatePrimitives(); + update(); +} + +/*! + Handles polish event + */ +void AnalogClockWidget::polish( HbStyleParameters& params ) +{ + HbWidget::polish(params); + updatePrimitives(); +} + +// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetimpl/src/clockwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetimpl/src/clockwidget.cpp Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Clockwidget +* +*/ + +// System includes +#include + +// User includes +#include "clockwidget.h" +#include "analogclockwidget.h" + +/*! + \class ClockWidget + + This is the generic wrapper for the clockwidget which manages analog and ditial clockwidgets. + */ + +/*! + Constructor. + */ +ClockWidget::ClockWidget(QGraphicsItem *parent, Qt::WindowFlags flags) + : HbWidget(parent, flags), + mClockType(ClockTypeAnalog) +{ + loadClockWidget(); +} + +/*! + Destructor. +*/ +ClockWidget::~ClockWidget() +{ + +} + +/*! + Returns the clock type. +*/ +ClockWidget::ClockType ClockWidget::clockType() const +{ + return mClockType; +} + +/*! + Sets the clock type; +*/ +void ClockWidget::setClockType(const ClockType &type) +{ + if (type == ClockTypeDigital) { + mClockType = ClockTypeDigital; + } else { + mClockType = ClockTypeAnalog; + } +} + +/*! + Updates the clock time with every second +*/ +void ClockWidget::updateTime() +{ + if (mClockType == ClockTypeAnalog) { + mAnalogClock->tick(); + } +} + +/*! + Constructs the clockwidget based upon its type. +*/ +void ClockWidget::loadClockWidget() +{ + if (mClockType == ClockTypeAnalog) { + mAnalogClock = new AnalogClockWidget(this); + mLayout = new QGraphicsLinearLayout(Qt::Vertical); + mLayout->setContentsMargins(0,0,0,0); + mLayout->addItem(mAnalogClock); + setLayout(mLayout); + } +} + +// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetplugin/clockwidgetplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetplugin/clockwidgetplugin.h Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Clockwidget custom document loader plugin. +* +*/ + +#ifndef CLOCKWIDGETDPLUGIN_H +#define CLOCKWIDGETDPLUGIN_H + +// System includes +#include +#include + + +class ClockWidgetPlugin : public HbDocumentLoaderPlugin +{ + +private: + virtual QObject *createObject(const QString &type, const QString &name); + virtual QList supportedObjects(); + +}; +Q_EXPORT_PLUGIN(ClockWidgetPlugin) + +#endif // CLOCKWIDGETDPLUGIN_H + +// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetplugin/clockwidgetplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetplugin/clockwidgetplugin.pro Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,67 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: This is the project specification file for the +# clockwidgetplugin. +# + +TEMPLATE = lib +TARGET = clockwidgetplugin + +win32{ +CONFIG(release, debug|release){ + TARGET = clockwidgetplugin + } else { + TARGET = clockwidgetplugind + } +} + +CONFIG += hb plugin + +win32{ +CONFIG(release, debug|release){ + DESTDIR = ../release # for easy plugin loading + LIBS += -L../release -lclockwidget + } else { + DESTDIR = ../debug # for easy plugin loading + LIBS += -L../debug -lclockwidgetd + } +} + +SOURCES += \ + main.cpp + +INCLUDEPATH += \ + ../clockwidgetimpl \ + ../clockwidgetimpl/inc + +symbian: { + TARGET.UID3 = 0x2002E716 + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = CAP_GENERAL_DLL + + LIBS += \ + -lclockwidget.dll + + pluginstub.sources = clockwidgetplugin.dll + pluginstub.path = /resource/plugins + DEPLOYMENT += pluginstub + DESTDIR = $$HB_PLUGINS_DIR +} + +!local { + target.path = $$HB_PLUGINS_DIR + INSTALLS += target +} + +# End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/clockwidgetplugin/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/clockwidgetplugin/main.cpp Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Clock widget +* +*/ + +// User includes +#include "clockwidgetplugin.h" +#include "clockwidget.h" + +/*! + \class ClockWidgetPlugin + + This class is a wrapper plug-in DLL that references the custom widget DLLs that need to be part of the widget package. +*/ + + +/*! + Creates an instance of each of the types of custom widget supported in this plug-in. + The code uses the parameter type to control which type of object must be created. + It also sets the created object's name +*/ +QObject *ClockWidgetPlugin::createObject(const QString &type, const QString &name) +{ + if (type == ClockWidget::staticMetaObject.className()) { + QObject *object = new ClockWidget(); + object->setObjectName(name); + return object; + } + return 0; +} + +/*! + Get a QMetaObject for each custom widget and add it to the list of supported objects. + A QMetaObject pointer must be added for every custom widget that is created by the plug-in. +*/ +QList ClockWidgetPlugin::supportedObjects() +{ + QList list; + list.append( &ClockWidget::staticMetaObject ); + return list; +} + +// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/eabi/clockwidgetu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock/clockui/clockwidget/eabi/clockwidgetu.def Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,22 @@ +EXPORTS + _ZN11ClockWidget10updateTimeEv @ 1 NONAME + _ZN11ClockWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME + _ZN11ClockWidget11qt_metacastEPKc @ 3 NONAME + _ZN11ClockWidget12setClockTypeERKNS_9ClockTypeE @ 4 NONAME + _ZN11ClockWidget15loadClockWidgetEv @ 5 NONAME + _ZN11ClockWidget16staticMetaObjectE @ 6 NONAME DATA 16 + _ZN11ClockWidget19getStaticMetaObjectEv @ 7 NONAME + _ZN11ClockWidgetC1EP13QGraphicsItem6QFlagsIN2Qt10WindowTypeEE @ 8 NONAME + _ZN11ClockWidgetC2EP13QGraphicsItem6QFlagsIN2Qt10WindowTypeEE @ 9 NONAME + _ZN11ClockWidgetD0Ev @ 10 NONAME + _ZN11ClockWidgetD1Ev @ 11 NONAME + _ZN11ClockWidgetD2Ev @ 12 NONAME + _ZNK11ClockWidget10metaObjectEv @ 13 NONAME + _ZNK11ClockWidget9clockTypeEv @ 14 NONAME + _ZTI11ClockWidget @ 15 NONAME + _ZTV11ClockWidget @ 16 NONAME + _ZThn16_N11ClockWidgetD0Ev @ 17 NONAME + _ZThn16_N11ClockWidgetD1Ev @ 18 NONAME + _ZThn8_N11ClockWidgetD0Ev @ 19 NONAME + _ZThn8_N11ClockWidgetD1Ev @ 20 NONAME + diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/inc/analogclock.h --- a/clock/clockui/clockwidget/inc/analogclock.h Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// analogclock.h - -#ifndef ANALOGCLOCK_H -#define ANALOGCLOCK_H - -#include - -#include -#include - -class QGraphicsWidget; -class QStyleOptionGraphicsItem; -class QPainter; -class HbIconItem; -class HbStackedLayout; - -class AnalogClock : public HbWidget -{ - Q_OBJECT - -public: - AnalogClock(QGraphicsWidget *parent = 0); - ~AnalogClock(); - -public: - void showNext(); - void showPrev(); - -public slots: - void updateDisplay(); - -protected: - void paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget *widget = 0); - -private: - void constructImages(); - -private slots: - void widget_hidden(const HbEffect::EffectStatus &status); - -private: - QString mFaceName; - QString mHourName; - QString mMinuteName; - - HbIconItem *mClockFace; - HbIconItem *mHourHand; - HbIconItem *mMinuteHand; - HbStackedLayout* mParentLayout; - - bool mIsDay; - bool mFirstDraw; - int mCurrentClock; -}; - -#endif // ANALOGCLOCK_P_H - -// End of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/inc/clockwidgetdefines.h --- a/clock/clockui/clockwidget/inc/clockwidgetdefines.h Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * Common definition file for clockwidget component. - * - */ - -#ifndef CLOCKWIDGETDEFINES_H -#define CLOCKWIDGETDEFINES_H - -// System includes -#include - -#ifdef CLOCKWIDGET_LIB -# define CLOCKWIDGET_EXPORT Q_DECL_EXPORT -#else -# define CLOCKWIDGET_EXPORT Q_DECL_IMPORT -#endif - -#endif // CLOCKWIDGETDEFINES_H - -// End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/inc/digitalclock.h --- a/clock/clockui/clockwidget/inc/digitalclock.h Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// digitalclock.h - -#ifndef DIGITALCLOCK_H -#define DIGITALCLOCK_H - -#include - -#include -#include - -class QGraphicsLinearLayout; -class QGraphicsWidget; -class HbIconItem; -class HbLabel; - -class DigitalClock : public HbWidget -{ - Q_OBJECT - -public: - DigitalClock(QGraphicsWidget *parent = 0); - ~DigitalClock(); - -public: - void updateDisplay(); - -public slots: - void fadeBackIn(const HbEffect::EffectStatus &status); - -private: - void constructImages(); - -private: - QGraphicsLinearLayout *mDigitalClockLayout; - QGraphicsLinearLayout *mWidgetLayout; - QGraphicsWidget *mDummyWidget; - - HbIconItem *mPositionOne; - HbIconItem *mPositionTwo; - HbIconItem *mPositionThree; - HbIconItem *mPositionFour; - HbIconItem *mSeperator; - HbLabel *mAmPmLabel; - - bool m24HourFormat; -}; - -#endif // DIGITALCLOCK_H - -// End of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/inc/skinnableclock.h --- a/clock/clockui/clockwidget/inc/skinnableclock.h Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#ifndef SKINNABLECLOCK_H -#define SKINNABLECLOCK_H - -#include -#include -#include - -#include "clockwidgetdefines.h" - -class QTimer; -class QEvent; -class QGraphicsLinearLayout; -class AnalogClock; -class DigitalClock; -class TimezoneClient; -class SettingsUtility; - -class CLOCKWIDGET_EXPORT SkinnableClock : public HbWidget -{ - Q_OBJECT - -public: - SkinnableClock(QGraphicsItem *parent = 0); - ~SkinnableClock(); - -public: - bool clockTypeAnalog(); - bool clockFormat24(); - -public slots: - void updateDisplay(bool newTimer = true); - void updateClockType(); - void finishChangeType(const HbEffect::EffectStatus &status); - -protected: -// bool sceneEvent(QEvent *event); - void paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget *widget = 0); - -private: - void setClockTypeAnalog(bool analog); - void startChangeType(); - -private: - QTimer *mTickTimer; - QGraphicsLinearLayout *mLayout; - - AnalogClock *mAnalogClock; - DigitalClock *mDigitalClock; - TimezoneClient *mClient; - SettingsUtility *mSettingsUtility; - - bool mAnalog; - bool mClockFormat24; - bool mUpdateNeeded; -}; - -#endif // SKINNABLECLOCK_H - -// End of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/src/analogclock.cpp --- a/clock/clockui/clockwidget/src/analogclock.cpp Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,241 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// analogclock.cpp - -#include -#include -#include -#include -#include -#include -#include - -#include "analogclock.h" - -const QString KPrefix(":/clock/"); -const QString KUnderScore("_"); -const QString KFaceDay(":/clock/analog_face_day"); -const QString KHourDay(":/clock/hour_hand_day"); -const QString KMinDay(":/clock/minute_hand_day"); -const QString KFaceNight("analog_face_night"); -const QString KHourNight("hour_hand_night"); -const QString KMinNight("minute_hand_night"); - -AnalogClock::AnalogClock(QGraphicsWidget *parent) -:HbWidget(parent), - mIsDay(true), - mFirstDraw(true), - mCurrentClock(0) -{ - // Add the required effects. - HbEffect::add(this, - QString(":/clock/hide_widget.fxml"), - "hide_widget"); - - // Construct the images here. - constructImages(); - - // A single shot timer after which the hands are updated to show the - // correct time. - // TODO: QTimer::singleShot(500, this, SLOT(updateDisplay())); -} - -AnalogClock::~AnalogClock() -{ - // No implementation yet. -} - -void AnalogClock::showPrev() -{ - mCurrentClock--; - if (mCurrentClock < 0) { - mCurrentClock = 3; - } - // Start the effect. - HbEffect::start(this, "hide_widget", this, "widget_hidden"); -} - -void AnalogClock::showNext() -{ - mCurrentClock++; - mCurrentClock = mCurrentClock % 4; - - // Start the effect. - HbEffect::start(this, "hide_widget", this, "widget_hidden"); -} - -void AnalogClock::updateDisplay() -{ - // Take the current time. - bool changeClock = false; - QTime timeNow = QTime::currentTime(); - int hourNow = timeNow.hour(); - - if (17 < hourNow || 6 > hourNow) { - if (mIsDay) { - // It was previously day. We need to change the clock - changeClock = true; - } - mIsDay = false; - } else { - if (!mIsDay) { - // It was previously night. We need to change the clock - changeClock = true; - } - mIsDay = true; - } - - if (changeClock) { - if (mIsDay) { - mClockFace->setIconName(mFaceName); - mHourHand->setIconName(mHourName); - mMinuteHand->setIconName(mMinuteName); - } else { - mClockFace->setIconName(mFaceName); - mHourHand->setIconName(mHourName); - mMinuteHand->setIconName(mMinuteName); - } - } - - // Calculate the rotation angle for hour hand. - qreal hourAngle = 30.0*((timeNow.hour()+timeNow.minute()/60.0)); - hourAngle += 270; - - // Rotate the hour hand. - mHourHand->setTransform( - QTransform().translate(mHourHand->iconItemSize().width()/2, - mHourHand->iconItemSize().height()/2).rotate(hourAngle) - .translate(-mHourHand->iconItemSize().width()/2, - -mHourHand->iconItemSize().height()/2)); - - // Rotate the minute hand. - mMinuteHand->setTransform( - QTransform().translate(mMinuteHand->iconItemSize().width()/2, - mMinuteHand->iconItemSize().height()/2) - .rotate(6.0*(timeNow.minute()+timeNow.second()/60.0)) - .translate(-mMinuteHand->iconItemSize().width()/2, - -mMinuteHand->iconItemSize().height()/2)); -} - -void AnalogClock::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget *widget) -{ - Q_UNUSED(painter) - Q_UNUSED(option) - Q_UNUSED(widget) - - if (mFirstDraw) { - mFirstDraw = false; - - QTime timeNow = QTime::currentTime(); - int hourNow = timeNow.hour(); - - // Calculate the rotation angle for hour hand. - qreal hourAngle = 30.0 * ((timeNow.hour() + timeNow.minute() / 60.0)); - hourAngle += 270; - - // Rotate the hour hand. - mHourHand->setTransform( - QTransform().translate(mHourHand->iconItemSize().width()/2, - mHourHand->iconItemSize().height()/2).rotate(hourAngle) - .translate(-mHourHand->iconItemSize().width()/2, - -mHourHand->iconItemSize().height()/2)); - - // Rotate the minute hand. - mMinuteHand->setTransform( - QTransform().translate(mMinuteHand->iconItemSize().width()/2, - mMinuteHand->iconItemSize().height()/2) - .rotate(6.0*(timeNow.minute()+timeNow.second()/60.0)) - .translate(-mMinuteHand->iconItemSize().width()/2, - -mMinuteHand->iconItemSize().height()/2)); - - } -} - -void AnalogClock::constructImages() -{ - mFaceName.append(KFaceDay); - mHourName.append(KHourDay); - mMinuteName.append(KMinDay); - - mParentLayout = new HbStackedLayout(this); - - mClockFace = new HbIconItem(mFaceName, this); - mHourHand = new HbIconItem(mHourName, this); - mMinuteHand = new HbIconItem(mMinuteName, this); - - mParentLayout->addItem(mClockFace); - mParentLayout->addItem(mHourHand); - mParentLayout->addItem(mMinuteHand); - - setLayout(mParentLayout); -} - -void AnalogClock::widget_hidden(const HbEffect::EffectStatus &status) -{ - Q_UNUSED(status) - - QString clockNum; - clockNum = clockNum.setNum(mCurrentClock); - - mFaceName.clear(); - mHourName.clear(); - mMinuteName.clear(); - - if (mIsDay) { - mFaceName.append(KPrefix); - mFaceName.append(clockNum); - mFaceName.append(KUnderScore); - mFaceName.append(KFaceDay); - - mHourName.append(KPrefix); - mHourName.append(clockNum); - mHourName.append(KUnderScore); - mHourName.append(KHourDay); - - mMinuteName.append(KPrefix); - mMinuteName.append(clockNum); - mMinuteName.append(KUnderScore); - mMinuteName.append(KMinDay); - } else { - mFaceName.append(KPrefix); - mFaceName.append(clockNum); - mFaceName.append(KUnderScore); - mFaceName.append(KFaceNight); - - mHourName.append(KPrefix); - mHourName.append(clockNum); - mHourName.append(KUnderScore); - mHourName.append(KHourNight); - - mMinuteName.append(KPrefix); - mMinuteName.append(clockNum); - mMinuteName.append(KUnderScore); - mMinuteName.append(KMinNight); - } - - mClockFace->setIconName(mFaceName); - mHourHand->setIconName(mHourName); - mMinuteHand->setIconName(mMinuteName); - - HbEffect::add(this, QString(":/clock/show_widget.fxml"), "show_widget"); - HbEffect::start(this, "show_widget"); -} - -// End of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/src/digitalclock.cpp --- a/clock/clockui/clockwidget/src/digitalclock.cpp Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,273 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// digitalclock.cpp - -#include -#include -#include -#include - -#include -#include -#include - -#include "digitalclock.h" - -DigitalClock::DigitalClock(QGraphicsWidget *parent) -:HbWidget(parent), -m24HourFormat(false) -{ - constructImages(); -} - -DigitalClock::~DigitalClock() -{ - // No implementation yet. -} - -void DigitalClock::updateDisplay() -{ - QTime currentTime = QTime::currentTime(); - int currentHour, currentMin; - if (!m24HourFormat && currentTime.hour() > 12) { - currentHour = currentTime.hour() % 12; - } else { - currentHour = currentTime.hour(); - } - currentMin = currentTime.minute(); - - int numAt1, numAt2, numAt3, numAt4; - numAt1 = currentHour / 10; - numAt2 = currentHour % 10; - numAt3 = currentMin / 10; - numAt4 = currentMin % 10; - - // The first digit. - if (m24HourFormat) { - switch (numAt1) { - case 0: - mPositionOne->setIconName(":/clock/digit_zero"); - break; - case 1: - mPositionOne->setIconName(":/clock/digit_one"); - break; - case 2: - mPositionOne->setIconName(":/clock/digit_two"); - break; - default: - break; - } - } else { - switch (numAt1) { - case 0: - mPositionOne->setIconName(":/clock/digit_zero"); - break; - case 1: - mPositionOne->setIconName(":/clock/digit_one"); - break; - default: - break; - } - } - - // The second digit. - switch(numAt2) { - case 0: - mPositionTwo->setIconName(":/clock/digit_zero"); - break; - case 1: - mPositionTwo->setIconName(":/clock/digit_one"); - break; - case 2: - mPositionTwo->setIconName(":/clock/digit_two"); - break; - case 3: - mPositionTwo->setIconName(":/clock/digit_three"); - break; - case 4: - mPositionTwo->setIconName(":/clock/digit_four"); - break; - case 5: - mPositionTwo->setIconName(":/clock/digit_five"); - break; - case 6: - mPositionTwo->setIconName(":/clock/digit_six"); - break; - case 7: - mPositionTwo->setIconName(":/clock/digit_seven"); - break; - case 8: - mPositionTwo->setIconName(":/clock/digit_eight"); - break; - case 9: - mPositionTwo->setIconName(":/clock/digit_nine"); - break; - default: - break; - } - - // The separator. - mSeperator->setIconName(":/clock/sep_colon"); - // Start the blinking effect. - HbEffect::start(mSeperator, "fade_out", this, "fadeBackIn"); - - // The third digit. - switch (numAt3) { - case 0: - mPositionThree->setIconName(":/clock/digit_zero"); - break; - case 1: - mPositionThree->setIconName(":/clock/digit_one"); - break; - case 2: - mPositionThree->setIconName(":/clock/digit_two"); - break; - case 3: - mPositionThree->setIconName(":/clock/digit_three"); - break; - case 4: - mPositionThree->setIconName(":/clock/digit_four"); - break; - case 5: - mPositionThree->setIconName(":/clock/digit_five"); - break; - case 6: - mPositionThree->setIconName(":/clock/digit_six"); - break; - case 7: - mPositionThree->setIconName(":/clock/digit_seven"); - break; - case 8: - mPositionThree->setIconName(":/clock/digit_eight"); - break; - case 9: - mPositionThree->setIconName(":/clock/digit_nine"); - break; - default: - break; - } - - // The fourth digit. - switch (numAt4) { - case 0: - mPositionFour->setIconName(":/clock/digit_zero"); - break; - case 1: - mPositionFour->setIconName(":/clock/digit_one"); - break; - case 2: - mPositionFour->setIconName(":/clock/digit_two"); - break; - case 3: - mPositionFour->setIconName(":/clock/digit_three"); - break; - case 4: - mPositionFour->setIconName(":/clock/digit_four"); - break; - case 5: - mPositionFour->setIconName(":/clock/digit_five"); - break; - case 6: - mPositionFour->setIconName(":/clock/digit_six"); - break; - case 7: - mPositionFour->setIconName(":/clock/digit_seven"); - break; - case 8: - mPositionFour->setIconName(":/clock/digit_eight"); - break; - case 9: - mPositionFour->setIconName(":/clock/digit_nine"); - break; - default: - break; - } - - if (!m24HourFormat) { - mAmPmLabel->setPlainText(currentTime.toString("ap")); - } else { - mAmPmLabel->setPlainText(("")); - } -} - -void DigitalClock::fadeBackIn(const HbEffect::EffectStatus &status) -{ - Q_UNUSED(status) - - HbEffect::start(mSeperator, "fade_in"); -} - -void DigitalClock::constructImages() -{ - mDummyWidget = new QGraphicsWidget(this); - mWidgetLayout = new QGraphicsLinearLayout(Qt::Vertical); - mDigitalClockLayout = - new QGraphicsLinearLayout(Qt::Horizontal, mDummyWidget); - - // The icon at the first position. - mPositionOne = new HbIconItem(QString(), mDummyWidget); - mPositionOne->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mDigitalClockLayout->addItem(mPositionOne); - - // The icon at the second position. - mPositionTwo = new HbIconItem(QString(), mDummyWidget); - mPositionTwo->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mDigitalClockLayout->addItem(mPositionTwo); - - // The icon for separator. - mSeperator = new HbIconItem(QString(), mDummyWidget); - mSeperator->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mDigitalClockLayout->addItem(mSeperator); - - // The icon at the third position. - mPositionThree = new HbIconItem(QString(), mDummyWidget); - mPositionThree->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mDigitalClockLayout->addItem(mPositionThree); - - // The icon at the fourth position. - mPositionFour = new HbIconItem(QString(), mDummyWidget); - mPositionFour->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mDigitalClockLayout->addItem(mPositionFour); - - mDummyWidget->setLayout(mDigitalClockLayout); - - mAmPmLabel = new HbLabel((""), this); - //mAmPmLabel->setLogicalFont(Hb::FontPrimarySmall); - mAmPmLabel->setAlignment(Qt::AlignRight); - - mWidgetLayout->addItem(mDummyWidget); - mWidgetLayout->addItem(mAmPmLabel); - - QGraphicsLinearLayout *layout = - new QGraphicsLinearLayout(Qt::Horizontal, this); - layout->addStretch(100); - layout->addItem(mWidgetLayout); - layout->addStretch(100); - - setLayout(layout); - - // Add the blinking effect to the separator. - HbEffect::add(mSeperator, - QString(":/clock/fade_out.fxml"), - "fade_out"); - HbEffect::add(mSeperator, - QString(":/clock/fade_in.fxml"), - "fade_in"); -} - -// End of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/clockwidget/src/skinnableclock.cpp --- a/clock/clockui/clockwidget/src/skinnableclock.cpp Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,242 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// skinnableclock.cpp - -#include -#include -#include -#include - -#include "skinnableclock.h" -#include "analogclock.h" -#include "digitalclock.h" -#include "timezoneclient.h" -#include "settingsutility.h" - -SkinnableClock::SkinnableClock(QGraphicsItem *parent) -:HbWidget(parent), - mAnalogClock(0), - mDigitalClock(0), - mAnalog(true), - mClockFormat24(true), - mUpdateNeeded(true) -{ - // Enable the gestures for the widget and subscribe for "PAN" gestures. -/* QApplication::setAttribute(Qt::AA_EnableGestures); - grabGesture(Qt::PanGesture);*/ - - qDebug("clock: SkinnableClock::SkinnableClock() -->"); - - // Construct the settings utility. - mSettingsUtility = new SettingsUtility(this); - - qDebug("clock: SkinnableClock::SkinnableClock() - constructed settingsutility."); - - // Construct the layout and the widgets. - mLayout = new QGraphicsLinearLayout(Qt::Vertical, this); - mAnalogClock = new AnalogClock(this); - mDigitalClock = new DigitalClock(this); - - // Set the clock type according to the seetings. - // And construct the corresponding widget. - QStringList clockTypeList; - int typeIndex = mSettingsUtility->clockType(clockTypeList); - if (0 == typeIndex) { - setClockTypeAnalog(true); - } else { - setClockTypeAnalog(false); - } - - setLayout(mLayout); - - // Add the required effects. - HbEffect::add(mAnalogClock, - QString(":/clock/disappear.fxml"), - "disappear"); - HbEffect::add(mDigitalClock, - QString(":/clock/disappear.fxml"), - "disappear"); - HbEffect::add(mAnalogClock, - QString(":/clock/appear.fxml"), - "appear"); - HbEffect::add(mDigitalClock, - QString(":/clock/appear.fxml"), - "appear"); - - mClient = new TimezoneClient(this); - qDebug("clock: SkinnableClock::SkinnableClock() - constructed tzclient"); - - connect(mClient, SIGNAL(timechanged()), - this, SLOT(updateDisplay())); - connect(mClient, SIGNAL(timechanged()), - this, SLOT(updateClockType())); - - // Start a timer. - mTickTimer = new QTimer(this); - QObject::connect(mTickTimer, SIGNAL(timeout()), - this, SLOT(updateDisplay())); - // TODO: mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); - mTickTimer->start(1000); - - qDebug("clock: SkinnableClock::SkinnableClock() <--"); -} - -SkinnableClock::~SkinnableClock() -{ - // No implementation yet. -} - - -bool SkinnableClock::clockTypeAnalog() -{ - return mAnalog; -} - -bool SkinnableClock::clockFormat24() -{ - return mClockFormat24; -} - -void SkinnableClock::updateDisplay(bool newTimer) -{ - if (newTimer) { - // Start the timer again for 1 minute. - // TODO: mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); - mTickTimer->start(1000); - } - - if (mAnalog) { - mAnalogClock->updateDisplay(); - } else { - mDigitalClock->updateDisplay(); - } -} - -void SkinnableClock::updateClockType() -{ - // Update the clock type according to the seetings. - QStringList clockTypeList; - int typeIndex = mSettingsUtility->clockType(clockTypeList); - - if ((mAnalog && 1 == typeIndex) || (!mAnalog && 0 == typeIndex)) { - mUpdateNeeded = true; - mAnalog = !mAnalog; - mDigitalClock->hide(); - mAnalogClock->hide(); - } else { - mUpdateNeeded = false; - } -} - -/*bool SkinnableClock::sceneEvent(QEvent *event) -{ - if (event->type() == QEvent::GraphicsSceneGesture) { - QGraphicsSceneGestureEvent *gestureEvent = - static_cast(event); - if (const QGesture *gesture = gestureEvent->gesture(Qt::PanGesture)) { - const QPanningGesture *panningGesture = - static_cast(gesture); - - if (Qt::GestureFinished == gesture->state()) { - if (Qt::LeftDirection == panningGesture->direction()) { - if (mAnalog) { - mAnalogClock->showPrev(); - } - } else if (Qt::RightDirection == panningGesture->direction()) { - if (mAnalog) { - mAnalogClock->showNext(); - } - } else if (Qt::UpDirection == panningGesture->direction() || - Qt::DownDirection == panningGesture->direction()) { - startChangeType(); - } - event->accept(); - return true; - } - event->accept(); - return true; - } - } - return HbWidget::sceneEvent(event); -}*/ - -void SkinnableClock::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget *widget) -{ - Q_UNUSED(painter) - Q_UNUSED(option) - Q_UNUSED(widget) - - if (mUpdateNeeded) { - setClockTypeAnalog(mAnalog); - mUpdateNeeded = !mUpdateNeeded; - } -} - -void SkinnableClock::setClockTypeAnalog(bool analog) -{ - if (analog) { - mDigitalClock->hide(); - mLayout->removeItem(mDigitalClock); - mAnalogClock->show(); - mLayout->addItem(mAnalogClock); - } else { - mAnalogClock->hide(); - mLayout->removeItem(mAnalogClock); - mDigitalClock->show(); - mLayout->addItem(mDigitalClock); - } - - mAnalog = analog; - - // Update the display. - updateDisplay(false); -} - -void SkinnableClock::startChangeType() -{ - if (mAnalog) { - HbEffect::start(mAnalogClock, - "disappear", - this, - "finishChangeType"); - } else { - HbEffect::start(mDigitalClock, - "disappear", - this, - "finishChangeType"); - } -} - -void SkinnableClock::finishChangeType(const HbEffect::EffectStatus &status) -{ - Q_UNUSED(status) - - setClockTypeAnalog(!mAnalog); - - if (mAnalog) { - HbEffect::start(mAnalogClock, - "appear"); - } else { - HbEffect::start(mDigitalClock, - "appear"); - } -} - -// End of file diff -r fd30d51f876b -r a949c2543c15 clock/clockui/eabi/clockalarmeditoru.def --- a/clock/clockui/eabi/clockalarmeditoru.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/eabi/clockalarmeditoru.def Fri May 14 15:51:09 2010 +0300 @@ -1,12 +1,8 @@ EXPORTS _ZN16ClockAlarmEditor15showAlarmEditorEv @ 1 NONAME - _ZN16ClockAlarmEditorC1EiP15QGraphicsWidget @ 2 NONAME - _ZN16ClockAlarmEditorC2EiP15QGraphicsWidget @ 3 NONAME + _ZN16ClockAlarmEditorC1ER11AlarmClientiP7QObject @ 2 NONAME + _ZN16ClockAlarmEditorC2ER11AlarmClientiP7QObject @ 3 NONAME _ZN16ClockAlarmEditorD0Ev @ 4 NONAME _ZN16ClockAlarmEditorD1Ev @ 5 NONAME _ZN16ClockAlarmEditorD2Ev @ 6 NONAME - _ZThn16_N16ClockAlarmEditorD0Ev @ 7 NONAME - _ZThn16_N16ClockAlarmEditorD1Ev @ 8 NONAME - _ZThn8_N16ClockAlarmEditorD0Ev @ 9 NONAME - _ZThn8_N16ClockAlarmEditorD1Ev @ 10 NONAME diff -r fd30d51f876b -r a949c2543c15 clock/clockui/eabi/clockviewsu.def --- a/clock/clockui/eabi/clockviewsu.def Mon May 03 12:30:32 2010 +0300 +++ b/clock/clockui/eabi/clockviewsu.def Fri May 14 15:51:09 2010 +0300 @@ -1,22 +1,32 @@ EXPORTS - _ZN13ClockMainView9setupViewER20ClockAppControllerIfP14ClockDocLoader @ 1 NONAME - _ZN13ClockMainViewC1EP13QGraphicsItem @ 2 NONAME - _ZN13ClockMainViewC2EP13QGraphicsItem @ 3 NONAME - _ZN13ClockMainViewD0Ev @ 4 NONAME - _ZN13ClockMainViewD1Ev @ 5 NONAME - _ZN13ClockMainViewD2Ev @ 6 NONAME - _ZN14ClockWorldView9setupViewER20ClockAppControllerIfP14ClockDocLoader @ 7 NONAME - _ZN14ClockWorldViewC1EP13QGraphicsItem @ 8 NONAME - _ZN14ClockWorldViewC2EP13QGraphicsItem @ 9 NONAME - _ZN14ClockWorldViewD0Ev @ 10 NONAME - _ZN14ClockWorldViewD1Ev @ 11 NONAME - _ZN14ClockWorldViewD2Ev @ 12 NONAME - _ZThn16_N13ClockMainViewD0Ev @ 13 NONAME - _ZThn16_N13ClockMainViewD1Ev @ 14 NONAME - _ZThn16_N14ClockWorldViewD0Ev @ 15 NONAME - _ZThn16_N14ClockWorldViewD1Ev @ 16 NONAME - _ZThn8_N13ClockMainViewD0Ev @ 17 NONAME - _ZThn8_N13ClockMainViewD1Ev @ 18 NONAME - _ZThn8_N14ClockWorldViewD0Ev @ 19 NONAME - _ZThn8_N14ClockWorldViewD1Ev @ 20 NONAME + _ZN13ClockMainView19setupAfterViewReadyEv @ 1 NONAME + _ZN13ClockMainView9setupViewER20ClockAppControllerIfP14ClockDocLoader @ 2 NONAME + _ZN13ClockMainViewC1EP13QGraphicsItem @ 3 NONAME + _ZN13ClockMainViewC2EP13QGraphicsItem @ 4 NONAME + _ZN13ClockMainViewD0Ev @ 5 NONAME + _ZN13ClockMainViewD1Ev @ 6 NONAME + _ZN13ClockMainViewD2Ev @ 7 NONAME + _ZN14ClockWorldView9setupViewER20ClockAppControllerIfP14ClockDocLoader @ 8 NONAME + _ZN14ClockWorldViewC1EP13QGraphicsItem @ 9 NONAME + _ZN14ClockWorldViewC2EP13QGraphicsItem @ 10 NONAME + _ZN14ClockWorldViewD0Ev @ 11 NONAME + _ZN14ClockWorldViewD1Ev @ 12 NONAME + _ZN14ClockWorldViewD2Ev @ 13 NONAME + _ZN17ClockHomeCityItemC1EP13QGraphicsItem @ 14 NONAME + _ZN17ClockHomeCityItemC2EP13QGraphicsItem @ 15 NONAME + _ZN17ClockHomeCityItemD0Ev @ 16 NONAME + _ZN17ClockHomeCityItemD1Ev @ 17 NONAME + _ZN17ClockHomeCityItemD2Ev @ 18 NONAME + _ZThn16_N13ClockMainViewD0Ev @ 19 NONAME + _ZThn16_N13ClockMainViewD1Ev @ 20 NONAME + _ZThn16_N14ClockWorldViewD0Ev @ 21 NONAME + _ZThn16_N14ClockWorldViewD1Ev @ 22 NONAME + _ZThn16_N17ClockHomeCityItemD0Ev @ 23 NONAME + _ZThn16_N17ClockHomeCityItemD1Ev @ 24 NONAME + _ZThn8_N13ClockMainViewD0Ev @ 25 NONAME + _ZThn8_N13ClockMainViewD1Ev @ 26 NONAME + _ZThn8_N14ClockWorldViewD0Ev @ 27 NONAME + _ZThn8_N14ClockWorldViewD1Ev @ 28 NONAME + _ZThn8_N17ClockHomeCityItemD0Ev @ 29 NONAME + _ZThn8_N17ClockHomeCityItemD1Ev @ 30 NONAME diff -r fd30d51f876b -r a949c2543c15 clock/clockui/eabi/clockwidgetprotou.def --- a/clock/clockui/eabi/clockwidgetprotou.def Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -EXPORTS - _ZN14SkinnableClock11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME - _ZN14SkinnableClock11qt_metacastEPKc @ 2 NONAME - _ZN14SkinnableClock13clockFormat24Ev @ 3 NONAME - _ZN14SkinnableClock13updateDisplayEb @ 4 NONAME - _ZN14SkinnableClock15clockTypeAnalogEv @ 5 NONAME - _ZN14SkinnableClock15startChangeTypeEv @ 6 NONAME - _ZN14SkinnableClock15updateClockTypeEv @ 7 NONAME - _ZN14SkinnableClock16finishChangeTypeERKN8HbEffect12EffectStatusE @ 8 NONAME - _ZN14SkinnableClock16staticMetaObjectE @ 9 NONAME DATA 16 - _ZN14SkinnableClock18setClockTypeAnalogEb @ 10 NONAME - _ZN14SkinnableClock19getStaticMetaObjectEv @ 11 NONAME - _ZN14SkinnableClock5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 12 NONAME - _ZN14SkinnableClockC1EP13QGraphicsItem @ 13 NONAME - _ZN14SkinnableClockC2EP13QGraphicsItem @ 14 NONAME - _ZN14SkinnableClockD0Ev @ 15 NONAME - _ZN14SkinnableClockD1Ev @ 16 NONAME - _ZN14SkinnableClockD2Ev @ 17 NONAME - _ZNK14SkinnableClock10metaObjectEv @ 18 NONAME - _ZTI14SkinnableClock @ 19 NONAME - _ZTV14SkinnableClock @ 20 NONAME - _ZThn16_N14SkinnableClockD0Ev @ 21 NONAME - _ZThn16_N14SkinnableClockD1Ev @ 22 NONAME - _ZThn8_N14SkinnableClock5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 23 NONAME - _ZThn8_N14SkinnableClockD0Ev @ 24 NONAME - _ZThn8_N14SkinnableClockD1Ev @ 25 NONAME - diff -r fd30d51f876b -r a949c2543c15 clock/data/alarm/qtg_test_alarm.svg --- a/clock/data/alarm/qtg_test_alarm.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/alarm/qtg_test_noalarm.svg --- a/clock/data/alarm/qtg_test_noalarm.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/alarm/qtg_test_repeat.svg --- a/clock/data/alarm/qtg_test_repeat.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/clock.qrc --- a/clock/data/clock.qrc Mon May 03 12:30:32 2010 +0300 +++ b/clock/data/clock.qrc Fri May 14 15:51:09 2010 +0300 @@ -1,36 +1,7 @@ - toolbar/qtg_test_alarm.svg - toolbar/qtg_test_worldclock.svg - toolbar/qtg_test_timer.svg - toolbar/qtg_test_stopwatch.svg - - alarm/qtg_test_repeat.svg - alarm/qtg_test_alarm.svg - alarm/qtg_test_noalarm.svg - toolbar/qtg_test_newalarm.svg - - toolbar/qtg_test_addnewcity.svg worldclock/qtg_test_day.svg worldclock/qtg_test_night.svg - worldclock/qtg_test_homecity.svg - worldclock/qgn_test_city_default.svg - worldclock/qgn_indi_dst_add.svg - worldclock/qgn_indi_find.svg - - toolbar/qtg_test_start.svg - toolbar/qtg_test_stop.svg - toolbar/qtg_test_reset.svg - timer/qtg_graf_timer2_base.svg - timer/knob_arc_indicator_1min.svg - timer/qtg_graf_timer2_button.svg - timer/qtg_graf_timer2_arrow.svg - timer/qtg_graf_timer2_time24.svg - timer/qtg_graf_timer2_time60.svg - - toolbar/qtg_test_lap.svg - toolbar/qtg_test_split.svg - toolbar/qtg_test_analyze.svg effects/hide_widget.fxml effects/show_widget.fxml @@ -40,9 +11,6 @@ effects/fade_out.fxml effects/fade_in.fxml - - effects/timerknob_appear.fxml - effects/timerknob_disappear.fxml translations/clock.qm diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/knob_arc_indicator_1min.svg --- a/clock/data/timer/knob_arc_indicator_1min.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1016 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer2_arrow.svg --- a/clock/data/timer/qtg_graf_timer2_arrow.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer2_base.svg --- a/clock/data/timer/qtg_graf_timer2_base.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer2_button.svg --- a/clock/data/timer/qtg_graf_timer2_button.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer2_colorindication.svg --- a/clock/data/timer/qtg_graf_timer2_colorindication.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer2_pointer.svg --- a/clock/data/timer/qtg_graf_timer2_pointer.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer2_time24.svg --- a/clock/data/timer/qtg_graf_timer2_time24.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer2_time60.svg --- a/clock/data/timer/qtg_graf_timer2_time60.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer_bg.svg --- a/clock/data/timer/qtg_graf_timer_bg.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer_overlay.svg --- a/clock/data/timer/qtg_graf_timer_overlay.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/timer/qtg_graf_timer_pointer.svg --- a/clock/data/timer/qtg_graf_timer_pointer.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_addnewcity.svg --- a/clock/data/toolbar/qtg_test_addnewcity.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_alarm.svg --- a/clock/data/toolbar/qtg_test_alarm.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_analyze.svg --- a/clock/data/toolbar/qtg_test_analyze.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_lap.svg --- a/clock/data/toolbar/qtg_test_lap.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_newalarm.svg --- a/clock/data/toolbar/qtg_test_newalarm.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_reset.svg --- a/clock/data/toolbar/qtg_test_reset.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_split.svg --- a/clock/data/toolbar/qtg_test_split.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_start.svg --- a/clock/data/toolbar/qtg_test_start.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_stop.svg --- a/clock/data/toolbar/qtg_test_stop.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_stopwatch.svg --- a/clock/data/toolbar/qtg_test_stopwatch.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_timer.svg --- a/clock/data/toolbar/qtg_test_timer.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/toolbar/qtg_test_worldclock.svg --- a/clock/data/toolbar/qtg_test_worldclock.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/translations/clock.qm Binary file clock/data/translations/clock.qm has changed diff -r fd30d51f876b -r a949c2543c15 clock/data/translations/clock.ts --- a/clock/data/translations/clock.ts Mon May 03 12:30:32 2010 +0300 +++ b/clock/data/translations/clock.ts Fri May 14 15:51:09 2010 +0300 @@ -2,14 +2,14 @@ - - 1st label in Regional date & time settings view - Time format - Time format - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl + + Title for Date and time settings view + Clock + Clock + + Common + Common + Co False @@ -22,24 +22,24 @@ Cl False - - Default value for Description label in Alarm editor view - Alarm - Alarm - qtl_dataform_description_sec - Clock_Alarm editor_P03 - formlabel_1_val + + When a city is added to the World Clock list view, its relative time offset is displayed with respect to Homecity. (Hour and Mins) + %1 hr %2 mins + %1 hr %2 mins + txt_clock_dblist_val_l1_hr + Clock_World clock_P05 + dblist_1_val Cl False - - Title for the time picker tumbler widget - Alarm time - Alarm time - qtl_dialog_pri_heading - Tumbler - title - Tu + + When a city is added to the World Clock list view, its relative time offset is displayed with respect to Homecity. (Mins) + %1 mins + %1 mins + txt_clock_dblist_val_l1_hr + Clock_World clock_P05 + dblist_1_val + Cl False @@ -47,7 +47,7 @@ mm dd yyyy mm dd yyyy qtl_dataform_group_pri - Clock_Date & time settings_P04_3 + Clock main view_P01 setlabel_2_val Cl False @@ -62,23 +62,23 @@ Cl False - - When user edits an already existed alarm in Alarm editor form, he can "Discard changes" from Options menu and the prevoius values are saved. - Discard changes - Discard changes + + + Add city + Add city qtl_menu_pri - Clock_Alarm editor_P03 + Clock_World clock_P05 opt Cl False - - Tapping on this button opens advanced date and time view - Regional date & time settings - Regional date & time settings - qtl_dataform_button_sec - Clock_Date & time settings_P04_1 - button + + Long tap menu on an added city in World clock view (both portrait and landscape) + Show on homescreen + Show on homescreen + qtl_menu_pri + Clock_World clock_P05 + menu Cl False @@ -92,26 +92,6 @@ Cl False - - When user taps on already existed alarm in the alarm list, the alarm editor opens with subtitle "Alarm" - Alarm - Alarm - qtl_groupbox_simple_sec - Clock_Alarm editor_P03 - subhead - Cl - False - - - 2nd dropdown list value for Occurence label in Alarm editor view - Repeat daily - Repeat daily - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_2_val - Cl - False - Secondary text displaying the time remaining for the alarm (hour, mins) In %1hr %2mins @@ -122,53 +102,33 @@ Cl False - + - Time - Time - qtl_dialog_pri_heading - Tumbler - title - Tu + DST + DST + + Common + setlabel_1 + Co False - - 5th label for Place in Clock settings view - Place - Place - qtl_dataform_heading_pri - Clock_Date & time settings_P04_1 - formlabel_1 - Cl - False - - - Label for Time in Alarm editor view - Time - Time - qtl_dataform_heading_pri - Clock_Alarm editor_P03 + + Secondary text displaying the time remaining for the alarm (hours, mins) + In %1hrs %2mins + In %1hrs %2mins + txt_clock_main_view_setlabel_in_1hrs_2mins + Clock main view_P01 setlabel_1 Cl False - - 1st dropdown list value for Occurence label in Alarm editor view - Once - Once - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_1_val - Cl - False - - - 5th dropdown list value for Day label in Alarm editor view - Friday - Friday - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_5_val + + + Alarms + Alarms + qtl_toolbar_tiny1_3 + Clock main view_P01 + button Cl False @@ -182,33 +142,23 @@ Cl False - - 6th field in Regional date & time settings view - Week starts on - Week starts on - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 + + Layout ID Parent. Custom Layout. Text to show the alarm occurance. + Workdays + Workdays + txt_clock_main_view_dblist_daily_val_today + Clock main view_P01 + dblist_1_val Cl False - - 4th dropdown list value for Occurence label in Alarm editor view - Repeat on workdays - Repeat on workdays + + 3rd value in combo box list for Date format label + yyyy mm dd + yyyy mm dd qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_4_val - Cl - False - - - 7th dropdown list value for Day label in Alarm editor view - Sunday - Sunday - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_7_val + Clock main view_P01 + setlabel_3_val Cl False @@ -222,23 +172,13 @@ Cl False - - 3rd value in combo box list for Date format label - yyyy mm dd - yyyy mm dd - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_3_val - Cl - False - - - Note displayed after alarm is set (time remaining) (hr, mins) - Time to alarm %1 hour and %2 minutes - Time to alarm %1 hour and %2 minutes - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo + + Subtitle for World Clock view + World Clock + World Clock + qtl_groupbox_simple_sec + Clock_World clock_P05 + subhead Cl False @@ -252,23 +192,13 @@ Cl False - - Form label for city name in add own city (popup) data entry form - City name - City name - qtl_dataform_heading_pri - Clock_City list_P07 - formlabel_1 - Cl - False - - - Form label for timezone in add own city (popup) data entry form - Timezone - Timezone - qtl_dataform_heading_pri - Clock_City list_P07 - formlabel_1 + + + Add city + Add city + qtl_toolbar_tiny1_3 + Clock_World clock_P05 + button Cl False @@ -282,6 +212,16 @@ Cl False + + Secondary text displaying the time remaining for the alarm (hours, min) + In %1hrs %2min + In %1hrs %2min + txt_clock_main_view_setlabel_in_1hrs_2min + Clock main view_P01 + setlabel_1 + Cl + False + GMT @@ -292,13 +232,23 @@ Co False - - "Add own city" from Options menu in City list - Add own city - Add own city - qtl_menu_pri - Clock_City list_P07 - opt + + Clock application in Application library grid + Clock + Clock + qtl_grid_applications_sec + Clock + grid + Cl + False + + + Layout ID Parent. Custom layout. Days remaining for the alarm + In %1days + In %1days + txt_clock_main_view_setlabel_in_1days + Clock main view_P01 + setlabel_1 Cl False @@ -322,36 +272,6 @@ Cl False - - Label to the date field (picker) in the settings view - Date - Date - qtl_dataform_pri - Clock_Date & time settings_P04_1 - setlabel_1 - Cl - False - - - Label for Workdays in Alarm editor - Workdays - Workdays - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - 2nd value in combo box list for Time format label - 12 hour - 12 hour - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_2_val - Cl - False - Layout ID Parent. Custom. Alarm Occurance detail. Every %1 @@ -362,499 +282,6 @@ Cl False - - Note displayed after alarm is set (time remaining) (hrs, mins) - Time to alarm %1 hours and %2 minutes - Time to alarm %1 hours and %2 minutes - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - 3rd dropdown list value for Occurence label in Alarm editor view - Repeat weekly - Repeat weekly - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_3_val - Cl - False - - - Note displayed after alarm is set (workdays) - Alarm occurs workdays at %1 - Alarm occurs workdays at %1 - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Clock application in Application library list - Clock - Clock - qtl_list_pri_large_graphic - Clock - list - Cl - False - - - Sub-title for Date & time settings view - Date & time - Date & time - qtl_groupbox_simple_sec - Clock_Date & time settings_P04_1 - subhead - Cl - False - - - Information shown in a popup once the alarm is deactivated - Alarm Deactivated - Alarm Deactivated - qtl_notifdialog_pri2 - Clock main view_P01 - dpopinfo - Cl - False - - - Long tap menu on an added city in the World clock view (both portrait and landscape) - Set as current location - Set as current location - qtl_menu_pri - Clock_World clock_P05 - menu - Cl - False - - - Item in Options menu from Clock main vew - Settings - Settings - qtl_menu_pri - Clock main view_P01 - opt - Cl - False - - - 3rd dropdown list value for Day label in Alarm editor view - Wednesday - Wednesday - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_3_val - Cl - False - - - Title for Date and time settings view - Clock - Clock - - Common - Common - Co - False - - - The time and date information will be displayed in 2nd row - %1, %2 - %1, %2 - qtl_list_sec_large_graphic - CP main view_time & date plugin_P11 - list - CP - False - - - Setting item to clock display type. Tap to toggle values. - Digital - Digital - qtl_dataform_button_sec - Clock_Date & time settings_P04_1 - button - Cl - False - - - This text is displayed in 1st row - Time & date - Time & date - qtl_list_pri_large_graphic - CP main view_time & date plugin_P11 - list - CP - False - - - Note displayed after alarm is set (every week) - Alarm occurs every week on %1 at %2 - Alarm occurs every week on %1 at %2 - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - When a city is added to the World Clock list view, its relative time offset is displayed with respect to Homecity. (Hour and Mins) - %1 hr %2 mins - %1 hr %2 mins - txt_clock_dblist_val_l1_hr - Clock_World clock_P05 - dblist_1_val - Cl - False - - - Label for Occurence in Alarm editor - Occurence - Occurence - qtl_dataform_heading_pri - Clock_Alarm editor_P03 - setlabel_1 - Cl - False - - - When a city is added to the World Clock list view, its relative time offset is displayed with respect to Homecity. (Mins) - %1 mins - %1 mins - txt_clock_dblist_val_l1_hr - Clock_World clock_P05 - dblist_1_val - Cl - False - - - 3rd field in Regional date & time settings view - Date format - Date format - qtl_dataform_heading_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Note displayed after alarm is set (time remaining) (hrs, min) - Time to alarm %1 hours and %2 minute - Time to alarm %1 hours and %2 minute - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Long tap menu on an added city in World clock view (both portrait and landscape) - Show on homescreen - Show on homescreen - qtl_menu_pri - Clock_World clock_P05 - menu - Cl - False - - - Popup Information which comes after setting the alarm. - Alarm will occur at %1 after automatic daylight saving update - Alarm will occur at %1 after automatic daylight saving update - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - When user taps on "New alarm" toolbar button in Clock main view, alarm editor opens with the subtitle "New alarm". - New alarm - New alarm - qtl_groupbox_simple_sec - Clock_Alarm editor_P03 - subhead - Cl - False - - - Sub-title for Regiional date & time settings - Regional date & time settings - Regional date & time settings - qtl_groupbox_simple_sec - Clock_Date & time settings_P04_3 - subhead - Cl - False - - - 1st Value in combo box list for Time format label - 24 hour - 24 hour - qtl_dataform_group_pri - Clock_Date & time settings_P04_3 - setlabel_1_val - Cl - False - - - Secondary text displaying the time remaining for the alarm (hours, mins) - In %1hrs %2mins - In %1hrs %2mins - txt_clock_main_view_setlabel_in_1hrs_2mins - Clock main view_P01 - setlabel_1 - Cl - False - - - Form label for country in add own city (popup) data entry form - Country - Country - qtl_dataform_heading_pri - Clock_City list_P07 - formlabel_1 - Cl - False - - - - DST - DST - - Common - setlabel_1 - Co - False - - - Label for Alarm sound in Alarm editor view - Alarm sound - Alarm sound - qtl_checkbox_sec - Clock_Alarm editor_P03 - setlabel_1 - Cl - False - - - 1st dropdown list value for Day label in Alarm editor view - Monday - Monday - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_1_val - Cl - False - - - - Alarms - Alarms - qtl_toolbar_tiny1_3 - Clock main view_P01 - button - Cl - False - - - Note displayed after alarm is set (Everyday Time) - Alarm occurs every day at %1 - Alarm occurs every day at %1 - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - 4th dropdown list value for Day label in Alarm editor view - Thursday - Thursday - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_4_val - Cl - False - - - Alarm snooze time details in the list box (5mins, 10mins, 15mins, 30mins) - %Ln minutes - - (s)%Ln minutes - (p)%Ln minutes - - qtl_dataform_combobox_sec - Clock_Date & time settings_P04_1 - set - Cl - False - - - Setting item to clock display type. Tap to toggle values. - Analog - Analog - qtl_dataform_button_sec - Clock_Date & time settings_P04_1 - button - Cl - False - - - Note displayed after alarm is set (time remaining) - Time to alarm %1 hour and %2 minute - Time to alarm %1 hour and %2 minute - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Layout ID Parent. Custom Layout. Text to show the alarm occurance. - Workdays - Workdays - txt_clock_main_view_dblist_daily_val_today - Clock main view_P01 - dblist_1_val - Cl - False - - - 2nd dropdown list value for Day label in Alarm editor view - Tuesday - Tuesday - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_2_val - Cl - False - - - Subtitle for World Clock view - World Clock - World Clock - qtl_groupbox_simple_sec - Clock_World clock_P05 - subhead - Cl - False - - - Note displayed after alarm is set (only once) - Alarm occurs once only on next %1 at %2 - Alarm occurs once only on next %1 at %2 - qtl_notifdialog_pri2 - Clock_Alarm editor_P03 - dpopinfo - Cl - False - - - Title for the date picker tumbler widget - Alarm date - Alarm date - qtl_dialog_pri_heading - Tumbler - title - Tu - False - - - - Date - Date - qtl_dialog_pri_heading - Tumbler - title - Tu - False - - - Secondary text displaying the time remaining for the alarm (hours, min) - In %1hrs %2min - In %1hrs %2min - txt_clock_main_view_setlabel_in_1hrs_2min - Clock main view_P01 - setlabel_1 - Cl - False - - - Clock application in Application library grid - Clock - Clock - qtl_grid_applications_sec - Clock - grid - Cl - False - - - Label for Day in Alarm editor view - Day - Day - qtl_dataform_heading_pri - Clock_Alarm editor_P03 - setlabel_1 - Cl - False - - - Layout ID Parent. Custom layout. Days remaining for the alarm - In %1days - In %1days - txt_clock_main_view_setlabel_in_1days - Clock main view_P01 - setlabel_1 - Cl - False - - - 1st label in Date and time settings view - Use network date & time - Use network date & time - qtl_checkbox_sec - Clock_Date & time settings_P04_1 - setlabel_1 - Cl - False - - - Subtitle for the time seperator drop down list - Time separator - Time separator - qtl_dataform_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Subtitle for the date seperator drop down list - Date separator - Date separator - qtl_dataform_pri - Clock_Date & time settings_P04_3 - setlabel_1 - Cl - False - - - Label to the time field (picker) in the settings view - Time - Time - qtl_dataform_pri - Clock_Date & time settings_P04_1 - setlabel_1 - Cl - False - Layout ID Parent. Custom Layout. Text to show the alarm occurance. Today @@ -865,40 +292,40 @@ Cl False - - Primary text label for Clock Type - Clock Type - Clock Type - qtl_dataform_pri - Clock_Date & time settings_P04_1 - setlabel_5 + + Clock application in Application library list + Clock + Clock + qtl_list_pri_large_graphic + Clock + list Cl False - - Subtitle for City list - City list - City list - qtl_groupbox_simple_sec - Clock_City list_P07 - subhead - Cl - False - - - When user creates a new alarm in Alarm editor form, he can "Delete" this alarm via Options menu. - Delete - Delete + + Item in Options menu from Clock main vew + Settings + Settings qtl_menu_pri - Clock_Alarm editor_P03 + Clock main view_P01 opt Cl False - - Information shown in a popup once the alarm is activated - Alarm Activated - Alarm Activated + + Long tap menu on an added city in the World clock view (both portrait and landscape) + Set as current location + Set as current location + qtl_menu_pri + Clock_World clock_P05 + menu + Cl + False + + + Information shown in a popup once the alarm is deactivated + Alarm Deactivated + Alarm Deactivated qtl_notifdialog_pri2 Clock main view_P01 dpopinfo @@ -915,23 +342,13 @@ Cl False - - 6th dropdown list value for Day label in Alarm editor view - Saturday - Saturday - qtl_dataform_group_pri - Clock_Alarm editor_P03 - setlabel_6_val - Cl - False - - - Label for Description in Alarm editor view - Description - Description - qtl_dataform_pri - Clock_Alarm editor_P03 - formlabel_1 + + Information shown in a popup once the alarm is activated + Alarm Activated + Alarm Activated + qtl_notifdialog_pri2 + Clock main view_P01 + dpopinfo Cl False @@ -940,7 +357,7 @@ dd mm yyyy dd mm yyyy qtl_dataform_group_pri - Clock_Date & time settings_P04_3 + Clock main view_P01 setlabel_1_val Cl False diff -r fd30d51f876b -r a949c2543c15 clock/data/worldclock/qgn_clock_time_zone.svg --- a/clock/data/worldclock/qgn_clock_time_zone.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/worldclock/qgn_indi_dst_add.svg --- a/clock/data/worldclock/qgn_indi_dst_add.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r fd30d51f876b -r a949c2543c15 clock/data/worldclock/qgn_indi_find.svg --- a/clock/data/worldclock/qgn_indi_find.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/data/worldclock/qgn_test_city_default.svg --- a/clock/data/worldclock/qgn_test_city_default.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r fd30d51f876b -r a949c2543c15 clock/data/worldclock/qtg_test_homecity.svg --- a/clock/data/worldclock/qtg_test_homecity.svg Mon May 03 12:30:32 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r fd30d51f876b -r a949c2543c15 clock/ftudatetimewizard/inc/ftudatetimeview.h --- a/clock/ftudatetimewizard/inc/ftudatetimeview.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/ftudatetimewizard/inc/ftudatetimeview.h Fri May 14 15:51:09 2010 +0300 @@ -19,10 +19,11 @@ #define FTUDATETIMEVIEW_H // System includes -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "clockcityselectionlist.h" // Forward declarations. @@ -56,6 +57,7 @@ void updateDate(); void updateTime(); void HandleLocationChange(LocationInfo); + void selectedAction(HbAction *action); private: void createMainLayout(); @@ -63,22 +65,27 @@ void populateDateTimeGroup(); void populatePlaceGroup(); void wizardEditedDate(const QDate &date); - + +private: HbDataForm* mDateTimePlaceForm; HbDataFormModel* mDateTimePlaceModel; - + HbDataFormModelItem *mDateItem; HbDataFormModelItem *mTimeItem; HbDataFormModelItem *mAutoTimeUpdateItem; HbDataFormModelItem *mPlaceGroup; HbDataFormModelItem *mCountryItem; HbDataFormModelItem *mCityItem; - + HbDateTimePicker* mDatePicker; HbDateTimePicker* mTimePicker; - HbDialog* mDatetimepopup; + QPointer mDatePickerDialog; + QPointer mTimePickerDialog; + + HbAction *mOkAction; + HbAction *mCancelAction; SettingsUtility *mSettingsUtility; - + TimezoneClient *mTimeZoneClient; ClockCitySelectionList* mCitySelectionList; bool mTimeAutoUpdate; diff -r fd30d51f876b -r a949c2543c15 clock/ftudatetimewizard/inc/ftudatetimewizardfactory.h --- a/clock/ftudatetimewizard/inc/ftudatetimewizardfactory.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/ftudatetimewizard/inc/ftudatetimewizardfactory.h Fri May 14 15:51:09 2010 +0300 @@ -19,7 +19,7 @@ #define FTUDATETIMEWIZARDFACTORY_H // System includes -#include +#include // User includes #include "ftuwizardfactory.h" diff -r fd30d51f876b -r a949c2543c15 clock/ftudatetimewizard/src/ftudatetimeview.cpp --- a/clock/ftudatetimewizard/src/ftudatetimeview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/clock/ftudatetimewizard/src/ftudatetimeview.cpp Fri May 14 15:51:09 2010 +0300 @@ -60,8 +60,7 @@ FtuDateTimeView::FtuDateTimeView() : HbView(), mDatePicker(NULL), -mTimePicker(NULL), -mDatetimepopup(NULL) +mTimePicker(NULL) { //TODO: Localisation has to be done // set title for wizard @@ -73,10 +72,10 @@ new FtuDateTimeCustomItem(mDateTimePlaceForm); prototypes.append(customItem); mDateTimePlaceForm->setItemPrototypes(prototypes); - + // Construct the settings utility. mSettingsUtility = new SettingsUtility(); - mTimeZoneClient = new TimezoneClient(); + mTimeZoneClient = TimezoneClient::getInstance(); mTimeAutoUpdate = mTimeZoneClient->timeUpdateOn(); } @@ -88,6 +87,10 @@ delete mDateTimePlaceForm; delete mDateTimePlaceModel; delete mSettingsUtility; + + if (!mTimeZoneClient->isNull()) { + mTimeZoneClient->deleteInstance(); + } } /*! Creates the main view. @@ -123,7 +126,7 @@ */ void FtuDateTimeView::populateDateTimeGroup() { - HbDataFormModelItem *dateTimeGroup = + HbDataFormModelItem *dateTimeGroup = mDateTimePlaceModel->appendDataFormGroup (QString(tr("Date and Time")), mDateTimePlaceModel->invisibleRootItem()); @@ -146,7 +149,7 @@ SLOT(populateDatePicker())); mDateTimePlaceForm->addConnection(mTimeItem, SIGNAL(clicked()), this, SLOT(populateTimePicker())); - mDateTimePlaceForm->addConnection(mAutoTimeUpdateItem, SIGNAL(clicked()), + mDateTimePlaceForm->addConnection(mAutoTimeUpdateItem, SIGNAL(clicked()), this, SLOT(setAutoTimeupDate())); } @@ -165,14 +168,14 @@ mCityItem = mDateTimePlaceModel->appendDataFormItem( HbDataFormModelItem::CustomItemBase, QString(tr("City")), mPlaceGroup); - + // Connect the items to the proper slots mDateTimePlaceForm->addConnection(mCountryItem, SIGNAL(clicked()), this, SLOT(populateCitySelectionList())); mDateTimePlaceForm->addConnection(mCityItem, SIGNAL(clicked()), this, SLOT(populateCitySelectionList())); - - + + } /*! @@ -189,12 +192,12 @@ } else { mAutoTimeUpdateItem->setContentWidgetData("text", tr("OFF")); } - mCountryItem->setContentWidgetData("text", + mCountryItem->setContentWidgetData("text", mTimeZoneClient->getCurrentZoneInfoL().countryName); - mCityItem->setContentWidgetData("text", + mCityItem->setContentWidgetData("text", mTimeZoneClient->getCurrentZoneInfoL().cityName); - // Set the date,time,country and city fields disable + // Set the date,time,country and city fields disable // if auto time update is ON if (mTimeAutoUpdate) { mDateItem->setEnabled(false); @@ -209,14 +212,13 @@ */ void FtuDateTimeView::populateDatePicker() { - if (mDatetimepopup) { - delete mDatetimepopup; - mDatetimepopup = NULL; + if (mDatePickerDialog) { + delete mDatePickerDialog; } - mDatetimepopup = new HbDialog(); + mDatePickerDialog = new HbDialog(); - mDatetimepopup->setDismissPolicy(HbDialog::NoDismiss); - mDatetimepopup->setTimeout(HbDialog::NoDismiss); + mDatePickerDialog->setDismissPolicy(HbDialog::NoDismiss); + mDatePickerDialog->setTimeout(HbDialog::NoDismiss); if(mDatePicker) { mDatePicker = NULL; @@ -225,54 +227,53 @@ this); mDatePicker->setMinimumDate(QDate::fromString("01/01/1900", "dd/MM/yyyy")); mDatePicker->setMaximumDate(QDate::fromString("31/12/2100", "dd/MM/yyyy")); - mDatePicker->setDisplayFormat(mSettingsUtility->dateFormatString()); - // Sets the primary action and secondary action - HbAction *primaryAction = new HbAction(tr("OK"), mDatetimepopup); - HbAction *secondaryAction = new HbAction(tr("Cancel"), mDatetimepopup); + mDatePickerDialog->setContentWidget(mDatePicker); - mDatetimepopup->setPrimaryAction(primaryAction); - mDatetimepopup->setSecondaryAction(secondaryAction); - mDatetimepopup->setContentWidget(mDatePicker); + // Add ok and cancel actions. + mOkAction = new HbAction( + hbTrId("txt_common_button_ok"), mDatePickerDialog); + mCancelAction = new HbAction( + hbTrId("txt_common_button_cancel"), mDatePickerDialog); - connect(primaryAction, SIGNAL(triggered()), this, SLOT(updateDate())); - connect(secondaryAction, SIGNAL(triggered()), mDatetimepopup, SLOT(close())); - mDatetimepopup->exec(); + mDatePickerDialog->addAction(mOkAction); + mDatePickerDialog->addAction(mCancelAction); + + mDatePickerDialog->open(this, SLOT(selectedAction(HbAction *))); } /*! Populates the Time Picker. */ void FtuDateTimeView::populateTimePicker() -{ - if (mDatetimepopup) { - delete mDatetimepopup; - mDatetimepopup = NULL; +{ + if (mTimePickerDialog) { + delete mTimePickerDialog; } - mDatetimepopup = new HbDialog(); - mDatetimepopup->setDismissPolicy(HbDialog::NoDismiss); - mDatetimepopup->setTimeout(HbDialog::NoDismiss); + mTimePickerDialog = new HbDialog(); + mTimePickerDialog->setDismissPolicy(HbDialog::NoDismiss); + mTimePickerDialog->setTimeout(HbDialog::NoDismiss); if(mTimePicker) { mTimePicker = NULL; } - mTimePicker = new HbDateTimePicker(QTime().currentTime(), - this); + mTimePicker = new HbDateTimePicker( + QTime().currentTime(), this); mTimePicker->setDisplayFormat(mSettingsUtility->timeFormatString()); - // Sets the primary action and secondary action - HbAction *primaryAction = new HbAction(tr("OK"), mDatetimepopup); - HbAction *secondaryAction = new HbAction(tr("Cancel"), mDatetimepopup); + mTimePickerDialog->setContentWidget(mTimePicker); - mDatetimepopup->setPrimaryAction(primaryAction); - mDatetimepopup->setSecondaryAction(secondaryAction); + // Add ok and cancel actions. + mOkAction = new HbAction( + hbTrId("txt_common_button_ok"), mTimePickerDialog); - mDatetimepopup->setContentWidget(mTimePicker); + mCancelAction = new HbAction( + hbTrId("txt_common_button_cancel"), mTimePickerDialog); - connect(primaryAction, SIGNAL(triggered()), this, SLOT(updateTime())); - connect(secondaryAction, SIGNAL(triggered()), mDatetimepopup, SLOT(close())); + mTimePickerDialog->addAction(mOkAction); + mTimePickerDialog->addAction(mCancelAction); - mDatetimepopup->exec(); + mTimePickerDialog->open(this, SLOT(selectedAction(HbAction*))); } /*! @@ -334,6 +335,27 @@ } /*! + Slot to handle the selected action. + */ +void FtuDateTimeView::selectedAction(HbAction *action) +{ + // Update time/date based on the picker selected. + if (action == mOkAction) { + if (mTimePickerDialog) { + updateTime(); + } else if(mDatePickerDialog) { + updateDate(); + } + }else { + if(mTimePickerDialog) { + mTimePickerDialog->deleteLater(); + } else if(mDatePickerDialog) { + mDatePickerDialog->deleteLater(); + } + } +} + +/*! Sets the device date. */ void FtuDateTimeView::updateDate() @@ -341,7 +363,7 @@ QDate date = mDatePicker->date(); // Set device Date if (date.isValid()) { - mDateItem->setContentWidgetData("text", + mDateItem->setContentWidgetData("text", date.toString(mSettingsUtility->dateFormatString())); mTimeZoneClient->setDateTime(QDateTime(date, QTime::currentTime())); wizardEditedDate(date); @@ -356,7 +378,7 @@ QTime time = mTimePicker->time(); // Set device Time if (time.isValid()) { - mTimeItem->setContentWidgetData("text", + mTimeItem->setContentWidgetData("text", time.toString(mSettingsUtility->timeFormatString())); mTimeZoneClient->setDateTime(QDateTime(QDate::currentDate(), time)); wizardEditedDate(QDate::currentDate()); @@ -370,7 +392,7 @@ QDate FtuDateTimeView::getWizardCompletedDate() { XQSettingsManager *settingsManager = new XQSettingsManager(); - XQSettingsKey *ftuPluginDateCenrepKey = + XQSettingsKey *ftuPluginDateCenrepKey = new XQSettingsKey(XQSettingsKey::TargetCentralRepository, KCRUidClockApp, KFtuPluginDate); // Read the initial values from the cenrep @@ -392,10 +414,10 @@ void FtuDateTimeView::wizardEditedDate(const QDate &date) { XQSettingsManager *settingsManager = new XQSettingsManager(); - XQSettingsKey *ftuPluginDateCenrepKey = + XQSettingsKey *ftuPluginDateCenrepKey = new XQSettingsKey(XQSettingsKey::TargetCentralRepository, KCRUidClockApp, KFtuPluginDate); - QString dateString = date.toString(mSettingsUtility->dateFormatString()); + QString dateString = date.toString(mSettingsUtility->dateFormatString()); settingsManager->writeItemValue(*ftuPluginDateCenrepKey,dateString); // Cleanup. diff -r fd30d51f876b -r a949c2543c15 clock/inc/clockcommon.h --- a/clock/inc/clockcommon.h Mon May 03 12:30:32 2010 +0300 +++ b/clock/inc/clockcommon.h Fri May 14 15:51:09 2010 +0300 @@ -25,10 +25,17 @@ const QString CITY_INFO_DB ("cityInfo.dat"); const QString CLOCK_DEBUG_FILE("debug.txt"); const QString PATH_TEXT("C:/"); +const int KMaximumCityListCount(50); const long int KCRUidNitz = { 0x101F8876 }; +/** Active Protocol key */ +const long int KActiveProtocol = 0x00000001; +/** Previous alarm time high */ +const long int KPreviousAlarmTime = 0x00000002; -const long int KPreviousAlarmTime = 0x00000002; +const long int KCRUidClockApp = { 0x101F874D }; +/** Alarm snooze time key */ +const long int KClockAppSnoozeTime = 0x00000002; // Common definitions for docml. #define CLOCK_MAIN_VIEW_DOCML ":/xml/clockmainview.docml" @@ -38,9 +45,14 @@ #define CLOCK_WIDGET "clockWidget" #define CLOCK_ALARMLIST "alarmListView" #define CLOCK_NOALARMLABEL "noAlarmLabel" -#define WORLD_CLOCK_VIEW_DOCML ":/xml/worldclockview.docml" -#define WORLD_CLOCK_VIEW "worldClockView" -#define CLOCK_VIEWS_STYLE_PATH ":/style" +#define CLOCK_WORLD_VIEW_DOCML ":/xml/clockworldview.docml" +#define CLOCK_WORLD_VIEW "worldClockView" +#define CLOCK_WORLD_CITYLIST "worldClockCityListView" +#define CLOCK_WORLD_HOMECITY "homeCityWidget" +#define CLOCK_WORLD_VIEW_PORTRAIT_NOHOMECITY_SECTION "portrait-nohomecity" +#define CLOCK_WORLD_VIEW_PORTRAIT_HOMECITY_SECTION "portrait-homecity" +#define CLOCK_WORLD_VIEW_LANDSCAPE_NOHOMECITY_SECTION "landscape-nohomecity" +#define CLOCK_WORLD_VIEW_LANDSCAPE_HOMECITY_SECTION "landscape-homecity" #endif // CLOCKCOMMON_H diff -r fd30d51f876b -r a949c2543c15 clock/rom/clock.iby --- a/clock/rom/clock.iby Mon May 03 12:30:32 2010 +0300 +++ b/clock/rom/clock.iby Fri May 14 15:51:09 2010 +0300 @@ -44,15 +44,15 @@ // Binaries. file=ABI_DIR\BUILD_DIR\clockalarmclient.dll SHARED_LIB_DIR\clockalarmclient.dll file=ABI_DIR\BUILD_DIR\timezoneclient.dll SHARED_LIB_DIR\timezoneclient.dll -file=ABI_DIR\BUILD_DIR\clockstopwatchengine.dll SHARED_LIB_DIR\clockstopwatchengine.dll file=ABI_DIR\BUILD_DIR\clocksettingsutility.dll SHARED_LIB_DIR\clocksettingsutility.dll file=ABI_DIR\BUILD_DIR\clocksettingsview.dll SHARED_LIB_DIR\clocksettingsview.dll -file=ABI_DIR\BUILD_DIR\clockwidgetproto.dll SHARED_LIB_DIR\clockwidgetproto.dll file=ABI_DIR\BUILD_DIR\clockcityselectionlist.dll SHARED_LIB_DIR\clockcityselectionlist.dll file=ABI_DIR\BUILD_DIR\clockalarmeditor.dll SHARED_LIB_DIR\clockalarmeditor.dll file=ABI_DIR\BUILD_DIR\clockappcontroller.dll SHARED_LIB_DIR\clockappcontroller.dll file=ABI_DIR\BUILD_DIR\clockviewmanager.dll SHARED_LIB_DIR\clockviewmanager.dll file=ABI_DIR\BUILD_DIR\clockviews.dll SHARED_LIB_DIR\clockviews.dll +file=ABI_DIR\BUILD_DIR\clockwidget.dll SHARED_LIB_DIR\clockwidget.dll +file=ABI_DIR\BUILD_DIR\clockwidgetplugin.dll SHARED_LIB_DIR\clockwidgetplugin.dll file=ABI_DIR\BUILD_DIR\datetimesettingsplugin.dll SHARED_LIB_DIR\datetimesettingsplugin.dll data=\epoc32\data\c\resource\qt\plugins\controlpanel\datetimesettingsplugin.qtplugin resource\qt\plugins\controlpanel\datetimesettingsplugin.qtplugin diff -r fd30d51f876b -r a949c2543c15 notes/data/translations/notes.qm Binary file notes/data/translations/notes.qm has changed diff -r fd30d51f876b -r a949c2543c15 notes/data/translations/notes.ts --- a/notes/data/translations/notes.ts Mon May 03 12:30:32 2010 +0300 +++ b/notes/data/translations/notes.ts Fri May 14 15:51:09 2010 +0300 @@ -534,7 +534,7 @@ Layout ID Parent. Date Push Button in Dataform to set alarm date for a To-do note. This action opens the date picker component - %1 + %2 txt_notes_button_2 Notes_P8 @@ -602,6 +602,16 @@ No False + + Notes application name in Task Switcher + Notes + + txt_tsw_caption_notes + tsw01 + caption + ts + False + Sub title for Collections view Collections @@ -812,6 +822,16 @@ No False + + If a plain note is marked as To-do note in the list view, the marked item disappears from the current view with a notification dialog + Note moved to To-do's + + qtl_notifdialog_pri2 + Notes + dpopinfo + No + False + Item specific menu item to mark a task as completed Mark as done diff -r fd30d51f876b -r a949c2543c15 notes/data/xml/notescollectionsview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes/data/xml/notescollectionsview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 notes/data/xml/notesfavoriteview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes/data/xml/notesfavoriteview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 notes/data/xml/notesmainview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes/data/xml/notesmainview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 notes/data/xml/notesnoteview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes/data/xml/notesnoteview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 notes/data/xml/notestodoview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes/data/xml/notestodoview.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 notes/notesui/bwins/notesmodelu.def --- a/notes/notesui/bwins/notesmodelu.def Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/bwins/notesmodelu.def Fri May 14 15:51:09 2010 +0300 @@ -41,4 +41,5 @@ ?populateSourceModel@NotesModel@@AAEXXZ @ 40 NONAME ; void NotesModel::populateSourceModel(void) ?dateFormatString@NotesModel@@AAE?AVQString@@XZ @ 41 NONAME ; class QString NotesModel::dateFormatString(void) ?timeFormatString@NotesModel@@AAE?AVQString@@XZ @ 42 NONAME ; class QString NotesModel::timeFormatString(void) + ?handleInstanceViewCreationCompleted@NotesModel@@AAEXH@Z @ 43 NONAME ; void NotesModel::handleInstanceViewCreationCompleted(int) diff -r fd30d51f876b -r a949c2543c15 notes/notesui/bwins/notesviewsu.def --- a/notes/notesui/bwins/notesviewsu.def Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/bwins/notesviewsu.def Fri May 14 15:51:09 2010 +0300 @@ -4,14 +4,18 @@ ??1NotesMainView@@UAE@XZ @ 3 NONAME ; NotesMainView::~NotesMainView(void) ??0NotesFavoriteView@@QAE@PAVQGraphicsWidget@@@Z @ 4 NONAME ; NotesFavoriteView::NotesFavoriteView(class QGraphicsWidget *) ??1NotesFavoriteView@@UAE@XZ @ 5 NONAME ; NotesFavoriteView::~NotesFavoriteView(void) - ?setupView@NotesMainView@@QAEXAAVNotesAppControllerIf@@PAVNotesDocLoader@@@Z @ 6 NONAME ; void NotesMainView::setupView(class NotesAppControllerIf &, class NotesDocLoader *) - ??0NotesTodoView@@QAE@PAVQGraphicsWidget@@@Z @ 7 NONAME ; NotesTodoView::NotesTodoView(class QGraphicsWidget *) - ??0NotesMainView@@QAE@PAVQGraphicsWidget@@@Z @ 8 NONAME ; NotesMainView::NotesMainView(class QGraphicsWidget *) - ??1NotesTodoView@@UAE@XZ @ 9 NONAME ; NotesTodoView::~NotesTodoView(void) - ?setupView@NotesFavoriteView@@QAEXAAVNotesAppControllerIf@@PAVNotesDocLoader@@@Z @ 10 NONAME ; void NotesFavoriteView::setupView(class NotesAppControllerIf &, class NotesDocLoader *) - ?setupView@NotesTodoView@@QAEXAAVNotesAppControllerIf@@PAVNotesDocLoader@@@Z @ 11 NONAME ; void NotesTodoView::setupView(class NotesAppControllerIf &, class NotesDocLoader *) - ??0NotesCollectionView@@QAE@PAVQGraphicsWidget@@@Z @ 12 NONAME ; NotesCollectionView::NotesCollectionView(class QGraphicsWidget *) - ??0NotesNoteView@@QAE@PAVQGraphicsWidget@@@Z @ 13 NONAME ; NotesNoteView::NotesNoteView(class QGraphicsWidget *) - ??1NotesNoteView@@UAE@XZ @ 14 NONAME ; NotesNoteView::~NotesNoteView(void) - ?setupView@NotesNoteView@@QAEXAAVNotesAppControllerIf@@PAVNotesDocLoader@@@Z @ 15 NONAME ; void NotesNoteView::setupView(class NotesAppControllerIf &, class NotesDocLoader *) + ??0NotesNoteView@@QAE@PAVQGraphicsWidget@@@Z @ 6 NONAME ; NotesNoteView::NotesNoteView(class QGraphicsWidget *) + ?setupView@NotesMainView@@QAEXAAVNotesAppControllerIf@@PAVNotesDocLoader@@@Z @ 7 NONAME ; void NotesMainView::setupView(class NotesAppControllerIf &, class NotesDocLoader *) + ??0NotesTodoView@@QAE@PAVQGraphicsWidget@@@Z @ 8 NONAME ; NotesTodoView::NotesTodoView(class QGraphicsWidget *) + ??0NotesMainView@@QAE@PAVQGraphicsWidget@@@Z @ 9 NONAME ; NotesMainView::NotesMainView(class QGraphicsWidget *) + ??1NotesNoteView@@UAE@XZ @ 10 NONAME ; NotesNoteView::~NotesNoteView(void) + ?setupAfterViewReady@NotesMainView@@QAEXXZ @ 11 NONAME ; void NotesMainView::setupAfterViewReady(void) + ?setupView@NotesNoteView@@QAEXAAVNotesAppControllerIf@@PAVNotesDocLoader@@@Z @ 12 NONAME ; void NotesNoteView::setupView(class NotesAppControllerIf &, class NotesDocLoader *) + ??1NotesTodoView@@UAE@XZ @ 13 NONAME ; NotesTodoView::~NotesTodoView(void) + ?setupView@NotesFavoriteView@@QAEXAAVNotesAppControllerIf@@PAVNotesDocLoader@@@Z @ 14 NONAME ; void NotesFavoriteView::setupView(class NotesAppControllerIf &, class NotesDocLoader *) + ?setupView@NotesTodoView@@QAEXAAVNotesAppControllerIf@@PAVNotesDocLoader@@@Z @ 15 NONAME ; void NotesTodoView::setupView(class NotesAppControllerIf &, class NotesDocLoader *) + ??0NotesCollectionView@@QAE@PAVQGraphicsWidget@@@Z @ 16 NONAME ; NotesCollectionView::NotesCollectionView(class QGraphicsWidget *) + ?updateTitle@NotesMainView@@QAEXXZ @ 17 NONAME ; void NotesMainView::updateTitle(void) + ?populateListView@NotesCollectionView@@QAEXXZ @ 18 NONAME ; void NotesCollectionView::populateListView(void) + ?updateTitle@NotesTodoView@@QAEXXZ @ 19 NONAME ; void NotesTodoView::updateTitle(void) diff -r fd30d51f876b -r a949c2543c15 notes/notesui/eabi/notesmodelu.def --- a/notes/notesui/eabi/notesmodelu.def Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/eabi/notesmodelu.def Fri May 14 15:51:09 2010 +0300 @@ -41,4 +41,5 @@ _ZTV25NotesSortFilterProxyModel @ 40 NONAME _ZN10NotesModel16dateFormatStringEv @ 41 NONAME _ZN10NotesModel16timeFormatStringEv @ 42 NONAME + _ZN10NotesModel35handleInstanceViewCreationCompletedEi @ 43 NONAME diff -r fd30d51f876b -r a949c2543c15 notes/notesui/eabi/notesviewsu.def --- a/notes/notesui/eabi/notesviewsu.def Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/eabi/notesviewsu.def Fri May 14 15:51:09 2010 +0300 @@ -1,52 +1,56 @@ EXPORTS - _ZN13NotesMainView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 1 NONAME - _ZN13NotesMainViewC1EP15QGraphicsWidget @ 2 NONAME - _ZN13NotesMainViewC2EP15QGraphicsWidget @ 3 NONAME - _ZN13NotesMainViewD0Ev @ 4 NONAME - _ZN13NotesMainViewD1Ev @ 5 NONAME - _ZN13NotesMainViewD2Ev @ 6 NONAME - _ZN13NotesTodoView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 7 NONAME - _ZN13NotesTodoViewC1EP15QGraphicsWidget @ 8 NONAME - _ZN13NotesTodoViewC2EP15QGraphicsWidget @ 9 NONAME - _ZN13NotesTodoViewD0Ev @ 10 NONAME - _ZN13NotesTodoViewD1Ev @ 11 NONAME - _ZN13NotesTodoViewD2Ev @ 12 NONAME - _ZN17NotesFavoriteView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 13 NONAME - _ZN17NotesFavoriteViewC1EP15QGraphicsWidget @ 14 NONAME - _ZN17NotesFavoriteViewC2EP15QGraphicsWidget @ 15 NONAME - _ZN17NotesFavoriteViewD0Ev @ 16 NONAME - _ZN17NotesFavoriteViewD1Ev @ 17 NONAME - _ZN17NotesFavoriteViewD2Ev @ 18 NONAME - _ZN19NotesCollectionView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 19 NONAME - _ZN19NotesCollectionViewC1EP15QGraphicsWidget @ 20 NONAME - _ZN19NotesCollectionViewC2EP15QGraphicsWidget @ 21 NONAME - _ZN19NotesCollectionViewD0Ev @ 22 NONAME - _ZN19NotesCollectionViewD1Ev @ 23 NONAME - _ZN19NotesCollectionViewD2Ev @ 24 NONAME - _ZThn16_N13NotesMainViewD0Ev @ 25 NONAME - _ZThn16_N13NotesMainViewD1Ev @ 26 NONAME - _ZThn16_N13NotesTodoViewD0Ev @ 27 NONAME - _ZThn16_N13NotesTodoViewD1Ev @ 28 NONAME - _ZThn16_N17NotesFavoriteViewD0Ev @ 29 NONAME - _ZThn16_N17NotesFavoriteViewD1Ev @ 30 NONAME - _ZThn16_N19NotesCollectionViewD0Ev @ 31 NONAME - _ZThn16_N19NotesCollectionViewD1Ev @ 32 NONAME - _ZThn8_N13NotesMainViewD0Ev @ 33 NONAME - _ZThn8_N13NotesMainViewD1Ev @ 34 NONAME - _ZThn8_N13NotesTodoViewD0Ev @ 35 NONAME - _ZThn8_N13NotesTodoViewD1Ev @ 36 NONAME - _ZThn8_N17NotesFavoriteViewD0Ev @ 37 NONAME - _ZThn8_N17NotesFavoriteViewD1Ev @ 38 NONAME - _ZThn8_N19NotesCollectionViewD0Ev @ 39 NONAME - _ZThn8_N19NotesCollectionViewD1Ev @ 40 NONAME - _ZN13NotesNoteView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 41 NONAME - _ZN13NotesNoteViewC1EP15QGraphicsWidget @ 42 NONAME - _ZN13NotesNoteViewC2EP15QGraphicsWidget @ 43 NONAME - _ZN13NotesNoteViewD0Ev @ 44 NONAME - _ZN13NotesNoteViewD1Ev @ 45 NONAME - _ZN13NotesNoteViewD2Ev @ 46 NONAME - _ZThn16_N13NotesNoteViewD0Ev @ 47 NONAME - _ZThn16_N13NotesNoteViewD1Ev @ 48 NONAME - _ZThn8_N13NotesNoteViewD0Ev @ 49 NONAME - _ZThn8_N13NotesNoteViewD1Ev @ 50 NONAME + _ZN13NotesMainView19setupAfterViewReadyEv @ 1 NONAME + _ZN13NotesMainView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 2 NONAME + _ZN13NotesMainViewC1EP15QGraphicsWidget @ 3 NONAME + _ZN13NotesMainViewC2EP15QGraphicsWidget @ 4 NONAME + _ZN13NotesMainViewD0Ev @ 5 NONAME + _ZN13NotesMainViewD1Ev @ 6 NONAME + _ZN13NotesMainViewD2Ev @ 7 NONAME + _ZN13NotesNoteView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 8 NONAME + _ZN13NotesNoteViewC1EP15QGraphicsWidget @ 9 NONAME + _ZN13NotesNoteViewC2EP15QGraphicsWidget @ 10 NONAME + _ZN13NotesNoteViewD0Ev @ 11 NONAME + _ZN13NotesNoteViewD1Ev @ 12 NONAME + _ZN13NotesNoteViewD2Ev @ 13 NONAME + _ZN13NotesTodoView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 14 NONAME + _ZN13NotesTodoViewC1EP15QGraphicsWidget @ 15 NONAME + _ZN13NotesTodoViewC2EP15QGraphicsWidget @ 16 NONAME + _ZN13NotesTodoViewD0Ev @ 17 NONAME + _ZN13NotesTodoViewD1Ev @ 18 NONAME + _ZN13NotesTodoViewD2Ev @ 19 NONAME + _ZN17NotesFavoriteView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 20 NONAME + _ZN17NotesFavoriteViewC1EP15QGraphicsWidget @ 21 NONAME + _ZN17NotesFavoriteViewC2EP15QGraphicsWidget @ 22 NONAME + _ZN17NotesFavoriteViewD0Ev @ 23 NONAME + _ZN17NotesFavoriteViewD1Ev @ 24 NONAME + _ZN17NotesFavoriteViewD2Ev @ 25 NONAME + _ZN19NotesCollectionView9setupViewER20NotesAppControllerIfP14NotesDocLoader @ 26 NONAME + _ZN19NotesCollectionViewC1EP15QGraphicsWidget @ 27 NONAME + _ZN19NotesCollectionViewC2EP15QGraphicsWidget @ 28 NONAME + _ZN19NotesCollectionViewD0Ev @ 29 NONAME + _ZN19NotesCollectionViewD1Ev @ 30 NONAME + _ZN19NotesCollectionViewD2Ev @ 31 NONAME + _ZThn16_N13NotesMainViewD0Ev @ 32 NONAME + _ZThn16_N13NotesMainViewD1Ev @ 33 NONAME + _ZThn16_N13NotesNoteViewD0Ev @ 34 NONAME + _ZThn16_N13NotesNoteViewD1Ev @ 35 NONAME + _ZThn16_N13NotesTodoViewD0Ev @ 36 NONAME + _ZThn16_N13NotesTodoViewD1Ev @ 37 NONAME + _ZThn16_N17NotesFavoriteViewD0Ev @ 38 NONAME + _ZThn16_N17NotesFavoriteViewD1Ev @ 39 NONAME + _ZThn16_N19NotesCollectionViewD0Ev @ 40 NONAME + _ZThn16_N19NotesCollectionViewD1Ev @ 41 NONAME + _ZThn8_N13NotesMainViewD0Ev @ 42 NONAME + _ZThn8_N13NotesMainViewD1Ev @ 43 NONAME + _ZThn8_N13NotesNoteViewD0Ev @ 44 NONAME + _ZThn8_N13NotesNoteViewD1Ev @ 45 NONAME + _ZThn8_N13NotesTodoViewD0Ev @ 46 NONAME + _ZThn8_N13NotesTodoViewD1Ev @ 47 NONAME + _ZThn8_N17NotesFavoriteViewD0Ev @ 48 NONAME + _ZThn8_N17NotesFavoriteViewD1Ev @ 49 NONAME + _ZThn8_N19NotesCollectionViewD0Ev @ 50 NONAME + _ZThn8_N19NotesCollectionViewD1Ev @ 51 NONAME + _ZN13NotesMainView11updateTitleEv @ 52 NONAME + _ZN13NotesTodoView11updateTitleEv @ 53 NONAME + _ZN19NotesCollectionView16populateListViewEv @ 54 NONAME diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/data/translations/notes.qm Binary file notes/notesui/noteseditor/data/translations/notes.qm has changed diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/data/translations/notes.ts --- a/notes/notesui/noteseditor/data/translations/notes.ts Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/noteseditor/data/translations/notes.ts Fri May 14 15:51:09 2010 +0300 @@ -534,7 +534,7 @@ Layout ID Parent. Date Push Button in Dataform to set alarm date for a To-do note. This action opens the date picker component - %1 + %2 txt_notes_button_2 Notes_P8 @@ -602,6 +602,16 @@ No False + + Notes application name in Task Switcher + Notes + + txt_tsw_caption_notes + tsw01 + caption + ts + False + Sub title for Collections view Collections @@ -812,6 +822,16 @@ No False + + If a plain note is marked as To-do note in the list view, the marked item disappears from the current view with a notification dialog + Note moved to To-do's + + qtl_notifdialog_pri2 + Notes + dpopinfo + No + False + Item specific menu item to mark a task as completed Mark as done diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/data/xml/notesnoteeditor.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes/notesui/noteseditor/data/xml/notesnoteeditor.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/data/xml/todoeditor.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes/notesui/noteseditor/data/xml/todoeditor.docml Fri May 14 15:51:09 2010 +0300 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/inc/notesnoteeditor.h --- a/notes/notesui/noteseditor/inc/notesnoteeditor.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/noteseditor/inc/notesnoteeditor.h Fri May 14 15:51:09 2010 +0300 @@ -48,7 +48,6 @@ private: void execute(AgendaEntry entry); QString getDescription(); - bool showDeleteConfirmationQuery(); private slots: void markNoteAsTodo(); @@ -63,6 +62,7 @@ void handleEntrySaveFromCalendar(); void handleCalendarEditorClosed(); void handleNewNoteAction(); + void selectedAction(HbAction *action); private: HbView *mEditor; @@ -77,6 +77,9 @@ QPointer mMarkFavouriteAction; QPointer mDiscardChangesAction; QPointer mNewNoteAction; + HbAction *mDeleteNoteAction; + HbAction *mCancelDeleteAction; + ulong mEntryId; NotesEditorDocLoader *mDocLoader; NotesEditorPrivate* mOwner; diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/inc/notestodoeditor.h --- a/notes/notesui/noteseditor/inc/notestodoeditor.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/noteseditor/inc/notestodoeditor.h Fri May 14 15:51:09 2010 +0300 @@ -71,7 +71,6 @@ void addMenu(); bool validAlarmSet(); void addDiscardChangesAction(); - bool showDeleteConfirmationQuery(); private slots: void saveTodo(); @@ -80,6 +79,7 @@ void handleRemoveDescriptionAction(); void handleDeleteAction(); void handleDiscardChangesAction(); + void selectedAction(HbAction *action); private: NotesEditorPrivate* mOwner; @@ -99,7 +99,8 @@ HbAction *mDoneAction; HbAction *mDiscardAction; QPointer mDescriptionAction; - + HbAction *mDeleteTodoAction; + HbAction *mCancelDeleteAction; HbGroupBox *mSubHeading; NotesEditorDocLoader *mDocLoader; diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/inc/notestodoeditorcustomitem.h --- a/notes/notesui/noteseditor/inc/notestodoeditorcustomitem.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/noteseditor/inc/notestodoeditorcustomitem.h Fri May 14 15:51:09 2010 +0300 @@ -45,9 +45,11 @@ private slots: void launchTimePicker(); void launchDatePicker(); + void selectDueDate(); + void selectedAction(HbAction *action); + +private: void handleOkAction(); - void handleCancelAction(); - void selectDueDate(); private: QPointer mTimePickerDialog; @@ -55,6 +57,10 @@ QPointer mTimeWidget; QPointer mDateWidget; QPointer mDueDateItem; + + HbAction *mOkAction; + HbAction *mCancelAction; + NotesEditorPrivate* mNotesTodoeditorPvt; bool mDueDatePickerIsActive; diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/src/notesnoteeditor.cpp --- a/notes/notesui/noteseditor/src/notesnoteeditor.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/noteseditor/src/notesnoteeditor.cpp Fri May 14 15:51:09 2010 +0300 @@ -230,7 +230,7 @@ // Set our view as the current view. HbMainWindow *window = hbInstance->allMainWindows().first(); - HbAction *action = new HbAction(Hb::BackAction); + HbAction *action = new HbAction(Hb::BackNaviAction); mEditor->setNavigationAction(action); connect( action, SIGNAL(triggered()), @@ -295,19 +295,33 @@ */ void NotesNoteEditor::deleteNote() { - if (showDeleteConfirmationQuery()) { - mOwner->deleteNote(); + HbMessageBox *confirmationQuery = new HbMessageBox( + HbMessageBox::MessageTypeQuestion); + confirmationQuery->setDismissPolicy(HbDialog::NoDismiss); + confirmationQuery->setTimeout(HbDialog::NoTimeout); + confirmationQuery->setIconVisible(true); - HbMainWindow *window = hbInstance->allMainWindows().first(); - bool status = false; + QString displayText; + displayText = displayText.append(hbTrId("txt_notes_info_delete_note")); + + confirmationQuery->setText(displayText); - // Now close the editor. - window->removeView(mEditor); + // Remove the default actions. + QList defaultActions = confirmationQuery->actions(); + for (int index=0;indexremoveAction(defaultActions[index]); + } + defaultActions.clear(); - mOwner->editingCompleted(status); + // Add delete and cancel actions. + mDeleteNoteAction = new HbAction( + hbTrId("txt_notes_button_dialog_delete")); + mCancelDeleteAction = new HbAction( + hbTrId("txt_common_button_cancel")); + confirmationQuery->addAction(mDeleteNoteAction); + confirmationQuery->addAction(mCancelDeleteAction); - } - + confirmationQuery->open(this, SLOT(selectedAction(HbAction*))); } /*! @@ -526,32 +540,21 @@ } /* ! - Show the delete confirmation query. + Slot to handle the selected action from delete message box. */ -bool NotesNoteEditor::showDeleteConfirmationQuery() +void NotesNoteEditor::selectedAction(HbAction *action) { - bool retValue(false); - - HbMessageBox confirmationQuery(HbMessageBox::MessageTypeQuestion); - confirmationQuery.setDismissPolicy(HbDialog::NoDismiss); - confirmationQuery.setTimeout(HbDialog::NoTimeout); - confirmationQuery.setIconVisible(true); + if (action == mDeleteNoteAction) { + mOwner->deleteNote(); - QString displayText; - displayText = displayText.append(hbTrId("txt_notes_info_delete_note")); - - confirmationQuery.setText(displayText); + HbMainWindow *window = hbInstance->allMainWindows().first(); + bool status = false; - confirmationQuery.setPrimaryAction(new HbAction( - hbTrId("txt_notes_button_dialog_delete"), &confirmationQuery)); - confirmationQuery.setSecondaryAction(new HbAction( - hbTrId("txt_common_button_cancel"), &confirmationQuery)); - HbAction *selected = confirmationQuery.exec(); - if (selected == confirmationQuery.primaryAction()) { - retValue = true; + // Now close the editor. + window->removeView(mEditor); + + mOwner->editingCompleted(status); } - - return retValue; } // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/src/notestodoeditor.cpp --- a/notes/notesui/noteseditor/src/notestodoeditor.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/noteseditor/src/notestodoeditor.cpp Fri May 14 15:51:09 2010 +0300 @@ -32,10 +32,9 @@ #include #include #include -#include #include #include -#include +#include #include #include #include @@ -296,7 +295,7 @@ // Store the current view and set our view as the current view. HbMainWindow *window = hbInstance->allMainWindows().first(); - HbAction *action = new HbAction(Hb::BackAction); + HbAction *action = new HbAction(Hb::BackNaviAction); mEditor->setNavigationAction(action); connect( action, SIGNAL(triggered()), @@ -636,14 +635,33 @@ */ void NotesTodoEditor::handleDeleteAction() { - if (showDeleteConfirmationQuery()) { - // Delete the to-do entry. - mOwner->deleteNote(); + HbMessageBox *confirmationQuery = new HbMessageBox( + HbMessageBox::MessageTypeQuestion); + confirmationQuery->setDismissPolicy(HbDialog::NoDismiss); + confirmationQuery->setTimeout(HbDialog::NoTimeout); + confirmationQuery->setIconVisible(true); + + QString displayText; + displayText = displayText.append(hbTrId("txt_notes_info_delete_todo_note")); + + confirmationQuery->setText(displayText); - // Close the to-do editor. - close(); + // Remove the default actions. + QList defaultActions = confirmationQuery->actions(); + for (int index=0;indexremoveAction(defaultActions[index]); } + defaultActions.clear(); + // Add delete and cancel actions. + mDeleteTodoAction = new HbAction( + hbTrId("txt_notes_button_dialog_delete")); + mCancelDeleteAction = new HbAction( + hbTrId("txt_common_button_cancel")); + confirmationQuery->addAction(mDeleteTodoAction); + confirmationQuery->addAction((mCancelDeleteAction)); + + confirmationQuery->open(this, SLOT(selectedAction(HbAction*))); } /*! @@ -653,35 +671,20 @@ { // Close the to-do editor close(); - } -/* ! - Show the delete confirmation query. +/*! + Slot to handle selected action in delete confirmation note. */ -bool NotesTodoEditor::showDeleteConfirmationQuery() +void NotesTodoEditor::selectedAction(HbAction *action) { - bool retValue(false); - - HbMessageBox confirmationQuery(HbMessageBox::MessageTypeQuestion); - confirmationQuery.setDismissPolicy(HbDialog::NoDismiss); - confirmationQuery.setTimeout(HbDialog::NoTimeout); - confirmationQuery.setIconVisible(true); - - QString displayText; - displayText = displayText.append(hbTrId("txt_notes_info_delete_todo_note")); + if (action==mDeleteTodoAction) { + // Delete the to-do entry. + mOwner->deleteNote(); - confirmationQuery.setText(displayText); + // Close the to-do editor. + close(); + } +} - confirmationQuery.setPrimaryAction(new HbAction( - hbTrId("txt_notes_button_dialog_delete"), &confirmationQuery)); - confirmationQuery.setSecondaryAction(new HbAction( - hbTrId("txt_common_button_cancel"), &confirmationQuery)); - HbAction *selected = confirmationQuery.exec(); - if (selected == confirmationQuery.primaryAction()) { - retValue = true; - } - - return retValue; -} // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 notes/notesui/noteseditor/src/notestodoeditorcustomitem.cpp --- a/notes/notesui/noteseditor/src/notestodoeditorcustomitem.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/noteseditor/src/notestodoeditorcustomitem.cpp Fri May 14 15:51:09 2010 +0300 @@ -187,7 +187,7 @@ mTimePickerDialog->setHeadingWidget(timeLabel); // Create the tumbler. HbDateTimePicker *timePicker = new HbDateTimePicker(mTimePickerDialog); - + // Set the format for time picker. timePicker->setDisplayFormat(mNotesTodoeditorPvt->timeFormatString()); // Set the time needs to be displayed in time picker. @@ -197,21 +197,15 @@ // Set the tumbler as the content widget. mTimePickerDialog->setContentWidget(timePicker); - - HbAction *okAction = new HbAction(QString("Ok"), mTimePickerDialog); - mTimePickerDialog->setPrimaryAction(okAction); - connect( - okAction, SIGNAL(triggered()), - this, SLOT(handleOkAction())); + mOkAction = new HbAction( + hbTrId("txt_common_button_ok"), mTimePickerDialog); + mTimePickerDialog->addAction(mOkAction); - HbAction *cancelAction = new HbAction(QString("Cancel"), mTimePickerDialog); - mTimePickerDialog->setSecondaryAction(cancelAction); + mCancelAction = new HbAction( + hbTrId("txt_common_button_cancel"), mTimePickerDialog); + mTimePickerDialog->addAction(mCancelAction); - connect( - cancelAction, SIGNAL(triggered()), - this, SLOT(handleCancelAction())); - - mTimePickerDialog->exec(); + mTimePickerDialog->open(this, SLOT(selectedAction(HbAction *))); } /*! @@ -238,32 +232,90 @@ datePicker->setDateRange(QDate::fromString("01/01/1900", mNotesTodoeditorPvt->dateFormatString()), QDate::fromString("31/12/2100", mNotesTodoeditorPvt->dateFormatString())); - + // Set the date format in date picker. datePicker->setDisplayFormat(mNotesTodoeditorPvt->dateFormatString()); // Set the date needs to be in focus in date picker. datePicker->setDate(QDate::fromString(mDateWidget->text(), mNotesTodoeditorPvt->dateFormatString())); - + // Set the tumbler as the content widget. mDatePickerDialog->setContentWidget(datePicker); + mOkAction = new HbAction( + hbTrId("txt_common_button_ok"), mDatePickerDialog); + mDatePickerDialog->addAction(mOkAction); - HbAction *okAction = new HbAction(QString("Ok"), mDatePickerDialog); - mDatePickerDialog->setPrimaryAction(okAction); - connect( - okAction, SIGNAL(triggered()), - this, SLOT(handleOkAction())); + mCancelAction = new HbAction( + hbTrId("txt_common_button_cancel"), mDatePickerDialog); + mDatePickerDialog->addAction(mCancelAction); + + mDatePickerDialog->open(this, SLOT(selectedAction(HbAction *))); +} + +/* + Launches date picker for selecting the due date + */ +void NotesTodoEditorCustomItem::selectDueDate() +{ + if( mDueDateItem->isDown()) { + mDueDateItem->setDown(false); + return; + } + + mDueDatePickerIsActive = true; + + if (mDatePickerDialog) { + delete mDatePickerDialog; + } + + // Create the dialog. + mDatePickerDialog = new HbDialog; + mDatePickerDialog->setTimeout(HbDialog::NoTimeout); + mDatePickerDialog->setDismissPolicy(HbDialog::NoDismiss); - HbAction *cancelAction = new HbAction(QString("Cancel"), mDatePickerDialog); - mDatePickerDialog->setSecondaryAction(cancelAction); - connect( - cancelAction, SIGNAL(triggered()), - this, SLOT(handleCancelAction())); + // Create date picker + HbDateTimePicker *datePicker = new HbDateTimePicker(mDatePickerDialog); + // Set the min/max date for the editor. + datePicker->setDateRange(QDate::fromString("01/01/1900", + mNotesTodoeditorPvt->dateFormatString()), QDate::fromString("31/12/2100", + mNotesTodoeditorPvt->dateFormatString())); + + // Set the format of date picker. + datePicker->setDisplayFormat(mNotesTodoeditorPvt->dateFormatString()); + // Set the date needs to be displayed in datepicker. + datePicker->setDate(QDate::fromString(mDueDateItem->text(), + mNotesTodoeditorPvt->dateFormatString())); + + // Set the heading text + HbLabel *label = new HbLabel(hbTrId("txt_notes_formlabel_due_date")); + mDatePickerDialog->setHeadingWidget(label); + + // Set the tumbler as the content widget. + mDatePickerDialog->setContentWidget(datePicker); - mDatePickerDialog->exec(); + mOkAction = new HbAction( + hbTrId("txt_common_button_ok"), mDatePickerDialog); + mDatePickerDialog->addAction(mOkAction); + + mCancelAction = new HbAction( + hbTrId("txt_common_button_cancel"), mDatePickerDialog); + mDatePickerDialog->addAction(mCancelAction); + + mDatePickerDialog->open(this, SLOT(selectedAction(HbAction *))); } + +/*! + Slot to handle the selected action. + */ +void NotesTodoEditorCustomItem::selectedAction(HbAction *action) +{ + if (action == mOkAction) { + handleOkAction(); + } +} + /*! Handles the ok action of date/time picker dialog. */ @@ -339,77 +391,6 @@ alarmDateItem->setContentWidgetData("alarmDate",dueDateText); } } - - handleCancelAction(); -} -/*! - Handles the ok action of date/time picker dialog. - */ -void NotesTodoEditorCustomItem::handleCancelAction() -{ - // Close the dialog. - if (mDatePickerDialog) { - mDatePickerDialog->close(); - mDatePickerDialog->deleteLater(); - }else { - mTimePickerDialog->close(); - mTimePickerDialog->deleteLater(); - } -} - -/* - Launches date picker for selecting the due date - */ -void NotesTodoEditorCustomItem::selectDueDate() -{ - if( mDueDateItem->isDown()) { - mDueDateItem->setDown(false); - return; - } - - mDueDatePickerIsActive = true; - - if (mDatePickerDialog) { - delete mDatePickerDialog; - } - - // Create the dialog. - mDatePickerDialog = new HbDialog; - mDatePickerDialog->setTimeout(HbDialog::NoTimeout); - mDatePickerDialog->setDismissPolicy(HbDialog::NoDismiss); - - // Create date picker - HbDateTimePicker *datePicker = new HbDateTimePicker(mDatePickerDialog); - // Set the min/max date for the editor. - datePicker->setDateRange(QDate::fromString("01/01/1900", - mNotesTodoeditorPvt->dateFormatString()), QDate::fromString("31/12/2100", - mNotesTodoeditorPvt->dateFormatString())); - - // Set the format of date picker. - datePicker->setDisplayFormat(mNotesTodoeditorPvt->dateFormatString()); - // Set the date needs to be displayed in datepicker. - datePicker->setDate(QDate::fromString(mDueDateItem->text(), - mNotesTodoeditorPvt->dateFormatString())); - - // Set the heading text - HbLabel *label = new HbLabel(hbTrId("txt_notes_formlabel_due_date")); - mDatePickerDialog->setHeadingWidget(label); - - // Add actions to date picker - HbAction *okAction = new HbAction(tr("Ok")); - mDatePickerDialog->setPrimaryAction(okAction); - connect( - okAction, SIGNAL(triggered()), - this, SLOT(handleOkAction())); - - HbAction *cancelAction = new HbAction(tr("Cancel")); - mDatePickerDialog->setSecondaryAction(cancelAction); - connect( - cancelAction, SIGNAL(triggered()), - this, SLOT(handleCancelAction())); - - mDatePickerDialog->setContentWidget(datePicker); - mDatePickerDialog->exec(); } // End of file --Don't delete. diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesmodel/inc/notesmodel.h --- a/notes/notesui/notesmodel/inc/notesmodel.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesmodel/inc/notesmodel.h Fri May 14 15:51:09 2010 +0300 @@ -55,6 +55,7 @@ void populateSourceModel(QList ids); void addEntryToModel(ulong id); void removeEntryFromModel(ulong id); + void handleInstanceViewCreationCompleted(int status); private: void modifyEntryInModel(ulong id, int row); diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesmodel/src/notesmodel.cpp --- a/notes/notesui/notesmodel/src/notesmodel.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesmodel/src/notesmodel.cpp Fri May 14 15:51:09 2010 +0300 @@ -68,8 +68,10 @@ mAgendaUtil, SIGNAL(entryUpdated(ulong)), this, SLOT(updateSourceModel(ulong))); - // Populate the model in a different thread. - QTimer::singleShot(1, this, SLOT(populateSourceModel())); + // Connect for instance view creation completed signal + connect( + mAgendaUtil, SIGNAL(instanceViewCreationCompleted(int)), + this,SLOT(handleInstanceViewCreationCompleted(int))); } /*! @@ -325,6 +327,15 @@ } /*! + Populate the model after instance view creation. + */ +void NotesModel::handleInstanceViewCreationCompleted(int status) +{ + Q_UNUSED(status); + populateSourceModel(); +} + +/*! Modifies the content of a given `row' with the data of the entry given by `id'. diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviewmanager/inc/notesviewmanager.h --- a/notes/notesui/notesviewmanager/inc/notesviewmanager.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviewmanager/inc/notesviewmanager.h Fri May 14 15:51:09 2010 +0300 @@ -27,6 +27,7 @@ // Forward declarations class HbMainWindow; +class HbAction; class NotesMainView; class NotesModel; class AgendaUtil; @@ -54,11 +55,12 @@ void loadTodoView(); void loadFavoritesView(); void loadNoteView(); - bool showDeleteConfirmationQuery(ulong entryId); private slots: void loadOtherViews(); void deleteEntryFromView(ulong entryId); + void selectedAction(HbAction *action); + void handleInstanceViewCreationCompleted(int status); private: NotesAppControllerIf &mAppControllerIf; @@ -70,6 +72,10 @@ NotesFavoriteView *mFavoriteView; NotesNoteView *mNoteView; + HbAction *mDeleteAction; + HbAction *mCancelAction; + ulong mEntryId; + private: Q_DISABLE_COPY(NotesViewManager) }; diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviewmanager/src/notesviewmanager.cpp --- a/notes/notesui/notesviewmanager/src/notesviewmanager.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviewmanager/src/notesviewmanager.cpp Fri May 14 15:51:09 2010 +0300 @@ -59,6 +59,10 @@ mAgendaUtil = mAppControllerIf.agendaUtil(); + connect( + mAgendaUtil, SIGNAL(instanceViewCreationCompleted(int)), + this,SLOT(handleInstanceViewCreationCompleted(int))); + // Load the main view at the start up. loadNotesMainView(); @@ -249,21 +253,12 @@ } /*! - Delete the entry. - */ -void NotesViewManager::deleteEntryFromView(ulong entryId) -{ - if (showDeleteConfirmationQuery(entryId)) { - // Delete the given note. - mAgendaUtil->deleteEntry(entryId); - } -} - -/*! Loads other views from the docml file. */ void NotesViewManager::loadOtherViews() { + mMainView->setupAfterViewReady(); + // Load the collection view. loadNotesCollectionView(); // Load the to-do view. @@ -280,38 +275,71 @@ this, SLOT(loadOtherViews())); } -/* ! - Show the delete confirmation query. +/*! + Delete the entry. */ -bool NotesViewManager::showDeleteConfirmationQuery(ulong noteId) +void NotesViewManager::deleteEntryFromView(ulong entryId) { - bool retValue(false); - - HbMessageBox confirmationQuery(HbMessageBox::MessageTypeQuestion); - confirmationQuery.setDismissPolicy(HbDialog::NoDismiss); - confirmationQuery.setTimeout(HbDialog::NoTimeout); - confirmationQuery.setIconVisible(true); + mEntryId = entryId; + HbMessageBox *confirmationQuery = new HbMessageBox( + HbMessageBox::MessageTypeQuestion); + confirmationQuery->setDismissPolicy(HbDialog::NoDismiss); + confirmationQuery->setTimeout(HbDialog::NoTimeout); + confirmationQuery->setIconVisible(true); QString displayText; QString x; - AgendaEntry entry = mAgendaUtil->fetchById(noteId); + AgendaEntry entry = mAgendaUtil->fetchById(entryId); if (AgendaEntry::TypeTodo == entry.type()) { displayText += hbTrId("txt_notes_info_delete_todo_note"); } else { displayText += hbTrId("txt_notes_info_delete_note"); } - confirmationQuery.setText(displayText); + confirmationQuery->setText(displayText); + + // Remove the default actions. + QList defaultActions = confirmationQuery->actions(); + for (int index=0;indexremoveAction(defaultActions[index]); + } + defaultActions.clear(); + + // Add delete and cancel actions + mDeleteAction = new HbAction(hbTrId("txt_notes_button_dialog_delete")); + mCancelAction = new HbAction(hbTrId("txt_common_button_cancel")); + + confirmationQuery->addAction(mDeleteAction); + confirmationQuery->addAction(mCancelAction); + + confirmationQuery->open(this, SLOT(selectedAction(HbAction*))); +} - confirmationQuery.setPrimaryAction(new HbAction( - hbTrId("txt_notes_button_dialog_delete"), &confirmationQuery)); - confirmationQuery.setSecondaryAction(new HbAction( - hbTrId("txt_common_button_cancel"), &confirmationQuery)); - HbAction *selected = confirmationQuery.exec(); - if (selected == confirmationQuery.primaryAction()) { - retValue = true; +/*! + Slot to handle the delete action + */ +void NotesViewManager::selectedAction(HbAction *action) +{ + if (action == mDeleteAction) { + // Delete the given note. + mAgendaUtil->deleteEntry(mEntryId); } +} - return retValue; +/*! + Slot to handle instance view creation complete. + */ +void NotesViewManager::handleInstanceViewCreationCompleted(int status) +{ + Q_UNUSED(status) + + // Update the title for main view. + mMainView->updateTitle(); + + // Populate collections view. + mCollectionView->populateListView(); + + // Update the title for to-do view. + mTodoView->updateTitle(); } // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/inc/notescollectionview.h --- a/notes/notesui/notesviews/inc/notescollectionview.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/inc/notescollectionview.h Fri May 14 15:51:09 2010 +0300 @@ -47,6 +47,7 @@ public: NOTESVIEWS_EXPORT void setupView( NotesAppControllerIf &controllerIf, NotesDocLoader *docLoader); + NOTESVIEWS_EXPORT void populateListView(); private slots: void displayAllNotesView(); @@ -60,7 +61,7 @@ void handleActionStateChanged(); private: - void populateListView(); + int todosCount(); int recentNotesCount(); diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/inc/notesfavoriteview.h --- a/notes/notesui/notesviews/inc/notesfavoriteview.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/inc/notesfavoriteview.h Fri May 14 15:51:09 2010 +0300 @@ -67,6 +67,8 @@ void handleActionStateChanged(); void handleOrientationChanged(Qt::Orientation); void openNote(); + void selectedMenuAction(HbAction *action); + void handleMenuClosed(); private: HbListView *mListView; @@ -87,6 +89,7 @@ NotesModel *mNotesModel; NotesSortFilterProxyModel *mProxyModel; NotesEditor *mNotesEditor; + bool mIsLongTop; }; #endif // NOTESFAVORITEVIEW_H diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/inc/notesmainview.h --- a/notes/notesui/notesviews/inc/notesmainview.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/inc/notesmainview.h Fri May 14 15:51:09 2010 +0300 @@ -53,6 +53,9 @@ public: NOTESVIEWS_EXPORT void setupView( NotesAppControllerIf &controllerIf, NotesDocLoader *docLoader); + NOTESVIEWS_EXPORT void setupAfterViewReady(); + NOTESVIEWS_EXPORT void updateTitle(); + signals: void deleteEntry(ulong entryId); @@ -74,6 +77,8 @@ void updateSubTitle(ulong id=0); void markNoteAsTodo(); void openNote(); + void selectedMenuAction(HbAction *action); + void handleMenuClosed(); private: HbListView *mListView; @@ -102,6 +107,7 @@ NotesSortFilterProxyModel *mProxyModel; NotesEditor *mNotesEditor; AgendaEventViewer *mAgendaEventViewer; + bool mIsLongTop; }; #endif // NOTESMAINVIEW_H diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/inc/notesnoteview.h --- a/notes/notesui/notesviews/inc/notesnoteview.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/inc/notesnoteview.h Fri May 14 15:51:09 2010 +0300 @@ -49,7 +49,7 @@ public: NOTESVIEWS_EXPORT void setupView( NotesAppControllerIf &controllerIf, NotesDocLoader *docLoader); - + signals: void deleteEntry(ulong entryId); @@ -67,6 +67,8 @@ void handleActionStateChanged(); void handleOrientationChanged(Qt::Orientation); void openNote(); + void selectedMenuAction(HbAction *action); + void handleMenuClosed(); private: HbListView *mListView; @@ -88,6 +90,7 @@ NotesModel *mNotesModel; NotesSortFilterProxyModel *mProxyModel; NotesEditor *mNotesEditor; + bool mIsLongTop; }; #endif // NOTESNOTEVIEW_H diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/inc/notestodoview.h --- a/notes/notesui/notesviews/inc/notestodoview.h Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/inc/notestodoview.h Fri May 14 15:51:09 2010 +0300 @@ -50,7 +50,8 @@ public: NOTESVIEWS_EXPORT void setupView( NotesAppControllerIf &controllerIf, NotesDocLoader *docLoader); - + NOTESVIEWS_EXPORT void updateTitle(); + signals: void deleteEntry(ulong entryId); @@ -71,6 +72,8 @@ void handleOrientationChanged(Qt::Orientation); void updateSubTitle(ulong id=0); void openTodo(); + void selectedMenuAction(HbAction *action); + void handleMenuClosed(); private: HbListView *mListView; @@ -94,6 +97,7 @@ NotesSortFilterProxyModel *mProxyModel; NotesEditor *mNotesEditor; AgendaEventViewer *mAgendaEventViewer; + bool mIsLongTop; }; #endif // NOTESTODOVIEW_H diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/src/notescollectionview.cpp --- a/notes/notesui/notesviews/src/notescollectionview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/src/notescollectionview.cpp Fri May 14 15:51:09 2010 +0300 @@ -117,9 +117,6 @@ mListView, SIGNAL(activated(const QModelIndex &)), this, SLOT(handleActivated(const QModelIndex &))); - // Populate the content of the view. - populateListView(); - // Get the toolbar/menu actions. mAllNotesAction = static_cast ( mDocLoader->findObject("allNotesAction")); @@ -158,6 +155,46 @@ } /*! + Populate the content of the view. + */ +void NotesCollectionView::populateListView() +{ + QStandardItemModel *model = new QStandardItemModel(this); + model->setColumnCount(1); + + QString countString(hbTrId("txt_notes_list_note_count")); + + // Add To-do's item. + QStandardItem *item = new QStandardItem(); + QStringList todoStringList; + todoStringList.append(hbTrId("txt_notes_list_todos")); + todoStringList.append(countString.arg(QString::number(todosCount()))); + item->setData(todoStringList, Qt::DisplayRole); + model->appendRow(item); + + // Add Favorites item. + item = new QStandardItem(); + QStringList favStringList; + favStringList.append(hbTrId("txt_notes_list_favorites")); + favStringList.append(countString.arg(mFavouriteModel->rowCount())); + item->setData(favStringList, Qt::DisplayRole); + model->appendRow(item); + + // Add Recent notes item. + item = new QStandardItem(); + QStringList notesStringList; + notesStringList.append(hbTrId("txt_notes_list_plain_notes")); + notesStringList.append( + countString.arg(QString::number(recentNotesCount()))); + item->setData(notesStringList, Qt::DisplayRole); + model->appendRow(item); + + HbStyleLoader::registerFilePath(":/style"); + mListView->setLayoutName("custom"); + mListView->setModel(model); +} + +/*! Displays all notes view. */ void NotesCollectionView::displayAllNotesView() @@ -315,46 +352,6 @@ mViewCollectionAction->setChecked(true); } -/*! - Populate the content of the view. - */ -void NotesCollectionView::populateListView() -{ - QStandardItemModel *model = new QStandardItemModel(this); - model->setColumnCount(1); - - QString countString(hbTrId("txt_notes_list_note_count")); - - // Add To-do's item. - QStandardItem *item = new QStandardItem(); - QStringList todoStringList; - todoStringList.append(hbTrId("txt_notes_list_todos")); - todoStringList.append(countString.arg(QString::number(todosCount()))); - item->setData(todoStringList, Qt::DisplayRole); - model->appendRow(item); - - // Add Favorites item. - item = new QStandardItem(); - QStringList favStringList; - favStringList.append(hbTrId("txt_notes_list_favorites")); - favStringList.append(countString.arg(mFavouriteModel->rowCount())); - item->setData(favStringList, Qt::DisplayRole); - model->appendRow(item); - - // Add Recent notes item. - item = new QStandardItem(); - QStringList notesStringList; - notesStringList.append(hbTrId("txt_notes_list_plain_notes")); - notesStringList.append( - countString.arg(QString::number(recentNotesCount()))); - item->setData(notesStringList, Qt::DisplayRole); - model->appendRow(item); - - HbStyleLoader::registerFilePath(":/style"); - mListView->setLayoutName("custom"); - mListView->setModel(model); -} - /*! Returns the todos count diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/src/notesfavoriteview.cpp --- a/notes/notesui/notesviews/src/notesfavoriteview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/src/notesfavoriteview.cpp Fri May 14 15:51:09 2010 +0300 @@ -30,6 +30,7 @@ #include #include #include +#include // User includes #include "notesfavoriteview.h" @@ -56,7 +57,8 @@ NotesFavoriteView::NotesFavoriteView(QGraphicsWidget *parent) :HbView(parent), mSelectedItem(0), - mDeleteAction(0) + mDeleteAction(0), + mIsLongTop(false) { // Nothing yet. } @@ -176,35 +178,37 @@ */ void NotesFavoriteView::handleItemReleased(const QModelIndex &index) { - // Sanity check. - if (!index.isValid()) { - return; - } + if (!mIsLongTop) { + // Sanity check. + if (!index.isValid()) { + return; + } - // First get the id of the note and get the corresponding information from - // agendautil. - ulong noteId = index.data(NotesNamespace::IdRole).value(); + // First get the id of the note and get the corresponding information from + // agendautil. + ulong noteId = index.data(NotesNamespace::IdRole).value(); - if (0 >= noteId) { - // Something wrong. - return; - } + if (0 >= noteId) { + // Something wrong. + return; + } - // Get the entry details. - AgendaEntry entry = mAgendaUtil->fetchById(noteId); + // Get the entry details. + AgendaEntry entry = mAgendaUtil->fetchById(noteId); + + if (entry.isNull()) { - if (entry.isNull()) { + // Entry invalid. + return; + } - // Entry invalid. - return; + // Now launch the editor with the obtained info. + mNotesEditor = new NotesEditor(mAgendaUtil, this); + connect( + mNotesEditor, SIGNAL(editingCompleted(bool)), + this, SLOT(handleEditingCompleted(bool))); + mNotesEditor->edit(entry); } - - // Now launch the editor with the obtained info. - mNotesEditor = new NotesEditor(mAgendaUtil, this); - connect( - mNotesEditor, SIGNAL(editingCompleted(bool)), - this, SLOT(handleEditingCompleted(bool))); - mNotesEditor->edit(entry); } /*! @@ -219,6 +223,7 @@ HbAbstractViewItem *item, const QPointF &coords) { mSelectedItem = item; + mIsLongTop = true; // Get the entry of the selected item. ulong noteId = item->modelIndex().data( @@ -227,37 +232,28 @@ // Display a context specific menu. HbMenu *contextMenu = new HbMenu(); + connect( + contextMenu,SIGNAL(aboutToClose()), + this, SLOT(handleMenuClosed())); // Add actions to the context menu. mOpenAction = contextMenu->addAction(hbTrId("txt_common_menu_open")); - connect( - mOpenAction, SIGNAL(triggered()), - this, SLOT(openNote())); mDeleteAction = contextMenu->addAction(hbTrId("txt_common_menu_delete")); - connect( - mDeleteAction, SIGNAL(triggered()), - this, SLOT(deleteNote())); mRemoveFavoriteAction = contextMenu->addAction( hbTrId("txt_notes_menu_remove_from_favorites")); - connect( - mRemoveFavoriteAction, SIGNAL(triggered()), - this, SLOT(markNoteAsNotFavourite())); - mMarkTodoAction = contextMenu->addAction( hbTrId("txt_notes_menu_make_it_as_todo_note")); - connect( - mMarkTodoAction, SIGNAL(triggered()), - this, SLOT(markNoteAsTodo())); // Show the menu. - contextMenu->exec(coords); + contextMenu->open(this, SLOT(selectedMenuAction(HbAction*))); + contextMenu->setPreferredPos(coords); } /*! @@ -352,6 +348,14 @@ // Delete the old entry. mAgendaUtil->deleteEntry(entry.id()); + + // Show the soft notification. + HbNotificationDialog *notificationDialog = new HbNotificationDialog(); + notificationDialog->setTimeout( + HbNotificationDialog::ConfirmationNoteTimeout); + notificationDialog->setTitle( + hbTrId("txt_notes_dpopinfo_note_moved_to_todos")); + notificationDialog->show(); } /*! @@ -430,5 +434,29 @@ // Launch the notes editor with the obtained info. mNotesEditor->edit(entry); } + +/* + Slot to handle the context menu actions. + */ +void NotesFavoriteView::selectedMenuAction(HbAction *action) +{ + if(action == mOpenAction) { + openNote(); + } else if (action == mDeleteAction) { + deleteNote(); + } else if (action ==mRemoveFavoriteAction){ + markNoteAsNotFavourite(); + } else if (action == mMarkTodoAction) { + markNoteAsTodo(); + } +} + +/*! + Slot to handle the context menu closed. + */ +void NotesFavoriteView::handleMenuClosed() +{ + mIsLongTop = false; +} // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/src/notesmainview.cpp --- a/notes/notesui/notesviews/src/notesmainview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/src/notesmainview.cpp Fri May 14 15:51:09 2010 +0300 @@ -57,7 +57,8 @@ NotesMainView::NotesMainView(QGraphicsWidget *parent) :HbView(parent), mSelectedItem(0), - mDeleteAction(0) + mDeleteAction(0), + mIsLongTop(false) { // Nothing yet. } @@ -122,9 +123,26 @@ this, SLOT(scrollTo(QModelIndex))); // Get the view heading label - mViewHeading = static_cast ( +/* mViewHeading = static_cast ( + mDocLoader->findWidget("viewHeading"));*/ + + mSubTitle = static_cast( mDocLoader->findWidget("viewHeading")); + // Handles the orientation change for list items + HbMainWindow *window = hbInstance->allMainWindows().first(); + handleOrientationChanged(window->orientation()); + connect( + window, SIGNAL(orientationChanged(Qt::Orientation)), + this, SLOT(handleOrientationChanged(Qt::Orientation))); + + // Set the graphics size for the icons. + HbListViewItem *prototype = mListView->listItemPrototype(); + prototype->setGraphicsSize(HbListViewItem::SmallIcon); +} + +void NotesMainView::setupAfterViewReady() +{ // Get the toolbar/menu actions. mAddNoteAction = static_cast ( mDocLoader->findObject("newNoteAction")); @@ -159,19 +177,6 @@ mViewCollectionAction, SIGNAL(triggered()), this, SLOT(displayCollectionView())); - mSubTitle = static_cast( - mDocLoader->findWidget("viewHeading")); - - // Handles the orientation change for list items - HbMainWindow *window = hbInstance->allMainWindows().first(); - handleOrientationChanged(window->orientation()); - connect( - window, SIGNAL(orientationChanged(Qt::Orientation)), - this, SLOT(handleOrientationChanged(Qt::Orientation))); - - // Update sub heading text for main view. - updateSubTitle(); - connect( mAgendaUtil, SIGNAL(entryAdded(ulong)), this,SLOT(updateSubTitle(ulong))); @@ -181,10 +186,14 @@ connect( mAgendaUtil, SIGNAL(entryUpdated(ulong)), this, SLOT(updateSubTitle(ulong))); +} - // Set the graphics size for the icons. - HbListViewItem *prototype = mListView->listItemPrototype(); - prototype->setGraphicsSize(HbListViewItem::SmallIcon); +/* + Updates the title text for the first launch + */ +void NotesMainView::updateTitle() +{ + updateSubTitle(); } /*! @@ -212,46 +221,48 @@ */ void NotesMainView::handleItemReleased(const QModelIndex &index) { - // Sanity check. - if (!index.isValid()) { - return; - } + if(!mIsLongTop) { + // Sanity check. + if (!index.isValid()) { + return; + } - // First get the id of the note and get the corresponding information from - // agendautil. - ulong noteId = index.data(NotesNamespace::IdRole).value(); + // First get the id of the note and get the corresponding information from + // agendautil. + ulong noteId = index.data(NotesNamespace::IdRole).value(); - if (0 >= noteId) { - // Something wrong. - return; - } + if (0 >= noteId) { + // Something wrong. + return; + } - // Get the entry details. - AgendaEntry entry = mAgendaUtil->fetchById(noteId); - if (entry.isNull()) { - // Entry invalid. - return; - } + // Get the entry details. + AgendaEntry entry = mAgendaUtil->fetchById(noteId); + if (entry.isNull()) { + // Entry invalid. + return; + } - if(AgendaEntry::TypeTodo == entry.type()) { - // Construct agenda event viewer. - mAgendaEventViewer = new AgendaEventViewer(mAgendaUtil, this); + if(AgendaEntry::TypeTodo == entry.type()) { + // Construct agenda event viewer. + mAgendaEventViewer = new AgendaEventViewer(mAgendaUtil, this); - connect( - mAgendaEventViewer, SIGNAL(viewingCompleted(const QDate)), - this, SLOT(handleViewingCompleted())); - // Launch agenda event viewer - mAgendaEventViewer->view( - entry, AgendaEventViewer::ActionEditDelete); - }else if(AgendaEntry::TypeNote == entry.type()) { - // Construct notes editor. - mNotesEditor = new NotesEditor(mAgendaUtil, this); - connect( - mNotesEditor, SIGNAL(editingCompleted(bool)), - this, SLOT(handleEditingCompleted(bool))); + connect( + mAgendaEventViewer, SIGNAL(viewingCompleted(const QDate)), + this, SLOT(handleViewingCompleted())); + // Launch agenda event viewer + mAgendaEventViewer->view( + entry, AgendaEventViewer::ActionEditDelete); + }else if(AgendaEntry::TypeNote == entry.type()) { + // Construct notes editor. + mNotesEditor = new NotesEditor(mAgendaUtil, this); + connect( + mNotesEditor, SIGNAL(editingCompleted(bool)), + this, SLOT(handleEditingCompleted(bool))); - // Launch the notes editor with the obtained info. - mNotesEditor->edit(entry); + // Launch the notes editor with the obtained info. + mNotesEditor->edit(entry); + } } } @@ -266,6 +277,7 @@ void NotesMainView::handleItemLongPressed( HbAbstractViewItem *item, const QPointF &coords) { + mIsLongTop = true; mSelectedItem = item; ulong noteId = item->modelIndex().data( @@ -274,74 +286,48 @@ // Display a context specific menu. HbMenu *contextMenu = new HbMenu(); + connect( + contextMenu,SIGNAL(aboutToClose()), + this, SLOT(handleMenuClosed())); + mOpenAction = contextMenu->addAction(hbTrId("txt_common_menu_open")); - connect( - mOpenAction, SIGNAL(triggered()), - this, SLOT(openNote())); // Add actions to the context menu. if (AgendaEntry::TypeTodo == entry.type()) { mEditTodoAction = contextMenu->addAction(hbTrId("txt_common_menu_edit")); - connect( - mEditTodoAction, SIGNAL(triggered()), - this, SLOT(editTodo())); } mDeleteAction = contextMenu->addAction(hbTrId("txt_common_menu_delete")); - connect( - mDeleteAction, SIGNAL(triggered()), - this, SLOT(deleteNote())); if (AgendaEntry::TypeNote == entry.type()) { if (entry.favourite()) { mMakeFavouriteAction = contextMenu->addAction( hbTrId("txt_notes_menu_remove_from_favorites")); - - connect( - mMakeFavouriteAction, SIGNAL(triggered()), - this, SLOT(markNoteAsFavourite())); - } else { mMakeFavouriteAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_favorite")); - - connect( - mMakeFavouriteAction, SIGNAL(triggered()), - this, SLOT(markNoteAsFavourite())); } mMarkTodoAction = contextMenu->addAction( hbTrId("txt_notes_menu_make_it_as_todo_note")); - connect( - mMarkTodoAction, SIGNAL(triggered()), - this, SLOT(markNoteAsTodo())); } else if (AgendaEntry::TypeTodo == entry.type()) { if (AgendaEntry::TodoNeedsAction == entry.status()) { mTodoStatusAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_done")); - - connect( - mTodoStatusAction , SIGNAL(triggered()), - this, SLOT(markTodoStatus())); - } else if (AgendaEntry::TodoCompleted == entry.status()) { mTodoStatusAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_not_done")); - - connect( - mTodoStatusAction , SIGNAL(triggered()), - this, SLOT(markTodoStatus())); } } // Show the menu. - contextMenu->exec(coords); - + contextMenu->open(this, SLOT(selectedMenuAction(HbAction*))); + contextMenu->setPreferredPos(coords); } /*! @@ -453,10 +439,7 @@ */ void NotesMainView::handleViewingCompleted() { - - mAgendaEventViewer->deleteLater(); - } /*! @@ -473,7 +456,6 @@ void NotesMainView::editTodo() { - // Get the selected list item index QModelIndex index = mSelectedItem->modelIndex(); if (!index.isValid()) { @@ -619,4 +601,33 @@ entry, AgendaEventViewer::ActionEditDelete); } } + +/*! + Slot to handle the selected context menu actions + */ +void NotesMainView::selectedMenuAction(HbAction *action) +{ + if (action == mOpenAction) { + openNote(); + } else if (action == mEditTodoAction) { + editTodo(); + } else if (action == mDeleteAction) { + deleteNote(); + } else if (action == mMakeFavouriteAction) { + markNoteAsFavourite(); + } else if (action == mMarkTodoAction) { + markNoteAsTodo(); + } else if (action == mTodoStatusAction) { + markTodoStatus(); + } +} + +/*! + Slot to handle the context menu closed. + */ +void NotesMainView::handleMenuClosed() +{ + mIsLongTop = false; +} + // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/src/notesnoteview.cpp --- a/notes/notesui/notesviews/src/notesnoteview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/src/notesnoteview.cpp Fri May 14 15:51:09 2010 +0300 @@ -26,6 +26,7 @@ #include #include #include +#include // User includes #include "notesnoteview.h" @@ -53,7 +54,8 @@ NotesNoteView::NotesNoteView(QGraphicsWidget *parent) :HbView(parent), mSelectedItem(0), - mDeleteAction(0) + mDeleteAction(0), + mIsLongTop(false) { // Nothing yet. } @@ -170,34 +172,36 @@ */ void NotesNoteView::handleItemReleased(const QModelIndex &index) { - // Sanity check. - if (!index.isValid()) { - return; - } + if(!mIsLongTop) { + // Sanity check. + if (!index.isValid()) { + return; + } - // First get the id of the note and get the corresponding information from - // agendautil. - ulong noteId = index.data(NotesNamespace::IdRole).value(); + // First get the id of the note and get the corresponding information from + // agendautil. + ulong noteId = index.data(NotesNamespace::IdRole).value(); - if (0 >= noteId) { - // Something wrong. - return; - } + if (0 >= noteId) { + // Something wrong. + return; + } - // Get the entry details. - AgendaEntry entry = mAgendaUtil->fetchById(noteId); + // Get the entry details. + AgendaEntry entry = mAgendaUtil->fetchById(noteId); - if (entry.isNull()) { - // Entry invalid. - return; + if (entry.isNull()) { + // Entry invalid. + return; + } + + // Now launch the editor with the obtained info. + mNotesEditor = new NotesEditor(mAgendaUtil, this); + connect( + mNotesEditor, SIGNAL(editingCompleted(bool)), + this, SLOT(handleEditingCompleted(bool))); + mNotesEditor->edit(entry); } - - // Now launch the editor with the obtained info. - mNotesEditor = new NotesEditor(mAgendaUtil, this); - connect( - mNotesEditor, SIGNAL(editingCompleted(bool)), - this, SLOT(handleEditingCompleted(bool))); - mNotesEditor->edit(entry); } /*! @@ -212,6 +216,7 @@ HbAbstractViewItem *item, const QPointF &coords) { mSelectedItem = item; + mIsLongTop = true; ulong noteId = item->modelIndex().data( NotesNamespace::IdRole).value(); @@ -219,48 +224,32 @@ // Display a context specific menu. HbMenu *contextMenu = new HbMenu(); + connect( + contextMenu,SIGNAL(aboutToClose()), + this, SLOT(handleMenuClosed())); // Add actions to the context menu. mOpenAction = contextMenu->addAction(hbTrId("txt_common_menu_open")); - connect( - mOpenAction, SIGNAL(triggered()), - this, SLOT(openNote())); mDeleteAction = contextMenu->addAction(hbTrId("txt_common_menu_delete")); - connect( - mDeleteAction, SIGNAL(triggered()), - this, SLOT(deleteNote())); if (AgendaEntry::TypeNote == entry.type()) { if (entry.favourite()) { - mMakeFavouriteAction = - contextMenu->addAction( + mMakeFavouriteAction = contextMenu->addAction( hbTrId("txt_notes_menu_remove_from_favorites")); - - connect( - mMakeFavouriteAction, SIGNAL(triggered()), - this, SLOT(markNoteAsFavourite())); - } else { - mMakeFavouriteAction = - contextMenu->addAction( + mMakeFavouriteAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_favorite")); - - connect( - mMakeFavouriteAction, SIGNAL(triggered()), - this, SLOT(markNoteAsFavourite())); } mMarkTodoAction = contextMenu->addAction( hbTrId("txt_notes_menu_make_it_as_todo_note")); - connect( - mMarkTodoAction, SIGNAL(triggered()), - this, SLOT(markNoteAsTodo())); } // Show the menu. - contextMenu->exec(coords); + contextMenu->open(this, SLOT(selectedMenuAction(HbAction*))); + contextMenu->setPreferredPos(coords); } /*! @@ -357,6 +346,13 @@ // Delete the old entry. mAgendaUtil->deleteEntry(entry.id()); + // Show the soft notification. + HbNotificationDialog *notificationDialog = new HbNotificationDialog(); + notificationDialog->setTimeout( + HbNotificationDialog::ConfirmationNoteTimeout); + notificationDialog->setTitle( + hbTrId("txt_notes_dpopinfo_note_moved_to_todos")); + notificationDialog->show(); } /*! @@ -437,5 +433,29 @@ // Launch the notes editor with the obtained info. mNotesEditor->edit(entry); } + +/*! + Slot to handle context menu actions. + */ +void NotesNoteView::selectedMenuAction(HbAction *action) +{ + if (action == mOpenAction) { + openNote(); + } else if (action == mDeleteAction) { + deleteNote(); + } else if (action == mMakeFavouriteAction) { + markNoteAsFavourite(); + } else if (action == mMarkTodoAction) { + markNoteAsTodo(); + } +} + +/*! + Slot to handle the context menu closed. + */ +void NotesNoteView::handleMenuClosed() +{ + mIsLongTop = false; +} // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 notes/notesui/notesviews/src/notestodoview.cpp --- a/notes/notesui/notesviews/src/notestodoview.cpp Mon May 03 12:30:32 2010 +0300 +++ b/notes/notesui/notesviews/src/notestodoview.cpp Fri May 14 15:51:09 2010 +0300 @@ -57,7 +57,8 @@ NotesTodoView::NotesTodoView(QGraphicsWidget *parent) :HbView(parent), mSelectedItem(0), - mDeleteAction(0) + mDeleteAction(0), + mIsLongTop(false) { // Nothing yet. } @@ -149,9 +150,6 @@ mSubTitle = static_cast( mDocLoader->findWidget("subtitleGroupBox")); - // Update sub heading text for to-do collections view. - updateSubTitle(); - connect( mAgendaUtil, SIGNAL(entryAdded(ulong)), this,SLOT(updateSubTitle(ulong))); @@ -167,6 +165,14 @@ prototype->setGraphicsSize(HbListViewItem::SmallIcon); } +/* + Updates the title text for the first launch + */ +void NotesTodoView::updateTitle() +{ + updateSubTitle(); +} + /*! Opens the to-do editor to create a new to-do. */ @@ -190,28 +196,30 @@ */ void NotesTodoView::handleItemReleased(const QModelIndex &index) { - // Sanity check. - if (!index.isValid()) { - return; - } + if(!mIsLongTop) { + // Sanity check. + if (!index.isValid()) { + return; + } - // First get the id of the to-do and get the corresponding information from - // agendautil. - ulong toDoId = index.data(NotesNamespace::IdRole).value(); + // First get the id of the to-do and get the corresponding information from + // agendautil. + ulong toDoId = index.data(NotesNamespace::IdRole).value(); - if (0 >= toDoId) { - // Something wrong. - return; - } + if (0 >= toDoId) { + // Something wrong. + return; + } - // Construct agenda event viewer. - mAgendaEventViewer = new AgendaEventViewer(mAgendaUtil, this); + // Construct agenda event viewer. + mAgendaEventViewer = new AgendaEventViewer(mAgendaUtil, this); - connect( - mAgendaEventViewer, SIGNAL(viewingCompleted(const QDate)), - this, SLOT(handleViewingCompleted())); - // Launch agenda event viewer - mAgendaEventViewer->view(toDoId, AgendaEventViewer::ActionEditDelete); + connect( + mAgendaEventViewer, SIGNAL(viewingCompleted(const QDate)), + this, SLOT(handleViewingCompleted())); + // Launch agenda event viewer + mAgendaEventViewer->view(toDoId, AgendaEventViewer::ActionEditDelete); + } } /*! @@ -226,6 +234,7 @@ HbAbstractViewItem *item, const QPointF &coords) { mSelectedItem = item; + mIsLongTop = true; // Get the entry of the selected item. ulong noteId = item->modelIndex().data( @@ -234,46 +243,34 @@ // Display a context specific menu. HbMenu *contextMenu = new HbMenu(); + connect( + contextMenu,SIGNAL(aboutToClose()), + this, SLOT(handleMenuClosed())); // Add actions to the context menu. mOpenAction = contextMenu->addAction(hbTrId("txt_common_menu_open")); - connect( - mOpenAction, SIGNAL(triggered()), - this, SLOT(openTodo())); mEditAction = contextMenu->addAction( hbTrId("txt_common_menu_edit")); - connect( - mEditAction, SIGNAL(triggered()), - this, SLOT(editTodo())); mDeleteAction = contextMenu->addAction( hbTrId("txt_common_menu_delete")); - connect( - mDeleteAction, SIGNAL(triggered()), - this, SLOT(deleteTodo())); if (AgendaEntry::TypeTodo == entry.type()) { if (AgendaEntry::TodoNeedsAction == entry.status()) { mTodoStatusAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_done")); - connect( - mTodoStatusAction , SIGNAL(triggered()), - this, SLOT(markTodoStatus())); - } else if (AgendaEntry::TodoCompleted == entry.status()) { mTodoStatusAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_not_done")); - connect( - mTodoStatusAction , SIGNAL(triggered()), - this, SLOT(markTodoStatus())); } } // Show the menu. - contextMenu->exec(coords); + contextMenu->open(this, SLOT(selectedMenuAction(HbAction*))); + contextMenu->setPreferredPos(coords); } /*! @@ -465,4 +462,28 @@ entry, AgendaEventViewer::ActionEditDelete); } +/* + Slot to handle the context menu actions. + */ +void NotesTodoView::selectedMenuAction(HbAction *action) +{ + if (action == mOpenAction) { + openTodo(); + } else if (action == mEditAction) { + editTodo(); + } else if (action == mDeleteAction) { + deleteTodo(); + } else if (action == mTodoStatusAction) { + markTodoStatus(); + } +} + + +/*! + Slot to handle the context menu closed. + */ +void NotesTodoView::handleMenuClosed() +{ + mIsLongTop = false; +} // End of file --Don't remove this. diff -r fd30d51f876b -r a949c2543c15 organizer_plat/agenda_interface_api/inc/agendautil.h --- a/organizer_plat/agenda_interface_api/inc/agendautil.h Mon May 03 12:30:32 2010 +0300 +++ b/organizer_plat/agenda_interface_api/inc/agendautil.h Fri May 14 15:51:09 2010 +0300 @@ -120,6 +120,8 @@ void entryDeleted(ulong id); void entryUpdated(ulong id); void entriesDeleted(int status); + void entryViewCreationCompleted(int status); + void instanceViewCreationCompleted(int status); private: friend class AgendaUtilPrivate; diff -r fd30d51f876b -r a949c2543c15 organizer_plat/calendar_editor_api/tsrc/unittest_caleneditor/src/unittest_caleneditor.cpp --- a/organizer_plat/calendar_editor_api/tsrc/unittest_caleneditor/src/unittest_caleneditor.cpp Mon May 03 12:30:32 2010 +0300 +++ b/organizer_plat/calendar_editor_api/tsrc/unittest_caleneditor/src/unittest_caleneditor.cpp Fri May 14 15:51:09 2010 +0300 @@ -2,7 +2,7 @@ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available - * under the terms of the License "Eclipse Public License v1.0" + * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * diff -r fd30d51f876b -r a949c2543c15 organizer_plat/calendar_editor_api/tsrc/unittest_caleneditor/unittest_caleneditor.pro --- a/organizer_plat/calendar_editor_api/tsrc/unittest_caleneditor/unittest_caleneditor.pro Mon May 03 12:30:32 2010 +0300 +++ b/organizer_plat/calendar_editor_api/tsrc/unittest_caleneditor/unittest_caleneditor.pro Fri May 14 15:51:09 2010 +0300 @@ -2,7 +2,7 @@ # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available -# under the terms of the License "Eclipse Public License v1.0" +# under the terms of "Eclipse Public License v1.0" # which accompanies this distribution, and is available # at the URL "http://www.eclipse.org/legal/epl-v10.html". # diff -r fd30d51f876b -r a949c2543c15 organizer_plat/calendar_exporter_api/inc/CalenExporter.h --- a/organizer_plat/calendar_exporter_api/inc/CalenExporter.h Mon May 03 12:30:32 2010 +0300 +++ b/organizer_plat/calendar_exporter_api/inc/CalenExporter.h Fri May 14 15:51:09 2010 +0300 @@ -25,7 +25,7 @@ #include #include // for TParse #include -#include +#include // FORWARD DECLARATIONS diff -r fd30d51f876b -r a949c2543c15 organizer_plat/calendar_importer_api/inc/CalenImporter.h --- a/organizer_plat/calendar_importer_api/inc/CalenImporter.h Mon May 03 12:30:32 2010 +0300 +++ b/organizer_plat/calendar_importer_api/inc/CalenImporter.h Fri May 14 15:51:09 2010 +0300 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include +#include diff -r fd30d51f876b -r a949c2543c15 pimappservices/calendar/client/src/calentryimpl.cpp --- a/pimappservices/calendar/client/src/calentryimpl.cpp Mon May 03 12:30:32 2010 +0300 +++ b/pimappservices/calendar/client/src/calentryimpl.cpp Fri May 14 15:51:09 2010 +0300 @@ -1510,8 +1510,6 @@ void CCalEntryImpl::SetDTStampL(const TCalTime& aDTStampTime) { - __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, - User::Leave(KErrNotSupported)); LoadFullEntryL(); iFullEntry->SetDTStampUtcL(aDTStampTime.TimeUtcL()); } diff -r fd30d51f876b -r a949c2543c15 pimappservices/calendar/tsrc/tcal_dataexchange.cpp --- a/pimappservices/calendar/tsrc/tcal_dataexchange.cpp Mon May 03 12:30:32 2010 +0300 +++ b/pimappservices/calendar/tsrc/tcal_dataexchange.cpp Fri May 14 15:51:09 2010 +0300 @@ -133,7 +133,7 @@ _LIT(KSUMMARY, "First Entry"); _LIT(KAttachmentFile, "tcal_datax_attachment.vcs"); _LIT(KAttachmentCidFile, "c:\\calendar_attachments\\tcal_attach.jpg"); -_LIT(KCalendarAttachmentsDir, "c:\\private\\10003a5b\\attachments"); + _LIT8(KTzEuropeHelsinki, "Europe/Helsinki"); _LIT8(KTzAmericaVancouver, "America/Vancouver"); diff -r fd30d51f876b -r a949c2543c15 pimappservices/calendar/tsrc/tcal_dataexchange.mmp --- a/pimappservices/calendar/tsrc/tcal_dataexchange.mmp Mon May 03 12:30:32 2010 +0300 +++ b/pimappservices/calendar/tsrc/tcal_dataexchange.mmp Fri May 14 15:51:09 2010 +0300 @@ -22,8 +22,10 @@ SOURCE tcal_dataexchange.cpp USERINCLUDE . +APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include + LIBRARY calinterimapi.lib LIBRARY euser.lib estor.lib efsrv.lib caltestlib.lib LIBRARY pimtestclient.lib diff -r fd30d51f876b -r a949c2543c15 pimappservices/calendarvcalplugin/src/agmvcalx.cpp --- a/pimappservices/calendarvcalplugin/src/agmvcalx.cpp Mon May 03 12:30:32 2010 +0300 +++ b/pimappservices/calendarvcalplugin/src/agmvcalx.cpp Fri May 14 15:51:09 2010 +0300 @@ -437,9 +437,10 @@ // DTSTAMP TCalTime dTStamp = aEntry->DTStampL(); - - if ( dTStamp.TimeUtcL() != Time::NullTTime() ) - { + + if ( dTStamp.TimeUtcL() != Time::NullTTime() && + CCalEntry::ENote != aEntry->EntryTypeL() ) + { AddDateTimePropertyL(aParser, KVersitTokenXDTSTAMP, dTStamp.TimeUtcL(), TVersitDateTime::EIsUTC, iTimeFlag); } diff -r fd30d51f876b -r a949c2543c15 pimappsupport/chinesecalendaralg/test/group/calcontable.mmp --- a/pimappsupport/chinesecalendaralg/test/group/calcontable.mmp Mon May 03 12:30:32 2010 +0300 +++ b/pimappsupport/chinesecalendaralg/test/group/calcontable.mmp Fri May 14 15:51:09 2010 +0300 @@ -22,6 +22,8 @@ SOURCE calcontable.cpp USERINCLUDE ../../calcontablesrc USERINCLUDE ../../originalinc + +APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include LIBRARY euser.lib efsrv.lib cconoriginal.lib charconv.lib diff -r fd30d51f876b -r a949c2543c15 pimappsupport/vcardandvcal/Ticket/VTicket.MMP --- a/pimappsupport/vcardandvcal/Ticket/VTicket.MMP Mon May 03 12:30:32 2010 +0300 +++ b/pimappsupport/vcardandvcal/Ticket/VTicket.MMP Fri May 14 15:51:09 2010 +0300 @@ -22,6 +22,7 @@ SOURCEPATH ../Ticket userinclude ../inc +APP_LAYER_SYSTEMINCLUDE systeminclude /epoc32/include source VTicketMaster.CPP diff -r fd30d51f876b -r a949c2543c15 pimappsupport/vcardandvcal/tsrc/TJapaneseSoundProperty.mmp --- a/pimappsupport/vcardandvcal/tsrc/TJapaneseSoundProperty.mmp Mon May 03 12:30:32 2010 +0300 +++ b/pimappsupport/vcardandvcal/tsrc/TJapaneseSoundProperty.mmp Fri May 14 15:51:09 2010 +0300 @@ -21,7 +21,9 @@ sourcepath . userinclude . -userinclude ../inc +userinclude ../inc + +APP_LAYER_SYSTEMINCLUDE systeminclude /epoc32/include source TJapaneseSoundProperty.cpp diff -r fd30d51f876b -r a949c2543c15 pimappsupport/vcardandvcal/tsrc/Test_saveloadbinoom.mmp --- a/pimappsupport/vcardandvcal/tsrc/Test_saveloadbinoom.mmp Mon May 03 12:30:32 2010 +0300 +++ b/pimappsupport/vcardandvcal/tsrc/Test_saveloadbinoom.mmp Fri May 14 15:51:09 2010 +0300 @@ -23,6 +23,7 @@ userinclude ../tsrc userinclude ../inc +APP_LAYER_SYSTEMINCLUDE systeminclude /epoc32/include source Test_saveloadbinoom.cpp library euser.lib estor.lib efsrv.lib diff -r fd30d51f876b -r a949c2543c15 pimappsupport/vcardandvcal/tsrc/UnitTest_PBAPSupport/group/TestExternalize.mmp --- a/pimappsupport/vcardandvcal/tsrc/UnitTest_PBAPSupport/group/TestExternalize.mmp Mon May 03 12:30:32 2010 +0300 +++ b/pimappsupport/vcardandvcal/tsrc/UnitTest_PBAPSupport/group/TestExternalize.mmp Fri May 14 15:51:09 2010 +0300 @@ -21,6 +21,8 @@ SOURCEPATH ../src USERINCLUDE ../inc USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include SOURCE TestExternalize.cpp