Class: Yast::WrapperSlideshowCallbacksClient

Inherits:
Client
  • Object
show all
Defined in:
src/clients/wrapper_slideshow_callbacks.rb

Overview

A wrapper for SlideShowCallbacks

module,

required for removing the cyclic import dependency between SlideShowCallbacks.ycp and SlideShow.ycp

Instance Method Summary collapse

Instance Method Details

#mainObject


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'src/clients/wrapper_slideshow_callbacks.rb', line 7

def main
  @func = Convert.to_string(WFM.Args(0))
  @param = []

  # get parameters if available
  if Ops.greater_or_equal(Builtins.size(WFM.Args), 2)
    @param = Convert.to_list(WFM.Args(1))
  end

  @ret = nil

  Builtins.y2milestone(
    "SlideShowCallbacks:: wrapper: func: %1, args: %2",
    @func,
    @param
  )

  Yast.import "SlideShowCallbacks"

  # call the required function
  if @func == "InstallSlideShowCallbacks"
    @ret = SlideShowCallbacks.InstallSlideShowCallbacks
  elsif @func == "RemoveSlideShowCallbacks"
    @ret = SlideShowCallbacks.RemoveSlideShowCallbacks
  else
    # the required function is not known
    Builtins.y2error("unknown function: %1", @func)
  end

  Builtins.y2milestone("SlideShowCallbacks wrapper: result: %1", @ret)

  deep_copy(@ret)
end