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.


31
32
33
34
# File 'library/general/src/modules/Event.rb', line 31

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.


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

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

  Ops.get_symbol(event, "ID")
end

#IsMenu(event) ⇒ Object

Checks that the EventType is MenuEvent.

return id or nil.


110
111
112
113
114
115
# File 'library/general/src/modules/Event.rb', line 110

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.


120
121
122
123
124
125
# File 'library/general/src/modules/Event.rb', line 120

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

  Ops.get_symbol(event, "ID")
end

#IsWidgetActivated(event) ⇒ Object

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

Returns id or nil.


40
41
42
43
44
45
46
47
# File 'library/general/src/modules/Event.rb', line 40

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

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

  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.


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

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

  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.


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

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

  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.


53
54
55
56
57
58
59
60
# File 'library/general/src/modules/Event.rb', line 53

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

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

  Ops.get_symbol(event, "ID")
end

#IsWidgetValueChanged(event) ⇒ Object

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

Returns id or nil.


66
67
68
69
70
71
72
73
# File 'library/general/src/modules/Event.rb', line 66

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

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

  Ops.get_symbol(event, "ID")
end