rimmed pushed a commit to branch eflete-1.18.

http://git.enlightenment.org/tools/eflete.git/commit/?id=aee9a9d1913bd8bffe34492c83f3dbd5848f4047

commit aee9a9d1913bd8bffe34492c83f3dbd5848f4047
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Fri Sep 2 15:21:31 2016 +0300

    popup: add popup_button_disabled_set for async popup
---
 src/bin/ui/main_window.h |  2 ++
 src/bin/ui/popup.c       | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/src/bin/ui/main_window.h b/src/bin/ui/main_window.h
index 0213523..6e37458 100644
--- a/src/bin/ui/main_window.h
+++ b/src/bin/ui/main_window.h
@@ -373,6 +373,8 @@ popup_active_helper_close(void *data,
  */
 void
 popup_buttons_disabled_set(Popup_Button p_btns, Eina_Bool disabled);
+void
+popup_button_disabled_set(Evas_Object *popup, Popup_Button btn, Eina_Bool 
disabled);
 
 void
 popup_fileselector_folder_helper(const char *title, Evas_Object *follow_up, 
const char *path,
diff --git a/src/bin/ui/popup.c b/src/bin/ui/popup.c
index b8b29e5..3a13d21 100644
--- a/src/bin/ui/popup.c
+++ b/src/bin/ui/popup.c
@@ -269,6 +269,8 @@ popup_add(const char *title,
    elm_object_part_text_set(pd->popup, "title,text", title);
    elm_popup_content_text_wrap_type_set(pd->popup, ELM_WRAP_WORD);
 
+   evas_object_data_set(pd->popup, POPUP_DATA, pd);
+
    int bt_num = 0;
    pd->button.ok        = _button_add(pd, &bt_num, _("Ok"),         popup_btns 
& BTN_OK);
    pd->button.save      = _button_add(pd, &bt_num, _("Save"),       popup_btns 
& BTN_SAVE);
@@ -293,6 +295,40 @@ popup_add(const char *title,
 
    return pd->popup;
 }
+
+void
+popup_button_disabled_set(Evas_Object *popup, Popup_Button btn, Eina_Bool 
disabled)
+{
+   assert(popup != NULL);
+
+   if (!btn) return;
+
+   Popup_Data *pd = evas_object_data_get(popup, POPUP_DATA);
+   switch (btn)
+     {
+      case BTN_OK:
+         elm_object_disabled_set(pd->button.ok, disabled);
+         break;
+      case BTN_SAVE:
+         elm_object_disabled_set(pd->button.save, disabled);
+         break;
+      case BTN_APPEND:
+         elm_object_disabled_set(pd->button.append, disabled);
+         break;
+      case BTN_REPLACE:
+         elm_object_disabled_set(pd->button.replace, disabled);
+         break;
+      case BTN_DONT_SAVE:
+         elm_object_disabled_set(pd->button.dont_save, disabled);
+         break;
+      case BTN_CANCEL:
+         elm_object_disabled_set(pd->button.cancel, disabled);
+         break;
+      default:
+         ERR("Unknown button.");
+         abort(); /* only one single button allowed */
+     }
+}
 /* end of async popup */
 
 #if HAVE_TIZEN

-- 


Reply via email to