Class: Ruber::RubyRunner::ConfigWidget
- Inherits:
-
Qt::Widget
- Object
- Qt::Widget
- Ruber::RubyRunner::ConfigWidget
- Defined in:
- plugins/ruby_runner/config_widget.rb
Overview
Config widget for the ruby runner plugin
Instance Method Summary (collapse)
-
- (nil) default_interpreter(value)
Writer for the
ruby/ruby
setting. -
- (Object) fill_interpreters(value)
private
Fills the “Ruby interpreters widget”.
-
- (ConfigWidget) initialize(parent = nil)
constructor
Creates a new widget.
-
- (nil) read_ruby_options(val)
Writer for the
ruby/ruby_options
setting. -
- (<String>) store_ruby_options
Reader for the
ruby/ruby_options
setting. -
- (nil) update_default_interpreter
slot
private
Fills the “Default interpreter” combo box according to the availlable interpreters.
Constructor Details
- (ConfigWidget) initialize(parent = nil)
Creates a new widget
41 42 43 44 45 46 |
# File 'plugins/ruby_runner/config_widget.rb', line 41 def initialize parent = nil super @ui = Ui::RubyRunnerConfigWidget.new @ui.setupUi self connect @ui._ruby__interpreters, SIGNAL(:changed), self, SLOT(:update_default_interpreter) end |
Instance Method Details
- (nil) default_interpreter=(value)
Writer for the ruby/ruby
setting
73 74 75 76 77 |
# File 'plugins/ruby_runner/config_widget.rb', line 73 def default_interpreter= value it = @ui._ruby__ruby.each_with_index.find{|txt, i| txt == value} @ui._ruby__ruby.current_index = it ? it[1] : 0 nil end |
- (Object) fill_interpreters(value) (private)
Fills the “Ruby interpreters widget”
Before filling the widget, clears it. After filling the widget, it updates the “Default interpreter” widget.
89 90 91 92 93 |
# File 'plugins/ruby_runner/config_widget.rb', line 89 def fill_interpreters value @ui._ruby__interpreters.clear @ui._ruby__interpreters.insert_string_list value update_default_interpreter end |
- (nil) read_ruby_options(val)
Writer for the ruby/ruby_options
setting
53 54 55 56 |
# File 'plugins/ruby_runner/config_widget.rb', line 53 def val @ui..text = val.join ' ' nil end |
- (<String>) store_ruby_options
Reader for the ruby/ruby_options
setting
63 64 65 |
# File 'plugins/ruby_runner/config_widget.rb', line 63 def Shellwords.split_with_quotes @ui..text end |
- (nil) update_default_interpreter (private)
Fills the “Default interpreter” combo box according to the availlable interpreters
This method attempts to preserve the current entry if possible. This means that if an entry with the same text still exists, it will become current.
103 104 105 106 107 108 109 110 |
# File 'plugins/ruby_runner/config_widget.rb', line 103 def update_default_interpreter old_current = @ui._ruby__ruby.current_text @ui._ruby__ruby.clear @ui._ruby__ruby.add_items @ui._ruby__interpreters.items idx = @ui._ruby__ruby.items.index old_current @ui._ruby__ruby.current_index = idx ? idx : 0 nil end |
Slot Signature:
update_default_interpreter()