summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bouchaud (yoz) <yoz@efl.so>2019-01-14 00:29:47 +0100
committerMichael Bouchaud (yoz) <yoz@efl.so>2019-01-14 00:29:47 +0100
commit743db365790ad96cb9489c604a9ca8ef80636e25 (patch)
treeaeccf70363b6c0c65836ff8877af3c034e028bf5
parent0af8affd9228a8e0d92ac3ed0f3f3f4e00a9aafa (diff)
Call weather setup with weather_map gadget module
-rw-r--r--src/weather.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/weather.c b/src/weather.c
index ec34686..48fa96f 100644
--- a/src/weather.c
+++ b/src/weather.c
@@ -1121,6 +1121,19 @@ _weather_gadget_created(void *data, Evas_Object *obj, void *event_info EINA_UNUS
1121} 1121}
1122 1122
1123static void 1123static void
1124_weather_map_gadget_created(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
1125{
1126 Instance *inst;
1127
1128 inst = data;
1129 fprintf(stderr, "Created lolollo\n");
1130 e_gadget_configure_cb_set(inst->obj, _weather_map_configure_module);
1131 evas_object_smart_callback_del_full(obj, "gadget_created", _weather_map_gadget_created, data);
1132 weather_plugin_weather_add(inst);
1133}
1134
1135
1136static void
1124_weather_gadget_removed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) 1137_weather_gadget_removed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
1125{ 1138{
1126 Instance *inst; 1139 Instance *inst;
@@ -1147,6 +1160,33 @@ _weather_gadget_removed(void *data, Evas_Object *obj, void *event_info EINA_UNUS
1147} 1160}
1148 1161
1149static void 1162static void
1163_weather_map_gadget_removed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
1164{
1165 Instance *inst;
1166
1167 inst = data;
1168 evas_object_smart_callback_del_full(obj, "gadget_created",
1169 _weather_map_gadget_created, inst);
1170 evas_object_smart_callback_del_full(obj, "gadget_removed",
1171 _weather_map_gadget_removed, inst);
1172 /*
1173 EINA_LIST_FOREACH(weather_config->items, l, ci)
1174 {
1175 if (ci->id == inst->cfg->id)
1176 {
1177 eina_stringshare_del(ci->geo_id);
1178 eina_stringshare_del(ci->city);
1179 eina_stringshare_del(ci->country);
1180 weather_config->items =
1181 eina_list_remove_list(weather_config->items, l);
1182 break;
1183 }
1184 }
1185 * TODO check if only one, add a refcount */
1186}
1187
1188
1189static void
1150_weather_popup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED) 1190_weather_popup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
1151{ 1191{
1152 evas_object_del(obj); 1192 evas_object_del(obj);
@@ -1687,9 +1727,9 @@ weather_map_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient EIN
1687 _weather_map_configure_sandbox, inst); 1727 _weather_map_configure_sandbox, inst);
1688#else 1728#else
1689 evas_object_smart_callback_add(parent, "gadget_created", 1729 evas_object_smart_callback_add(parent, "gadget_created",
1690 _weather_gadget_created, inst); 1730 _weather_map_gadget_created, inst);
1691 evas_object_smart_callback_add(parent, "gadget_removed", 1731 evas_object_smart_callback_add(parent, "gadget_removed",
1692 _weather_gadget_removed, inst); 1732 _weather_map_gadget_removed, inst);
1693#endif 1733#endif
1694 1734
1695 1735