diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-05-11 23:48:06 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-05-11 23:48:06 -0500 |
commit | 2533566cb859d9bae6250749973a4c014d4dcc21 (patch) | |
tree | 7a80505e1c7e9f7eda0b695c97535481def4a9f2 | |
parent | b8fdb19bde2c9d26fac3fc08dad18532ba3181f4 (diff) | |
download | horizon-qt5-2533566cb859d9bae6250749973a4c014d4dcc21.tar.gz horizon-qt5-2533566cb859d9bae6250749973a4c014d4dcc21.tar.bz2 horizon-qt5-2533566cb859d9bae6250749973a4c014d4dcc21.tar.xz horizon-qt5-2533566cb859d9bae6250749973a4c014d4dcc21.zip |
Add partition page stub
-rw-r--r-- | horizon-qt5.pro | 8 | ||||
-rw-r--r-- | horizon.qrc | 1 | ||||
-rw-r--r-- | horizonwizard.cc | 3 | ||||
-rw-r--r-- | partitionpage.cc | 69 | ||||
-rw-r--r-- | partitionpage.hh | 22 | ||||
-rw-r--r-- | resources/partition-help.txt | 5 | ||||
-rw-r--r-- | welcomepage.cc | 13 |
7 files changed, 107 insertions, 14 deletions
diff --git a/horizon-qt5.pro b/horizon-qt5.pro index 98ca621..7a258d1 100644 --- a/horizon-qt5.pro +++ b/horizon-qt5.pro @@ -13,7 +13,8 @@ SOURCES += main.cc \ horizonwizardpage.cc \ softwarepage.cc \ horizonhelpwindow.cc \ - netsimplewifipage.cc + netsimplewifipage.cc \ + partitionpage.cc HEADERS += \ horizonwizard.hh \ @@ -22,7 +23,8 @@ HEADERS += \ horizonwizardpage.hh \ softwarepage.hh \ horizonhelpwindow.hh \ - netsimplewifipage.hh + netsimplewifipage.hh \ + partitionpage.hh RESOURCES += \ horizon.qrc @@ -30,3 +32,5 @@ RESOURCES += \ unix: CONFIG += link_pkgconfig unix: PKG_CONFIG = PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkgconf unix: PKGCONFIG += horizon-core + +DISTFILES += diff --git a/horizon.qrc b/horizon.qrc index 601eb25..dfe0fa8 100644 --- a/horizon.qrc +++ b/horizon.qrc @@ -11,5 +11,6 @@ <file>resources/welcome-help.txt</file> <file>resources/network-start-help.txt</file> <file>resources/software-help.txt</file> + <file>resources/partition-help.txt</file> </qresource> </RCC> diff --git a/horizonwizard.cc b/horizonwizard.cc index 5e8845f..1b66136 100644 --- a/horizonwizard.cc +++ b/horizonwizard.cc @@ -12,6 +12,7 @@ # include <horizon/networkinterface.hh> using Horizon::NetworkInterface; #endif +#include "partitionpage.hh" #include "networkingpage.hh" #include "netsimplewifipage.hh" #include "softwarepage.hh" @@ -21,6 +22,7 @@ using std::string; static map<int, string> help_id_map = { {HorizonWizard::Page_Welcome, "welcome"}, + {HorizonWizard::Page_Partition, "partition"}, {HorizonWizard::Page_Networking, "network-start"}, {HorizonWizard::Page_Network_SimpleWireless, "network-wifi"}, {HorizonWizard::Page_Network_SimpleWired, "network-wired"}, @@ -46,6 +48,7 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) setSizeGripEnabled(false); setPage(Page_Welcome, new WelcomePage); + setPage(Page_Partition, new PartitionPage); setPage(Page_Networking, new NetworkingPage); setPage(Page_Network_SimpleWireless, new NetworkSimpleWirelessPage); setPage(Page_Software, new SoftwarePage); diff --git a/partitionpage.cc b/partitionpage.cc new file mode 100644 index 0000000..6a9d381 --- /dev/null +++ b/partitionpage.cc @@ -0,0 +1,69 @@ +#include "partitionpage.hh" +#include "horizonwizard.hh" + +#ifndef NOT_NATIVE +# include <QHBoxLayout> +# include <QProcess> +#endif + +#include <QLabel> +#include <QVBoxLayout> + +PartitionPage::PartitionPage(QWidget *parent) : HorizonWizardPage (parent) +{ + QLabel *infoLabel; + QVBoxLayout *layout = new QVBoxLayout; +#ifndef NOT_NATIVE + QHBoxLayout *buttonLayout = new QHBoxLayout; +#endif + + loadWatermark("partition"); + setTitle(tr("Partition Disk Drive")); + + infoLabel = new QLabel(tr( +#ifdef NOT_NATIVE + "You must partition the disk before continuing. Unfortunately the Horizon Wizard cannot help you at this time." +#else + "You must partition your computer's disk drive(s) before " + "you can install the Adélie Linux system.\n\nIf you have " + "already partitioned your computer's disk drive(s) before " + "beginning this installation, choose Next. Otherwise, " + "choose \"Launch Partitioner\" to start the disk " + "partitioning process.\n\n" + + "NOTE: Incorrectly partitioning your computer's disk " + "drive(s) may cause data loss, or require further " + "partitioning in order to boot. Consult the owner's " + "manual for your computer and/or firmware for more " + "information." +#endif + )); + infoLabel->setWordWrap(true); + + layout->addWidget(infoLabel); +#ifndef NOT_NATIVE + openEditor = new QPushButton(tr("Launch Partitioner")); + QObject::connect(openEditor, static_cast<void (QPushButton:: *)(bool)>(&QPushButton::clicked), + [](bool checked) { + QProcess *parted = new QProcess; + + }); + buttonLayout->addWidget(openEditor, 0, Qt::AlignCenter); + layout->addLayout(buttonLayout); +#endif + this->setLayout(layout); +} + +int PartitionPage::nextId() const +{ +#ifdef NOT_NATIVE + return HorizonWizard::Page_Networking; +#else + if(this->horizonWizard()->interfaces.size() > 0) + { + return HorizonWizard::Page_Networking; + } else { + return HorizonWizard::Page_Software; + } +#endif +} diff --git a/partitionpage.hh b/partitionpage.hh new file mode 100644 index 0000000..0819cb3 --- /dev/null +++ b/partitionpage.hh @@ -0,0 +1,22 @@ +#ifndef PARTITIONPAGE_HH +#define PARTITIONPAGE_HH + +#include "horizonwizardpage.hh" + +#ifndef NOT_NATIVE +# include <QPushButton> +#endif + +class PartitionPage : public HorizonWizardPage +{ +public: + PartitionPage(QWidget *parent = nullptr); + + int nextId() const; +private: +#ifndef NOT_NATIVE + QPushButton *openEditor; +#endif +}; + +#endif // SOFTWAREPAGE_HH diff --git a/resources/partition-help.txt b/resources/partition-help.txt new file mode 100644 index 0000000..0f0bf19 --- /dev/null +++ b/resources/partition-help.txt @@ -0,0 +1,5 @@ +<h2>Partitioning the Hard Disk Drive</h2> + +Please help the user partition the disk drive here. + +Do not ship this content. diff --git a/welcomepage.cc b/welcomepage.cc index aa84eb5..6da1474 100644 --- a/welcomepage.cc +++ b/welcomepage.cc @@ -55,16 +55,5 @@ WelcomePage::WelcomePage(QWidget *parent) : HorizonWizardPage(parent) int WelcomePage::nextId() const { -#ifndef NOT_NATIVE - if(this->horizonWizard()->interfaces.size() > 0) - { -#endif - return HorizonWizard::Page_Networking; -#ifndef NOT_NATIVE - } - else - { - return HorizonWizard::Page_Software; - } -#endif + return HorizonWizard::Page_Partition; } |