1 /* Setup if we need connman? */
3 #include "e_mod_main.h"
5 #define E_CONNMAN_I_KNOW_THIS_API_IS_SUBJECT_TO_CHANGE 1
6 #include <connman0_7x/E_Connman.h>
9 static Ecore_Event_Handler *handler = NULL;
10 static Ecore_Timer *connman_timeout = NULL;
13 _recommend_connman(E_Wizard_Page *pg)
15 Evas_Object *o, *of, *ob;
17 o = e_widget_list_add(pg->evas, 1, 0);
18 e_wizard_title_set(_("Network Management"));
20 of = e_widget_framelist_add(pg->evas,
21 _("Connman network service not found"), 0);
23 ob = e_widget_label_add
24 (pg->evas, _("Install Connman for network management support"));
25 e_widget_framelist_object_append(of, ob);
28 e_widget_list_object_append(o, of, 0, 0, 0.5);
32 e_wizard_page_show(o);
35 e_wizard_button_next_enable_set(1);
40 _connman_in(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
44 ecore_event_handler_del(handler);
49 ecore_timer_del(connman_timeout);
50 connman_timeout = NULL;
52 e_wizard_button_next_enable_set(1);
58 _connman_timeout(void *data)
60 E_Wizard_Page *pg = data;
64 EINA_LIST_FOREACH(e_config->modules, l, em)
66 if (!em->name) continue;
67 if (!strcmp(em->name, "connman"))
69 e_config->modules = eina_list_remove_list
70 (e_config->modules, l);
71 if (em->name) eina_stringshare_del(em->name);
76 e_config_save_queue();
77 connman_timeout = NULL;
80 ecore_event_handler_del(handler);
83 _recommend_connman(pg);
89 wizard_page_init(E_Wizard_Page *pg __UNUSED__)
95 wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
101 wizard_page_show(E_Wizard_Page *pg)
103 int have_connman = 0;
104 E_DBus_Connection *c;
106 c = e_dbus_bus_get(DBUS_BUS_SYSTEM);
110 if (e_connman_system_init(c))
112 handler = ecore_event_handler_add
113 (E_CONNMAN_EVENT_MANAGER_IN, _connman_in, NULL);
114 if (connman_timeout) ecore_timer_del(connman_timeout);
115 connman_timeout = ecore_timer_add(2.0, _connman_timeout, pg);
117 e_wizard_button_next_enable_set(0);
126 EINA_LIST_FOREACH(e_config->modules, l, em)
128 if (!em->name) continue;
129 if (!strcmp(em->name, "connman"))
131 e_config->modules = eina_list_remove_list
132 (e_config->modules, l);
133 if (em->name) eina_stringshare_del(em->name);
138 e_config_save_queue();
139 _recommend_connman(pg);
141 e_wizard_title_set(_("Checking to see if Connman exists"));
142 return 1; /* 1 == show ui, and wait for user, 0 == just continue */
146 wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
150 ecore_event_handler_del(handler);
155 ecore_timer_del(connman_timeout);
156 connman_timeout = NULL;
158 // if (pg->data) evas_object_del(pg->data);
163 wizard_page_apply(E_Wizard_Page *pg __UNUSED__)