Commits

wodny  committed fd9b060

Reenable quit at the end.

  • Participants
  • Parent commits 512cbcf

Comments (0)

Files changed (3)

File lib/dispatch.py

     def handle(self, executor):
         self.gui.expand_errors(self.expand)
 
+class EnableQuit(Event):
+    def __init__(self, gui):
+        self.gui = gui
+
+    def handle(self, executor):
+        self.gui.enable_quit()
+
 class SetExitCode(Event):
     def __init__(self, exitcode):
         self.exitcode = exitcode
         self.errors_expander = self.builder.get_object("errors_expander")
         self.main_status = self.builder.get_object("main_status")
 
-        quit_button = self.builder.get_object("quit_button")
-        if noquit:
-            quit_button.set_visible(False)
-        self.noquit = noquit
+        self.quit_button = self.builder.get_object("quit_button")
+
+        self.__enable_quit(not noquit)
 
         self.builder.connect_signals(self)
         self.window.show()
     def instance():
         return GUI.__single if GUI.__single else GUI()
 
+    def show_quit_button(self, show = True):
+        self.quit_button.set_visible(show)
+
     def on_the_window_delete(self, widget, data = None):
         if self.noquit:
             return True
     
     def __expand_errors_idle(self, really):
         self.errors_expander.set_expanded(really)
+    
+    def enable_quit(self, enable = True):
+        gobject.idle_add(self.__enable_quit, enable)
+
+    def __enable_quit(self, enable = True):
+        self.noquit = not enable
+        self.show_quit_button(enable)

File lib/rsync.py

             event_queue.put(dispatch.ExpandErrors(gui, True))
             event_queue.put(dispatch.MakeSurprise(self.options.nzdelay))
 
+        event_queue.put(dispatch.EnableQuit(gui))
+
         event_queue.put(dispatch.SetExitCode(self.process.returncode))
 
     def kill(self):