booh-classifier: properly not quit when toplevel window is closed and user says to...
authorGuillaume Cottenceau <gcottenc@gmail.com>
Sun, 14 Dec 2008 14:24:15 +0000 (15:24 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Sun, 14 Dec 2008 14:24:15 +0000 (15:24 +0100)
bin/booh-classifier

index 79bd95a30be9337b38abff2bdbb520bc747d18dd..cc3170dd35ec4bfc876e9f4d74b5cc8e8e549110 100755 (executable)
@@ -1244,12 +1244,14 @@ def open_dir_popup
 end
 
 def try_quit(*options)
-    if ! $allentries.detect { |e| e.removed || e.labeled } ||
-       show_popup($main_window,
-                  utf8(_("Are you sure you want to quit?")),
-                  { :okcancel => true })
+    if ! $allentries.detect { |e| e.removed || e.labeled } || show_popup($main_window,
+                                                                         utf8(_("You have not executed the classification. Are you sure you want to quit?")),
+                                                                         { :okcancel => true })
         Gtk.main_quit
         $quit = true
+        return false
+    else
+        return true
     end
 end
 
@@ -1829,7 +1831,7 @@ def create_main_window
     $main_window = create_window
     $main_window.add(main_vbox)
     $main_window.signal_connect('delete-event') {
-        try_quit({ :disallow_cancel => true })
+        try_quit
     }
 
     #- read/save size and position of window