Class: Yast::SummaryClass
- Inherits:
-
Module
- Object
- Module
- Yast::SummaryClass
- Defined in:
- ../../library/general/src/modules/Summary.rb
Instance Method Summary (collapse)
-
- (String) AddHeader(summary, header)
Add a RichText section header to an existing summary.
-
- (String) AddLine(summary, line)
Add a line to an existing summary.
-
- (String) AddListItem(summary, item)
Add a list item to an existing summary.
-
- (String) AddNewLine(summary)
Add a newline to an existing summary.
-
- (String) AddSimpleSection(summary, header, item)
Add a simple section to an existing summary, consisting of a header and one single item.
-
- (String) CloseList(summary)
End a list within a summary.
-
- (String) Device(name, description)
Function that creates description of one device.
-
- (String) DevicesList(devices)
Function that creates the whole final product.
- - (Object) main
-
- (Object) NotConfigured
Function that creates a 'Not configured.' message.
-
- (String) OpenList(summary)
Start a list within a summary.
Instance Method Details
- (String) AddHeader(summary, header)
Add a RichText section header to an existing summary.
108 109 110 |
# File '../../library/general/src/modules/Summary.rb', line 108 def AddHeader(summary, header) Ops.add(Ops.add(Ops.add(summary, "<h3>"), header), "</h3>") end |
- (String) AddLine(summary, line)
Add a line to an existing summary.
117 118 119 |
# File '../../library/general/src/modules/Summary.rb', line 117 def AddLine(summary, line) Ops.add(Ops.add(Ops.add(summary, "<p>"), line), "</p>") end |
- (String) AddListItem(summary, item)
Add a list item to an existing summary. Requires a previous call to 'summaryOpenList()'.
151 152 153 |
# File '../../library/general/src/modules/Summary.rb', line 151 def AddListItem(summary, item) Ops.add(Ops.add(Ops.add(summary, "\n<li>"), item), "</li>") end |
- (String) AddNewLine(summary)
Add a newline to an existing summary.
125 126 127 |
# File '../../library/general/src/modules/Summary.rb', line 125 def AddNewLine(summary) Ops.add(summary, "<br>") end |
- (String) AddSimpleSection(summary, header, item)
Add a simple section to an existing summary, consisting of a header and one single item.
163 164 165 166 167 168 169 170 |
# File '../../library/general/src/modules/Summary.rb', line 163 def AddSimpleSection(summary, header, item) summary = AddHeader(summary, header) summary = OpenList(summary) summary = AddListItem(summary, item) summary = CloseList(summary) summary end |
- (String) CloseList(summary)
End a list within a summary.
141 142 143 |
# File '../../library/general/src/modules/Summary.rb', line 141 def CloseList(summary) Ops.add(summary, "</ul>") end |
- (String) Device(name, description)
Function that creates description of one device.
99 100 101 |
# File '../../library/general/src/modules/Summary.rb', line 99 def Device(name, description) Builtins.sformat("<li><p>%1<br>%2</p></li>", name, description) end |
- (String) DevicesList(devices)
Function that creates the whole final product. “Not detected” will be returned if the list is empty.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File '../../library/general/src/modules/Summary.rb', line 76 def DevicesList(devices) devices = deep_copy(devices) text = "" if Builtins.size(devices) == 0 if !Mode.config # translators: summary if no hardware was detected text = Builtins.sformat("<ul><li>%1</li></ul>", _("Not detected.")) else text = Builtins.sformat("<ul><li>%1</li></ul>", NotConfigured()) end else Builtins.foreach(devices) { |dev| text = Ops.add(text, dev) } text = Builtins.sformat("<ul>%1</ul>", text) end text end |
- (Object) main
58 59 60 61 62 |
# File '../../library/general/src/modules/Summary.rb', line 58 def main textdomain "base" Yast.import "Mode" end |
- (Object) NotConfigured
Function that creates a 'Not configured.' message.
66 67 68 69 |
# File '../../library/general/src/modules/Summary.rb', line 66 def NotConfigured # translators: summary if the module has not been used yet in AutoYaST profile _("Not configured yet.") end |
- (String) OpenList(summary)
Start a list within a summary.
133 134 135 |
# File '../../library/general/src/modules/Summary.rb', line 133 def OpenList(summary) Ops.add(summary, "<ul>") end |