add application-service
authorGenie Kim <daejins.kim@samsung.com>
Fri, 5 Apr 2013 10:02:09 +0000 (19:02 +0900)
committerGenie Kim <daejins.kim@samsung.com>
Sat, 6 Apr 2013 09:14:11 +0000 (18:14 +0900)
Change-Id: I7520ad0ec8f9a31b08f924a67be6590acd3d8ebf

libug-setting-location-efl.c
ug-setting-location-efl.xml

index 4ea72e9..43f8015 100644 (file)
@@ -45,7 +45,7 @@ static char *menu[] = {
 #define LOCATION_MENU_NET      2
 #define LOCATION_MENU_MYPOS    3
 
-#define GL_GPS_INDEX           2
+#define GL_GPS_INDEX           1
 
 int setting_location_set_int(const char *path, int val)
 {
@@ -345,7 +345,6 @@ Evas_Object *setting_location_create_gl(Evas_Object * parent, void *data)
 {
        LOC_LOG("setting_location_create_gl");
        struct ug_data *ugd = (struct ug_data *)data;
-       ugd->opt_index = 0;
 
        Evas_Object *genlist;
 
@@ -360,7 +359,7 @@ Evas_Object *setting_location_create_gl(Evas_Object * parent, void *data)
        ugd->itc_top_sep->func.state_get = NULL;
        ugd->itc_top_sep->func.del = NULL;
        ugd->gi_top_sep = elm_genlist_item_append(genlist, ugd->itc_top_sep, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
-       ugd->opt_index++;
+       ugd->opt_index = 0;
        elm_genlist_item_select_mode_set(ugd->gi_top_sep, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
 
        ugd->itc_gps = elm_genlist_item_class_new();
@@ -571,8 +570,17 @@ static void on_destroy(ui_gadget_h ug, service_h service, void *priv)
        else if (!ugd->is_gps && !ugd->is_net) strncpy(value, "GPSDisabled|WPSDisabled", sizeof(value));
        service_add_extra_data(result, "State", value);
 
+       if (ugd->is_gps) strncpy(value, "enable", sizeof(value));
+       else if (!ugd->is_gps) strncpy(value, "disable", sizeof(value));
+       service_add_extra_data(result, "http://tizen.org/appcontrol/data/location/gps", value);
+
+       if (ugd->is_net) strncpy(value, "enable", sizeof(value));
+       else if (!ugd->is_net) strncpy(value, "disable", sizeof(value));
+       service_add_extra_data(result, "http://tizen.org/appcontrol/data/location/wps", value);
+
        ug_send_result(ug, result);
        service_destroy(result);
+
        setting_location_deinit(ugd);
 
        if (ugd->base != NULL) {
index db22973..9b2539d 100644 (file)
@@ -5,5 +5,14 @@
        <description>Setting Location AppControl</description>
        <ui-application appid="setting-location-efl" exec="/usr/ug/bin/setting-location-efl" nodisplay="true" multiple="true" type="capp" taskmanage="false">
                <label>Settings Location</label>
+               <application-service>
+                       <operation name="http://tizen.org/appcontrol/operation/setting/location"/>
+               </application-service>
+               <application-service>
+                       <operation name="http://samsung.com/appcontrol/operation/setting/location"/>
+               </application-service>
+               <application-service>
+                       <operation name="http://tizen.org/appcontrol/operation/configure/location"/>
+               </application-service>
        </ui-application>
 </manifest>