[Accessibility] Disable "delete" (switches) button, when no switch is selected. 97/150197/2
authorPawel Kurowski <p.kurowski2@samsung.com>
Thu, 14 Sep 2017 14:31:29 +0000 (16:31 +0200)
committerPawel Kurowski <p.kurowski2@samsung.com>
Mon, 18 Sep 2017 10:25:47 +0000 (12:25 +0200)
Change-Id: I5e4daa8af92a4b83f8c8a023d477b2969d310c77

setting-accessibility/include/setting-accessibility.h
setting-accessibility/src/setting-accessibility-universal-switch-remove-switch.c

index bd7df7ab1d95d622d35c7121d5b37c830efb4042..fe44e9a004cca410de78afbbd1eb941b85e66dc6 100755 (executable)
@@ -256,6 +256,7 @@ struct _SettingAccessibility {
        Evas_Object *entry;
        Evas_Object *all_checkbox;
        Evas_Object *remove_switches_page_button;
+       Evas_Object *remove_switches_popup_button;
        Evas_Object *update_accessories_action_genlist;
        Evas_Object *universal_switch_settings_btn;
 
index 0b5a7009aac9958369427f238497579a24f8bfed..ad8c369d4faf19904ac6ba23161e77039c4c19ed 100644 (file)
@@ -152,6 +152,7 @@ void setting_accessibility_universal_switch_use_naviframe_title_as_counter(Setti
        } else {
                title = _(DEVOPTION_STR_ACCESSIBILITY_SELECT_ITEMS);
        }
+       elm_object_disabled_set(ad->remove_switches_popup_button, ad->switches_to_remove_counter ? EINA_FALSE : EINA_TRUE);
        elm_layout_text_set(ad->md.naviframe, "default", title);
        SETTING_TRACE_END;
 }
@@ -204,8 +205,9 @@ void setting_accessibility_universal_switch_remove_switch_page_create(SettingAcc
        evas_object_smart_callback_add(ad->all_checkbox, "changed", __all_button_clicked_cb, ad);
        elm_layout_content_set(ad->md.naviframe, "prev_btn", ad->all_checkbox);
 
-       Evas_Object *delete_btn = setting_create_button(ad->md.naviframe, _(DEVOPTION_STR_ACCESSIBILITY_DELETE_CAPS), "naviframe/title_right", __delete_button_clicked_cb, ad);
-       elm_layout_content_set(ad->md.naviframe, "title_right_btn", delete_btn);
+       ad->remove_switches_popup_button = setting_create_button(ad->md.naviframe, _(DEVOPTION_STR_ACCESSIBILITY_DELETE_CAPS), "naviframe/title_right", __delete_button_clicked_cb, ad);
+       elm_layout_content_set(ad->md.naviframe, "title_right_btn", ad->remove_switches_popup_button);
+       elm_object_disabled_set(ad->remove_switches_popup_button, EINA_TRUE);
 
        Eina_Array_Iterator iterator;
        UniversalSwitchConfigurationItem *config_item;