Class: Ruber::Rake::ConfigWidget::AddQuickActionDlg
- Inherits:
-
KDE::Dialog
- Object
- KDE::Dialog
- Ruber::Rake::ConfigWidget::AddQuickActionDlg
- Defined in:
- plugins/rake/rake_widgets.rb
Overview
Dialog used by the configuration widget to have the user choose a quick task, that is associate a shortcut with a name (which is supposed to correspond to a task in the rakefile)
Instance Method Summary (collapse)
-
- (nil) change_ok_state
slot
private
Enables or disables the Ok button depending on whether both the task name and the corresponding shortcut have been chosen.
-
- (AddQuickActionDlg) initialize(parent = Ruber[:main_window])
constructor
A new instance of AddQuickActionDlg.
-
- (String) shortcut
The shortcut chosen by the user.
-
- (String) task
The name chosen by the user.
Constructor Details
- (AddQuickActionDlg) initialize(parent = Ruber[:main_window])
A new instance of AddQuickActionDlg
214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'plugins/rake/rake_widgets.rb', line 214 def initialize parent = Ruber[:main_window] super @ui = Ui::RakeAddQuickTaskWidget.new @ui.setupUi collections = Ruber[:main_window].factory.clients.map{|cl| cl.action_collection} @ui.shortcut.check_action_collections = collections connect @ui.shortcut, SIGNAL('stealShortcut(QKeySequence, KAction*)'), @ui.shortcut, SLOT(:applyStealShortcut) false @ui.task.set_focus connect @ui.task, SIGNAL('textChanged(QString)'), self, SLOT(:change_ok_state) connect @ui.shortcut, SIGNAL('keySequenceChanged(QKeySequence)'), self, SLOT(:change_ok_state) end |
Instance Method Details
- (nil) change_ok_state (private)
Enables or disables the Ok button depending on whether both the task name and the corresponding shortcut have been chosen
250 251 252 253 |
# File 'plugins/rake/rake_widgets.rb', line 250 def change_ok_state !(@ui.task.text.empty? || @ui.shortcut.key_sequence.empty?) nil end |
Slot Signature:
change_ok_state()
- (String) shortcut
The shortcut chosen by the user
239 240 241 |
# File 'plugins/rake/rake_widgets.rb', line 239 def shortcut @ui.shortcut.key_sequence.to_string end |
- (String) task
The name chosen by the user
231 232 233 |
# File 'plugins/rake/rake_widgets.rb', line 231 def task @ui.task.text end |