Skip to content

Commit

Permalink
Merge pull request #843 from yast/abort_confirm
Browse files Browse the repository at this point in the history
Abort confirm
  • Loading branch information
jreidinger committed Mar 13, 2020
2 parents d9ec3cd + 3d83fc1 commit cb8a8a5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 38 deletions.
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Mar 13 09:26:49 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

- Add Abort confirmation for inst_welcome client used in firstboot
(bsc#1163347)
- 4.2.37

-------------------------------------------------------------------
Thu Feb 27 15:03:36 UTC 2020 - Stefan Hundhammer <shundhammer@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-installation
Version: 4.2.36
Version: 4.2.37
Release: 0
Group: System/YaST
License: GPL-2.0-only
Expand Down
72 changes: 35 additions & 37 deletions src/lib/installation/clients/inst_welcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,33 @@ def main
Yast.import "CustomDialogs"
Yast.import "Language"

@argmap = GetInstArgs.argmap
argmap = GetInstArgs.argmap

@default_patterns = ["welcome.%1.txt", "welcome.txt"]
default_patterns = ["welcome.%1.txt", "welcome.txt"]

@directory = Ops.get_string(@argmap, "directory", Directory.datadir)
directory = argmap["directory"] || Directory.datadir

if Ops.get_string(@argmap, "directory", "") != ""
@directory = Ops.add(Directory.custom_workflow_dir, @directory)
if Ops.get_string(argmap, "directory", "") != ""
directory = Directory.custom_workflow_dir + directory
end

@patterns = Convert.convert(
Ops.get(@argmap, "patterns", @default_patterns),
from: "any",
to: "list <string>"
)
patterns = argmap["patterns"] || default_patterns

@welcome = CustomDialogs.load_file_locale(
@patterns,
@directory,
welcome = CustomDialogs.load_file_locale(
patterns,
directory,
Language.language
)
Builtins.y2debug("welcome map: %1", @welcome)
Builtins.y2debug("welcome map: %1", welcome)

@display = UI.GetDisplayInfo
@space = Ops.get_boolean(@display, "TextMode", true) ? 1 : 3
display = UI.GetDisplayInfo
space = display["TextMode"] ? 1 : 3

# dialog caption
@caption = _("Welcome")
caption = _("Welcome")

# welcome text 1/4
@text = _("<p><b>Welcome!</b></p>") +
text = _("<p><b>Welcome!</b></p>") +
# welcome text 2/4
_(
"<p>There are a few more steps to take before your system is ready to\n" \
Expand All @@ -78,47 +74,49 @@ def main
)

# welcome text
@welcome_text = @welcome["text"]
@welcome_text = @text if !@welcome_text || @welcome_text.empty?
welcome_text = welcome["text"]
welcome_text = text if !welcome_text || welcome_text.empty?

# help ttext
@help = _(
help = _(
"<p>Click <b>Next</b> to perform the\nbasic configuration of the system.</p>\n"
)

@rt = Empty()

if Builtins.regexpmatch(@welcome_text, "</.*>")
@rt = RichText(Id(:welcome_text), @welcome_text)
if Builtins.regexpmatch(welcome_text, "</.*>")
rt = RichText(Id(:welcome_text), welcome_text)
else
Builtins.y2debug("plain text")
@rt = RichText(Id(:welcome_text), Opt(:plainText), @welcome_text)
rt = RichText(Id(:welcome_text), Opt(:plainText), welcome_text)
end

@contents = VBox(
VSpacing(@space),
contents = VBox(
VSpacing(space),
HBox(
HSpacing(Ops.multiply(2, @space)),
@rt,
HSpacing(Ops.multiply(2, @space))
HSpacing(2 * space),
rt,
HSpacing(2 * space)
),
VSpacing(2)
)

Wizard.SetContents(
@caption,
@contents,
@help,
caption,
contents,
help,
GetInstArgs.enable_back,
GetInstArgs.enable_next
)
Wizard.SetFocusToNextButton

@ret = UI.UserInput
ret = nil
loop do
ret = UI.UserInput

deep_copy(@ret)
break if ret != :abort
break if Popup.ReallyAbort(:painless)
end

# EOF
ret
end
end
end

0 comments on commit cb8a8a5

Please sign in to comment.