yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=d981815fcc9dbb62542dd1ce2ede7bd60b4e7bd2

commit d981815fcc9dbb62542dd1ce2ede7bd60b4e7bd2
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Thu Nov 19 14:36:00 2015 +0200

    Fix behavior of popup window for usaved project
    
    When closing Erigo popup window will be shown for unsaved project.
    If press Cancel in popup wid, closing project will be aborted.
---
 src/bin/gui/egui_logic.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/bin/gui/egui_logic.c b/src/bin/gui/egui_logic.c
index 155a9e5..412d190 100644
--- a/src/bin/gui/egui_logic.c
+++ b/src/bin/gui/egui_logic.c
@@ -115,7 +115,6 @@ _project_close_internal(Gui_Context *ctx)
    _context_toolbar_item_delete(ctx);
 }
 
-/* Wrapper to handle project closure and allow to show popup window for not 
saved project. */
 static void
 _main_win_del_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 
*event EINA_UNUSED);
 
@@ -124,6 +123,7 @@ static void
 _project_save_popup_cb(Popup_Button_Type button_type, void *data)
 {
    Gui_Context *ctx = _active_context_get();
+   Eina_Bool erigo_close = (intptr_t) data;
    /* If OK button pressed - save file */
    if (button_type == POPUP_OK_BUTTON)
      {
@@ -147,11 +147,19 @@ _project_save_popup_cb(Popup_Button_Type button_type, 
void *data)
              free(swap_file);
           }
      }
-   _project_close_internal(ctx);
-   Eina_Bool close_erigo = (intptr_t) data;
-   if (close_erigo) _main_win_del_cb(NULL, NULL, NULL);
+   /* If press CANCEL button, cancel closure process */
+   if (button_type == POPUP_CANCEL_BUTTON)
+     {
+        erigo_close = EINA_FALSE;
+     }
+   else
+     {
+        _project_close_internal(ctx);
+     }
+   if (erigo_close) _main_win_del_cb(NULL, NULL, NULL);
 }
 
+/* Wrapper to handle project closure and allow to show popup window for not 
saved project. */
 static void
 project_close(Gui_Context *ctx, Eina_Bool erigo_close)
 {

-- 


Reply via email to