Class: Ruber::RubyRunner::RubyOptionsWidget
- Inherits:
-
ProjectConfigWidget
- Object
- Qt::Widget
- ProjectConfigWidget
- Ruber::RubyRunner::RubyOptionsWidget
- Defined in:
- plugins/ruby_runner/ruby_runner.rb
Overview
Put this class inside the namespace after it’s been changed from Ruber (as rbuic puts all classes starting with K in the KDE namespace)
Widget to use to set the ruby_options
setting.
It is made by a KDE::LineEdit and the corresponding Qt::Label. It already provides the signal property to be used by SettingsDialogContainer (set to text_changed(QString)).
Plugin developers should only need to put this widget inside their project widget and give it the appropriate name (usually _grp__ruby_options, where grp is the group specified in RubyRunnerPlugin.new)
If something fancier is needed, the underlying label and line edit widgets can
be accessed using the label_widget
and text_widget
methods.
Instance Attribute Summary
Attributes inherited from ProjectConfigWidget
Instance Method Summary (collapse)
-
- (RubyOptionsWidget) initialize(parent = nil)
constructor
Creates a new instance.
-
- (Qt::Label) label_widget
The label widget.
-
- (<String>) text
Converts the contents of the line edit to an array.
-
- (Object) text(val)
Sets the text in the line edit.
-
- (KDE::LineEdit) text_widget
The line edit widget widget.
Signal Summary
-
- text_changed(QString text)
Signal emitted whenever the text inside the line edit changes.
API for feature ruby_runner
Constructor Details
- (RubyOptionsWidget) initialize(parent = nil)
Creates a new instance
86 87 88 89 90 91 |
# File 'plugins/ruby_runner/ruby_runner.rb', line 86 def initialize parent = nil super @ui = Ui::RubyRunnerPluginOptionWidget.new @ui.setupUi self connect @ui.text, SIGNAL('textChanged(QString)'), self, SIGNAL('text_changed(QString)') end |
Instance Method Details
- (Qt::Label) label_widget
The label widget.
This is useful, for example, if you don’t like the default label.
100 101 102 |
# File 'plugins/ruby_runner/ruby_runner.rb', line 100 def @ui.label end |
- (<String>) text
Converts the contents of the line edit to an array
130 131 132 |
# File 'plugins/ruby_runner/ruby_runner.rb', line 130 def text Shellwords.split_with_quotes @ui.text.text end |
- (Object) text=(val)
Sets the text in the line edit
121 122 123 |
# File 'plugins/ruby_runner/ruby_runner.rb', line 121 def text= val @ui.text.text = val.join ' ' end |
- (KDE::LineEdit) text_widget
The line edit widget widget.
In most cases, you shouldn’t need to use this
112 113 114 |
# File 'plugins/ruby_runner/ruby_runner.rb', line 112 def @ui.text end |
Signal Details
- text_changed(QString text)
Signal emitted whenever the text inside the line edit changes.