From f224345c263f9e117b8ed6b9f084946796bde09d Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Thu, 13 May 2021 20:42:50 -0400 Subject: [PATCH] Write version info to file each time it's run --- apps.cpp | 10 ++++++---- koboxappsdialog.cpp | 7 ++++--- koboxsettings.ui | 3 +++ mainwindow.cpp | 12 ++++++++++-- usbms_splash.cpp | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/apps.cpp b/apps.cpp index 3afa0ea..ef9335c 100644 --- a/apps.cpp +++ b/apps.cpp @@ -24,13 +24,15 @@ apps::apps(QWidget *parent) : ui->calculatorLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px"); // Hiding KoBox apps button and label if X11 isn't enabled/wasn't started - string_checkconfig_ro("/external_root/boot/flags/X11_START"); - if(checkconfig_str_val != "true") { + if(checkconfig("/external_root/boot/flags/X11_START") != true) { + ui->label_5->hide(); + ui->koboxAppsOpenButton->hide(); ui->label_5->deleteLater(); ui->koboxAppsOpenButton->deleteLater(); } - string_checkconfig_ro("/external_root/boot/flags/X11_STARTED"); - if(checkconfig_str_val != "true") { + if(checkconfig("/external_root/boot/flags/X11_START") != true) { + ui->label_5->hide(); + ui->koboxAppsOpenButton->hide(); ui->label_5->deleteLater(); ui->koboxAppsOpenButton->deleteLater(); } diff --git a/koboxappsdialog.cpp b/koboxappsdialog.cpp index c16c1fa..6fdc120 100644 --- a/koboxappsdialog.cpp +++ b/koboxappsdialog.cpp @@ -104,7 +104,7 @@ void koboxAppsDialog::on_launchBtn_clicked() } // Fullscreen or windowed (i3) - // Mostly windowed except for apps like KTerm which ships its own OSK + // Mostly windowed except for apps like KTerm which ship their own OSK dpModeSetting = "windowed"; if(itemText == "Netsurf") { @@ -112,7 +112,7 @@ void koboxAppsDialog::on_launchBtn_clicked() string_writeconfig("/external_root/tmp/X_program", "!netsurf"); } else if(itemText == "KTerm") { - string_writeconfig("/external_root/tmp/X_program", "kterm -l /usr/local/share/kterm/layouts/keyboard-kt.xml -k 1"); + string_writeconfig("/external_root/tmp/X_program", "/usr/local/bin/kterm -l /usr/local/share/kterm/layouts/keyboard-kt.xml -k 1"); dpModeSetting = "fullscreen"; dpiSetting = "175"; } @@ -128,7 +128,7 @@ void koboxAppsDialog::on_launchBtn_clicked() string_writeconfig("/external_root/tmp/X_dpmode", dpModeSetting); string_writeconfig("/external_root/tmp/X_dpi", dpiSetting); - // Wheeee! + /* Wheeee! */ global::kobox::showKoboxSplash = true; // Re-use USBMS splash window for KoBox splash, since it's pretty much the same layout @@ -138,6 +138,7 @@ void koboxAppsDialog::on_launchBtn_clicked() usbmsSplashWindow->show(); QApplication::processEvents(); + // Write to FIFO to start X11 string_writeconfig("/opt/ibxd", "x_start_gui\n"); } } diff --git a/koboxsettings.ui b/koboxsettings.ui index 4809531..f06358f 100644 --- a/koboxsettings.ui +++ b/koboxsettings.ui @@ -222,6 +222,9 @@ OK 25 + + 125 + diff --git a/mainwindow.cpp b/mainwindow.cpp index fa58a36..aa4fe4c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -378,8 +378,8 @@ MainWindow::MainWindow(QWidget *parent) } } ); // **** FEATURE WARNING **** - // Due to the fsl-usb2-udc/gadget/suspended file which really only changes after a real unplugging of the USB port, further development on this feature is no longer possible and is abandoned unless a fix is found. - // Problem encontered: it would prompt to connect after a fresh reboot even if no USB cable is plugged in. + // Due to the fsl-usb2-udc/gadget/suspended file which really only changes after a real plug/unplug of the USB cable, further development on this feature is no longer possible and is abandoned unless a fix is found. + // Problem encontered: it would prompt to connect after a fresh reboot even if no USB cable was plugged in. // usbmsPrompt->start(); // **** FEATURE WARNING **** @@ -535,6 +535,14 @@ MainWindow::MainWindow(QWidget *parent) string_writeconfig("/external_root/opt/update/inkbox_updated", "false"); } } + + // Write current running version to a file for utility purposes + { + string_checkconfig_ro("/external_root/opt/isa/version"); + std::string inkbox_version = checkconfig_str_val.toStdString(); + string_writeconfig("/opt/version", inkbox_version); + } + } MainWindow::~MainWindow() diff --git a/usbms_splash.cpp b/usbms_splash.cpp index d312151..9bc4c94 100644 --- a/usbms_splash.cpp +++ b/usbms_splash.cpp @@ -31,7 +31,7 @@ usbms_splash::usbms_splash(QWidget *parent) : ui->label->setText("Launching KoBox subsystem"); ui->label->setStyleSheet("font-size: 14pt"); ui->label_3->setText("Please wait, this could take a while."); - ui->label_3->setStyleSheet("font-size: 10pt"); + ui->label_3->setStyleSheet("font-size: 11pt"); QPixmap pixmap(":/resources/kobox-icon.png"); QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);