summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-04-09 17:34:15 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-04-09 17:34:15 +0100
commit32f5bb93ce99f5423b8271708b0f35141d1da639 (patch)
treefa961dd3cf2c66274cc47d2637710f0123da7136
parentd14b566aa872d447191274794d70d19792629455 (diff)
bz5 -> genlist item flip on press of an option button to see main view
it isn't obvious you should flip back once u press a button to pair or unpair or connect etc. you you can see the pair requests etc. that are displayed in normal mode, not flipped mode.
-rw-r--r--src/modules/bluez5/e_mod_popup.c67
1 files changed, 55 insertions, 12 deletions
diff --git a/src/modules/bluez5/e_mod_popup.c b/src/modules/bluez5/e_mod_popup.c
index e2b68f611..4b0bb266d 100644
--- a/src/modules/bluez5/e_mod_popup.c
+++ b/src/modules/bluez5/e_mod_popup.c
@@ -208,87 +208,116 @@ _cb_visible(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUS
208} 208}
209 209
210static void 210static void
211_cb_pairable(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 211_unflip(Obj *o, Evas_Object *obj)
212{
213 Evas_Object *gl = evas_object_data_get(obj, "genlist");
214 Elm_Object_Item *it;
215
216 for (it = elm_genlist_first_item_get(gl); it;
217 it = elm_genlist_item_next_get(it))
218 {
219 if (o == elm_object_item_data_get(it))
220 {
221 if (elm_genlist_item_flip_get(it))
222 elm_genlist_item_flip_set(it, EINA_FALSE);
223 break;
224 }
225 }
226}
227
228static void
229_cb_pairable(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
212{ 230{
213 Obj *o = data; 231 Obj *o = data;
214 if (elm_check_state_get(obj)) bz_obj_pairable(o); 232 if (elm_check_state_get(obj)) bz_obj_pairable(o);
215 else bz_obj_unpairable(o); 233 else bz_obj_unpairable(o);
234 _unflip(o, obj);
216} 235}
217 236
218static void 237static void
219_cb_connect(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 238_cb_connect(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
220{ 239{
221 Obj *o = data; 240 Obj *o = data;
222 bz_obj_connect(o); 241 bz_obj_connect(o);
242 _unflip(o, obj);
223} 243}
224 244
225static void 245static void
226_cb_disconnect(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 246_cb_disconnect(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
227{ 247{
228 Obj *o = data; 248 Obj *o = data;
229 bz_obj_disconnect(o); 249 bz_obj_disconnect(o);
250 _unflip(o, obj);
230} 251}
231 252
232static void 253static void
233_cb_trust(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 254_cb_trust(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
234{ 255{
235 Obj *o = data; 256 Obj *o = data;
236 bz_obj_trust(o); 257 bz_obj_trust(o);
258 _unflip(o, obj);
237} 259}
238 260
239static void 261static void
240_cb_distrust(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 262_cb_distrust(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
241{ 263{
242 Obj *o = data; 264 Obj *o = data;
243 bz_obj_distrust(o); 265 bz_obj_distrust(o);
266 _unflip(o, obj);
244} 267}
245 268
246static void 269static void
247_cb_pair(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 270_cb_pair(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
248{ 271{
249 Obj *o = data; 272 Obj *o = data;
250 bz_obj_pair(o); 273 bz_obj_pair(o);
274 _unflip(o, obj);
251} 275}
252 276
253static void 277static void
254_cb_unpair(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 278_cb_unpair(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
255{ 279{
256 Obj *o = data; 280 Obj *o = data;
257 bz_obj_remove(o); 281 bz_obj_remove(o);
282 _unflip(o, obj);
258} 283}
259 284
260static void 285static void
261_cb_unlock_start(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 286_cb_unlock_start(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
262{ 287{
263 Obj *o = data; 288 Obj *o = data;
264 printf("unlock start %s\n", o->address); 289 printf("unlock start %s\n", o->address);
265 ebluez5_device_prop_unlock_set(o->address, EINA_TRUE); 290 ebluez5_device_prop_unlock_set(o->address, EINA_TRUE);
266 ebluez5_popup_device_change(o); 291 ebluez5_popup_device_change(o);
292 _unflip(o, obj);
267} 293}
268 294
269static void 295static void
270_cb_unlock_stop(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 296_cb_unlock_stop(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
271{ 297{
272 Obj *o = data; 298 Obj *o = data;
273 printf("unlock stop %s\n", o->address); 299 printf("unlock stop %s\n", o->address);
274 ebluez5_device_prop_unlock_set(o->address, EINA_FALSE); 300 ebluez5_device_prop_unlock_set(o->address, EINA_FALSE);
275 ebluez5_popup_device_change(o); 301 ebluez5_popup_device_change(o);
302 _unflip(o, obj);
276} 303}
277 304
278static void 305static void
279_cb_force_connect_start(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 306_cb_force_connect_start(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
280{ 307{
281 Obj *o = data; 308 Obj *o = data;
282 ebluez5_device_prop_force_connect_set(o->address, EINA_TRUE); 309 ebluez5_device_prop_force_connect_set(o->address, EINA_TRUE);
283 ebluez5_popup_adapter_change(o); 310 ebluez5_popup_adapter_change(o);
311 _unflip(o, obj);
284} 312}
285 313
286static void 314static void
287_cb_force_connect_stop(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 315_cb_force_connect_stop(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
288{ 316{
289 Obj *o = data; 317 Obj *o = data;
290 ebluez5_device_prop_force_connect_set(o->address, EINA_FALSE); 318 ebluez5_device_prop_force_connect_set(o->address, EINA_FALSE);
291 ebluez5_popup_adapter_change(o); 319 ebluez5_popup_adapter_change(o);
320 _unflip(o, obj);
292} 321}
293 322
294static void 323static void
@@ -485,7 +514,7 @@ _cb_dev_text_get(void *data, Evas_Object *obj EINA_UNUSED,
485} 514}
486 515
487static Evas_Object * 516static Evas_Object *
488_cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj, 517_cb_dev_content_get(void *data, Evas_Object *obj,
489 const char *part) 518 const char *part)
490{ 519{
491 Obj *o = data; 520 Obj *o = data;
@@ -540,12 +569,14 @@ _cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj,
540 { 569 {
541 bt = util_button_icon_add(obj, "changes-allow-symbolic", 570 bt = util_button_icon_add(obj, "changes-allow-symbolic",
542 _("Stop this from being an unlock device")); 571 _("Stop this from being an unlock device"));
572 evas_object_data_set(bt, "genlist", obj);
543 evas_object_smart_callback_add(bt, "clicked", _cb_unlock_stop, o); 573 evas_object_smart_callback_add(bt, "clicked", _cb_unlock_stop, o);
544 } 574 }
545 else 575 else
546 { 576 {
547 bt = util_button_icon_add(obj, "channel-insecure-symbolic", 577 bt = util_button_icon_add(obj, "channel-insecure-symbolic",
548 _("Make this auto unlock when detected (and lock when not)")); 578 _("Make this auto unlock when detected (and lock when not)"));
579 evas_object_data_set(bt, "genlist", obj);
549 evas_object_smart_callback_add(bt, "clicked", _cb_unlock_start, o); 580 evas_object_smart_callback_add(bt, "clicked", _cb_unlock_start, o);
550 } 581 }
551 elm_box_pack_end(bx, bt); 582 elm_box_pack_end(bx, bt);
@@ -555,12 +586,14 @@ _cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj,
555 { 586 {
556 bt = util_button_icon_add(obj, "checkbox-symbolic", 587 bt = util_button_icon_add(obj, "checkbox-symbolic",
557 _("Stop this device from being forcefullty connected")); 588 _("Stop this device from being forcefullty connected"));
589 evas_object_data_set(bt, "genlist", obj);
558 evas_object_smart_callback_add(bt, "clicked", _cb_force_connect_stop, o); 590 evas_object_smart_callback_add(bt, "clicked", _cb_force_connect_stop, o);
559 } 591 }
560 else 592 else
561 { 593 {
562 bt = util_button_icon_add(obj, "checkbox-checked-symbolic", 594 bt = util_button_icon_add(obj, "checkbox-checked-symbolic",
563 _("Force this device to be connected when detected")); 595 _("Force this device to be connected when detected"));
596 evas_object_data_set(bt, "genlist", obj);
564 evas_object_smart_callback_add(bt, "clicked", _cb_force_connect_start, o); 597 evas_object_smart_callback_add(bt, "clicked", _cb_force_connect_start, o);
565 } 598 }
566 elm_box_pack_end(bx, bt); 599 elm_box_pack_end(bx, bt);
@@ -570,12 +603,14 @@ _cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj,
570 { 603 {
571 bt = util_button_icon_add(obj, "network-offline", 604 bt = util_button_icon_add(obj, "network-offline",
572 _("Disconnect this device")); 605 _("Disconnect this device"));
606 evas_object_data_set(bt, "genlist", obj);
573 evas_object_smart_callback_add(bt, "clicked", _cb_disconnect, o); 607 evas_object_smart_callback_add(bt, "clicked", _cb_disconnect, o);
574 } 608 }
575 else 609 else
576 { 610 {
577 bt = util_button_icon_add(obj, "network-transmit-receive", 611 bt = util_button_icon_add(obj, "network-transmit-receive",
578 _("Connect this device")); 612 _("Connect this device"));
613 evas_object_data_set(bt, "genlist", obj);
579 evas_object_smart_callback_add(bt, "clicked", _cb_connect, o); 614 evas_object_smart_callback_add(bt, "clicked", _cb_connect, o);
580 } 615 }
581 elm_box_pack_end(bx, bt); 616 elm_box_pack_end(bx, bt);
@@ -585,12 +620,14 @@ _cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj,
585 { 620 {
586 bt = util_button_icon_add(obj, "security-low", 621 bt = util_button_icon_add(obj, "security-low",
587 _("Disrust this device")); 622 _("Disrust this device"));
623 evas_object_data_set(bt, "genlist", obj);
588 evas_object_smart_callback_add(bt, "clicked", _cb_distrust, o); 624 evas_object_smart_callback_add(bt, "clicked", _cb_distrust, o);
589 } 625 }
590 else 626 else
591 { 627 {
592 bt = util_button_icon_add(obj, "security-high", 628 bt = util_button_icon_add(obj, "security-high",
593 _("Trust this device")); 629 _("Trust this device"));
630 evas_object_data_set(bt, "genlist", obj);
594 evas_object_smart_callback_add(bt, "clicked", _cb_trust, o); 631 evas_object_smart_callback_add(bt, "clicked", _cb_trust, o);
595 } 632 }
596 elm_box_pack_end(bx, bt); 633 elm_box_pack_end(bx, bt);
@@ -602,6 +639,7 @@ _cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj,
602 { 639 {
603 bt = util_button_icon_add(obj, "list-add", 640 bt = util_button_icon_add(obj, "list-add",
604 _("Pair with this device")); 641 _("Pair with this device"));
642 evas_object_data_set(bt, "genlist", obj);
605 evas_object_smart_callback_add(bt, "clicked", _cb_pair, o); 643 evas_object_smart_callback_add(bt, "clicked", _cb_pair, o);
606 elm_box_pack_end(bx, bt); 644 elm_box_pack_end(bx, bt);
607 evas_object_show(bt); 645 evas_object_show(bt);
@@ -611,6 +649,7 @@ _cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj,
611 { 649 {
612 bt = util_button_icon_add(obj, "list-remove", 650 bt = util_button_icon_add(obj, "list-remove",
613 _("Unpair with this device")); 651 _("Unpair with this device"));
652 evas_object_data_set(bt, "genlist", obj);
614 evas_object_smart_callback_add(bt, "clicked", _cb_unpair, o); 653 evas_object_smart_callback_add(bt, "clicked", _cb_unpair, o);
615 elm_box_pack_end(bx, bt); 654 elm_box_pack_end(bx, bt);
616 evas_object_show(bt); 655 evas_object_show(bt);
@@ -661,6 +700,7 @@ _cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj,
661 700
662 bt = util_button_icon_add(obj, "list-add", 701 bt = util_button_icon_add(obj, "list-add",
663 _("Pair with this device")); 702 _("Pair with this device"));
703 evas_object_data_set(bt, "genlist", obj);
664 evas_object_data_set(bt, "entry", en); 704 evas_object_data_set(bt, "entry", en);
665 evas_object_smart_callback_add(bt, "clicked", _cb_agent_ok, o); 705 evas_object_smart_callback_add(bt, "clicked", _cb_agent_ok, o);
666 elm_box_pack_end(bx, bt); 706 elm_box_pack_end(bx, bt);
@@ -668,6 +708,7 @@ _cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj,
668 708
669 bt = util_button_icon_add(obj, "list-remove", 709 bt = util_button_icon_add(obj, "list-remove",
670 _("Reject pairing")); 710 _("Reject pairing"));
711 evas_object_data_set(bt, "genlist", obj);
671 evas_object_smart_callback_add(bt, "clicked", _cb_agent_cancel, o); 712 evas_object_smart_callback_add(bt, "clicked", _cb_agent_cancel, o);
672 elm_box_pack_end(bx, bt); 713 elm_box_pack_end(bx, bt);
673 evas_object_show(bt); 714 evas_object_show(bt);
@@ -681,12 +722,14 @@ _cb_dev_content_get(void *data EINA_UNUSED, Evas_Object *obj,
681 722
682 bt = util_button_icon_add(obj, "list-add", 723 bt = util_button_icon_add(obj, "list-add",
683 _("Pair with this device")); 724 _("Pair with this device"));
725 evas_object_data_set(bt, "genlist", obj);
684 evas_object_smart_callback_add(bt, "clicked", _cb_agent_ok, o); 726 evas_object_smart_callback_add(bt, "clicked", _cb_agent_ok, o);
685 elm_box_pack_end(bx, bt); 727 elm_box_pack_end(bx, bt);
686 evas_object_show(bt); 728 evas_object_show(bt);
687 729
688 bt = util_button_icon_add(obj, "list-remove", 730 bt = util_button_icon_add(obj, "list-remove",
689 _("Reject pairing")); 731 _("Reject pairing"));
732 evas_object_data_set(bt, "genlist", obj);
690 evas_object_smart_callback_add(bt, "clicked", _cb_agent_cancel, o); 733 evas_object_smart_callback_add(bt, "clicked", _cb_agent_cancel, o);
691 elm_box_pack_end(bx, bt); 734 elm_box_pack_end(bx, bt);
692 evas_object_show(bt); 735 evas_object_show(bt);