Skip to content

Commit

Permalink
Fix replace point widget.
Browse files Browse the repository at this point in the history
In general problem here is that CWM need widget id in string, but
UI.ReplaceWidget need widget with sym, so we use to_sym for replace
point and then for method call.
  • Loading branch information
jreidinger committed Jan 20, 2017
1 parent 431e080 commit 3967dbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/cwm/src/lib/cwm/widget.rb
Original file line number Diff line number Diff line change
Expand Up @@ -829,14 +829,14 @@ class ReplacePoint < CustomWidget
# placeholder needed to be in dialog. Parameter type is limited by component
# system
# @param widget [CWM::AbstractWidget] initial widget in placeholder
def initialize(id: :_placeholder, widget: Empty.new(:_initial_placeholder))
def initialize(id: "_placeholder", widget: Empty.new("_initial_placeholder"))
self.handle_all_events = true
self.widget_id = id
@widget = widget
end

def contents
ReplacePoint(Id(widget_id), widget_content(@widget))
ReplacePoint(Id(widget_id.to_sym), widget_content(@widget))
end

def init
Expand All @@ -848,7 +848,7 @@ def init
# @param widget [CWM::AbstractWidget] widget to display and process events
def replace(widget)
log.info "replacing with new widget #{widget.inspect}"
Yast::UI.ReplaceWidget(@id, widget_content(widget))
Yast::UI.ReplaceWidget(widget_id.to_sym, widget_content(widget))
@widget = widget
init
end
Expand Down

0 comments on commit 3967dbe

Please sign in to comment.