/
SelectionBox-icons.py
49 lines (43 loc) · 1.39 KB
/
SelectionBox-icons.py
1
2
3
4
5
6
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
40
41
42
43
44
45
46
47
48
# encoding: utf-8
# Selection box with icons
from yast import import_module
import_module('UI')
from yast import *
class SelectionBoxIconsClient:
def main(self):
UI.OpenDialog(
VBox(
Heading("YaST2 Mini Control Center"),
SelectionBox(
Id("mod"),
"Modules",
[
Item(Id("keyboard"), Term("icon", "yast-keyboard.png"), "Keyboard"),
Item(Id("mouse"), Term("icon", "yast-mouse.png"), "Mouse"),
Item(
Id("timezone"),
Term("icon", "yast-timezone.png"),
"Time zone"
),
Item(Id("lan"), Term("icon", "yast-lan.png"), "Network"),
Item(
Id("sw_single"),
Term("icon", "yast-software.png"),
"Software"
)
]
),
PushButton("&OK")
)
)
UI.UserInput()
# Get the input from the selection box.
#
# Notice: The return value of UI::UserInput() does NOT return this value!
# Rather, it returns the ID of the widget (normally the PushButton)
# that caused UI::UserInput() to return.
mod = UI.QueryWidget(Id("mod"), "CurrentItem")
# Close the dialog.
# Remember to read values from the dialog's widgets BEFORE closing it!
UI.CloseDialog()
SelectionBoxIconsClient().main()