Class: Ruber::ChoosePluginsDlg
- Inherits:
-
KDE::Dialog
- Object
- KDE::Dialog
- Ruber::ChoosePluginsDlg
- Defined in:
- lib/ruber/main_window/choose_plugins_dlg.rb
Overview
Dialog where the user can choose the plugins to load and the directories where to look for plugins.
The main functionality is provided by the main widget, of class ChoosePluginsWidget.
Instance Method Summary (collapse)
-
- (ChoosePluginsDlg) initialize(parent = nil)
constructor
Creates a new ChoosePluginsDlg and initializes it using both the settings in the configuration file and the loaded plugins.
-
- (Object) plugins
See ChoosePluginsWidget#plugins.
-
- (Object) slotButtonClicked(btn)
private
Override the default behaviour when the user presses the Ok or Apply buttons and there are problems with dependencies (unresolved dependencies or circular dependencies).
-
- (Object) write_settings
slot
private
Writes the settings to the configuration file and disables the Apply button.
Constructor Details
- (ChoosePluginsDlg) initialize(parent = nil)
Creates a new ChoosePluginsDlg and initializes it using both the settings in the configuration file and the loaded plugins.
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ruber/main_window/choose_plugins_dlg.rb', line 40 def initialize parent = nil super self. = "Choose plugins" self. = Ok | Cancel | Apply | Default | Reset self. = ChoosePluginsWidget.new false .connect(SIGNAL('plugins_changed()')){ true} .connect(SIGNAL('directories_changed()')){ true} connect self, SIGNAL(:applyClicked), self, SLOT(:write_settings) connect self, SIGNAL(:okClicked), self, SLOT(:write_settings) connect self, SIGNAL(:defaultClicked), , SLOT(:apply_defaults) end |
Instance Method Details
- (Object) plugins
See ChoosePluginsWidget#plugins
54 55 56 |
# File 'lib/ruber/main_window/choose_plugins_dlg.rb', line 54 def plugins .plugins end |
- (Object) slotButtonClicked(btn) (private)
Override the default behaviour when the user presses the Ok or Apply buttons and there are problems with dependencies (unresolved dependencies or circular dependencies). In this case, it displays a message box where the user can choose whether he truly wants to save the settings or not. If he chooses to write the settings, the usual behaviour is followed. Otherwise, the method does nothing.
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/ruber/main_window/choose_plugins_dlg.rb', line 75 def slotButtonClicked btn if btn == Ok || btn == Apply and !.deps_satisfied? msg = "There are dependencies problems among plugins. Are you sure you want to accept these settings?" if KDE::MessageBox.question_yes_no(nil, msg) == KDE::MessageBox::Yes super else return end else super end end |
- (Object) write_settings (private)
Writes the settings to the configuration file and disables the Apply button
63 64 65 66 |
# File 'lib/ruber/main_window/choose_plugins_dlg.rb', line 63 def write_settings .write_settings false end |
Slot Signature:
write_settings()