forked from enlightenment/enlightenment
Do not go back to online when marked as 'Offline'
The way it was, if you changed offline it was repeatedly toggling due E "offline mode" state and connman module fighting. Now it does it once. By: Lucas De Marchi <lucas.demarchi@profusion.mobi> SVN revision: 45410
This commit is contained in:
parent
397c19771a
commit
251bb08baf
|
@ -112,9 +112,7 @@ _connman_toggle_offline_mode_cb(void *data, DBusMessage *msg __UNUSED__, DBusErr
|
|||
if ((!error) || (!dbus_error_is_set(error)))
|
||||
{
|
||||
printf("DBG CONNMAN: successfuly toggled to offline mode\n");
|
||||
// XXX hack: connman does not emit propertychanged for this, they need to fix it
|
||||
e_connman_manager_sync_elements();
|
||||
_connman_default_service_changed_delayed(ctxt);
|
||||
ctxt->offline_mode_pending = EINA_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -122,14 +120,6 @@ _connman_toggle_offline_mode_cb(void *data, DBusMessage *msg __UNUSED__, DBusErr
|
|||
dbus_error_free(error);
|
||||
}
|
||||
|
||||
static void
|
||||
_connman_toggle_offline_mode_pending_cb(void *data, DBusMessage *msg, DBusError *error)
|
||||
{
|
||||
E_Connman_Module_Context *ctxt = data;
|
||||
ctxt->offline_mode_pending = EINA_FALSE;
|
||||
_connman_toggle_offline_mode_cb(data, msg, error);
|
||||
}
|
||||
|
||||
static void
|
||||
_connman_toggle_offline_mode(E_Connman_Module_Context *ctxt)
|
||||
{
|
||||
|
@ -915,6 +905,7 @@ _connman_popup_cb_offline_mode_changed(void *data, Evas_Object *obj, void *event
|
|||
(_("Cannot toggle system's offline mode."));
|
||||
return;
|
||||
}
|
||||
ctxt->offline_mode_pending = EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1617,13 +1608,14 @@ _connman_event_mode_changed(void *data, int type __UNUSED__, void *event __UNUSE
|
|||
if ((ctxt->offline_mode == e_config->mode.offline) ||
|
||||
(!ctxt->has_manager))
|
||||
return 1;
|
||||
|
||||
if (!e_connman_manager_offline_mode_set
|
||||
(e_config->mode.offline, _connman_toggle_offline_mode_pending_cb, ctxt))
|
||||
_connman_operation_error_show
|
||||
(_("Cannot toggle system's offline mode."));
|
||||
if (!ctxt->offline_mode_pending)
|
||||
{
|
||||
if (!e_connman_manager_offline_mode_set(e_config->mode.offline,
|
||||
_connman_toggle_offline_mode_cb, ctxt))
|
||||
_connman_operation_error_show(_("Cannot toggle system's offline mode."));
|
||||
}
|
||||
else
|
||||
ctxt->offline_mode_pending = EINA_TRUE;
|
||||
ctxt->offline_mode_pending = EINA_FALSE;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#define MOD_CONF_VERSION 2
|
||||
|
||||
|
||||
typedef struct E_Connman_Instance E_Connman_Instance;
|
||||
typedef struct E_Connman_Module_Context E_Connman_Module_Context;
|
||||
typedef struct E_Connman_Service E_Connman_Service;
|
||||
|
|
Loading…
Reference in New Issue