Class: Installation::ProposalErrors
- Inherits:
-
Object
- Object
- Installation::ProposalErrors
- Includes:
- Yast::I18n, Yast::Logger
- Defined in:
- src/lib/installation/proposal_errors.rb
Constant Summary collapse
- ERROR_PROPOSAL_TIMEOUT =
60
Instance Method Summary collapse
-
#append(message) ⇒ Object
appends new error with given message.
-
#approved? ⇒ Boolean
returns true if there is no error or user approved stored errors.
-
#clear ⇒ Object
clears previously stored errros.
-
#initialize ⇒ ProposalErrors
constructor
A new instance of ProposalErrors.
Constructor Details
#initialize ⇒ ProposalErrors
Returns a new instance of ProposalErrors.
15 16 17 18 |
# File 'src/lib/installation/proposal_errors.rb', line 15 def initialize textdomain "installation" @errors = [] end |
Instance Method Details
#append(message) ⇒ Object
appends new error with given message
26 27 28 |
# File 'src/lib/installation/proposal_errors.rb', line 26 def append() @errors << end |
#approved? ⇒ Boolean
returns true if there is no error or user approved stored errors
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'src/lib/installation/proposal_errors.rb', line 31 def approved? return true if @errors.empty? headline = _("Error Found in Installation Settings") text = _("The following errors were found in the configuration proposal.\n" \ "If you continue with the installation it may not be successful.\n" \ "Errors:\n") sep = Yast::UI.TextMode ? "-" : "•" text += "#{sep} " + @errors.join("\n#{sep} ") if Yast::Mode.auto !Yast::Popup.TimedErrorAnyQuestion(headline, text, Yast::Label.BackButton, Yast::Label.ContinueButton, :focus_yes, ERROR_PROPOSAL_TIMEOUT) else !Yast::Popup.ErrorAnyQuestion(headline, text, Yast::Label.BackButton, Yast::Label.ContinueButton, :focus_yes) end end |
#clear ⇒ Object
clears previously stored errros
21 22 23 |
# File 'src/lib/installation/proposal_errors.rb', line 21 def clear @errors = [] end |