Class: KDE::XMLGUIClient

Inherits:
Object show all
Defined in:
lib/ruber/kde_sugar.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) change_state(state, value)

Changes the GUI state state, by calling KDE::XMLGUIClient#stateChanged. If value is a true value, stateChanged will be called with KDE::XMLGUIClient::StateNoReverse, if it is false or nil, it will be called with KDE::XMLGUIClient::StateReverse.

Returns KDE::XMLGUIClient::StateNoReverse or KDE::XMLGUIClient::StateReverse, depending on which argument was passed to stateChanged


201
202
203
204
205
# File 'lib/ruber/kde_sugar.rb', line 201

def change_state state, value
  value = value ? StateNoReverse : StateReverse
  stateChanged(state, value)
  value
end

- (Object) global_change_state(state, value)

Changes the GUI state state, by calling KDE::XMLGUIClient#stateChanged. If value is a true value, stateChanged will be called with KDE::XMLGUIClient::StateNoReverse, if it is false or nil, it will be called with KDE::XMLGUIClient::StateReverse.

Unlike change_state, this method recursively changes the state of child clients, calling their global_change_state method, if defined, or their stateChanged method otherwise.


216
217
218
219
220
221
222
223
224
# File 'lib/ruber/kde_sugar.rb', line 216

def global_change_state state, value
  res = change_state state, value
  child_clients.each do |c| 
    if c.respond_to? :global_change_state then c.global_change_state state, value
    else c.send :stateChanged, state, res
    end
  end
  res
end