Class: CWM::Dialog

Inherits:
Object
  • Object
show all
Includes:
Yast::I18n, Yast::Logger, Yast::UIShortcuts
Defined in:
library/cwm/src/lib/cwm/dialog.rb

Overview

An OOP API and the pieces missing from Yast::CWM.show:

  • creating and closing a wizard dialog

  • Back/Abort/Next buttons

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(*args) ⇒ Object

A shortcut for `.new(*args).run`



28
29
30
# File 'library/cwm/src/lib/cwm/dialog.rb', line 28

def self.run(*args)
  new(*args).run
end

Instance Method Details

#abort_buttonString?

The :abort button

Returns:

  • (String, nil)

    button label, `nil` to use the default label, `“”` to omit the button



57
58
59
# File 'library/cwm/src/lib/cwm/dialog.rb', line 57

def abort_button
  nil
end

#back_buttonString?

The :back button

Returns:

  • (String, nil)

    button label, `nil` to use the default label, `“”` to omit the button



50
51
52
# File 'library/cwm/src/lib/cwm/dialog.rb', line 50

def back_button
  nil
end

#contentsCWM::WidgetTerm

Returns:



25
# File 'library/cwm/src/lib/cwm/dialog.rb', line 25

abstract_method :contents

#disable_buttonsArray<Symbol>

Returns Buttons to disable (:back, :next

Returns:

  • (Array<Symbol>)

    Buttons to disable (:back, :next



75
76
77
# File 'library/cwm/src/lib/cwm/dialog.rb', line 75

def disable_buttons
  []
end

#next_buttonString?

The :next button

Returns:

  • (String, nil)

    button label, `nil` to use the default label, `“”` to omit the button



64
65
66
# File 'library/cwm/src/lib/cwm/dialog.rb', line 64

def next_button
  nil
end

#runSymbol

The entry point. Will open (and close) a wizard dialog unless one already exists.

Returns:

  • (Symbol)


35
36
37
38
39
40
41
# File 'library/cwm/src/lib/cwm/dialog.rb', line 35

def run
  if should_open_dialog?
    wizard_create_dialog { cwm_show }
  else
    cwm_show
  end
end

#should_open_dialog?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'library/cwm/src/lib/cwm/dialog.rb', line 43

def should_open_dialog?
  !Yast::Wizard.IsWizardDialog
end

#skip_store_forArray<Symbol>

Returns Events for which `store` won't be called, see Yast::CWMClass#show

Returns:



70
71
72
# File 'library/cwm/src/lib/cwm/dialog.rb', line 70

def skip_store_for
  []
end

#titleString?

Returns The dialog title. `nil`: keep the existing title.

Returns:

  • (String, nil)

    The dialog title. `nil`: keep the existing title.



20
21
22
# File 'library/cwm/src/lib/cwm/dialog.rb', line 20

def title
  nil
end