Class: Cosmos::Splash::SplashDialogBox
- Inherits:
-
Qt::Dialog
- Object
- Qt::Dialog
- Cosmos::Splash::SplashDialogBox
- Defined in:
- lib/cosmos/gui/dialogs/splash.rb
Instance Method Summary collapse
-
#initialize(parent) ⇒ SplashDialogBox
constructor
A new instance of SplashDialogBox.
- #keyPressEvent(event) ⇒ Object
- #message=(message) ⇒ Object
- #message_callback ⇒ Object
- #progress=(progress) ⇒ Object
- #progress_callback ⇒ Object
Constructor Details
#initialize(parent) ⇒ SplashDialogBox
Returns a new instance of SplashDialogBox.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cosmos/gui/dialogs/splash.rb', line 22 def initialize(parent) super(parent, Qt::WindowTitleHint | Qt::CustomizeWindowHint) setWindowTitle(parent.windowTitle) setModal(true) layout = Qt::VBoxLayout.new splash_image_filename = File.join(::Cosmos::USERPATH, 'config', 'data', 'splash.gif') splash_image_filename = File.join(::Cosmos::PATH, 'data', 'splash.gif') unless File.exist?(splash_image_filename) image = Qt::Pixmap.new(splash_image_filename) label = Qt::Label.new label.setPixmap(image) layout.addWidget(label) = Qt::LineEdit.new .setReadOnly(true) layout.addWidget() = Qt::ProgressBar.new layout.addWidget() setLayout(layout) end |
Instance Method Details
#keyPressEvent(event) ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/cosmos/gui/dialogs/splash.rb', line 64 def keyPressEvent(event) # Don't allow the Escape key to close this dialog if event.key == Qt::Key_Escape event.ignore else super(event) end end |
#message=(message) ⇒ Object
44 45 46 47 48 |
# File 'lib/cosmos/gui/dialogs/splash.rb', line 44 def () Qt.execute_in_main_thread(true) do .setText() end end |
#message_callback ⇒ Object
56 57 58 |
# File 'lib/cosmos/gui/dialogs/splash.rb', line 56 def method(:message=) end |
#progress=(progress) ⇒ Object
50 51 52 53 54 |
# File 'lib/cosmos/gui/dialogs/splash.rb', line 50 def progress=(progress) Qt.execute_in_main_thread(true) do .setValue(progress * 100) end end |
#progress_callback ⇒ Object
60 61 62 |
# File 'lib/cosmos/gui/dialogs/splash.rb', line 60 def progress_callback method(:progress=) end |