Class: Ruber::ConfigManager

Inherits:
Qt::Object
  • Object
show all
Includes:
PluginLike, SettingsContainer
Defined in:
lib/ruber/config/config.rb

Overview

Class which provides easy access to the KDE::Config for the application using the SettingsContainer module and the KDEConfigSettingsBackend classes.

Almost all the functionality of this class comes is provided by the SettingsContainer module, so see its documentation for more information.

===Signals settings_changed:: signal emitted whenever the settings changed (actually, this signal is currently emitted whenever the write method is called. Since this usually happens when the settings have changed, there’s not a big difference).

Instance Attribute Summary

Attributes included from SettingsContainer

dialog_title

Attributes included from PluginLike

plugin_description

Instance Method Summary (collapse)

Methods included from SettingsContainer

#[], #[]=, #add_setting, #add_widget, #collect_options, #default, #delete_dialog, #dialog, #has_setting?, #relative_path?, #remove_setting, #remove_widget, #setup_container

Methods included from PluginLike

#add_extensions_to_project, #add_options_to_project, #add_widgets_to_project, #create_tool_widget, #delayed_initialize, #initialize_plugin, #load_settings, #plugin_name, #query_close, #register_options, #register_with_project, #remove_extensions_from_project, #remove_from_project, #remove_options_from_project, #remove_widgets_from_project, #restore_session, #save_settings, #session_data, #setup_action, #setup_actions, #shutdown, #unload, #update_project

Signal Summary

Constructor Details

- (ConfigManager) initialize(_manager, pdf)

Creates a new ConfigManager. _manager is the component manager (it is unused, but it’s required by the plugin loading system). pdf is the PluginSpecification related to this component



56
57
58
59
60
61
# File 'lib/ruber/config/config.rb', line 56

def initialize _manager, pdf
  super()
  initialize_plugin pdf
  setup_container KDEConfigSettingsBackend.new
  self.dialog_title = 'Configure Ruber'
end

Instance Method Details

- (Object) kconfig

Returns the configuration object. In theory, this shouldn’t been needed, but it’s provided for those few cases when it’s needed.



76
77
78
# File 'lib/ruber/config/config.rb', line 76

def kconfig
  @backend.instance_variable_get :@config
end

- (Object) write

Override of SettingsContainer#write which emits the settings_changed signal after writing back the settings.



67
68
69
70
# File 'lib/ruber/config/config.rb', line 67

def write
  super
  emit settings_changed
end

Signal Details

- settings_changed