Ticket #75: patch_plugin_reload.diff
File patch_plugin_reload.diff, 4.4 KB (added by , 17 years ago) |
---|
-
src/dialogs.py
70 70 name_col.set_expand(True) 71 71 dgtk.add_toggle_column(self.view, _("Enabled"), 1, toggled_signal=self.plugin_toggled) 72 72 signals = {'plugin_pref': self.plugin_pref, 73 'on_close_clicked': self.close_clicked} 73 'on_close_clicked': self.close_clicked, 74 'reload_plugins': self.reload_plugins} 74 75 self.glade.signal_autoconnect(signals) 75 76 self.plugins = plugins 76 77 … … 337 338 plugin_name = self.store.get_value(plugin_iter, 0) 338 339 self.plugins.configure_plugin(plugin_name, self.dialog) 339 340 341 def reload_plugins(self, widget): 342 self.plugins.shutdown_all_plugins() 343 self.plugins.scan_for_plugins() 344 for plugin in self.plugins.available_plugins.values(): 345 reload(plugin) 346 enable_plugins = self.preferences.get('enabled_plugins').split(':') 347 for plugin in enable_plugins: 348 try: 349 self.plugins.enable_plugin(plugin) 350 except KeyError: 351 pass 352 # plugin tab 353 self.store.clear() 354 for plugin in self.plugins.get_available_plugins(): 355 #print plugin 356 if plugin in self.plugins.get_enabled_plugins(): 357 self.store.append( (plugin, True) ) 358 else: 359 self.store.append( (plugin, False) ) 360 340 361 def TestPort(self, widget): 341 362 common.open_url_in_browser('http://www.deluge-torrent.org/test-port.php?port=%s' % self.active_port) 342 363 -
glade/preferences_dialog.glade
2915 2915 <widget class="GtkAlignment" id="alignment30"> 2916 2916 <property name="visible">True</property> 2917 2917 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 2918 <property name="left_padding">168</property> 2918 <property name="xalign">1</property> 2919 <property name="xscale">0.20000000298023224</property> 2919 2920 <child> 2921 <widget class="GtkButton" id="button_reload_plugins"> 2922 <property name="visible">True</property> 2923 <property name="can_focus">True</property> 2924 <property name="receives_default">True</property> 2925 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 2926 <property name="label" translatable="yes">gtk-refresh</property> 2927 <property name="use_stock">True</property> 2928 <property name="response_id">0</property> 2929 <signal name="clicked" handler="reload_plugins"/> 2930 </widget> 2931 </child> 2932 </widget> 2933 </child> 2934 <child> 2935 <widget class="GtkAlignment" id="alignment25"> 2936 <property name="visible">True</property> 2937 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 2938 <property name="xalign">0</property> 2939 <property name="xscale">0.20000000298023224</property> 2940 <child> 2920 2941 <widget class="GtkButton" id="plugin_conf"> 2921 2942 <property name="visible">True</property> 2922 2943 <property name="can_focus">True</property> … … 2930 2951 </child> 2931 2952 </widget> 2932 2953 <packing> 2933 <property name="expand">False</property> 2934 <property name="fill">False</property> 2954 <property name="position">1</property> 2935 2955 </packing> 2936 2956 </child> 2937 2957 </widget>