alarmui/alarmalertwidget/alarmalertplugin/src/alarmalertplugin.cpp
changeset 23 fd30d51f876b
parent 18 c198609911f9
child 45 b6db4fd4947b
equal deleted inserted replaced
18:c198609911f9 23:fd30d51f876b
    24 
    24 
    25 // User includes
    25 // User includes
    26 #include "alarmalertplugin.h"
    26 #include "alarmalertplugin.h"
    27 #include "alarmalertwidget_p.h"
    27 #include "alarmalertwidget_p.h"
    28 #include "alarmalert.h"
    28 #include "alarmalert.h"
       
    29 #include "alarmalertdocloader.h"
    29 
    30 
    30 // Plugin export
    31 // Plugin export
    31 Q_EXPORT_PLUGIN2(alarmalertplugin, AlarmAlertPlugin);
    32 Q_EXPORT_PLUGIN2(alarmalertplugin, AlarmAlertPlugin);
    32 
    33 
    33 // ---------------------------------------------------------
    34 // ---------------------------------------------------------
   129 {
   130 {
   130 	Q_UNUSED(deviceDialogType);
   131 	Q_UNUSED(deviceDialogType);
   131     
   132     
   132 	// Create and return the alarm alert dialog
   133 	// Create and return the alarm alert dialog
   133     HbDeviceDialogInterface *ret(0);
   134     HbDeviceDialogInterface *ret(0);
   134     AlarmAlertDialogPrivate *alarmDialog = new AlarmAlertDialogPrivate(parameters);
   135     AlarmAlertDocLoader *alertDocLoader = new AlarmAlertDocLoader(parameters);
   135     ret = alarmDialog;
   136     // Get the type of alarm to load the proper docml
       
   137     QVariantMap::const_iterator iter = parameters.constBegin();
       
   138     int count = parameters.size();
       
   139     AlarmType alertType = OtherAlarm;
       
   140 	while (iter != parameters.constEnd()) {
       
   141 		QString key(iter.key());
       
   142 		if (alarmType == key) {
       
   143 			alertType = static_cast <AlarmType> (iter.value().toInt());
       
   144 		}
       
   145 		iter++;
       
   146 	}
       
   147     bool loadSuccess = false;
       
   148     if (alertType == ClockAlarm) {
       
   149     	alertDocLoader->load(alarmNormalUIClockDocml, &loadSuccess);
       
   150     }else if (alertType == TodoAlarm) {
       
   151     	alertDocLoader->load(alarmNormalUITodoDocml, &loadSuccess);
       
   152     }else if(alertType == CalendarAlarm) {
       
   153     	alertDocLoader->load(alarmNormalUICalendarDocml, &loadSuccess);
       
   154     }
       
   155     if(!loadSuccess) {
       
   156     	qFatal("Unable to load the docml");
       
   157     }
       
   158     AlarmAlertDialogPrivate *alertDialog = qobject_cast<AlarmAlertDialogPrivate*> (alertDocLoader->findWidget("dialog"));
       
   159     alertDialog->setupNormalUI(alertDocLoader);
       
   160     ret = alertDialog;
   136     return ret;
   161     return ret;
   137 }
   162 }