Class: UI::InstallationDialog

Inherits:
Dialog
  • Object
show all
Defined in:
library/general/src/lib/ui/installation_dialog.rb

Overview

Subclass of UI::Dialog to be used by installation steps.

When used in YaST normal mode, it opens a one-step wizard to allow manual testing of the dialog

Examples:

simple dialog to set a setting

Yast.import "Bar"
class FooDialog < UI::InstallationDialog
  def initialize
    super
    textdomain "example"
  end

  def dialog_content
    InputField(Id(:foo), "Value for Foo", Yast::Bar.foo)
  end

  def dialog_title
    "Foo"
  end

  def help_text
    "<p>Set the value for foo here.</p>
  end

  def next_handler
    Yast::Bar.foo = Yast::UI.QueryWidget(Id(:foo), :Value)
    super
  end
end

# In the installation client
FooDialog.run

Instance Method Summary collapse

Methods inherited from Dialog

run, #run

Methods included from EventDispatcher

#event_loop, #finish_dialog, #user_input

Constructor Details

#initializeInstallationDialog



58
59
60
61
62
63
64
65
# File 'library/general/src/lib/ui/installation_dialog.rb', line 58

def initialize
  super
  Yast.import "Mode"
  Yast.import "Wizard"
  Yast.import "GetInstArgs"
  Yast.import "Popup"
  @_wizard_opened = false
end

Instance Method Details

#abort_handlerObject

Handler for the 'abort' event

The default implementation ask the user for confirmation



93
94
95
# File 'library/general/src/lib/ui/installation_dialog.rb', line 93

def abort_handler
  finish_dialog(:abort) if Yast::Popup.ConfirmAbort(:painless)
end

#accept_handlerObject

Handler for the 'accept' event

Used when the dialog is called from a proposal, by default it simply calls the handler for 'next'



71
72
73
# File 'library/general/src/lib/ui/installation_dialog.rb', line 71

def accept_handler
  next_handler
end

#back_handlerObject

Handler for the 'back' event



81
82
83
# File 'library/general/src/lib/ui/installation_dialog.rb', line 81

def back_handler
  finish_dialog(:back)
end

#cancel_handlerObject

Handler for the 'cancel' event



86
87
88
# File 'library/general/src/lib/ui/installation_dialog.rb', line 86

def cancel_handler
  finish_dialog(:cancel)
end

#next_handlerObject

Handler for the 'next' event



76
77
78
# File 'library/general/src/lib/ui/installation_dialog.rb', line 76

def next_handler
  finish_dialog(:next)
end