mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
Improve logging; timezone fix
This commit is contained in:
parent
698ee57585
commit
239ac55bd7
12 changed files with 56 additions and 4 deletions
|
@ -39,6 +39,7 @@ alert::alert(QWidget *parent) :
|
||||||
ui->alertIconLabel->setPixmap(scaledPixmap);
|
ui->alertIconLabel->setPixmap(scaledPixmap);
|
||||||
|
|
||||||
signatureError = true;
|
signatureError = true;
|
||||||
|
log("Displaying signature error alert splash", className);
|
||||||
ui->securityLabel->setText("Failed to update InkBox.");
|
ui->securityLabel->setText("Failed to update InkBox.");
|
||||||
ui->messageLabel->setText("The digital signature of the update is untrusted.\nFor security reasons, it cannot be installed.");
|
ui->messageLabel->setText("The digital signature of the update is untrusted.\nFor security reasons, it cannot be installed.");
|
||||||
ui->stackedWidget->setCurrentIndex(1);
|
ui->stackedWidget->setCurrentIndex(1);
|
||||||
|
@ -48,6 +49,7 @@ alert::alert(QWidget *parent) :
|
||||||
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
||||||
ui->alertIconLabel->setPixmap(scaledPixmap);
|
ui->alertIconLabel->setPixmap(scaledPixmap);
|
||||||
|
|
||||||
|
log("Displaying downgrade error alert splash", className);
|
||||||
downgradeError = true;
|
downgradeError = true;
|
||||||
ui->securityLabel->setText("Failed to update InkBox.");
|
ui->securityLabel->setText("Failed to update InkBox.");
|
||||||
ui->messageLabel->setText("An error occured during the update process.\nThe update package's version is lower than the actual installed version.");
|
ui->messageLabel->setText("An error occured during the update process.\nThe update package's version is lower than the actual installed version.");
|
||||||
|
@ -77,6 +79,7 @@ alert::alert(QWidget *parent) :
|
||||||
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
|
||||||
ui->alertIconLabel->setPixmap(scaledPixmap);
|
ui->alertIconLabel->setPixmap(scaledPixmap);
|
||||||
|
|
||||||
|
log("Displaying critical battery alert splash", className);
|
||||||
criticalBattery = true;
|
criticalBattery = true;
|
||||||
ui->warningLabel->setText("Please charge your eReader.");
|
ui->warningLabel->setText("Please charge your eReader.");
|
||||||
ui->securityLabel->setText("The battery's charge level is critical.");
|
ui->securityLabel->setText("The battery's charge level is critical.");
|
||||||
|
@ -121,6 +124,7 @@ void alert::on_continueBtn_clicked()
|
||||||
void alert::on_resetBtn_clicked()
|
void alert::on_resetBtn_clicked()
|
||||||
{
|
{
|
||||||
// We set the DO_FACTORY_RESET flag and we restart the Kobo
|
// We set the DO_FACTORY_RESET flag and we restart the Kobo
|
||||||
|
log("Factory reset requested; setting required flags", className);
|
||||||
string_writeconfig("/external_root/boot/flags/DO_FACTORY_RESET", "true");
|
string_writeconfig("/external_root/boot/flags/DO_FACTORY_RESET", "true");
|
||||||
string_writeconfig("/external_root/boot/flags/DIAGS_BOOT", "true");
|
string_writeconfig("/external_root/boot/flags/DIAGS_BOOT", "true");
|
||||||
QString reboot_prog ("/sbin/reboot");
|
QString reboot_prog ("/sbin/reboot");
|
||||||
|
@ -138,6 +142,7 @@ void alert::on_continue2Btn_clicked()
|
||||||
string_writeconfig("/external_root/boot/flags/ALERT", "false");
|
string_writeconfig("/external_root/boot/flags/ALERT", "false");
|
||||||
updateReset();
|
updateReset();
|
||||||
|
|
||||||
|
log("Restarting InkBox", className);
|
||||||
if(signatureError == true) {
|
if(signatureError == true) {
|
||||||
string_writeconfig("/external_root/boot/flags/ALERT_SIGN", "false");
|
string_writeconfig("/external_root/boot/flags/ALERT_SIGN", "false");
|
||||||
QProcess process;
|
QProcess process;
|
||||||
|
|
|
@ -176,9 +176,11 @@ void brightnessDialog::on_okBtn_clicked()
|
||||||
int warmthValue;
|
int warmthValue;
|
||||||
|
|
||||||
// Write brightness config
|
// Write brightness config
|
||||||
|
log("Display brightness set to " + QString::number(brightnessValue), className);
|
||||||
brightness_writeconfig(brightnessValue);
|
brightness_writeconfig(brightnessValue);
|
||||||
if(global::isN873 == true) {
|
if(global::isN873 == true) {
|
||||||
warmthValue = ui->warmthSlider->value();
|
warmthValue = ui->warmthSlider->value();
|
||||||
|
log("Display warmth set to " + QString::number(warmthValue), className);
|
||||||
warmth_writeconfig(warmthValue);
|
warmth_writeconfig(warmthValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ void dictionaryWidget::on_backBtn_clicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
void dictionaryWidget::dictionaryLookup(std::string word, QString first_letter, int position) {
|
void dictionaryWidget::dictionaryLookup(std::string word, QString first_letter, int position) {
|
||||||
|
log("Dictionary lookup requested for word '" + QString::fromStdString(word) + "', position " + QString::number(position), className);
|
||||||
QDir dictdir;
|
QDir dictdir;
|
||||||
dictdir.mkpath("/inkbox/dictionary");
|
dictdir.mkpath("/inkbox/dictionary");
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ void encryptionManager::setupPassphraseDialog() {
|
||||||
* 1: Normal behavior
|
* 1: Normal behavior
|
||||||
* 2: Repack
|
* 2: Repack
|
||||||
*/
|
*/
|
||||||
|
log("Showing passphrase dialog for mode " + QString::number(setupPassphraseDialogMode), className);
|
||||||
ui->activityWidget->hide();
|
ui->activityWidget->hide();
|
||||||
this->setStyleSheet("background-color: black");
|
this->setStyleSheet("background-color: black");
|
||||||
global::keyboard::keyboardDialog = true;
|
global::keyboard::keyboardDialog = true;
|
||||||
|
@ -142,12 +143,14 @@ void encryptionManager::setupPassphraseDialog() {
|
||||||
|
|
||||||
void encryptionManager::on_setupAbortBtn_clicked()
|
void encryptionManager::on_setupAbortBtn_clicked()
|
||||||
{
|
{
|
||||||
|
log("Aborting setup", className);
|
||||||
setDefaultWorkDir();
|
setDefaultWorkDir();
|
||||||
string_writeconfig(".config/18-encrypted_storage/status", "false");
|
string_writeconfig(".config/18-encrypted_storage/status", "false");
|
||||||
quit_restart();
|
quit_restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void encryptionManager::quit_restart() {
|
void encryptionManager::quit_restart() {
|
||||||
|
log("Restarting InkBox", className);
|
||||||
QProcess process;
|
QProcess process;
|
||||||
process.startDetached("inkbox", QStringList());
|
process.startDetached("inkbox", QStringList());
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
|
@ -166,6 +169,7 @@ void encryptionManager::showToast(QString messageToDisplay) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void encryptionManager::setupEncryptedStorage() {
|
void encryptionManager::setupEncryptedStorage() {
|
||||||
|
log("Setting up encrypted storage", className);
|
||||||
this->setStyleSheet("background-color: white");
|
this->setStyleSheet("background-color: white");
|
||||||
ui->activityWidget->show();
|
ui->activityWidget->show();
|
||||||
if(global::encfs::cancelSetup == true) {
|
if(global::encfs::cancelSetup == true) {
|
||||||
|
@ -199,6 +203,7 @@ void encryptionManager::setupEncryptedStorage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void encryptionManager::unlockEncryptedStorage() {
|
void encryptionManager::unlockEncryptedStorage() {
|
||||||
|
log("Trying to unlock encrypted storage", className);
|
||||||
if(global::encfs::cancelSetup == true) {
|
if(global::encfs::cancelSetup == true) {
|
||||||
global::encfs::cancelSetup = false;
|
global::encfs::cancelSetup = false;
|
||||||
poweroff(true);
|
poweroff(true);
|
||||||
|
@ -233,6 +238,7 @@ void encryptionManager::unlockEncryptedStorage() {
|
||||||
if(QFile::exists("/external_root/run/encfs_mounted")) {
|
if(QFile::exists("/external_root/run/encfs_mounted")) {
|
||||||
exitStatus = checkconfig("/external_root/run/encfs_mounted");
|
exitStatus = checkconfig("/external_root/run/encfs_mounted");
|
||||||
if(exitStatus == false) {
|
if(exitStatus == false) {
|
||||||
|
QString function = __func__; log(function + ": Invalid passphrase", className);
|
||||||
if(setupMessageBoxRan == false) {
|
if(setupMessageBoxRan == false) {
|
||||||
int delay = 0;
|
int delay = 0;
|
||||||
if(passphraseTries <= 3) {
|
if(passphraseTries <= 3) {
|
||||||
|
@ -281,6 +287,7 @@ void encryptionManager::unlockEncryptedStorage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void encryptionManager::mkEncfsDirs() {
|
void encryptionManager::mkEncfsDirs() {
|
||||||
|
log("Creating encrypted storage directories", className);
|
||||||
QDir encfsDir;
|
QDir encfsDir;
|
||||||
QString encfsPath("/external_root/run/encfs");
|
QString encfsPath("/external_root/run/encfs");
|
||||||
encfsDir.mkpath(encfsPath);
|
encfsDir.mkpath(encfsPath);
|
||||||
|
@ -320,6 +327,7 @@ void encryptionManager::on_failureContinueBtn_clicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
void encryptionManager::setupFailedAuthenticationMessageBox() {
|
void encryptionManager::setupFailedAuthenticationMessageBox() {
|
||||||
|
log("Showing 'Authentication failed' message box", className);
|
||||||
ui->activityWidget->hide();
|
ui->activityWidget->hide();
|
||||||
QMessageBox::critical(this, tr("Invalid argument"), tr("<font face='u001'>Invalid passphrase. Please try again.</font>"));
|
QMessageBox::critical(this, tr("Invalid argument"), tr("<font face='u001'>Invalid passphrase. Please try again.</font>"));
|
||||||
QFile::remove("/external_root/run/encfs_mounted");
|
QFile::remove("/external_root/run/encfs_mounted");
|
||||||
|
@ -335,6 +343,7 @@ void encryptionManager::on_acceptBtn_clicked()
|
||||||
|
|
||||||
void encryptionManager::on_usbmsBtn_clicked()
|
void encryptionManager::on_usbmsBtn_clicked()
|
||||||
{
|
{
|
||||||
|
log("Showing USBMS splash", className);
|
||||||
global::usbms::launchUsbms = true;
|
global::usbms::launchUsbms = true;
|
||||||
usbmsWindow = new usbms_splash();
|
usbmsWindow = new usbms_splash();
|
||||||
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -343,6 +352,7 @@ void encryptionManager::on_usbmsBtn_clicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
void encryptionManager::repackEncryptedStorage() {
|
void encryptionManager::repackEncryptedStorage() {
|
||||||
|
log("Repacking encrypted storage", className);
|
||||||
if(global::encfs::cancelSetup == true) {
|
if(global::encfs::cancelSetup == true) {
|
||||||
global::encfs::cancelSetup = false;
|
global::encfs::cancelSetup = false;
|
||||||
quit_restart();
|
quit_restart();
|
||||||
|
|
|
@ -691,6 +691,7 @@ namespace {
|
||||||
string_writeconfig(sysfsWarmthPath, warmthValueStr);
|
string_writeconfig(sysfsWarmthPath, warmthValueStr);
|
||||||
}
|
}
|
||||||
void installUpdate() {
|
void installUpdate() {
|
||||||
|
log("Installing update package", "functions");
|
||||||
string_writeconfig("/mnt/onboard/onboard/.inkbox/can_really_update", "true");
|
string_writeconfig("/mnt/onboard/onboard/.inkbox/can_really_update", "true");
|
||||||
string_writeconfig("/external_root/opt/update/will_update", "true");
|
string_writeconfig("/external_root/opt/update/will_update", "true");
|
||||||
string_writeconfig("/external_root/boot/flags/WILL_UPDATE", "true");
|
string_writeconfig("/external_root/boot/flags/WILL_UPDATE", "true");
|
||||||
|
|
|
@ -206,6 +206,7 @@ generalDialog::~generalDialog()
|
||||||
|
|
||||||
void generalDialog::on_cancelBtn_clicked()
|
void generalDialog::on_cancelBtn_clicked()
|
||||||
{
|
{
|
||||||
|
log("Cancel button clicked", className);
|
||||||
if(updateDialog == true) {
|
if(updateDialog == true) {
|
||||||
string_writeconfig("/tmp/cancelUpdateDialog", "true");
|
string_writeconfig("/tmp/cancelUpdateDialog", "true");
|
||||||
generalDialog::close();
|
generalDialog::close();
|
||||||
|
@ -253,10 +254,12 @@ void generalDialog::on_cancelBtn_clicked()
|
||||||
|
|
||||||
void generalDialog::on_okBtn_clicked()
|
void generalDialog::on_okBtn_clicked()
|
||||||
{
|
{
|
||||||
|
log("OK button clicked", className);
|
||||||
if(resetDialog == true) {
|
if(resetDialog == true) {
|
||||||
if(checkconfig("/opt/inkbox_genuine") == true) {
|
if(checkconfig("/opt/inkbox_genuine") == true) {
|
||||||
// Soft-reset the device
|
// Soft-reset the device
|
||||||
// We set a custom boot flag and reboot silently in Diagnostics
|
// We set a custom boot flag and reboot silently in Diagnostics
|
||||||
|
log("Setting up the device for soft-reset", className);
|
||||||
string_writeconfig("/external_root/boot/flags/DIAGS_BOOT", "true");
|
string_writeconfig("/external_root/boot/flags/DIAGS_BOOT", "true");
|
||||||
string_writeconfig("/external_root/boot/flags/DO_SOFT_RESET", "true");
|
string_writeconfig("/external_root/boot/flags/DO_SOFT_RESET", "true");
|
||||||
reboot(false);
|
reboot(false);
|
||||||
|
@ -264,6 +267,7 @@ void generalDialog::on_okBtn_clicked()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Restore default settings, we're not on InkBox OS
|
// Restore default settings, we're not on InkBox OS
|
||||||
|
log("Restoring default settings", className);
|
||||||
QString prog ("sh");
|
QString prog ("sh");
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << "reset-config.sh";
|
args << "reset-config.sh";
|
||||||
|
@ -297,6 +301,7 @@ void generalDialog::on_okBtn_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(usbmsDialog == true) {
|
if(usbmsDialog == true) {
|
||||||
|
log("Showing USBMS splash", className);
|
||||||
global::usbms::usbmsDialog = false;
|
global::usbms::usbmsDialog = false;
|
||||||
global::usbms::launchUsbms = true;
|
global::usbms::launchUsbms = true;
|
||||||
|
|
||||||
|
@ -343,6 +348,7 @@ void generalDialog::on_okBtn_clicked()
|
||||||
onboardPath = "/mnt/onboard/";
|
onboardPath = "/mnt/onboard/";
|
||||||
}
|
}
|
||||||
QDirIterator dirIt(onboardPath, QDirIterator::Subdirectories);
|
QDirIterator dirIt(onboardPath, QDirIterator::Subdirectories);
|
||||||
|
log("Searching local storage for '" + global::keyboard::keyboardText + "'", className);
|
||||||
while(dirIt.hasNext()) {
|
while(dirIt.hasNext()) {
|
||||||
dirIt.next();
|
dirIt.next();
|
||||||
if(QFileInfo(dirIt.filePath()).isFile()) {
|
if(QFileInfo(dirIt.filePath()).isFile()) {
|
||||||
|
@ -356,6 +362,7 @@ void generalDialog::on_okBtn_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!storageSearchResults.isEmpty()) {
|
if(!storageSearchResults.isEmpty()) {
|
||||||
|
log("Displaying search results", className);
|
||||||
for(int i = ui->mainStackedWidget->count(); i >= 0; i--) {
|
for(int i = ui->mainStackedWidget->count(); i >= 0; i--) {
|
||||||
QWidget * widget = ui->mainStackedWidget->widget(i);
|
QWidget * widget = ui->mainStackedWidget->widget(i);
|
||||||
ui->mainStackedWidget->removeWidget(widget);
|
ui->mainStackedWidget->removeWidget(widget);
|
||||||
|
@ -372,6 +379,7 @@ void generalDialog::on_okBtn_clicked()
|
||||||
ui->mainStackedWidget->insertWidget(1, searchResultsWidgetWindow);
|
ui->mainStackedWidget->insertWidget(1, searchResultsWidgetWindow);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
log("No search results found", className);
|
||||||
global::toast::delay = 3000;
|
global::toast::delay = 3000;
|
||||||
emit showToast("No results found");
|
emit showToast("No results found");
|
||||||
keyboardWidget->clearLineEdit();
|
keyboardWidget->clearLineEdit();
|
||||||
|
@ -381,6 +389,7 @@ void generalDialog::on_okBtn_clicked()
|
||||||
else if(ui->searchComboBox->currentText() == "Online library") {
|
else if(ui->searchComboBox->currentText() == "Online library") {
|
||||||
if(testPing() == 0 or global::deviceID == "emu\n") {
|
if(testPing() == 0 or global::deviceID == "emu\n") {
|
||||||
string_writeconfig("/inkbox/searchComboBoxFunction", "Online library");
|
string_writeconfig("/inkbox/searchComboBoxFunction", "Online library");
|
||||||
|
log("Searching online library for '" + global::keyboard::keyboardText + "'", className);
|
||||||
|
|
||||||
if(!readFile("/external_root/opt/storage/gutenberg/last_sync").isEmpty()) {
|
if(!readFile("/external_root/opt/storage/gutenberg/last_sync").isEmpty()) {
|
||||||
unsigned long currentEpoch = QDateTime::currentSecsSinceEpoch();
|
unsigned long currentEpoch = QDateTime::currentSecsSinceEpoch();
|
||||||
|
@ -426,6 +435,7 @@ void generalDialog::on_okBtn_clicked()
|
||||||
}
|
}
|
||||||
else if(global::keyboard::vncDialog == true) {
|
else if(global::keyboard::vncDialog == true) {
|
||||||
if(!global::keyboard::keyboardText.isEmpty()) {
|
if(!global::keyboard::keyboardText.isEmpty()) {
|
||||||
|
log("Gathering VNC connection information", className);
|
||||||
if(vncServerSet != true) {
|
if(vncServerSet != true) {
|
||||||
vncServerAddress = global::keyboard::keyboardText;
|
vncServerAddress = global::keyboard::keyboardText;
|
||||||
vncServerSet = true;
|
vncServerSet = true;
|
||||||
|
@ -453,6 +463,7 @@ void generalDialog::on_okBtn_clicked()
|
||||||
}
|
}
|
||||||
else if(global::keyboard::wifiPassphraseDialog == true) {
|
else if(global::keyboard::wifiPassphraseDialog == true) {
|
||||||
if(!global::keyboard::keyboardText.isEmpty()) {
|
if(!global::keyboard::keyboardText.isEmpty()) {
|
||||||
|
log("Attempting connection to Wi-Fi network '" + wifiEssid + "'", className);
|
||||||
this->hide();
|
this->hide();
|
||||||
wifiPassphrase = global::keyboard::keyboardText;
|
wifiPassphrase = global::keyboard::keyboardText;
|
||||||
global::toast::indefiniteToast = true;
|
global::toast::indefiniteToast = true;
|
||||||
|
@ -492,12 +503,14 @@ void generalDialog::on_okBtn_clicked()
|
||||||
}
|
}
|
||||||
if(global::encfs::repackDialog == true) {
|
if(global::encfs::repackDialog == true) {
|
||||||
global::encfs::repackDialog = false;
|
global::encfs::repackDialog = false;
|
||||||
|
log("Encrypted storage repack requested", className);
|
||||||
string_writeconfig("/external_root/run/encfs_repack", "true");
|
string_writeconfig("/external_root/run/encfs_repack", "true");
|
||||||
quit_restart();
|
quit_restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void generalDialog::on_acceptBtn_clicked()
|
void generalDialog::on_acceptBtn_clicked()
|
||||||
{
|
{
|
||||||
|
log("OK button clicked", className);
|
||||||
if(lowBatteryDialog == true) {
|
if(lowBatteryDialog == true) {
|
||||||
global::mainwindow::lowBatteryDialog = false;
|
global::mainwindow::lowBatteryDialog = false;
|
||||||
global::battery::batteryAlertLock = false;
|
global::battery::batteryAlertLock = false;
|
||||||
|
@ -579,6 +592,7 @@ void generalDialog::refreshScreenNative() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void generalDialog::startVNC(QString server, QString password, QString port) {
|
void generalDialog::startVNC(QString server, QString password, QString port) {
|
||||||
|
log("Launching VNC viewer", className);
|
||||||
std::string server_str = server.toStdString();
|
std::string server_str = server.toStdString();
|
||||||
std::string password_str = password.toStdString();
|
std::string password_str = password.toStdString();
|
||||||
std::string port_str = port.toStdString();
|
std::string port_str = port.toStdString();
|
||||||
|
@ -630,6 +644,7 @@ void generalDialog::closeIndefiniteToastNative() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void generalDialog::quit_restart() {
|
void generalDialog::quit_restart() {
|
||||||
|
log("Restarting InkBox", className);
|
||||||
// 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");
|
||||||
|
|
||||||
|
@ -640,6 +655,7 @@ void generalDialog::quit_restart() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void generalDialog::syncGutenbergCatalog() {
|
void generalDialog::syncGutenbergCatalog() {
|
||||||
|
log("Syncing Gutenberg catalog", className);
|
||||||
global::toast::modalToast = true;
|
global::toast::modalToast = true;
|
||||||
global::toast::indefiniteToast = true;
|
global::toast::indefiniteToast = true;
|
||||||
emit showToast("Sync in progress");
|
emit showToast("Sync in progress");
|
||||||
|
|
|
@ -123,10 +123,12 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
||||||
dpModeSetting = "windowed";
|
dpModeSetting = "windowed";
|
||||||
|
|
||||||
if(itemText == "Netsurf") {
|
if(itemText == "Netsurf") {
|
||||||
|
log("Launching KoBox app: NetSurf", className);
|
||||||
// Bypass standard shell script launch shenanigans
|
// Bypass standard shell script launch shenanigans
|
||||||
string_writeconfig("/external_root/tmp/X_program", "!netsurf");
|
string_writeconfig("/external_root/tmp/X_program", "!netsurf");
|
||||||
}
|
}
|
||||||
else if(itemText == "KTerm") {
|
else if(itemText == "KTerm") {
|
||||||
|
log("Launching KoBox app: KTerm", className);
|
||||||
string_writeconfig("/external_root/tmp/X_program", "/usr/local/bin/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";
|
||||||
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") {
|
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") {
|
||||||
|
@ -146,9 +148,11 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(itemText == "Geany") {
|
else if(itemText == "Geany") {
|
||||||
|
log("Launching KoBox app: Geany", className);
|
||||||
string_writeconfig("/external_root/tmp/X_program", "geany");
|
string_writeconfig("/external_root/tmp/X_program", "geany");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
log("Launching KoBox app: " + itemText, className);
|
||||||
QString itemTextLower = itemText.toLower();
|
QString itemTextLower = itemText.toLower();
|
||||||
std::string app = itemTextLower.toStdString();
|
std::string app = itemTextLower.toStdString();
|
||||||
string_writeconfig("/external_root/tmp/X_program", app);
|
string_writeconfig("/external_root/tmp/X_program", app);
|
||||||
|
@ -161,6 +165,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
||||||
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
|
||||||
|
log("Showing USBMS splash", className);
|
||||||
usbmsSplashWindow = new usbms_splash();
|
usbmsSplashWindow = new usbms_splash();
|
||||||
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()));
|
||||||
|
|
|
@ -80,6 +80,7 @@ void koboxSettings::on_checkBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
if(not_user_change != true) {
|
if(not_user_change != true) {
|
||||||
|
log("Enabling KoBox subsystem", className);
|
||||||
string_writeconfig("/external_root/boot/flags/X11_START", "true");
|
string_writeconfig("/external_root/boot/flags/X11_START", "true");
|
||||||
openSettingsRebootDialog();
|
openSettingsRebootDialog();
|
||||||
}
|
}
|
||||||
|
@ -88,6 +89,7 @@ void koboxSettings::on_checkBox_toggled(bool checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
log("Disabling KoBox subsystem", className);
|
||||||
string_writeconfig("/external_root/boot/flags/X11_START", "false");
|
string_writeconfig("/external_root/boot/flags/X11_START", "false");
|
||||||
openSettingsRebootDialog();
|
openSettingsRebootDialog();
|
||||||
}
|
}
|
||||||
|
@ -110,6 +112,7 @@ void koboxSettings::on_spinBox_valueChanged(int arg1)
|
||||||
QString number = QString::number(arg1);
|
QString number = QString::number(arg1);
|
||||||
string number_str = number.toStdString();
|
string number_str = number.toStdString();
|
||||||
string_writeconfig(".config/00-kobox/dpiSetting", number_str);
|
string_writeconfig(".config/00-kobox/dpiSetting", number_str);
|
||||||
|
log("X11 DPI set to " + number, className);
|
||||||
}
|
}
|
||||||
|
|
||||||
void koboxSettings::on_pushButton_clicked()
|
void koboxSettings::on_pushButton_clicked()
|
||||||
|
@ -119,6 +122,8 @@ void koboxSettings::on_pushButton_clicked()
|
||||||
global::usbms::launchUsbms = true;
|
global::usbms::launchUsbms = true;
|
||||||
global::usbms::koboxExportExtensions = true;
|
global::usbms::koboxExportExtensions = true;
|
||||||
|
|
||||||
|
log("Exporting KoBox extensions onboard storage via USB", className);
|
||||||
|
log("Showing USBMS splash", className);
|
||||||
usbmsWindow = new usbms_splash();
|
usbmsWindow = new usbms_splash();
|
||||||
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()));
|
||||||
|
|
1
main.cpp
1
main.cpp
|
@ -49,6 +49,7 @@ int main(int argc, char *argv[])
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
else if(checkconfig("/external_root/run/encfs_mounted") == true and checkconfig("/external_root/run/encfs_repack") == true) {
|
else if(checkconfig("/external_root/run/encfs_mounted") == true and checkconfig("/external_root/run/encfs_repack") == true) {
|
||||||
|
log("Launching encryptionManager", "main");
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
encryptionManager w;
|
encryptionManager w;
|
||||||
const QScreen * screen = qApp->primaryScreen();
|
const QScreen * screen = qApp->primaryScreen();
|
||||||
|
|
|
@ -949,6 +949,7 @@ bool reader::epub_file_match(QString file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void reader::dictionary_lookup(string word, QString first_letter, int position) {
|
void reader::dictionary_lookup(string word, QString first_letter, int position) {
|
||||||
|
log("Dictionary lookup requested for word '" + QString::fromStdString(word) + "', position " + QString::number(position), className);
|
||||||
ofstream fhandler;
|
ofstream fhandler;
|
||||||
fhandler.open("/inkbox/dictionary/word");
|
fhandler.open("/inkbox/dictionary/word");
|
||||||
fhandler << word;
|
fhandler << word;
|
||||||
|
|
|
@ -55,7 +55,7 @@ settings::settings(QWidget *parent) :
|
||||||
ui->generateSystemReportBtn->setStyleSheet("font-size: 9pt");
|
ui->generateSystemReportBtn->setStyleSheet("font-size: 9pt");
|
||||||
ui->checkOtaUpdateBtn->setStyleSheet("font-size: 9pt");
|
ui->checkOtaUpdateBtn->setStyleSheet("font-size: 9pt");
|
||||||
ui->comboBox->setStyleSheet("font-size: 9pt");
|
ui->comboBox->setStyleSheet("font-size: 9pt");
|
||||||
ui->tzComboBox->setStyleSheet("font-size: 8.5pt");
|
ui->tzComboBox->setStyleSheet("font-size: 9pt");
|
||||||
ui->sleepTimeoutComboBox->setStyleSheet("font-size: 9pt");
|
ui->sleepTimeoutComboBox->setStyleSheet("font-size: 9pt");
|
||||||
ui->setPasscodeBtn->setStyleSheet("font-size: 9pt");
|
ui->setPasscodeBtn->setStyleSheet("font-size: 9pt");
|
||||||
ui->repackBtn->setStyleSheet("font-size: 9pt");
|
ui->repackBtn->setStyleSheet("font-size: 9pt");
|
||||||
|
@ -952,6 +952,7 @@ void settings::on_enableEncryptedStorageCheckBox_toggled(bool checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
void settings::disableStorageEncryption() {
|
void settings::disableStorageEncryption() {
|
||||||
|
log("Disabling encrypted storage", className);
|
||||||
setDefaultWorkDir();
|
setDefaultWorkDir();
|
||||||
string_writeconfig("/external_root/run/encfs_stop_cleanup", "true");
|
string_writeconfig("/external_root/run/encfs_stop_cleanup", "true");
|
||||||
string_writeconfig("/opt/ibxd", "encfs_stop\n");
|
string_writeconfig("/opt/ibxd", "encfs_stop\n");
|
||||||
|
@ -993,6 +994,7 @@ void settings::on_repackBtn_clicked()
|
||||||
|
|
||||||
void settings::on_generateSystemReportBtn_clicked()
|
void settings::on_generateSystemReportBtn_clicked()
|
||||||
{
|
{
|
||||||
|
log("Generating system report", className);
|
||||||
string_writeconfig("/opt/ibxd", "generate_system_report\n");
|
string_writeconfig("/opt/ibxd", "generate_system_report\n");
|
||||||
while(true) {
|
while(true) {
|
||||||
if(QFile::exists("/inkbox/systemReportDone")) {
|
if(QFile::exists("/inkbox/systemReportDone")) {
|
||||||
|
@ -1014,11 +1016,14 @@ void settings::on_tzComboBox_currentTextChanged(const QString &arg1)
|
||||||
timezone_not_user_change = false;
|
timezone_not_user_change = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
log("Setting timezone to " + arg1, className);
|
||||||
setDefaultWorkDir();
|
setDefaultWorkDir();
|
||||||
// Preventing unnecessary (e)MMC writes
|
// Preventing unnecessary (e)MMC writes
|
||||||
if(readFile(".config/19-timezone/config-name") != arg1) {
|
if(readFile(".config/19-timezone/config-name") != arg1) {
|
||||||
QProcess::execute("ln", QStringList() << "-sf" << "/usr/share/zoneinfo/" + arg1 << ".config/19-timezone/config");
|
QProcess::execute("ln", QStringList() << "-sf" << "/usr/share/zoneinfo/" + arg1 << ".config/19-timezone/config");
|
||||||
string_writeconfig(".config/19-timezone/config-name", arg1.toStdString());
|
string_writeconfig(".config/19-timezone/config-name", arg1.toStdString());
|
||||||
|
string_writeconfig("/opt/ibxd", "gui_remount_localtime\n");
|
||||||
|
QThread::msleep(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>463</width>
|
<width>457</width>
|
||||||
<height>632</height>
|
<height>657</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
@ -1054,7 +1054,7 @@
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_11">
|
<widget class="QLabel" name="label_11">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Timezone (reboot req.)</string>
|
<string>Timezone</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in a new issue