confirm quit if needed
authorgc <gc>
Fri, 11 Apr 2008 21:58:19 +0000 (21:58 +0000)
committergc <gc>
Fri, 11 Apr 2008 21:58:19 +0000 (21:58 +0000)
bin/booh-classifier

index 81ca22b..4bc9dfd 100644 (file)
@@ -1175,8 +1175,13 @@ def open_dir_popup
 end
 
 def try_quit(*options)
-    Gtk.main_quit
-    $quit = true
+    if ! $allentries.detect { |e| e.removed || e.labeled } ||
+       show_popup($main_window,
+                  utf8(_("Are you sure you want to quit?")),
+                  { :okcancel => true })
+        Gtk.main_quit
+        $quit = true
+    end
 end
 
 def execute