Class: Yast::EventClass

Inherits:
Module
  • Object
show all
Defined in:
library/general/src/modules/Event.rb

Instance Method Summary collapse

Instance Method Details

#GetWidgetId(event) ⇒ Object

Returns id of widget causing the event.



33
34
35
36
# File 'library/general/src/modules/Event.rb', line 33

def GetWidgetId(event)
  event = deep_copy(event)
  Ops.get_symbol(event, "ID")
end

#IsCancel(event) ⇒ Object

Checks that the EventType is CancelEvent.

return id or nil.



150
151
152
153
154
155
156
157
# File 'library/general/src/modules/Event.rb', line 150

def IsCancel(event)
  event = deep_copy(event)
  if Ops.get_string(event, "EventType", "Unknown") != "CancelEvent"
    return nil
  end

  Ops.get_symbol(event, "ID")
end

#IsMenu(event) ⇒ Object

Checks that the EventType is MenuEvent.

return id or nil.



128
129
130
131
132
133
# File 'library/general/src/modules/Event.rb', line 128

def IsMenu(event)
  event = deep_copy(event)
  return nil if Ops.get_string(event, "EventType", "Unknown") != "MenuEvent"

  Ops.get_symbol(event, "ID")
end

#IsTimeout(event) ⇒ Object

Checks that the EventType is TimeoutEvent.

return id or nil.



138
139
140
141
142
143
144
145
# File 'library/general/src/modules/Event.rb', line 138

def IsTimeout(event)
  event = deep_copy(event)
  if Ops.get_string(event, "EventType", "Unknown") != "TimeoutEvent"
    return nil
  end

  Ops.get_symbol(event, "ID")
end

#IsWidgetActivated(event) ⇒ Object

Checks that the EventType is WidgetEvent and the EventReason is Activated.

Returns id or nil.



42
43
44
45
46
47
48
49
50
51
52
53
# File 'library/general/src/modules/Event.rb', line 42

def IsWidgetActivated(event)
  event = deep_copy(event)
  if Ops.get_string(event, "EventType", "Unknown") != "WidgetEvent"
    return nil
  end

  if Ops.get_string(event, "EventReason", "Unknown") != "Activated"
    return nil
  end

  Ops.get_symbol(event, "ID")
end

#IsWidgetActivatedOrSelectionChanged(event) ⇒ Object

Checks that the EventType is WidgetEvent and the EventReason is Activated or SelectionChanged.

Returns id or nil.



93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'library/general/src/modules/Event.rb', line 93

def IsWidgetActivatedOrSelectionChanged(event)
  event = deep_copy(event)
  if Ops.get_string(event, "EventType", "Unknown") != "WidgetEvent"
    return nil
  end

  if Ops.get_string(event, "EventReason", "Unknown") != "Activated" &&
      Ops.get_string(event, "EventReason", "Unknown") != "SelectionChanged"
    return nil
  end

  Ops.get_symbol(event, "ID")
end

#IsWidgetContextMenuActivated(event) ⇒ Object

Checks that the EventType is WidgetEvent and the EventReason is ContextMenuActivated.

Returns id or nil.



111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'library/general/src/modules/Event.rb', line 111

def IsWidgetContextMenuActivated(event)
  event = deep_copy(event)
  if Ops.get_string(event, "EventType", "Unknown") != "WidgetEvent"
    return nil
  end

  if Ops.get_string(event, "EventReason", "Unknown") !=
      "ContextMenuActivated"
    return nil
  end

  Ops.get_symbol(event, "ID")
end

#IsWidgetSelectionChanged(event) ⇒ Object

Checks that the EventType is WidgetEvent and the EventReason is SelectionChanged.

Returns id or nil.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'library/general/src/modules/Event.rb', line 59

def IsWidgetSelectionChanged(event)
  event = deep_copy(event)
  if Ops.get_string(event, "EventType", "Unknown") != "WidgetEvent"
    return nil
  end

  if Ops.get_string(event, "EventReason", "Unknown") != "SelectionChanged"
    return nil
  end

  Ops.get_symbol(event, "ID")
end

#IsWidgetValueChanged(event) ⇒ Object

Checks that the EventType is WidgetEvent and the EventReason is ValueChanged.

Returns id or nil.



76
77
78
79
80
81
82
83
84
85
86
87
# File 'library/general/src/modules/Event.rb', line 76

def IsWidgetValueChanged(event)
  event = deep_copy(event)
  if Ops.get_string(event, "EventType", "Unknown") != "WidgetEvent"
    return nil
  end

  if Ops.get_string(event, "EventReason", "Unknown") != "ValueChanged"
    return nil
  end

  Ops.get_symbol(event, "ID")
end