From ac9c5b1a47feca18988b09d15a1088222842c322 Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Sun, 16 May 2021 22:28:08 -0400 Subject: [PATCH] Check device info in read-only mode --- mainwindow.cpp | 2 +- reader.cpp | 4 ++-- settings.cpp | 10 +++++----- settingschooser.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 7d478c1..e9834ed 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -65,7 +65,7 @@ MainWindow::MainWindow(QWidget *parent) sH = QGuiApplication::screens()[0]->size().height(); // Defining what the default icon size will be - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n") { stdIconWidth = sW / 12; stdIconHeight = sH / 12; diff --git a/reader.cpp b/reader.cpp index 3e2cdf4..2601e07 100644 --- a/reader.cpp +++ b/reader.cpp @@ -872,7 +872,7 @@ void reader::menubar_show() { ui->menuBarWidget->setVisible(true); ui->statusBarWidget->setVisible(true); - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") { ; } @@ -891,7 +891,7 @@ void reader::menubar_show() { } void reader::menubar_hide() { - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") { ui->brightnessWidget->setVisible(false); } diff --git a/settings.cpp b/settings.cpp index f8a0ec5..0a7f943 100644 --- a/settings.cpp +++ b/settings.cpp @@ -101,7 +101,7 @@ settings::settings(QWidget *parent) : else { int dpi_number = checkconfig_str_val.toInt(); // Checking if it's a Mini or a Touch - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n") { if(dpi_number == 187) { ui->uiScalingSlider->setValue(0); @@ -498,7 +498,7 @@ void settings::on_darkModeCheckBox_toggled(bool checked) void settings::on_uiScalingSlider_valueChanged(int value) { if(value == 0) { - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n") { string_writeconfig(".config/09-dpi/config", "187"); } @@ -507,7 +507,7 @@ void settings::on_uiScalingSlider_valueChanged(int value) } } if(value == 1) { - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n") { string_writeconfig(".config/09-dpi/config", "214"); } @@ -516,7 +516,7 @@ void settings::on_uiScalingSlider_valueChanged(int value) } } if(value == 2) { - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n") { string_writeconfig(".config/09-dpi/config", "227"); } @@ -614,7 +614,7 @@ void settings::on_enableUiScalingCheckBox_toggled(bool checked) { if(checked == true) { // Writing default value depending on the device - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n") { string_writeconfig(".config/09-dpi/config", "187"); } diff --git a/settingschooser.cpp b/settingschooser.cpp index d8a3c99..f4f508a 100644 --- a/settingschooser.cpp +++ b/settingschooser.cpp @@ -28,7 +28,7 @@ settingsChooser::settingsChooser(QWidget *parent) : sH = QGuiApplication::screens()[0]->size().height(); // Defining what the default icon size will be - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n") { homeIconWidth = sW / 18; homeIconHeight = sW / 18; @@ -41,7 +41,7 @@ settingsChooser::settingsChooser(QWidget *parent) : ui->inkboxSettingsBtn->setProperty("type", "borderless"); ui->koboxSettingsBtn->setProperty("type", "borderless"); - string_checkconfig("/opt/inkbox_device"); + string_checkconfig_ro("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") { ui->inkboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left"); ui->koboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");