summaryrefslogtreecommitdiff
path: root/ui/qt5/intropage.cc
blob: 29bec114289a7e03889dff8ad7a11be7b5d3d481 (plain) (blame)
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
#include "intropage.hh"

#include <QLabel>
#ifdef HAS_INSTALL_ENV
#include <QMenu>
#include <QProcess>
#endif  /* HAS_INSTALL_ENV */
#include <QVBoxLayout>

IntroPage::IntroPage(QWidget *parent) : HorizonWizardPage(parent) {
    QLabel *descLabel;
    QVBoxLayout *layout;

    loadWatermark("intro");
    setTitle(tr("Welcome to Adélie Linux"));

#ifndef HAS_INSTALL_ENV
    descLabel = new QLabel(
                tr("<p>"
                   "Horizon will guide you through creation of a basic "
                   "<code>installfile</code> "
                   "for installing Adélie Linux on another computer."
                   "<p>"
                   "<b>IMPORTANT:</b> Not all advanced settings will "
                   "be available to you.  You may be allowed to "
                   "specify an invalid or non-bootable disk layout or "
                   "network configuration.  For best results, always "
                   "run System Installation directly on the computer "
                   "you wish to run Adélie Linux."
                   "<p>"
                   "For more information about the "
                   "<code>installfile</code> "
                   "format and syntax, see the "
                   "<a href='https://help.adelielinux.org/html/install/'>"
                   "Adélie Linux Installation Guide</a> on the "
                   "Internet."));
    descLabel->setOpenExternalLinks(true);
    descLabel->setTextFormat(Qt::RichText);
#else  /* HAS_INSTALL_ENV */
    QMenu *toolMenu;
    toolButton = new QPushButton(tr("Launch &Tool..."), this);
    toolMenu = new QMenu("&Tools", toolButton);
    connect(toolMenu->addAction("&Terminal"), &QAction::triggered, [=](void) {
        QProcess p;
        p.execute("xterm", {"-fa", "Liberation Mono", "-fs", "12"});
    });
    connect(toolMenu->addAction("&Partition Editor"), &QAction::triggered, [=](void) {
        QProcess p;
        p.execute("partitionmanager");
    });
    /*connect(toolMenu->addAction("&Web Browser"), &QAction::triggered, [=](void){
        QProcess p;
        p.execute("otter-browser");
    });*/
    toolButton->setMenu(toolMenu);

    descLabel = new QLabel(
                tr("Thank you for choosing the Adélie Linux operating system.  "
                   "This installation process will only take about 10-15 minutes of your time.  "
                   "When you're done, your computer will be up and running with the reliable, secure, libre Adélie Linux.\n\n"

                   "When you're ready to answer a few questions, you can get started by choosing Next or pressing F8.  "
                   "If you'd like more information about the installation procedure, choose Help or press F1 at any time.\n\n"

                   "The installation procedure will not change anything on your computer until the final step.  "
                   "You can safely cancel at any time, with no change to your computer, by choosing Cancel or pressing F3.\n\n"

                   "If you are unable to use a mouse, you may press the Tab key to cycle between the available inputs.  "
                   "The currently selected input will be highlighted."));
#endif  /* !HAS_INSTALL_ENV */
    descLabel->setWordWrap(true);

    layout = new QVBoxLayout;
    layout->addWidget(descLabel);
#ifdef HAS_INSTALL_ENV
    layout->addStretch();
    layout->addWidget(toolButton);
#endif  /* HAS_INSTALL_ENV */
    setLayout(layout);
}

int IntroPage::nextId() const {
    return HorizonWizard::Page_Input;
}