Skip to content

Commit

Permalink
allow adding media addons without registering the base system (bnc#87…
Browse files Browse the repository at this point in the history
…0625)

- 3.1.52
  • Loading branch information
lslezak committed May 13, 2014
1 parent 3cd3b6a commit 43f3e54
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 48 deletions.
7 changes: 7 additions & 0 deletions package/yast2-registration.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue May 13 20:12:46 UTC 2014 - lslezak@suse.cz

- allow adding media addons without registering the base system
(bnc#870625)
- 3.1.52

-------------------------------------------------------------------
Mon May 12 13:35:09 UTC 2014 - lslezak@suse.cz

Expand Down
4 changes: 3 additions & 1 deletion package/yast2-registration.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-registration
Version: 3.1.51
Version: 3.1.52
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -33,6 +33,8 @@ Requires: yast2-pkg-bindings >= 2.17.20
Requires: yast2-ruby-bindings >= 3.1.12
Requires: rubygem-suse-connect
Requires: yast2-slp >= 3.1.2
Requires: yast2-addon > 3.1.3
Requires: yast2-packager > 3.1.14

BuildRequires: yast2 >= 3.1.26
BuildRequires: update-desktop-files
Expand Down
62 changes: 15 additions & 47 deletions src/clients/inst_scc.rb
Expand Up @@ -64,6 +64,7 @@ def main
Yast.import "Sequencer"
Yast.import "Installation"
Yast.import "ProductControl"
Yast.import "SourceDialogs"

@selected_addons = ::Registration::Storage::InstallationOptions.instance.selected_addons

Expand Down Expand Up @@ -291,21 +292,6 @@ def addon_selection_items(addons)

# create content fot the addon selection dialog
def addon_selection_dialog_content(addons)
media_checkbox = Empty()

# the media check box is displayed only at installation
# to modify the installation workflow (display extra add-on dialog)
if Mode.installation
media_checkbox = VBox(
VSpacing(0.4),
HBox(
HSpacing(1),
Left(CheckBox(Id(:media), _("In&clude Extensions from Separate Media"),
Installation.add_on_selected)),
)
)
end

# less lines in textmode to fit 80x25 size
lines = UI.TextMode ? 9 : 14

Expand All @@ -332,8 +318,6 @@ def addon_selection_dialog_content(addons)
VWeight(25, RichText(Id(:details), Opt(:disabled), "<small>" +
_("Select an extension or a module to show details here") + "</small>")),
),
media_checkbox,
VSpacing(0.4),
VStretch()
)
end
Expand Down Expand Up @@ -377,21 +361,6 @@ def supported_addon_count(selected)
return true
end

# read the addon media checkbox and adapt the installation workflow accordingly
def set_media_addons
if Mode.installation
# the widget exists only at installation
Installation.add_on_selected = UI.QueryWidget(Id(:media), :Value)
log.info "Add-on media selected: #{Installation.add_on_selected}"

# lazy include, the file is part of yast2-installation
# avoid yast2-installation runtime dependency by including it only here,
# not at the global level
Yast.include self, "installation/misc.rb"
AdjustStepsAccordingToInstallationSettings()
end
end

# handle user input in the addon selection dialog
def handle_addon_selection_dialog(addons)
ret = nil
Expand All @@ -416,8 +385,6 @@ def handle_addon_selection_dialog(addons)
::Registration::Storage::InstallationOptions.instance.selected_addons = @selected_addons
log.info "Selected addons: #{@selected_addons.map(&:short_name)}"

set_media_addons

ret = :skip if @selected_addons.empty?
else
# check whether it's an add-on ID (checkbox clicked)
Expand All @@ -442,11 +409,8 @@ def select_addons
# dialog title
_("Extension Selection"),
addon_selection_dialog_content(addons),
# help text for add-ons installation, %s is URL
_("<p>\nTo install an extension or a module from separate media together with the product, select\n" +
"<b>Include Extensions from Separate Media</b>.</p>\n" +
"<p>If you need specific hardware drivers for installation, see <i>%s</i> site.</p>") %
"http://drivers.suse.com",
# TODO FIXME: add a help text
"",
GetInstArgs.enable_back || Mode.normal,
GetInstArgs.enable_next || Mode.normal
)
Expand Down Expand Up @@ -652,12 +616,15 @@ def confirm_skipping
end

def media_addons
if Installation.add_on_selected
# start the next step (add-on media selection)
ProductControl.RunFrom(ProductControl.CurrentStep + 1, false)
else
:next
end
# force displaying the UI
Installation.add_on_selected = true
# display global enable/disable switch
SourceDialogs.display_addon_checkbox = true

WFM.call("inst_add-on")
ensure
# make sure to revert the change if something goes wrong
SourceDialogs.display_addon_checkbox = false
end

def registered_dialog
Expand Down Expand Up @@ -736,7 +703,7 @@ def start_workflow
"register" => {
:abort => :abort,
:cancel => :abort,
:skip => :next,
:skip => "media_addons",
:next => "select_addons"
},
"select_addons" => {
Expand All @@ -750,7 +717,8 @@ def start_workflow
},
"media_addons" => {
:abort => :abort,
:next => :next
:next => :next,
:auto => :auto
}
}

Expand Down

0 comments on commit 43f3e54

Please sign in to comment.