Changeset e31acf
- Timestamp:
- 11/04/2016 11:54:46 PM (9 years ago)
- Branches:
- 2.0.x, develop, master
- Children:
- 0890cc
- Parents:
- d0d070
- git-author:
- Calum Lind <calumlind+deluge@gmail.com> (11/04/2016 11:36:33 PM)
- git-committer:
- Calum Lind <calumlind+deluge@gmail.com> (11/04/2016 11:54:46 PM)
- Location:
- deluge/ui/gtkui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
deluge/ui/gtkui/gtkui.py
rd0d070 re31acf 258 258 yield self.shutdown() 259 259 260 # Modal dialogs can prevent the application exiting so destroy mainwindow 261 # Must do this here to avoid hang when closing with SIGINT (CTRL-C) 260 # The gtk modal dialogs (e.g. Preferences) can prevent the application 261 # quitting, so force exiting by destroying MainWindow. Must be done here 262 # to avoid hanging when quitting with SIGINT (CTRL-C). 262 263 self.mainwindow.window.destroy() 263 264 264 265 reactor.stop() 266 267 # Restart the application after closing if MainWindow attribute set. 268 if component.get('MainWindow').restart: 269 os.execv(sys.argv[0], sys.argv) 265 270 266 271 def print_rpc_stats(self): -
deluge/ui/gtkui/mainwindow.py
rd0d070 re31acf 108 108 # UI when it is minimized. 109 109 self.is_minimized = False 110 self.restart = False 110 111 111 112 self.window.drag_dest_set(gtk.DEST_DEFAULT_ALL, [('text/uri-list', 0, 80)], gtk.gdk.ACTION_COPY) … … 201 202 return self.main_builder 202 203 203 def quit(self, shutdown=False): 204 def quit(self, shutdown=False, restart=False): 205 """Quits the GtkUI application. 206 207 Args: 208 shutdown (bool): Whether or not to shutdown the daemon as well. 209 restart (bool): Whether or not to restart the application after closing. 210 204 211 """ 205 Quits the GtkUI 206 207 :param shutdown: whether or not to shutdown the daemon as well 208 :type shutdown: boolean 209 """ 212 210 213 def quit_gtkui(): 211 214 def stop_gtk_reactor(result=None): 215 self.restart = restart 212 216 try: 213 217 reactor.callLater(0, reactor.fireSystemEvent, 'gtkui_close') -
deluge/ui/gtkui/preferences.py
rd0d070 re31acf 702 702 client.connected() and 703 703 client.is_localhost()) 704 component.get('MainWindow').quit(shutdown=shutdown_daemon )704 component.get('MainWindow').quit(shutdown=shutdown_daemon, restart=True) 705 705 else: 706 706 self.gtkui_config['standalone'] = not new_gtkui_standalone … … 709 709 self.builder.get_object('radio_thinclient').set_active( 710 710 not self.gtkui_config['standalone']) 711 mode = 'Thinclient' if was_standalone else 'Standalone' 711 712 dialog = YesNoDialog( 712 _('Switching client mode...'),713 _(' Your current session will be stopped. Do you wish to continue?')713 _('Switching Deluge Client Mode...'), 714 _('Do you want to restart to use %s mode?' % mode) 714 715 ) 715 716 dialog.run().addCallback(on_response)
Note:
See TracChangeset
for help on using the changeset viewer.