summarylogtreecommitdiffstats
path: root/install_rules.js
blob: fba436bc8c3572f80cceebcbb6f43405e2943647 (plain)
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
function Controller() {
    installer.autoRejectMessageBoxes();
    installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
    installer.setMessageBoxAutomaticAnswer("stopProcessesForUpdates", QMessageBox.Ignore);
    installer.setMessageBoxAutomaticAnswer("installationError", QMessageBox.Ignore);
    installer.installationFinished.connect(function() {
        gui.clickButton(buttons.NextButton);
    });
    installer.uninstallationFinished.connect(function() {
        gui.clickButton(buttons.NextButton);
    });

    console.log("OS: " + systemInfo.productType);
    console.log("Kernel: " + systemInfo.kernelType + "/" + systemInfo.kernelVersion);
    console.log("CPU Architecture: " +  systemInfo.currentCpuArchitecture);
    console.log("sys info: " +  systemInfo);

    // https://together.jolla.com/question/198669/sailfish-os-sdk-offline-installer-virtualbox-6/
    installer.setValue("ConfigVariant", "SailfishOS-SDK");
}

Controller.prototype.WelcomePageCallback = function() {
    console.log("component: " + gui.currentPageWidget());
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.CredentialsPageCallback = function() {
    console.log("component: " + gui.currentPageWidget());
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.IntroductionPageCallback = function() {
    console.log("component: " + gui.currentPageWidget());
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.TargetDirectoryPageCallback = function() {
    console.log("component: " + gui.currentPageWidget());
    gui.currentPageWidget().TargetDirectoryLineEdit.setText("/opt/SailfishOS/SDK");
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.PerformInstallationPageCallback = function() {
    var widget = gui.currentPageWidget();
    console.log("component: " + widget);
}

Controller.prototype.DynamicWorkspaceWidgetCallback = function() {
    var widget = gui.currentPageWidget();
    console.log("component: " + widget);
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.ComponentSelectionPageCallback = function() {
    var widget = gui.currentPageWidget();
    console.log("component: " + widget);
    widget.selectDefault();
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.LicenseAgreementPageCallback = function() {
    gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.StartMenuDirectoryPageCallback = function() {
    console.log("component: " + gui.currentPageWidget());
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.ReadyForInstallationPageCallback = function() {
    console.log("component: " + gui.currentPageWidget());
    gui.clickButton(buttons.NextButton);
}

Controller.prototype.FinishedPageCallback = function() {
    var widget = gui.currentPageWidget();
    console.log("component: " + widget);

    var checkBoxForm = widget.RunItCheckBox;
    console.log("component: " + checkBoxForm);

    if (checkBoxForm) {
        checkBoxForm.checked = false;
    }
    gui.clickButton(buttons.FinishButton);
}