Write version info to file each time it's run

This commit is contained in:
Nicolas Mailloux 2021-05-13 20:42:50 -04:00
parent 4d391801aa
commit f224345c26
5 changed files with 24 additions and 10 deletions

View file

@ -24,13 +24,15 @@ apps::apps(QWidget *parent) :
ui->calculatorLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px"); ui->calculatorLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
// Hiding KoBox apps button and label if X11 isn't enabled/wasn't started // 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("/external_root/boot/flags/X11_START") != true) {
if(checkconfig_str_val != "true") { ui->label_5->hide();
ui->koboxAppsOpenButton->hide();
ui->label_5->deleteLater(); ui->label_5->deleteLater();
ui->koboxAppsOpenButton->deleteLater(); ui->koboxAppsOpenButton->deleteLater();
} }
string_checkconfig_ro("/external_root/boot/flags/X11_STARTED"); if(checkconfig("/external_root/boot/flags/X11_START") != true) {
if(checkconfig_str_val != "true") { ui->label_5->hide();
ui->koboxAppsOpenButton->hide();
ui->label_5->deleteLater(); ui->label_5->deleteLater();
ui->koboxAppsOpenButton->deleteLater(); ui->koboxAppsOpenButton->deleteLater();
} }

View file

@ -104,7 +104,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
} }
// Fullscreen or windowed (i3) // 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"; dpModeSetting = "windowed";
if(itemText == "Netsurf") { if(itemText == "Netsurf") {
@ -112,7 +112,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
string_writeconfig("/external_root/tmp/X_program", "!netsurf"); string_writeconfig("/external_root/tmp/X_program", "!netsurf");
} }
else if(itemText == "KTerm") { 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"; dpModeSetting = "fullscreen";
dpiSetting = "175"; 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_dpmode", dpModeSetting);
string_writeconfig("/external_root/tmp/X_dpi", dpiSetting); string_writeconfig("/external_root/tmp/X_dpi", dpiSetting);
// Wheeee! /* Wheeee! */
global::kobox::showKoboxSplash = true; global::kobox::showKoboxSplash = true;
// Re-use USBMS splash window for KoBox splash, since it's pretty much the same layout // 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(); usbmsSplashWindow->show();
QApplication::processEvents(); QApplication::processEvents();
// Write to FIFO to start X11
string_writeconfig("/opt/ibxd", "x_start_gui\n"); string_writeconfig("/opt/ibxd", "x_start_gui\n");
} }
} }

View file

@ -222,6 +222,9 @@ OK
<property name="singleStep"> <property name="singleStep">
<number>25</number> <number>25</number>
</property> </property>
<property name="value">
<number>125</number>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

View file

@ -378,8 +378,8 @@ MainWindow::MainWindow(QWidget *parent)
} }
} ); } );
// **** FEATURE WARNING **** // **** 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. // 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 is plugged in. // Problem encontered: it would prompt to connect after a fresh reboot even if no USB cable was plugged in.
// usbmsPrompt->start(); // usbmsPrompt->start();
// **** FEATURE WARNING **** // **** FEATURE WARNING ****
@ -535,6 +535,14 @@ MainWindow::MainWindow(QWidget *parent)
string_writeconfig("/external_root/opt/update/inkbox_updated", "false"); 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() MainWindow::~MainWindow()

View file

@ -31,7 +31,7 @@ usbms_splash::usbms_splash(QWidget *parent) :
ui->label->setText("Launching KoBox subsystem"); ui->label->setText("Launching KoBox subsystem");
ui->label->setStyleSheet("font-size: 14pt"); ui->label->setStyleSheet("font-size: 14pt");
ui->label_3->setText("Please wait, this could take a while."); 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 pixmap(":/resources/kobox-icon.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);