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 PluginLike

#plugin_description

Instance Method Summary collapse

Methods included from SettingsContainer

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

Methods included from PluginLike

#add_extensions_to_project, #add_options_to_project, #add_widgets_to_project, #plugin_name, #query_close, #register_with_project, #remove_extensions_from_project, #remove_from_project, #remove_options_from_project, #remove_widgets_from_project, #restore_session, #save_settings, #session_data, #shutdown, #unload, #update_project

Constructor Details

#initialize(_manager, pdf) ⇒ ConfigManager

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

#kconfigObject

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

#writeObject

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