69 |
72 |
70 // Create the repeat choices |
73 // Create the repeat choices |
71 QStringList repeatChoices; |
74 QStringList repeatChoices; |
72 repeatChoices << hbTrId("txt_calendar_setlabel_repeat_val_only_once") |
75 repeatChoices << hbTrId("txt_calendar_setlabel_repeat_val_only_once") |
73 << hbTrId("txt_calendar_setlabel_repeat_val_daily") |
76 << hbTrId("txt_calendar_setlabel_repeat_val_daily") |
74 // TODO : add text ID for workdays |
77 << hbTrId("txt_calendar_setlabel_repeat_val_workdays") |
75 << hbTrId("Workdays") |
|
76 << hbTrId("txt_calendar_setlabel_repeat_val_weekly") |
78 << hbTrId("txt_calendar_setlabel_repeat_val_weekly") |
77 << hbTrId("txt_calendar_setlabel_repeat_val_fortnightly") |
79 << hbTrId("txt_calendar_setlabel_repeat_val_fortnightly") |
78 << hbTrId("txt_calendar_setlabel_repeat_val_monthly") |
80 << hbTrId("txt_calendar_setlabel_repeat_val_monthly") |
79 << hbTrId("txt_calendar_setlabel_repeat_val_yearly"); |
81 << hbTrId("txt_calendar_setlabel_repeat_val_yearly"); |
80 |
82 |
124 = qobject_cast<HbComboBox *> (item->dataItemContentWidget()); |
126 = qobject_cast<HbComboBox *> (item->dataItemContentWidget()); |
125 |
127 |
126 // Set the user roles for the combobox items so that we depend on these |
128 // Set the user roles for the combobox items so that we depend on these |
127 // roles to identify the correct repeat type when repeat choices are |
129 // roles to identify the correct repeat type when repeat choices are |
128 // dynamically removed or added |
130 // dynamically removed or added |
129 mRepeatComboBox->setItemData(RepeatOnce, RepeatOnce, Qt::UserRole+100); |
131 mRepeatComboBox->setItemData(RepeatOnce, RepeatOnce, userRole); |
130 mRepeatComboBox->setItemData(RepeatDaily, RepeatDaily, Qt::UserRole+100); |
132 mRepeatComboBox->setItemData(RepeatDaily, RepeatDaily, userRole); |
131 mRepeatComboBox->setItemData(RepeatWorkdays, |
133 mRepeatComboBox->setItemData(RepeatWorkdays, |
132 RepeatWorkdays, Qt::UserRole+100); |
134 RepeatWorkdays, userRole); |
133 mRepeatComboBox->setItemData(RepeatWeekly, RepeatWeekly, Qt::UserRole+100); |
135 mRepeatComboBox->setItemData(RepeatWeekly, RepeatWeekly, userRole); |
134 mRepeatComboBox->setItemData(RepeatBiWeekly, |
136 mRepeatComboBox->setItemData(RepeatBiWeekly, |
135 RepeatBiWeekly, Qt::UserRole+100); |
137 RepeatBiWeekly, userRole); |
136 mRepeatComboBox->setItemData(RepeatMonthly, |
138 mRepeatComboBox->setItemData(RepeatMonthly, |
137 RepeatMonthly, Qt::UserRole+100); |
139 RepeatMonthly, userRole); |
138 mRepeatComboBox->setItemData(RepeatYearly, RepeatYearly, Qt::UserRole+100); |
140 mRepeatComboBox->setItemData(RepeatYearly, RepeatYearly, userRole); |
139 |
141 |
140 if (mCalenEditor->editedEntry()->isRepeating()) { |
142 if (mCalenEditor->editedEntry()->isRepeating()) { |
141 switch (mCalenEditor->editedEntry()->repeatRule().type()) { |
143 switch (mCalenEditor->editedEntry()->repeatRule().type()) { |
142 case AgendaRepeatRule::DailyRule: { |
144 case AgendaRepeatRule::DailyRule: { |
143 mRepeatComboBox->setCurrentIndex(1); |
145 mRepeatComboBox->setCurrentIndex(1); |
444 int previousCount = mRepeatComboBox->count(); |
448 int previousCount = mRepeatComboBox->count(); |
445 mRepeatComboBox->clear(); |
449 mRepeatComboBox->clear(); |
446 QStringList repeatChoices; |
450 QStringList repeatChoices; |
447 repeatChoices << hbTrId("txt_calendar_setlabel_repeat_val_only_once") |
451 repeatChoices << hbTrId("txt_calendar_setlabel_repeat_val_only_once") |
448 << hbTrId("txt_calendar_setlabel_repeat_val_daily") |
452 << hbTrId("txt_calendar_setlabel_repeat_val_daily") |
449 // TODO : add text ID for workdays |
453 << hbTrId("txt_calendar_setlabel_repeat_val_workdays") |
450 << hbTrId("Workdays") |
|
451 << hbTrId("txt_calendar_setlabel_repeat_val_weekly") |
454 << hbTrId("txt_calendar_setlabel_repeat_val_weekly") |
452 << hbTrId("txt_calendar_setlabel_repeat_val_fortnightly") |
455 << hbTrId("txt_calendar_setlabel_repeat_val_fortnightly") |
453 << hbTrId("txt_calendar_setlabel_repeat_val_monthly") |
456 << hbTrId("txt_calendar_setlabel_repeat_val_monthly") |
454 << hbTrId("txt_calendar_setlabel_repeat_val_yearly"); |
457 << hbTrId("txt_calendar_setlabel_repeat_val_yearly"); |
455 mRepeatComboBox->addItems(repeatChoices); |
458 mRepeatComboBox->addItems(repeatChoices); |
456 // Set the user roles for the combobox items so that we depend on these |
459 // Set the user roles for the combobox items so that we depend on these |
457 // roles to identify the correct repeat type when repeat choices are |
460 // roles to identify the correct repeat type when repeat choices are |
458 // dynamically removed or added |
461 // dynamically removed or added |
459 mRepeatComboBox->setItemData(RepeatOnce, RepeatOnce, Qt::UserRole + 100); |
462 mRepeatComboBox->setItemData(RepeatOnce, RepeatOnce, userRole); |
460 mRepeatComboBox->setItemData(RepeatDaily, RepeatDaily, |
463 mRepeatComboBox->setItemData(RepeatDaily, RepeatDaily, |
461 Qt::UserRole + 100); |
464 userRole); |
462 mRepeatComboBox->setItemData(RepeatWorkdays, |
465 mRepeatComboBox->setItemData(RepeatWorkdays, |
463 RepeatWorkdays, Qt::UserRole+100); |
466 RepeatWorkdays, userRole); |
464 mRepeatComboBox->setItemData(RepeatWeekly, RepeatWeekly, |
467 mRepeatComboBox->setItemData(RepeatWeekly, RepeatWeekly, |
465 Qt::UserRole + 100); |
468 userRole); |
466 mRepeatComboBox->setItemData(RepeatBiWeekly, RepeatBiWeekly, |
469 mRepeatComboBox->setItemData(RepeatBiWeekly, RepeatBiWeekly, |
467 Qt::UserRole + 100); |
470 userRole); |
468 mRepeatComboBox->setItemData(RepeatMonthly, RepeatMonthly, |
471 mRepeatComboBox->setItemData(RepeatMonthly, RepeatMonthly, |
469 Qt::UserRole + 100); |
472 userRole); |
470 mRepeatComboBox->setItemData(RepeatYearly, RepeatYearly, |
473 mRepeatComboBox->setItemData(RepeatYearly, RepeatYearly, |
471 Qt::UserRole + 100); |
474 userRole); |
472 |
475 |
473 int totalCount = mRepeatComboBox->count(); |
476 int totalCount = mRepeatComboBox->count(); |
474 |
477 |
475 if (previousCount < totalCount && choice > 0) { |
478 if (previousCount < totalCount && choice > 0) { |
476 choice += (totalCount - previousCount); |
479 choice += (totalCount - previousCount); |