diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-02-27 22:08:16 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-03-01 18:39:45 -0600 |
commit | ed87a0251092aa94f81fcc3ba559f340d2360b43 (patch) | |
tree | e33244c0771fa6b62365f19ca10da50b16a53c4e | |
parent | a3c5b6e75573ebe22b2cd2319448cdf828eaf1fc (diff) | |
download | horizon-qt5-ed87a0251092aa94f81fcc3ba559f340d2360b43.tar.gz horizon-qt5-ed87a0251092aa94f81fcc3ba559f340d2360b43.tar.bz2 horizon-qt5-ed87a0251092aa94f81fcc3ba559f340d2360b43.tar.xz horizon-qt5-ed87a0251092aa94f81fcc3ba559f340d2360b43.zip |
Add help window and welcome help text
-rw-r--r-- | horizon-qt5.pro | 6 | ||||
-rw-r--r-- | horizon.qrc | 3 | ||||
-rw-r--r-- | horizonhelpwindow.cc | 30 | ||||
-rw-r--r-- | horizonhelpwindow.hh | 17 | ||||
-rw-r--r-- | horizonwizard.cc | 32 | ||||
-rw-r--r-- | resources/welcome-help.txt | 17 |
6 files changed, 103 insertions, 2 deletions
diff --git a/horizon-qt5.pro b/horizon-qt5.pro index 14909e9..19d0731 100644 --- a/horizon-qt5.pro +++ b/horizon-qt5.pro @@ -11,14 +11,16 @@ SOURCES += main.cc \ welcomepage.cc \ networkingpage.cc \ horizonwizardpage.cc \ - softwarepage.cc + softwarepage.cc \ + horizonhelpwindow.cc HEADERS += \ horizonwizard.hh \ welcomepage.hh \ networkingpage.hh \ horizonwizardpage.hh \ - softwarepage.hh + softwarepage.hh \ + horizonhelpwindow.hh RESOURCES += \ horizon.qrc diff --git a/horizon.qrc b/horizon.qrc index 741a7f5..b37c391 100644 --- a/horizon.qrc +++ b/horizon.qrc @@ -7,4 +7,7 @@ <file>resources/software-high.png</file> <file>resources/software-low.png</file> </qresource> + <qresource prefix="/wizard_help"> + <file>resources/welcome-help.txt</file> + </qresource> </RCC> diff --git a/horizonhelpwindow.cc b/horizonhelpwindow.cc new file mode 100644 index 0000000..e4f25fb --- /dev/null +++ b/horizonhelpwindow.cc @@ -0,0 +1,30 @@ +#include "horizonhelpwindow.hh" + +#include <QDialogButtonBox> +#include <QTextEdit> +#include <QVBoxLayout> + +HorizonHelpWindow::HorizonHelpWindow(QFile *helpFile, QWidget *parent) : + QDialog(parent), helpFile(helpFile) +{ + QDialogButtonBox *buttonBox; + QTextEdit *helpText; + QVBoxLayout *layout; + + setFixedSize(QSize(600, 400)); + setSizeGripEnabled(false); + setWindowTitle("Horizon Help"); + + helpText = new QTextEdit(this); + helpText->setReadOnly(true); + helpText->setHtml(helpFile->readAll().toStdString().c_str()); + + buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok, this); + connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); + + layout = new QVBoxLayout(); + layout->addWidget(helpText); + layout->addWidget(buttonBox); + + setLayout(layout); +} diff --git a/horizonhelpwindow.hh b/horizonhelpwindow.hh new file mode 100644 index 0000000..a84d33b --- /dev/null +++ b/horizonhelpwindow.hh @@ -0,0 +1,17 @@ +#ifndef HORIZONHELPWINDOW_HH +#define HORIZONHELPWINDOW_HH + +#include <QDialog> +#include <QFile> + +class HorizonHelpWindow : public QDialog +{ + Q_OBJECT +public: + explicit HorizonHelpWindow(QFile *helpFile, QWidget *parent = 0); + +private: + QFile *helpFile; +}; + +#endif // HORIZONHELPWINDOW_HH diff --git a/horizonwizard.cc b/horizonwizard.cc index 1f7229f..7c123ea 100644 --- a/horizonwizard.cc +++ b/horizonwizard.cc @@ -1,9 +1,31 @@ #include "horizonwizard.hh" +#include "horizonhelpwindow.hh" + +#include <QFile> +#include <map> +#include <string> #include "welcomepage.hh" #include "networkingpage.hh" #include "softwarepage.hh" +using std::map; +using std::string; + +map<int, string> help_id_map = { + {HorizonWizard::Page_Welcome, "welcome"}, + {HorizonWizard::Page_Networking, "network-start"}, + {HorizonWizard::Page_Network_SimpleWireless, "network-wifi"}, + {HorizonWizard::Page_Network_SimpleWired, "network-wired"}, + {HorizonWizard::Page_Network_Advanced, "network-advanced"}, + {HorizonWizard::Page_Software, "software"}, + {HorizonWizard::Page_AdvancedSoftware, "software-advanced"}, + {HorizonWizard::Page_Startup, "startup"}, + {HorizonWizard::Page_Commit, "commit"}, + {HorizonWizard::Page_Save, "save"}, + {HorizonWizard::Page_Finished, "finished"} +}; + HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) { setWindowTitle(tr("Adélie Linux System Installation")); @@ -20,5 +42,15 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) setPage(Page_Networking, new NetworkingPage); setPage(Page_Software, new SoftwarePage); + QObject::connect(this, (void (QWizard:: *)(void))&QWizard::helpRequested, + [=](void) { + string helppath = ":/wizard_help/resources/" + + help_id_map.at(currentId()) + "-help.txt"; + QFile helpfile(helppath.c_str()); + helpfile.open(QFile::ReadOnly); + HorizonHelpWindow help(&helpfile, this); + help.exec(); + }); + selected.insert("adelie-base"); } diff --git a/resources/welcome-help.txt b/resources/welcome-help.txt new file mode 100644 index 0000000..01a9caa --- /dev/null +++ b/resources/welcome-help.txt @@ -0,0 +1,17 @@ +<h2>Welcome to Adélie Linux!</h2> + +<p>This is the <b>Horizon Installation System</b>, which will guide you through the process of installing the Adélie Linux operating system to your computer.</p> + +<p>Each step of the installation system has a help screen just like this one, accessible via the 'Help' button in the lower left corner of the screen. If you need more information about an option provided, simply open the Help screen.</p> + + +<hr> + + +<h2>Preparing for the installation</h2> + +<p>Please back up all of your data before beginning installation. While every effort is made to ensure that the Adélie Linux installation routines are safe and error-free, we cannot guarantee that your data will be preserved once you start the installation. If you intend on dual-booting your computer with another operating system, such as Mac OS X or Windows, ensure there is adequate disk space available to install Adélie Linux. You will need up to 1 GB for a standard desktop installation, or at least 300 MB for a server installation.</p> + +<p>If you plan on connecting to the Internet directly from your Adélie Linux computer without using a router (not common), ensure you have your Internet access credentials (typically a username and password) available before starting installation. Adélie Linux supports connecting to most ADSL and dial-up Internet providers using PPP; and cable, T1, and fibre providers using Ethernet. If you use a static IP address (not common), make sure you have your IP address, subnet, and default gateway and nameserver settings before starting installation.</p> + +<p>If your computer came with recovery media, we recommend that you have it available in the very unlikely event you have an issue with Adélie Linux, or your hardware has an incompatibility. This way, you will be able to quickly restore your computer to normal operation.</p> |