Project:
IEs4Linux
Code Location:
http://www.tatanka.com.br/svn/ies4linux-gui/trunk/ies4linux-gui/trunk
Outline
- > M MakeTheGUI()
- > M callback_quit()
program.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import sys, os from model import installer, executor, process try: from gui import guigtk as gui except ImportError: from gui import guiwx as gui # Platform detection MAC = LINUX = False if sys.argv[1] == "mac": MAC=True if sys.argv[1] == "linux": LINUX=True userhome = os.getenv("HOME") # Define the GUI def MakeTheGUI(): return installer.InstallerDefinition()\ .set_title("IEs 4 Mac", show=MAC)\ .set_title("IEs 4 Linux", show=LINUX)\ .set_logo("mac/logo.png", show=MAC)\ .set_logo("linux/logo.png", show=LINUX)\ .tab("Install options")\ .group("Install Internet Explorers")\ .checkbox("IE 6.0 SP1", "--install-ie6", True)\ .checkbox("IE 5.5", "--install-ie55", False)\ .checkbox("IE 5.01", "--install-ie5", False)\ .combobox("Locale", "AR CN CS DA DE EL EN-US ES FI FR HE HU IT JA KO NL NO PL PT PT-BR RU SV TR TW", "--locale", "EN-US")\ .done()\ .group("Extra")\ .checkbox("Adobe Flash 9", "--install-flash", True)\ .checkbox("Core Fonts", "--install-corefonts", True, show=False)\ .vertical()\ .done()\ .done()\ .tab("Beta options")\ .toptext("These options are still beta. Use carefully.")\ .group("IE 7 engine")\ .checkbox("Install IE7 Engine", "--install-ie7", False)\ .done()\ .done()\ .tab("Advanced", LINUX)\ .group("Shortcuts")\ .checkbox("Create Desktop Icons", "--create-desktop-icons", True)\ .checkbox("Create Menu Entries", "--create-menu", False, show=False)\ .done()\ .group("Folders")\ .textfield("Base", userhome +"/.ies4linux", "--base-dir")\ .textfield("Download", userhome + "/.ies4linux/downloads", "--download-dir")\ .textfield("Bin", userhome + "/bin", "--bin-dir")\ .done()\ .group("Others")\ .textfield("Wget flags", "-c", "--wget-flags")\ .done()\ .done()\ .tab("Advanced Mac", False)\ .group("App Bundle")\ .checkbox("Create Application Bundle on Desktop", "--create-app", True)\ .done()\ .group("Others")\ .textfield("Curl flags", "", "--curl-flags")\ .done()\ .done()\ .button("Install", "none.png", callback_install)\ .button("Quit", "none.png", callback_quit) # Callbacks def callback_install(): # make gui e = MakeTheExecutor(_program) # show gui g.doExecutor(e) # execute process thread p = process.ProcessThread(e, g.write_command_line) g.process = p p.start_program() def callback_quit(): g.quit() sys.exit(0) # Execution screen def MakeTheExecutor(program): return executor.ExecutorDefinition()\ .title("Installing IEs")\ .logo(program.logo)\ .button("Cancel", "none.png", callback_cancel)\ .set_initial_command("~/workspace/ies4linux/ies4linux/trunk/ies4linux", ["--no-color"])\ .set_program(program) # Callbacks def callback_cancel(): g.process.kill() g.quit() sys.exit(0) # MAIN _program = MakeTheGUI() g = gui.GUI() g.doInstaller(_program)
