Class: Cosmos::ScriptRunnerDialog
- Inherits:
-
Qt::Dialog
- Object
- Qt::Dialog
- Cosmos::ScriptRunnerDialog
- Defined in:
- lib/cosmos/tools/script_runner/script_runner_frame.rb
Instance Attribute Summary collapse
-
#script_runner_frame ⇒ Object
readonly
Returns the value of attribute script_runner_frame.
Instance Method Summary collapse
-
#execute_text_and_close_on_complete(text, text_binding = nil) ⇒ Object
Executes the given text and closes when complete.
-
#initialize(parent, title, default_tab_text = 'Untitled') ⇒ ScriptRunnerDialog
constructor
Constructor.
- #reject ⇒ Object
Constructor Details
#initialize(parent, title, default_tab_text = 'Untitled') ⇒ ScriptRunnerDialog
Constructor
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/cosmos/tools/script_runner/script_runner_frame.rb', line 32 def initialize(parent, title, default_tab_text = 'Untitled') # Call base class constructor super(parent) setWindowTitle(title) setMinimumWidth(parent.width * 0.8) setMinimumHeight(parent.height * 0.6) # Create script runner frame @script_runner_frame = ScriptRunnerFrame.new(self, default_tab_text) layout = Qt::VBoxLayout.new layout.addWidget(@script_runner_frame) setLayout(layout) end |
Instance Attribute Details
#script_runner_frame ⇒ Object (readonly)
Returns the value of attribute script_runner_frame.
29 30 31 |
# File 'lib/cosmos/tools/script_runner/script_runner_frame.rb', line 29 def script_runner_frame @script_runner_frame end |
Instance Method Details
#execute_text_and_close_on_complete(text, text_binding = nil) ⇒ Object
Executes the given text and closes when complete
49 50 51 52 53 54 |
# File 'lib/cosmos/tools/script_runner/script_runner_frame.rb', line 49 def execute_text_and_close_on_complete(text, text_binding = nil) @script_runner_frame.set_text(text) @script_runner_frame.run_and_close_on_complete(text_binding) exec dispose end |
#reject ⇒ Object
56 57 58 59 60 |
# File 'lib/cosmos/tools/script_runner/script_runner_frame.rb', line 56 def reject # Don't allow the dialog to close if we're running return if @script_runner_frame.running? super end |