rimmed pushed a commit to branch master.

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

commit 475e9b2d25ca6608edb3049bb9bd30e781b14eb8
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Thu Oct 1 12:08:06 2015 +0300

    popup: add API for disable popup buttons
    
    Change-Id: Icbe90b948079ea4433836338d182444abfba53e6
---
 src/bin/ui/main_window.h | 10 ++++++++++
 src/bin/ui/popup.c       | 13 +++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/src/bin/ui/main_window.h b/src/bin/ui/main_window.h
index 0ace607..9fa6a25 100644
--- a/src/bin/ui/main_window.h
+++ b/src/bin/ui/main_window.h
@@ -403,6 +403,16 @@ popup_want_action(const char *title,
                   Popup_Button p_btns,
                   Popup_Validator_Func func,
                   void *data);
+/**
+ * Disable the popup buttons.
+ *
+ * @param p_btns The flags for set the popup buttons;
+ * @param disabled The button disabled state.
+ *
+ * @ingroup Window
+ */
+void
+popup_buttons_disabled_set(Popup_Button p_btns, Eina_Bool disabled);
 
 void
 popup_fileselector_folder_helper(Evas_Object *entry, const char *path);
diff --git a/src/bin/ui/popup.c b/src/bin/ui/popup.c
index 5e65bfe..ae0cfbe 100644
--- a/src/bin/ui/popup.c
+++ b/src/bin/ui/popup.c
@@ -107,6 +107,19 @@ popup_want_action(const char *title,
 }
 #undef BTN_ADD
 
+void
+popup_buttons_disabled_set(Popup_Button popup_btns, Eina_Bool disabled)
+{
+   if ((popup_btns & BTN_OK) || (popup_btns & BTN_SAVE) || (popup_btns & 
BTN_REPLACE))
+     elm_object_disabled_set(elm_object_part_content_get(popup, "button1"), 
disabled);
+   if (popup_btns & BTN_DONT_SAVE)
+     elm_object_disabled_set(elm_object_part_content_get(popup, "button2"), 
disabled);
+   if ((popup_btns & BTN_CANCEL) && (popup_btns & BTN_DONT_SAVE))
+     elm_object_disabled_set(elm_object_part_content_get(popup, "button3"), 
disabled);
+   if (popup_btns & BTN_CANCEL)
+     elm_object_disabled_set(elm_object_part_content_get(popup, "button2"), 
disabled);
+}
+
 static void
 _popup_dismiss(void *data __UNUSED__,
                Evas_Object *obj __UNUSED__,

-- 


Reply via email to