-
Notifications
You must be signed in to change notification settings - Fork 5
/
control_script.js
103 lines (84 loc) · 2.76 KB
/
control_script.js
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
103
/* jshint asi:true */
// Public domain via CC0.
function Controller() {
// It tends to complain about XCode, even if all is okay.
installer.setMessageBoxAutomaticAnswer("XcodeError", QMessageBox.Ok);
installer.installationFinished.connect(proceed)
}
function logCurrentPage() {
var pageName = page().objectName
var pagePrettyTitle = page().title
console.log("At page: " + pageName + " ('" + pagePrettyTitle + "')")
}
function page() {
return gui.currentPageWidget()
}
function proceed(button, delay) {
gui.clickButton(button || buttons.NextButton, delay)
}
/// Skip welcome page
Controller.prototype.WelcomePageCallback = function() {
logCurrentPage()
// For some reason, delay is needed. Two seconds seems to be enough.
proceed(buttons.NextButton, 2000)
}
/// Just click next -- that is sign in to Qt account if credentials are
/// remembered from previous installs, or skip sign in otherwise.
Controller.prototype.CredentialsPageCallback = function() {
logCurrentPage()
proceed()
}
/// Skip introduction page
Controller.prototype.IntroductionPageCallback = function() {
logCurrentPage()
proceed()
}
/// Set target directory
Controller.prototype.TargetDirectoryPageCallback = function() {
logCurrentPage()
page().TargetDirectoryLineEdit.text = InstallPath
proceed()
}
Controller.prototype.ComponentSelectionPageCallback = function() {
logCurrentPage()
// Deselect whatever was default, and can be deselected.
page().deselectAll()
InstallComponents.forEach(function(component) {
page().selectComponent(component)
})
proceed()
}
/// Agree license
Controller.prototype.LicenseAgreementPageCallback = function() {
logCurrentPage()
page().AcceptLicenseRadioButton.checked = true
gui.clickButton(buttons.NextButton)
}
/// Windows-specific, skip it
Controller.prototype.StartMenuDirectoryPageCallback = function() {
logCurrentPage()
gui.clickButton(buttons.NextButton)
}
/// Skip confirmation page
Controller.prototype.ReadyForInstallationPageCallback = function() {
logCurrentPage()
proceed()
}
/// Installation in progress, do nothing
Controller.prototype.PerformInstallationPageCallback = function() {
logCurrentPage()
}
Controller.prototype.FinishedPageCallback = function() {
logCurrentPage()
// Deselect "launch QtCreator"
page().RunItCheckBox.checked = false
proceed(buttons.FinishButton)
}
/// Question for tracking usage data, refuse it
Controller.prototype.DynamicTelemetryPluginFormCallback = function() {
logCurrentPage()
console.log(Object.keys(page().TelemetryPluginForm.statisticGroupBox))
var radioButtons = page().TelemetryPluginForm.statisticGroupBox
radioButtons.disableStatisticRadioButton.checked = true
proceed()
}