Class: Syskit::GUI::BatchManager::NewJobDialog
- Defined in:
- lib/syskit/gui/batch_manager.rb
Defined Under Namespace
Classes: Parser
Instance Attribute Summary collapse
-
#editor ⇒ Object
readonly
Returns the value of attribute editor.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(parent = nil, text = '') ⇒ NewJobDialog
constructor
A new instance of NewJobDialog.
- #result ⇒ Object
- #text ⇒ Object
- #text=(text) ⇒ Object
Constructor Details
#initialize(parent = nil, text = '') ⇒ NewJobDialog
Returns a new instance of NewJobDialog
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/syskit/gui/batch_manager.rb', line 162 def initialize(parent = nil, text = '') super(parent) resize(800, 600) layout = Qt::VBoxLayout.new(self) @error_message = Qt::Label.new(self) @error_message.style_sheet = "QLabel { background-color: #ffb8b9; border: 1px solid #ff6567; padding: 5px; }" @error_message.frame_style = Qt::Frame::StyledPanel layout.(@error_message) @error_message.hide @editor = Qt::TextEdit.new(self) self.text = text layout. editor = Qt::DialogButtonBox.new(Qt::DialogButtonBox::Ok | Qt::DialogButtonBox::Cancel) .connect(SIGNAL('accepted()')) do begin @error_message.hide @result = Parser.parse(self.text) accept rescue Exception => e @error_message.text = e. @error_message.show end end .connect(SIGNAL('rejected()')) { reject } layout. end |
Instance Attribute Details
#editor ⇒ Object (readonly)
Returns the value of attribute editor
160 161 162 |
# File 'lib/syskit/gui/batch_manager.rb', line 160 def editor @editor end |
Class Method Details
.exec(parent, text) ⇒ Object
192 193 194 |
# File 'lib/syskit/gui/batch_manager.rb', line 192 def self.exec(parent, text) new(parent, text).exec end |
Instance Method Details
#result ⇒ Object
217 218 219 |
# File 'lib/syskit/gui/batch_manager.rb', line 217 def result @result end |
#text ⇒ Object
225 226 227 |
# File 'lib/syskit/gui/batch_manager.rb', line 225 def text editor.to_plain_text end |
#text=(text) ⇒ Object
221 222 223 |
# File 'lib/syskit/gui/batch_manager.rb', line 221 def text=(text) editor.plain_text = text end |