summaryrefslogtreecommitdiff
path: root/ui/qt5
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-14 12:57:43 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-14 12:57:43 -0600
commitdf550933fb33ad6ed8bbbf7559afa1f6d797ac85 (patch)
tree29cf2d3b166360bba2318c47f503ea654bc704b2 /ui/qt5
parent5f42328911ec644cb2626b796d48c18f3167e59b (diff)
downloadhorizon-df550933fb33ad6ed8bbbf7559afa1f6d797ac85.tar.gz
horizon-df550933fb33ad6ed8bbbf7559afa1f6d797ac85.tar.bz2
horizon-df550933fb33ad6ed8bbbf7559afa1f6d797ac85.tar.xz
horizon-df550933fb33ad6ed8bbbf7559afa1f6d797ac85.zip
Qt UI: Add splash
Diffstat (limited to 'ui/qt5')
-rw-r--r--ui/qt5/main.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/ui/qt5/main.cc b/ui/qt5/main.cc
index 1881876..fe97b51 100644
--- a/ui/qt5/main.cc
+++ b/ui/qt5/main.cc
@@ -11,12 +11,35 @@
*/
#include <QApplication>
+#include <QDialog>
#include <QIcon>
+#include <QLabel>
#include <QLibraryInfo>
#include <QTranslator>
+#include <QVBoxLayout>
#include "horizonwizard.hh"
+class WaitDialog : public QDialog {
+public:
+ WaitDialog(QWidget *parent = nullptr);
+ void accept() override;
+ void reject() override;
+};
+
+WaitDialog::WaitDialog(QWidget *parent) : QDialog(parent) {
+ setWindowTitle(tr("Loading..."));
+ QVBoxLayout *layout = new QVBoxLayout;
+ QLabel *descLabel = new QLabel(tr("System Installation is loading.\n\nPlease wait a moment."));
+ descLabel->setAlignment(Qt::AlignCenter);
+ layout->addWidget(descLabel);
+ setLayout(layout);
+}
+
+/* Prevents the user from interacting in any way. */
+void WaitDialog::accept() { return; }
+void WaitDialog::reject() { return; }
+
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
@@ -30,9 +53,16 @@ int main(int argc, char *argv[]) {
app.installTranslator(translator);
}
+ WaitDialog d;
+ d.show();
+ app.setOverrideCursor(Qt::WaitCursor);
+ app.processEvents(QEventLoop::AllEvents, 300);
+
app.setWindowIcon(QIcon(":/horizon-256.png"));
HorizonWizard wizard;
+ d.hide();
+ app.restoreOverrideCursor();
wizard.show();
return app.exec();