diff --git a/functions.h b/functions.h index 2a3bf3e..061a71e 100644 --- a/functions.h +++ b/functions.h @@ -22,6 +22,9 @@ namespace global { inline bool skipOpenDialog; inline bool startBatteryWatchdog; } + namespace kobox { + inline bool showKoboxSplash; + } namespace mainwindow { namespace tabSwitcher { inline bool repaint; diff --git a/koboxappsdialog.cpp b/koboxappsdialog.cpp index ffc6646..4f6cb64 100644 --- a/koboxappsdialog.cpp +++ b/koboxappsdialog.cpp @@ -116,6 +116,15 @@ void koboxAppsDialog::on_launchBtn_clicked() string_writeconfig("/external_root/tmp/X_dpi", dpiSetting); // Wheeee! + global::kobox::showKoboxSplash = true; + + // Re-use USBMS splash window for KoBox splash, since it's pretty much the same layout + usbmsSplashWindow = new usbms_splash(); + usbmsSplashWindow->setAttribute(Qt::WA_DeleteOnClose); + usbmsSplashWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size())); + usbmsSplashWindow->show(); + QApplication::processEvents(); + string_writeconfig("/opt/ibxd", "x_start_gui\n"); } } diff --git a/koboxappsdialog.h b/koboxappsdialog.h index 503851f..6b2c9cb 100644 --- a/koboxappsdialog.h +++ b/koboxappsdialog.h @@ -4,6 +4,8 @@ #include #include +#include "usbms_splash.h" + namespace Ui { class koboxAppsDialog; } @@ -30,6 +32,7 @@ private slots: private: Ui::koboxAppsDialog *ui; + usbms_splash *usbmsSplashWindow; }; #endif // KOBOXAPPSDIALOG_H diff --git a/settings.cpp b/settings.cpp index 0e06be3..478a8a8 100644 --- a/settings.cpp +++ b/settings.cpp @@ -14,8 +14,7 @@ #include #include #include - -#include +#include using namespace std; @@ -355,7 +354,8 @@ void settings::on_usbmsBtn_clicked() usbmsWindow = new usbms_splash(); usbmsWindow->setAttribute(Qt::WA_DeleteOnClose); - usbmsWindow->showFullScreen(); + usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size())); + usbmsWindow->show(); QTimer *usbms_t = new QTimer(this); usbms_t->setInterval(1000); diff --git a/usbms_splash.cpp b/usbms_splash.cpp index 329f55d..518cba4 100644 --- a/usbms_splash.cpp +++ b/usbms_splash.cpp @@ -4,6 +4,8 @@ #include #include +#include "functions.h" + usbms_splash::usbms_splash(QWidget *parent) : QWidget(parent), ui(new Ui::usbms_splash) @@ -15,16 +17,36 @@ usbms_splash::usbms_splash(QWidget *parent) : float sH = QGuiApplication::screens()[0]->size().height(); // Defining what the default icon size will be - float stdIconWidth = sW / 1.15; - float stdIconHeight = sH / 1.15; + if(global::kobox::showKoboxSplash == true) { + float stdIconWidth = sW / 1.30; + float stdIconHeight = sH / 1.30; - this->setStyleSheet("background-color:black;"); - ui->label->setStyleSheet("QLabel { background-color : black; color : white; }"); - ui->label_3->setStyleSheet("QLabel { background-color : black; color : white; font-size: 9pt}"); + // Stylesheet + QFile stylesheetFile(":/resources/eink.qss"); + stylesheetFile.open(QFile::ReadOnly); + this->setStyleSheet(stylesheetFile.readAll()); + stylesheetFile.close(); - QPixmap pixmap(":/resources/usbms.png"); - QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); - ui->label_2->setPixmap(scaledPixmap); + ui->label->setText("Launching KoBox subsystem"); + ui->label_3->setText("Please wait, this could take a while."); + ui->label_3->setStyleSheet("font-size: 9pt"); + + QPixmap pixmap(":/resources/kobox-icon.png"); + QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + ui->label_2->setPixmap(scaledPixmap); + } + else { + float stdIconWidth = sW / 1.15; + float stdIconHeight = sH / 1.15; + + this->setStyleSheet("background-color:black;"); + ui->label->setStyleSheet("QLabel { background-color : black; color : white; }"); + ui->label_3->setStyleSheet("QLabel { background-color : black; color : white; font-size: 9pt}"); + + QPixmap pixmap(":/resources/usbms.png"); + QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + ui->label_2->setPixmap(scaledPixmap); + } } usbms_splash::~usbms_splash()