Skip to content

Commit

Permalink
Use abstract_method's for CWM::Page instead of ivars
Browse files Browse the repository at this point in the history
to be consistent with the rest of CWM
  • Loading branch information
mvidner committed May 22, 2017
1 parent 02d27cd commit 6038316
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions library/cwm/src/lib/cwm/page.rb
@@ -1,3 +1,4 @@
require "abstract_method"
require "cwm/custom_widget"
require "yast"
Yast.import "CWM"
Expand All @@ -15,16 +16,11 @@ class Page < CustomWidget
# @return [Boolean] is this the initially selected tab
attr_accessor :initial

# @return [WidgetTerm] contents of the tab, can contain {AbstractWidget}s
attr_reader :contents
# @return [String] Label of {Tab} or of {PagerTreeItem}
attr_reader :label
# @return [WidgetTerm] contents of the page, can contain {AbstractWidget}s
abstract_method :contents

This comment has been minimized.

Copy link
@jreidinger

jreidinger May 22, 2017

Member

is it needed? I think CustomWidget itself define it as abstract_method.

This comment has been minimized.

Copy link
@mvidner

mvidner May 22, 2017

Author Member

Yes, but CustomWidget#contents returns a UITerm, this returns a WidgetTerm.


def initialize(widget_id:, label:, contents:)
@widget_id = widget_id
@label = label
@contents = contents
end
# @return [String] Label of {Tab} or of {PagerTreeItem}

This comment has been minimized.

Copy link
@jreidinger

jreidinger May 22, 2017

Member

I will add there, that label is displayed and should be localized including shortcut part "&"

This comment has been minimized.

Copy link
@mvidner

mvidner May 22, 2017

Author Member

Actually! that is an important point: I believe the tree items should not include the & which is a flaw in my design

abstract_method :label

# @return [WidgetHash]
def cwm_definition
Expand Down

0 comments on commit 6038316

Please sign in to comment.