Changeset 520be1
- Timestamp:
- 06/10/2009 10:50:57 PM (16 years ago)
- Branches:
- 2.0.x, develop, extjs4-port, master
- Children:
- ca7f33d
- Parents:
- e36ca0
- Location:
- deluge/ui/gtkui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
deluge/ui/gtkui/gtkui.py
re36ca0 r520be1 238 238 client.start_classic_mode() 239 239 except deluge.error.DaemonRunningError: 240 response= dialogs.YesNoDialog(240 d = dialogs.YesNoDialog( 241 241 _("Turn off Classic Mode?"), 242 242 _("It appears that a Deluge daemon process (deluged) is already running.\n\n\ … … 244 244 245 245 self.started_in_classic = False 246 if response != gtk.RESPONSE_YES: 247 # The user does not want to turn Classic Mode off, so just quit 248 reactor.stop() 249 return 250 # Turning off classic_mode 251 self.config["classic_mode"] = False 246 def on_dialog_response(response): 247 if response != gtk.RESPONSE_YES: 248 # The user does not want to turn Classic Mode off, so just quit 249 reactor.stop() 250 return 251 # Turning off classic_mode 252 self.config["classic_mode"] = False 253 self.__start_non_classic() 254 255 d.addCallback(on_dialog_response) 252 256 else: 253 257 component.start() 254 258 return 255 259 256 # Autoconnect to a host 257 if self.config["autoconnect"]: 258 for host in self.connectionmanager.config["hosts"]: 259 if host[0] == self.config["autoconnect_host_id"]: 260 def on_connect(connector): 261 component.start() 262 client.connect(*host[1:]).addCallback(on_connect) 263 264 if self.config["show_connection_manager_on_start"]: 265 # XXX: We need to call a simulate() here, but this could be a bug in twisted 266 reactor.simulate() 267 self.connectionmanager.show() 260 else: 261 self.__start_non_classic() 262 263 def __start_non_classic(self): 264 # Autoconnect to a host 265 if self.config["autoconnect"]: 266 for host in self.connectionmanager.config["hosts"]: 267 if host[0] == self.config["autoconnect_host_id"]: 268 def on_connect(connector): 269 component.start() 270 client.connect(*host[1:]).addCallback(on_connect) 271 272 if self.config["show_connection_manager_on_start"]: 273 # XXX: We need to call a simulate() here, but this could be a bug in twisted 274 reactor.simulate() 275 self.connectionmanager.show() 268 276 269 277 -
deluge/ui/gtkui/toolbar.py
re36ca0 r520be1 75 75 ] 76 76 77 if self.config["classic_mode"]: 78 self.window.main_glade.get_widget("toolbutton_connectionmanager").hide() 77 self.config.register_set_function("classic_mode", self._on_classic_mode, True) 79 78 80 79 # Hide if necessary … … 82 81 83 82 def start(self): 83 if not self.config["classic_mode"]: 84 self.window.main_glade.get_widget("toolbutton_connectionmanager").show() 85 84 86 for widget in self.change_sensitivity: 85 87 self.window.main_glade.get_widget(widget).set_sensitive(True) … … 177 179 log.debug("on_toolbutton_queue_down_clicked") 178 180 component.get("MenuBar").on_menuitem_queue_down_activate(data) 181 182 def _on_classic_mode(self, key, value): 183 w = self.window.main_glade.get_widget("toolbutton_connectionmanager") 184 if value: 185 w.hide() 186 else: 187 w.show()
Note:
See TracChangeset
for help on using the changeset viewer.