Method: Ruber::PluginLike#unload
- Defined in:
- lib/ruber/plugin_like.rb
#unload ⇒ nil
Method called before the plugin is unloaded. It is used to do any needed cleanup.
This method should be overridden by any plugin which needs to do custom cleanup, but it’s important that the base class’s version of the method is called as well (most likely after the custom part).
This basic implementation does the following:
-
calls #shutdown
-
disconnects the #load_settings slot from the config manager Config#settings_changed signal
-
removes all the options belonging to the plugin from the config manager
-
removes all tool widgets belonging to the plugin from the main window
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/ruber/plugin_like.rb', line 83 def unload shutdown if Ruber[:config] disconnect Ruber[:config], SIGNAL('settings_changed()'), self, SLOT('load_settings()') @plugin_description..each_key do |g, n| Ruber[:config].remove_option(g.to_sym, n) end end @plugin_description..each do |w| Ruber[:main_window].remove_tool w.name if w.name end nil end |