Class: Qt::MessageBox

Inherits:
Object show all
Defined in:
lib/cosmos/gui/utilities/script_module_gui.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.critical(parent, title, text, buttons = Qt::MessageBox::Ok, defaultButton = Qt::MessageBox::NoButton) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/cosmos/gui/utilities/script_module_gui.rb', line 27

def self.critical(parent, title, text,
                  buttons = Qt::MessageBox::Ok,
                  defaultButton = Qt::MessageBox::NoButton)
  # Windows overrides critical dialogs with its own alert sound
  Cosmos.play_wav_file(Cosmos.data_path('critical.wav')) if Cosmos::System.sound
  super(parent,title,text,buttons,defaultButton)
end

.information(parent, title, text, buttons = Qt::MessageBox::Ok, defaultButton = Qt::MessageBox::NoButton) ⇒ Object



34
35
36
37
38
39
# File 'lib/cosmos/gui/utilities/script_module_gui.rb', line 34

def self.information(parent, title, text,
                     buttons = Qt::MessageBox::Ok,
                     defaultButton = Qt::MessageBox::NoButton)
  Cosmos.play_wav_file(Cosmos.data_path('information.wav')) if Cosmos::System.sound
  super(parent,title,text,buttons,defaultButton)
end

.question(parent, title, text, buttons = Qt::MessageBox::Ok, defaultButton = Qt::MessageBox::NoButton) ⇒ Object



40
41
42
43
44
45
# File 'lib/cosmos/gui/utilities/script_module_gui.rb', line 40

def self.question(parent, title, text,
                  buttons = Qt::MessageBox::Ok,
                  defaultButton = Qt::MessageBox::NoButton)
  Cosmos.play_wav_file(Cosmos.data_path('question.wav')) if Cosmos::System.sound
  super(parent,title,text,buttons,defaultButton)
end

.warning(parent, title, text, buttons = Qt::MessageBox::Ok, defaultButton = Qt::MessageBox::NoButton) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/cosmos/gui/utilities/script_module_gui.rb', line 46

def self.warning(parent, title, text,
                 buttons = Qt::MessageBox::Ok,
                 defaultButton = Qt::MessageBox::NoButton)
  # Windows overrides warning dialogs with its own alert sound
  Cosmos.play_wav_file(Cosmos.data_path('warning.wav')) if Cosmos::System.sound
  super(parent,title,text,buttons,defaultButton)
end

Instance Method Details

#exec(*args) ⇒ Object



23
24
25
26
# File 'lib/cosmos/gui/utilities/script_module_gui.rb', line 23

def exec(*args)
  Cosmos.play_wav_file(Cosmos.data_path('message.wav')) if Cosmos::System.sound
  method_missing(:exec, *args)
end