Changeset 3272

Show
Ignore:
Timestamp:
06/23/08 06:47:06 (7 months ago)
Author:
andar
Message:

Properly shutdown the daemon if changing from classic to regular

Location:
branches/deluge-0.6/deluge/ui/gtkui
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/deluge-0.6/deluge/ui/gtkui/gtkui.py

    r3267 r3272  
    133133        self.config = deluge.configmanager.ConfigManager("gtkui.conf", DEFAULT_PREFS) 
    134134 
     135        # We need to check on exit if it was started in classic mode to ensure we 
     136        # shutdown the daemon. 
     137        self.started_in_classic = self.config["classic_mode"] 
     138         
    135139        # Start the Dbus Interface before anything else.. Just in case we are 
    136140        # already running. 
     
    185189        # Shutdown all components 
    186190        component.shutdown() 
     191        if self.started_in_classic: 
     192            client.shutdown() 
    187193 
    188194    def _on_new_core(self, data): 
  • branches/deluge-0.6/deluge/ui/gtkui/menubar.py

    r3269 r3272  
    3737import pkg_resources 
    3838 
     39import deluge.error 
    3940import deluge.component as component 
    4041from deluge.ui.client import aclient as client 
     
    223224        log.debug("on_menuitem_quit_activate") 
    224225        if self.config["classic_mode"]: 
    225             client.shutdown() 
     226            try: 
     227                client.shutdown() 
     228            except deluge.error.NoCoreError: 
     229                pass 
    226230        self.window.quit() 
    227231