Class: Cosmos::ScriptRunnerDialog

Inherits:
Qt::Dialog show all
Defined in:
lib/cosmos/tools/script_runner/script_runner_frame.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Qt::Dialog

#exec

Constructor Details

#initialize(parent, title, default_tab_text = 'Untitled') ⇒ ScriptRunnerDialog

Returns a new instance of ScriptRunnerDialog.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/cosmos/tools/script_runner/script_runner_frame.rb', line 40

def initialize(parent,
               title,
               default_tab_text = 'Untitled')
  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_frameObject (readonly)

Returns the value of attribute script_runner_frame.



38
39
40
# File 'lib/cosmos/tools/script_runner/script_runner_frame.rb', line 38

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



56
57
58
59
60
61
# File 'lib/cosmos/tools/script_runner/script_runner_frame.rb', line 56

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

#rejectObject



63
64
65
66
67
# File 'lib/cosmos/tools/script_runner/script_runner_frame.rb', line 63

def reject
  # Don't allow the dialog to close if we're running
  return if @script_runner_frame.running?
  super
end