Browse Source

Merge branch '2415_quit_editor_fix'

* 2415_quit_editor_fix:
  Ticket #2415: keep active state of editor before final decision about quit.
Andrew Borodin 14 years ago
parent
commit
81b9326843
3 changed files with 5 additions and 10 deletions
  1. 2 4
      src/diffviewer/ydiff.c
  2. 2 3
      src/editor/editwidget.c
  3. 1 3
      src/viewer/actions_cmd.c

+ 2 - 4
src/diffviewer/ydiff.c

@@ -3235,11 +3235,9 @@ dview_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, v
 
     case DLG_VALIDATE:
         dview = (WDiff *) find_widget_type (h, dview_callback);
-        if (!dview_ok_to_exit (dview))
-            h->state = DLG_ACTIVE;
-        else
+        h->state = DLG_ACTIVE; /* don't stop the dialog before final decision */
+        if (dview_ok_to_exit (dview))
             h->state = DLG_CLOSED;
-
         return MSG_HANDLED;
 
     default:

+ 2 - 3
src/editor/editwidget.c

@@ -243,9 +243,8 @@ edit_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, vo
         return MSG_HANDLED;
 
     case DLG_VALIDATE:
-        if (!edit_ok_to_exit (edit))
-            h->state = DLG_ACTIVE;
-        else
+        h->state = DLG_ACTIVE; /* don't stop the dialog before final decision */
+        if (edit_ok_to_exit (edit))
             h->state = DLG_CLOSED;
         return MSG_HANDLED;
 

+ 1 - 3
src/viewer/actions_cmd.c

@@ -524,13 +524,11 @@ mcview_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm,
 
     case DLG_VALIDATE:
         view = (mcview_t *) find_widget_type (h, mcview_callback);
+        h->state = DLG_ACTIVE; /* don't stop the dialog before final decision */
         if (mcview_ok_to_quit (view))
             h->state = DLG_CLOSED;
         else
-        {
-            h->state = DLG_ACTIVE;
             mcview_update (view);
-        }
         return MSG_HANDLED;
 
     default: