Class: UI::Wizards::Layout
- Inherits:
-
Object
- Object
- UI::Wizards::Layout
- Defined in:
- library/general/src/lib/ui/wizards/layout.rb
Overview
Class to configure a wizard layout
There are four possible layouts:
- With a left sidebar which is usually used to place the installation steps.
- With a left tree.
- Without a sidebar/tree and with the title of the dialogs on the left.
- Without a sidebar/tree and with the title of the dialogs on top.
Moreover, for each layout, a top banner can be added.
Defined Under Namespace
Classes: Mode
Instance Attribute Summary collapse
-
#mode ⇒ Mode
readonly
Layout mode.
Class Method Summary collapse
-
.from_product_features ⇒ Layout
Creates a new layout according to the product features.
-
.with_steps ⇒ Layout
Creates a new layout with a left sidebar.
-
.with_title_on_left ⇒ Object
Creates a new layout without a sidebar/tree and with the title of the dialogs on the left.
-
.with_title_on_top ⇒ Layout
Creates a new layout without a sidebar/tree and with the title of the dialogs on top.
-
.with_tree ⇒ Layout
Creates a new layout with a left tree.
Instance Method Summary collapse
-
#banner? ⇒ Boolean
Whether the layout includes a banner.
-
#close_wizard ⇒ Object
Closes the wizard.
-
#hide_banner ⇒ Object
Configures the layout to not show a banner.
-
#open_wizard { ... } ⇒ Object
Opens a new wizard according to the layout configuration.
-
#show_banner ⇒ Object
Configures the layout to show a banner.
Instance Attribute Details
#mode ⇒ Mode (readonly)
Layout mode
159 160 161 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 159 def mode @mode end |
Class Method Details
.from_product_features ⇒ Layout
Creates a new layout according to the product features
151 152 153 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 151 def from_product_features new.send(:load_product_features) end |
.with_steps ⇒ Layout
Creates a new layout with a left sidebar
123 124 125 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 123 def with_steps new(Mode.steps) end |
.with_title_on_left ⇒ Object
Creates a new layout without a sidebar/tree and with the title of the dialogs on the left
137 138 139 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 137 def with_title_on_left new(Mode.title_on_left) end |
.with_title_on_top ⇒ Layout
Creates a new layout without a sidebar/tree and with the title of the dialogs on top
144 145 146 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 144 def with_title_on_top new(Mode.title_on_top) end |
Instance Method Details
#banner? ⇒ Boolean
Whether the layout includes a banner
174 175 176 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 174 def @banner end |
#close_wizard ⇒ Object
Closes the wizard
191 192 193 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 191 def close_wizard Yast::Wizard.CloseDialog end |
#hide_banner ⇒ Object
Configures the layout to not show a banner
167 168 169 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 167 def @banner = false end |
#open_wizard { ... } ⇒ Object
Opens a new wizard according to the layout configuration
181 182 183 184 185 186 187 188 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 181 def open_wizard(&block) Yast::Wizard.OpenWithLayout(self) return unless block_given? block.call close_wizard end |
#show_banner ⇒ Object
Configures the layout to show a banner
162 163 164 |
# File 'library/general/src/lib/ui/wizards/layout.rb', line 162 def @banner = true end |