mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-27 08:07:21 -08:00
Various fixes
This commit is contained in:
parent
3116d7d918
commit
95fb6af4c2
21 changed files with 108 additions and 81 deletions
|
@ -57,7 +57,7 @@ SOURCES += \
|
||||||
src/settings/settingschooser.cpp \
|
src/settings/settingschooser.cpp \
|
||||||
src/widgets/text/textwidget.cpp \
|
src/widgets/text/textwidget.cpp \
|
||||||
src/widgets/interfaceWidgets/toast.cpp \
|
src/widgets/interfaceWidgets/toast.cpp \
|
||||||
src/splash/usbms_splash.cpp \
|
src/splash/usbmsSplash.cpp \
|
||||||
src/apps/userapps.cpp \
|
src/apps/userapps.cpp \
|
||||||
src/widgets/virtualKeyboard/virtualkeyboard.cpp \
|
src/widgets/virtualKeyboard/virtualkeyboard.cpp \
|
||||||
src/widgets/virtualKeyboard/virtualkeypad.cpp \
|
src/widgets/virtualKeyboard/virtualkeypad.cpp \
|
||||||
|
@ -100,7 +100,7 @@ HEADERS += \
|
||||||
src/settings/settingschooser.h \
|
src/settings/settingschooser.h \
|
||||||
src/widgets/text/textwidget.h \
|
src/widgets/text/textwidget.h \
|
||||||
src/widgets/interfaceWidgets/toast.h \
|
src/widgets/interfaceWidgets/toast.h \
|
||||||
src/splash/usbms_splash.h \
|
src/splash/usbmsSplash.h \
|
||||||
src/apps/userapps.h \
|
src/apps/userapps.h \
|
||||||
src/widgets/virtualKeyboard/virtualkeyboard.h \
|
src/widgets/virtualKeyboard/virtualkeyboard.h \
|
||||||
src/widgets/virtualKeyboard/virtualkeypad.h \
|
src/widgets/virtualKeyboard/virtualkeypad.h \
|
||||||
|
@ -140,7 +140,7 @@ FORMS += \
|
||||||
src/settings/settingschooser.ui \
|
src/settings/settingschooser.ui \
|
||||||
src/widgets/text/textwidget.ui \
|
src/widgets/text/textwidget.ui \
|
||||||
src/widgets/interfaceWidgets/toast.ui \
|
src/widgets/interfaceWidgets/toast.ui \
|
||||||
src/splash/usbms_splash.ui \
|
src/splash/usbmsSplash.ui \
|
||||||
src/apps/userapps.ui \
|
src/apps/userapps.ui \
|
||||||
src/widgets/virtualKeyboard/virtualkeyboard.ui \
|
src/widgets/virtualKeyboard/virtualkeyboard.ui \
|
||||||
src/widgets/virtualKeyboard/virtualkeypad.ui \
|
src/widgets/virtualKeyboard/virtualkeypad.ui \
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include "usbms_splash.h"
|
#include "usbmsSplash.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
|
||||||
encryptionManager::encryptionManager(QWidget *parent) :
|
encryptionManager::encryptionManager(QWidget *parent) :
|
||||||
|
@ -346,7 +346,7 @@ void encryptionManager::on_usbmsBtn_clicked()
|
||||||
{
|
{
|
||||||
log("Showing USBMS splash", className);
|
log("Showing USBMS splash", className);
|
||||||
global::usbms::launchUsbms = true;
|
global::usbms::launchUsbms = true;
|
||||||
usbmsWindow = new usbms_splash();
|
usbmsWindow = new usbmsSplash();
|
||||||
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
|
usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
|
||||||
usbmsWindow->show();
|
usbmsWindow->show();
|
||||||
|
|
|
@ -48,7 +48,7 @@ private:
|
||||||
toast * toastWindow;
|
toast * toastWindow;
|
||||||
hourglassAnimationWidget * hourglassAnimationWidgetWindow;
|
hourglassAnimationWidget * hourglassAnimationWidgetWindow;
|
||||||
alert * alertWindow;
|
alert * alertWindow;
|
||||||
usbms_splash *usbmsWindow;
|
usbmsSplash *usbmsWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ENCRYPTIONMANAGER_H
|
#endif // ENCRYPTIONMANAGER_H
|
||||||
|
|
|
@ -634,13 +634,13 @@ void MainWindow::setBatteryIcon() {
|
||||||
stdIconHeight = sH / 16;
|
stdIconHeight = sH / 16;
|
||||||
|
|
||||||
QPixmap chargingPixmap(":/resources/battery_charging.png");
|
QPixmap chargingPixmap(":/resources/battery_charging.png");
|
||||||
QPixmap scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
QPixmap fullPixmap(":/resources/battery_full.png");
|
QPixmap fullPixmap(":/resources/battery_full.png");
|
||||||
QPixmap scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
QPixmap halfPixmap(":/resources/battery_half.png");
|
QPixmap halfPixmap(":/resources/battery_half.png");
|
||||||
QPixmap scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
QPixmap emptyPixmap(":/resources/battery_empty.png");
|
QPixmap emptyPixmap(":/resources/battery_empty.png");
|
||||||
QPixmap scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
|
||||||
// Checking battery level and status, then displaying the relevant icon on batteryIcon
|
// Checking battery level and status, then displaying the relevant icon on batteryIcon
|
||||||
if(isUsbPluggedIn() == true) {
|
if(isUsbPluggedIn() == true) {
|
||||||
|
@ -664,13 +664,13 @@ void MainWindow::setBatteryIcon() {
|
||||||
stdIconWidth = sW / 19;
|
stdIconWidth = sW / 19;
|
||||||
stdIconHeight = sH / 19;
|
stdIconHeight = sH / 19;
|
||||||
QPixmap chargingPixmap(":/resources/battery_charging.png");
|
QPixmap chargingPixmap(":/resources/battery_charging.png");
|
||||||
QPixmap scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
QPixmap fullPixmap(":/resources/battery_full.png");
|
QPixmap fullPixmap(":/resources/battery_full.png");
|
||||||
QPixmap scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
QPixmap halfPixmap(":/resources/battery_half.png");
|
QPixmap halfPixmap(":/resources/battery_half.png");
|
||||||
QPixmap scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
QPixmap emptyPixmap(":/resources/battery_empty.png");
|
QPixmap emptyPixmap(":/resources/battery_empty.png");
|
||||||
QPixmap scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
|
||||||
// Checking battery level and status, then displaying the relevant icon on batteryIcon
|
// Checking battery level and status, then displaying the relevant icon on batteryIcon
|
||||||
if(isUsbPluggedIn() == true) {
|
if(isUsbPluggedIn() == true) {
|
||||||
|
@ -711,11 +711,12 @@ void MainWindow::setInitialBrightness() {
|
||||||
// Coming from OOBE setup; not doing that fancy stuff again ;p
|
// Coming from OOBE setup; not doing that fancy stuff again ;p
|
||||||
QFile::remove("/tmp/oobe-inkbox_completed");
|
QFile::remove("/tmp/oobe-inkbox_completed");
|
||||||
pre_set_brightness(brightness_value);
|
pre_set_brightness(brightness_value);
|
||||||
|
log("Ignoring cinematic brightness call because it has already been done", className);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Fancy brightness fade-in
|
// Fancy brightness fade-in
|
||||||
if(checkconfig("/tmp/inkbox-cinematic_brightness_auto") == true) {
|
if(checkconfig("/tmp/inkbox-cinematicBrightness_auto") == true) {
|
||||||
QFile::remove("/tmp/inkbox-cinematic_brightness_auto");
|
QFile::remove("/tmp/inkbox-cinematicBrightness_auto");
|
||||||
cinematicBrightness(brightness_value, 2);
|
cinematicBrightness(brightness_value, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -723,6 +724,9 @@ void MainWindow::setInitialBrightness() {
|
||||||
string_writeconfig("/tmp/inkbox-cinematicBrightness_ran", "true");
|
string_writeconfig("/tmp/inkbox-cinematicBrightness_ran", "true");
|
||||||
cinematicBrightness(brightness_value, 0);
|
cinematicBrightness(brightness_value, 0);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
log("Ignoring cinematic brightness call because it has already been done", className);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "reader.h"
|
#include "reader.h"
|
||||||
#include "quit.h"
|
#include "quit.h"
|
||||||
#include "alert.h"
|
#include "alert.h"
|
||||||
#include "usbms_splash.h"
|
#include "usbmsSplash.h"
|
||||||
#include "brightnessdialog.h"
|
#include "brightnessdialog.h"
|
||||||
#include "generaldialog.h"
|
#include "generaldialog.h"
|
||||||
#include "koboxsettings.h"
|
#include "koboxsettings.h"
|
||||||
|
@ -106,7 +106,7 @@ private:
|
||||||
reader * readerWindow;
|
reader * readerWindow;
|
||||||
quit * quitWindow;
|
quit * quitWindow;
|
||||||
alert * alertWindow;
|
alert * alertWindow;
|
||||||
usbms_splash * usbmsWindow;
|
usbmsSplash * usbmsWindow;
|
||||||
brightnessDialog * brightnessDialogWindow;
|
brightnessDialog * brightnessDialogWindow;
|
||||||
generalDialog * generalDialogWindow;
|
generalDialog * generalDialogWindow;
|
||||||
koboxSettings * koboxSettingsWindow;
|
koboxSettings * koboxSettingsWindow;
|
||||||
|
|
|
@ -366,30 +366,24 @@ reader::reader(QWidget *parent) :
|
||||||
float sH = QGuiApplication::screens()[0]->size().height();
|
float sH = QGuiApplication::screens()[0]->size().height();
|
||||||
// Defining what the icons' size will be
|
// Defining what the icons' size will be
|
||||||
if(checkconfig("/opt/inkbox_genuine") == true) {
|
if(checkconfig("/opt/inkbox_genuine") == true) {
|
||||||
|
float stdIconWidth;
|
||||||
|
float stdIconHeight;
|
||||||
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") {
|
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") {
|
||||||
float stdIconWidth = sW / 16;
|
stdIconWidth = sW / 16;
|
||||||
float stdIconHeight = sW / 16;
|
stdIconHeight = sW / 16;
|
||||||
QPixmap chargingPixmap(":/resources/battery_charging.png");
|
|
||||||
scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
|
||||||
QPixmap fullPixmap(":/resources/battery_full.png");
|
|
||||||
scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
|
||||||
QPixmap halfPixmap(":/resources/battery_half.png");
|
|
||||||
scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
|
||||||
QPixmap emptyPixmap(":/resources/battery_empty.png");
|
|
||||||
scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
float stdIconWidth = sW / 19;
|
stdIconWidth = sW / 19;
|
||||||
float stdIconHeight = sH / 19;
|
stdIconHeight = sH / 19;
|
||||||
QPixmap chargingPixmap(":/resources/battery_charging.png");
|
|
||||||
scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
|
||||||
QPixmap fullPixmap(":/resources/battery_full.png");
|
|
||||||
scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
|
||||||
QPixmap halfPixmap(":/resources/battery_half.png");
|
|
||||||
scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
|
||||||
QPixmap emptyPixmap(":/resources/battery_empty.png");
|
|
||||||
scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
|
||||||
}
|
}
|
||||||
|
QPixmap chargingPixmap(":/resources/battery_charging.png");
|
||||||
|
scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
QPixmap fullPixmap(":/resources/battery_full.png");
|
||||||
|
scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
QPixmap halfPixmap(":/resources/battery_half.png");
|
||||||
|
scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
QPixmap emptyPixmap(":/resources/battery_empty.png");
|
||||||
|
scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
float stdIconWidth = sW / 19;
|
float stdIconWidth = sW / 19;
|
||||||
|
@ -1282,7 +1276,7 @@ void reader::on_homeBtn_clicked()
|
||||||
// Remount tmpfs
|
// Remount tmpfs
|
||||||
string_writeconfig("/inkbox/remount", "true");
|
string_writeconfig("/inkbox/remount", "true");
|
||||||
// Specify cinematic brightness mode
|
// Specify cinematic brightness mode
|
||||||
string_writeconfig("/tmp/inkbox-cinematic_brightness_auto", "true");
|
string_writeconfig("/tmp/inkbox-cinematicBrightness_auto", "true");
|
||||||
|
|
||||||
// Relaunching process
|
// Relaunching process
|
||||||
quit_restart();
|
quit_restart();
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 13 KiB |
Binary file not shown.
Before Width: | Height: | Size: 993 B After Width: | Height: | Size: 13 KiB |
|
@ -126,7 +126,7 @@ void koboxSettings::on_pushButton_clicked()
|
||||||
|
|
||||||
log("Exporting KoBox extensions onboard storage via USB", className);
|
log("Exporting KoBox extensions onboard storage via USB", className);
|
||||||
log("Showing USBMS splash", className);
|
log("Showing USBMS splash", className);
|
||||||
usbmsWindow = new usbms_splash();
|
usbmsWindow = new usbmsSplash();
|
||||||
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
|
usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
|
||||||
usbmsWindow->show();
|
usbmsWindow->show();
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "generaldialog.h"
|
#include "generaldialog.h"
|
||||||
#include "usbms_splash.h"
|
#include "usbmsSplash.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class koboxSettings;
|
class koboxSettings;
|
||||||
|
@ -33,7 +33,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
Ui::koboxSettings *ui;
|
Ui::koboxSettings *ui;
|
||||||
generalDialog *generalDialogWindow;
|
generalDialog *generalDialogWindow;
|
||||||
usbms_splash *usbmsWindow;
|
usbmsSplash *usbmsWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KOBOXSETTINGS_H
|
#endif // KOBOXSETTINGS_H
|
||||||
|
|
|
@ -901,7 +901,7 @@ void settings::usbms_launch()
|
||||||
log("Showing USBMS splash", className);
|
log("Showing USBMS splash", className);
|
||||||
global::usbms::launchUsbms = true;
|
global::usbms::launchUsbms = true;
|
||||||
|
|
||||||
usbmsWindow = new usbms_splash();
|
usbmsWindow = new usbmsSplash();
|
||||||
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
|
usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
|
||||||
usbmsWindow->show();
|
usbmsWindow->show();
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include <usbms_splash.h>
|
#include <usbmsSplash.h>
|
||||||
#include "generaldialog.h"
|
#include "generaldialog.h"
|
||||||
#include "otamanager.h"
|
#include "otamanager.h"
|
||||||
#include "toast.h"
|
#include "toast.h"
|
||||||
|
@ -79,7 +79,7 @@ signals:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::settings *ui;
|
Ui::settings *ui;
|
||||||
usbms_splash *usbmsWindow;
|
usbmsSplash *usbmsWindow;
|
||||||
generalDialog *generalDialogWindow;
|
generalDialog *generalDialogWindow;
|
||||||
otaManager *otaManagerWindow;
|
otaManager *otaManagerWindow;
|
||||||
toast *toastWindow;
|
toast *toastWindow;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "usbms_splash.h"
|
#include "usbmsSplash.h"
|
||||||
#include "ui_usbms_splash.h"
|
#include "ui_usbmsSplash.h"
|
||||||
|
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
@ -7,12 +7,12 @@
|
||||||
|
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
|
||||||
usbms_splash::usbms_splash(QWidget *parent) :
|
usbmsSplash::usbmsSplash(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::usbms_splash)
|
ui(new Ui::usbmsSplash)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
usbms_splash::setFont(QFont("u001"));
|
usbmsSplash::setFont(QFont("u001"));
|
||||||
ui->label->setFont(QFont("Inter"));
|
ui->label->setFont(QFont("Inter"));
|
||||||
|
|
||||||
// Getting the screen's size
|
// Getting the screen's size
|
||||||
|
@ -60,11 +60,11 @@ usbms_splash::usbms_splash(QWidget *parent) :
|
||||||
|
|
||||||
if(global::usbms::launchUsbms == true) {
|
if(global::usbms::launchUsbms == true) {
|
||||||
global::usbms::launchUsbms = false;
|
global::usbms::launchUsbms = false;
|
||||||
usbms_launch();
|
usbmsLaunch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void usbms_splash::usbms_launch()
|
void usbmsSplash::usbmsLaunch()
|
||||||
{
|
{
|
||||||
log("Entering USBMS session", className);
|
log("Entering USBMS session", className);
|
||||||
string_writeconfig("/tmp/in_usbms", "true");
|
string_writeconfig("/tmp/in_usbms", "true");
|
||||||
|
@ -169,16 +169,17 @@ void usbms_splash::usbms_launch()
|
||||||
usbms_t->start();
|
usbms_t->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
usbms_splash::~usbms_splash()
|
usbmsSplash::~usbmsSplash()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void usbms_splash::brightnessDown() {
|
void usbmsSplash::brightnessDown() {
|
||||||
cinematicBrightness(0, 1);
|
cinematicBrightness(0, 1);
|
||||||
|
writeFile("/tmp/inkbox-cinematicBrightness_ran", "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
void usbms_splash::quit_restart() {
|
void usbmsSplash::quit_restart() {
|
||||||
// If existing, cleaning bookconfig_mount mountpoint
|
// If existing, cleaning bookconfig_mount mountpoint
|
||||||
string_writeconfig("/opt/ibxd", "bookconfig_unmount\n");
|
string_writeconfig("/opt/ibxd", "bookconfig_unmount\n");
|
||||||
|
|
||||||
|
@ -188,7 +189,7 @@ void usbms_splash::quit_restart() {
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void usbms_splash::restartServices() {
|
void usbmsSplash::restartServices() {
|
||||||
// Restarting USBNet
|
// Restarting USBNet
|
||||||
// NOTE: USBNet is only started if required conditions are met (see https://github.com/Kobo-InkBox/rootfs/blob/master/etc/init.d/usbnet)
|
// NOTE: USBNet is only started if required conditions are met (see https://github.com/Kobo-InkBox/rootfs/blob/master/etc/init.d/usbnet)
|
||||||
string_writeconfig("/opt/ibxd", "usbnet_start\n");
|
string_writeconfig("/opt/ibxd", "usbnet_start\n");
|
|
@ -4,22 +4,22 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class usbms_splash;
|
class usbmsSplash;
|
||||||
}
|
}
|
||||||
|
|
||||||
class usbms_splash : public QWidget
|
class usbmsSplash : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString className = this->metaObject()->className();
|
QString className = this->metaObject()->className();
|
||||||
explicit usbms_splash(QWidget *parent = nullptr);
|
explicit usbmsSplash(QWidget *parent = nullptr);
|
||||||
~usbms_splash();
|
~usbmsSplash();
|
||||||
float sW;
|
float sW;
|
||||||
float sH;
|
float sH;
|
||||||
QString massStorageModule;
|
QString massStorageModule;
|
||||||
|
|
||||||
void usbms_launch();
|
void usbmsLaunch();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void brightnessDown();
|
void brightnessDown();
|
||||||
|
@ -27,7 +27,7 @@ private slots:
|
||||||
void restartServices();
|
void restartServices();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::usbms_splash *ui;
|
Ui::usbmsSplash *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // USBMS_SPLASH_H
|
#endif // USBMS_SPLASH_H
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>usbms_splash</class>
|
<class>usbmsSplash</class>
|
||||||
<widget class="QWidget" name="usbms_splash">
|
<widget class="QWidget" name="usbmsSplash">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
|
@ -337,7 +337,7 @@ void generalDialog::on_okBtn_clicked()
|
||||||
global::usbms::usbmsDialog = false;
|
global::usbms::usbmsDialog = false;
|
||||||
global::usbms::launchUsbms = true;
|
global::usbms::launchUsbms = true;
|
||||||
|
|
||||||
usbmsWindow = new usbms_splash();
|
usbmsWindow = new usbmsSplash();
|
||||||
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
|
usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
|
||||||
usbmsWindow->show();
|
usbmsWindow->show();
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
#include "usbms_splash.h"
|
#include "usbmsSplash.h"
|
||||||
#include "textwidget.h"
|
#include "textwidget.h"
|
||||||
#include "virtualkeyboard.h"
|
#include "virtualkeyboard.h"
|
||||||
#include "virtualkeypad.h"
|
#include "virtualkeypad.h"
|
||||||
|
@ -73,7 +73,7 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::generalDialog *ui;
|
Ui::generalDialog *ui;
|
||||||
usbms_splash *usbmsWindow;
|
usbmsSplash *usbmsWindow;
|
||||||
textwidget *textwidgetWindow;
|
textwidget *textwidgetWindow;
|
||||||
virtualkeyboard *keyboardWidget;
|
virtualkeyboard *keyboardWidget;
|
||||||
virtualkeypad *keypadWidget;
|
virtualkeypad *keypadWidget;
|
||||||
|
|
|
@ -166,7 +166,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
||||||
|
|
||||||
// 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
|
||||||
log("Showing KoBox splash", className);
|
log("Showing KoBox splash", className);
|
||||||
usbmsSplashWindow = new usbms_splash();
|
usbmsSplashWindow = new usbmsSplash();
|
||||||
usbmsSplashWindow->setAttribute(Qt::WA_DeleteOnClose);
|
usbmsSplashWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
usbmsSplashWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry().size()));
|
usbmsSplashWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry().size()));
|
||||||
usbmsSplashWindow->show();
|
usbmsSplashWindow->show();
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
|
|
||||||
#include "usbms_splash.h"
|
#include "usbmsSplash.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class koboxAppsDialog;
|
class koboxAppsDialog;
|
||||||
|
@ -36,7 +36,7 @@ signals:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::koboxAppsDialog *ui;
|
Ui::koboxAppsDialog *ui;
|
||||||
usbms_splash *usbmsSplashWindow;
|
usbmsSplash *usbmsSplashWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KOBOXAPPSDIALOG_H
|
#endif // KOBOXAPPSDIALOG_H
|
||||||
|
|
|
@ -12,6 +12,9 @@ connectiondialog::connectiondialog(QWidget *parent) :
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setFont(QFont("u001"));
|
this->setFont(QFont("u001"));
|
||||||
|
ui->passphraseTextEdit->setFont(QFont("Noto Mono"));
|
||||||
|
ui->label->setFont(QFont("Inter"));
|
||||||
|
ui->label_2->setFont(QFont("Inter"));
|
||||||
|
|
||||||
// Stylesheet, style & misc.
|
// Stylesheet, style & misc.
|
||||||
QFile stylesheetFile("/mnt/onboard/.adds/inkbox/eink.qss");
|
QFile stylesheetFile("/mnt/onboard/.adds/inkbox/eink.qss");
|
||||||
|
@ -19,15 +22,29 @@ connectiondialog::connectiondialog(QWidget *parent) :
|
||||||
this->setStyleSheet(stylesheetFile.readAll());
|
this->setStyleSheet(stylesheetFile.readAll());
|
||||||
stylesheetFile.close();
|
stylesheetFile.close();
|
||||||
|
|
||||||
ui->cancelBtn->setStyleSheet("font-size: 9pt");
|
ui->cancelBtn->setProperty("type", "borderless");
|
||||||
ui->connectBtn->setStyleSheet("font-size: 9pt");
|
ui->connectBtn->setProperty("type", "borderless");
|
||||||
ui->showPassphraseBtn->setStyleSheet("font-size: 9pt");
|
ui->showPassphraseBtn->setProperty("type", "borderless");
|
||||||
|
|
||||||
|
ui->label->setStyleSheet("font-weight: bold");
|
||||||
|
ui->label_2->setStyleSheet("font-weight: bold");
|
||||||
|
|
||||||
|
ui->cancelBtn->setIcon(QIcon(":/resources/close.png"));
|
||||||
|
ui->connectBtn->setIcon(QIcon(":/resources/arrow-right.png"));
|
||||||
|
|
||||||
// Size
|
// Size
|
||||||
QRect screenGeometry = QGuiApplication::screens()[0]->geometry();
|
QRect screenGeometry = QGuiApplication::screens()[0]->geometry();
|
||||||
this->setFixedWidth(screenGeometry.width());
|
this->setFixedWidth(screenGeometry.width() / 1.5);
|
||||||
|
|
||||||
|
int halfOfHalfHeight = ((screenGeometry.height() / 2) / 2) / 2;
|
||||||
|
int finalHeight = screenGeometry.height() - halfOfHalfHeight * 6.3;
|
||||||
|
|
||||||
|
this->setFixedHeight(finalHeight);
|
||||||
|
|
||||||
|
// Centering dialog
|
||||||
|
int x = (screenGeometry.width() - this->width()) / 2;
|
||||||
|
int y = (screenGeometry.height() - this->height()) / 2;
|
||||||
|
this->move(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
connectiondialog::~connectiondialog()
|
connectiondialog::~connectiondialog()
|
||||||
|
@ -63,12 +80,17 @@ void connectiondialog::applyVariables() {
|
||||||
}
|
}
|
||||||
QString passphrase = searchDatabase(connectedNetworkData.name);
|
QString passphrase = searchDatabase(connectedNetworkData.name);
|
||||||
if(passphrase.isEmpty() == false) {
|
if(passphrase.isEmpty() == false) {
|
||||||
log("Found passphrase: " + passphrase, className);
|
log("Found passphrase: '" + passphrase + "'", className);
|
||||||
ui->showPassphraseBtn->setIcon(QIcon(":/resources/show.png"));
|
ui->showPassphraseBtn->setIcon(QIcon(":/resources/show.png"));
|
||||||
showedPassphrase = false;
|
showedPassphrase = false;
|
||||||
savedPassphrase = passphrase;
|
savedPassphrase = passphrase;
|
||||||
|
|
||||||
ui->passphraseTextEdit->setText("********");
|
int passphraseLength = passphrase.length();
|
||||||
|
QString hiddenPassphrase;
|
||||||
|
for(int i = 0; i < passphraseLength; i++) {
|
||||||
|
hiddenPassphrase.append("•");
|
||||||
|
}
|
||||||
|
ui->passphraseTextEdit->setText(hiddenPassphrase);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log("No passphrase found", className);
|
log("No passphrase found", className);
|
||||||
|
@ -224,12 +246,12 @@ void connectiondialog::on_passphraseTextEdit_cursorPositionChanged(int oldpos, i
|
||||||
global::keyboard::keyboardText = "";
|
global::keyboard::keyboardText = "";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log("Passphrase is not saved; ignoring text edit call", className);
|
log("Passphrase is not saved; ignoring text edit widget call", className);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log("Ignoring click on text edit", className);
|
log("Ignoring click on text edit widget", className);
|
||||||
cursorPositionIgnore = true;
|
cursorPositionIgnore = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,7 +270,13 @@ void connectiondialog::on_showPassphraseBtn_clicked()
|
||||||
else {
|
else {
|
||||||
showedPassphrase = false;
|
showedPassphrase = false;
|
||||||
ui->showPassphraseBtn->setIcon(QIcon(":/resources/show.png"));
|
ui->showPassphraseBtn->setIcon(QIcon(":/resources/show.png"));
|
||||||
ui->passphraseTextEdit->setText("********");
|
|
||||||
|
int passphraseLength = searchDatabase(connectedNetworkData.name).length();
|
||||||
|
QString hiddenPassphrase;
|
||||||
|
for(int i = 0; i < passphraseLength; i++) {
|
||||||
|
hiddenPassphrase.append("•");
|
||||||
|
}
|
||||||
|
ui->passphraseTextEdit->setText(hiddenPassphrase);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="cancelBtn">
|
<widget class="QPushButton" name="cancelBtn">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Cancel</string>
|
<string></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="connectBtn">
|
<widget class="QPushButton" name="connectBtn">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Connect</string>
|
<string></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in a new issue