153 AlarmAlertDocLoader *alertDocLoader = new AlarmAlertDocLoader(parameters); |
153 AlarmAlertDocLoader *alertDocLoader = new AlarmAlertDocLoader(parameters); |
154 // Get the type of alarm to load the proper docml |
154 // Get the type of alarm to load the proper docml |
155 QVariantMap::const_iterator iter = parameters.constBegin(); |
155 QVariantMap::const_iterator iter = parameters.constBegin(); |
156 int count = parameters.size(); |
156 int count = parameters.size(); |
157 AlarmType alertType = OtherAlarm; |
157 AlarmType alertType = OtherAlarm; |
|
158 bool isTimedAlarm = false; |
158 while (iter != parameters.constEnd()) { |
159 while (iter != parameters.constEnd()) { |
159 QString key(iter.key()); |
160 QString key(iter.key()); |
160 if (alarmType == key) { |
161 if (alarmType == key) { |
161 alertType = static_cast <AlarmType> (iter.value().toInt()); |
162 alertType = static_cast <AlarmType> (iter.value().toInt()); |
162 } |
163 } |
|
164 if (alarmIsTimed == key) { |
|
165 isTimedAlarm = iter.value().toBool(); |
|
166 } |
163 iter++; |
167 iter++; |
164 } |
168 } |
|
169 |
165 bool loadSuccess = false; |
170 bool loadSuccess = false; |
166 if (alertType == ClockAlarm) { |
171 if (alertType == ClockAlarm) { |
167 alertDocLoader->load(alarmNormalUIClockDocml, &loadSuccess); |
172 alertDocLoader->load(alarmNormalUIClockDocml, &loadSuccess); |
168 }else if (alertType == TodoAlarm) { |
173 }else if (alertType == TodoAlarm) { |
169 alertDocLoader->load(alarmNormalUITodoDocml, &loadSuccess); |
174 alertDocLoader->load(alarmNormalUITodoDocml, &loadSuccess); |
170 }else if(alertType == CalendarAlarm) { |
175 }else if(alertType == CalendarAlarm) { |
171 alertDocLoader->load(alarmNormalUICalendarDocml, &loadSuccess); |
176 if (isTimedAlarm) { |
|
177 alertDocLoader->load(alarmNormalUICalendarDocml, &loadSuccess); |
|
178 } else { |
|
179 alertDocLoader->load( |
|
180 alarmNormalUINonTimedCalendarDocml, &loadSuccess); |
|
181 } |
172 } |
182 } |
173 if(!loadSuccess) { |
183 if(!loadSuccess) { |
174 qFatal("Unable to load the docml"); |
184 qFatal("Unable to load the docml"); |
175 } |
185 } |
|
186 // Transfer the ownership of docloader object to alarmalertdialogprivate. |
176 AlarmAlertDialogPrivate *alertDialog = qobject_cast<AlarmAlertDialogPrivate*> (alertDocLoader->findWidget("dialog")); |
187 AlarmAlertDialogPrivate *alertDialog = qobject_cast<AlarmAlertDialogPrivate*> (alertDocLoader->findWidget("dialog")); |
177 alertDialog->setupNormalUI(alertDocLoader); |
188 alertDialog->setupNormalUI(alertDocLoader); |
178 ret = alertDialog; |
189 ret = alertDialog; |
179 OstTraceFunctionExit0( ALARMALERTPLUGIN_CREATEDEVICEDIALOG_EXIT ); |
190 OstTraceFunctionExit0( ALARMALERTPLUGIN_CREATEDEVICEDIALOG_EXIT ); |
180 return ret; |
191 return ret; |