forked from enlightenment/enlightenment
bluez5 - dont need the force conenct option it seems - cant find a need
if connected AND trusted it should conenct again next time you power them on etc. ... so .. let's remove extra option cruft we seemingly don't need - less confusion for users @fix
This commit is contained in:
parent
f7708c6e74
commit
b6da0ac873
|
@ -36,7 +36,10 @@ cb_obj_prop_entry(void *data, const void *key, Eldbus_Message_Iter *var)
|
|||
{
|
||||
Eina_Bool val = EINA_FALSE;
|
||||
if (eldbus_message_iter_arguments_get(var, "b", &val))
|
||||
o->connected = val;
|
||||
{
|
||||
o->connected = val;
|
||||
printf("BZ: change connected for %s to %i\n", o->address, o->connected);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(skey, "Trusted"))
|
||||
{
|
||||
|
|
|
@ -294,7 +294,7 @@ ebluez5_instances_update(void)
|
|||
static void
|
||||
_device_prop_clean(Config_Device *dev)
|
||||
{
|
||||
if ((!dev->unlock) && (!dev->force_connect))
|
||||
if (!dev->unlock)
|
||||
{
|
||||
ebluez5_config->devices = eina_list_remove(ebluez5_config->devices, dev);
|
||||
eina_stringshare_del(dev->addr);
|
||||
|
@ -332,27 +332,6 @@ ebluez5_device_prop_find(const char *address)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ebluez5_device_prop_force_connect_set(const char *address, Eina_Bool enable)
|
||||
{
|
||||
Config_Device *dev;
|
||||
|
||||
if (!address) return;
|
||||
dev = ebluez5_device_prop_find(address);
|
||||
if (dev)
|
||||
{
|
||||
dev->force_connect = enable;
|
||||
_device_prop_clean(dev);
|
||||
return;
|
||||
}
|
||||
if (enable)
|
||||
{
|
||||
dev = _device_prop_new(address);
|
||||
dev->force_connect = enable;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ebluez5_device_prop_unlock_set(const char *address, Eina_Bool enable)
|
||||
{
|
||||
|
@ -405,7 +384,6 @@ e_modapi_init(E_Module *m)
|
|||
#define T Config_Device
|
||||
#define D conf_device_edd
|
||||
E_CONFIG_VAL(D, T, addr, STR);
|
||||
E_CONFIG_VAL(D, T, force_connect, UCHAR);
|
||||
E_CONFIG_VAL(D, T, unlock, UCHAR);
|
||||
|
||||
conf_edd = E_CONFIG_DD_NEW("Config", Config);
|
||||
|
|
|
@ -32,7 +32,6 @@ typedef struct _Config_Device Config_Device;
|
|||
struct _Config_Device
|
||||
{
|
||||
const char *addr;
|
||||
Eina_Bool force_connect;
|
||||
Eina_Bool unlock;
|
||||
};
|
||||
|
||||
|
|
|
@ -48,16 +48,6 @@ _devices_eval(void)
|
|||
if (dev)
|
||||
{
|
||||
printf("=== dev: %s|%s [%s]\n", dev->addr, o->address, o->name);
|
||||
if ((dev->force_connect) && (!o->connected))
|
||||
{
|
||||
printf("=== %s force con, not conn, ping ok=%i\n", o->address, o->ping_ok);
|
||||
if (o->ping_ok)
|
||||
{
|
||||
printf("=== %s force con, not conn, ping ok=%i\n", o->address, o->ping_ok);
|
||||
bz_obj_connect(o);
|
||||
}
|
||||
else need_ping = EINA_TRUE;
|
||||
}
|
||||
if (dev->unlock)
|
||||
{
|
||||
printf("=== unlock...\n");
|
||||
|
@ -303,24 +293,6 @@ _cb_unlock_stop(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|||
_unflip(o, obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_force_connect_start(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Obj *o = data;
|
||||
ebluez5_device_prop_force_connect_set(o->address, EINA_TRUE);
|
||||
ebluez5_popup_adapter_change(o);
|
||||
_unflip(o, obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_force_connect_stop(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Obj *o = data;
|
||||
ebluez5_device_prop_force_connect_set(o->address, EINA_FALSE);
|
||||
ebluez5_popup_adapter_change(o);
|
||||
_unflip(o, obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_flip(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -582,23 +554,6 @@ _cb_dev_content_get(void *data, Evas_Object *obj,
|
|||
}
|
||||
elm_box_pack_end(bx, bt);
|
||||
evas_object_show(bt);
|
||||
|
||||
if ((dev) && (dev->force_connect))
|
||||
{
|
||||
bt = util_button_icon_add(obj, "bt-force-connect-off",
|
||||
_("Stop this device from being forcefully connected"));
|
||||
evas_object_data_set(bt, "genlist", obj);
|
||||
evas_object_smart_callback_add(bt, "clicked", _cb_force_connect_stop, o);
|
||||
}
|
||||
else
|
||||
{
|
||||
bt = util_button_icon_add(obj, "bt-force-connect-on",
|
||||
_("Force this device to be connected when detected"));
|
||||
evas_object_data_set(bt, "genlist", obj);
|
||||
evas_object_smart_callback_add(bt, "clicked", _cb_force_connect_start, o);
|
||||
}
|
||||
elm_box_pack_end(bx, bt);
|
||||
evas_object_show(bt);
|
||||
}
|
||||
if (o->connected)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue