USBMS prompt

This commit is contained in:
Nicolas Mailloux 2021-05-08 01:03:25 -04:00
parent e19f3867ca
commit 49e6a7167f
3 changed files with 23 additions and 1 deletions

View file

@ -37,6 +37,7 @@ namespace global {
} }
inline bool updateDialog; inline bool updateDialog;
inline bool lowBatteryDialog; inline bool lowBatteryDialog;
inline bool usbmsDialog;
} }
namespace settings { namespace settings {
inline bool settingsRebootDialog; inline bool settingsRebootDialog;

View file

@ -350,6 +350,26 @@ MainWindow::MainWindow(QWidget *parent)
} ); } );
batteryWatchdog->start(); batteryWatchdog->start();
// USB mass storage prompt
QTimer *usbmsPrompt = new QTimer(this);
usbmsPrompt->setInterval(2000);
connect(usbmsPrompt, &QTimer::timeout, [&]() {
if(global::mainwindow::usbmsDialog != true) {
;
}
else {
string_checkconfig_ro("/sys/devices/platform/fsl-usb2-udc/gadget/suspended");
if(checkconfig_str_val != "0\n") {
// Loop again...
;
}
else {
// An USB cable is connected!
}
}
} );
// We set the brightness level saved in the config file // We set the brightness level saved in the config file
int brightness_value = brightness_checkconfig(".config/03-brightness/config"); int brightness_value = brightness_checkconfig(".config/03-brightness/config");
set_brightness(brightness_value); set_brightness(brightness_value);

View file

@ -28,8 +28,9 @@ usbms_splash::usbms_splash(QWidget *parent) :
stylesheetFile.close(); stylesheetFile.close();
ui->label->setText("Launching KoBox subsystem"); 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->setText("Please wait, this could take a while.");
ui->label_3->setStyleSheet("font-size: 9pt"); ui->label_3->setStyleSheet("font-size: 10pt");
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);