Skip to content

Commit

Permalink
handle rerun of dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jul 31, 2017
1 parent 82a455e commit fcf80ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/lib/installation/dialogs/product_selection.rb
Expand Up @@ -10,6 +10,11 @@
module Installation
module Dialogs
class ProductSelection < CWM::Dialog

class << self
attr_accessor :selected_package
end

def initialize
textdomain "installation"
end
Expand All @@ -34,12 +39,17 @@ def run
res = super

if res == :next
# remove already selected if it is not first run of dialog
if self.class.selected_package
Yast::WorkflowManager.RemoveWorkflow(:package, 0, self.class.selected_package)
end
product = selector.product
Yast::WorkflowManager.AddWorkflow(:package, 0, product.installation_package)
Yast::WorkflowManager.MergeWorkflows
Yast::WorkflowManager.RedrawWizardSteps
# run new steps for product, for now disable back TODO: allow it
res = Yast::ProductControl.RunFrom(Yast::ProductControl.CurrentStep + 1, false)
self.class.selected_package = product.installation_package
# run new steps for product
res = Yast::ProductControl.RunFrom(Yast::ProductControl.CurrentStep + 1, true)
end

res
Expand Down
2 changes: 1 addition & 1 deletion src/lib/installation/widgets/product_selector.rb
Expand Up @@ -51,7 +51,7 @@ def store
def validation
return true if value

Yast::Popup.Error(_("Please select product to install.")
Yast::Popup.Error(_("Please select product to install."))
false
end
end
Expand Down

0 comments on commit fcf80ec

Please sign in to comment.