Class: OkCancelDialog

Inherits:
KDE::Dialog
  • Object
show all
Defined in:
lib/download.rb

Overview


Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ OkCancelDialog

Returns a new instance of OkCancelDialog.



9
10
11
12
13
14
15
16
# File 'lib/download.rb', line 9

def initialize(parent)
    super(parent)
    setButtons( KDE::Dialog::Ok | KDE::Dialog::Cancel )
    @textEdit = Qt::Label.new do |w|
        w.wordWrap= true
    end
    setMainWidget(@textEdit)
end

Instance Attribute Details

#textEditObject (readonly)

Returns the value of attribute textEdit.



18
19
20
# File 'lib/download.rb', line 18

def textEdit
  @textEdit
end

Class Method Details

.ask(parent, text, title = text) ⇒ Object



20
21
22
23
24
25
# File 'lib/download.rb', line 20

def self.ask(parent, text, title = text)
    @@dialog ||= self.new(parent)
    @@dialog.textEdit.text = text
    @@dialog.caption = title
    @@dialog.exec
end