mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 23:57:22 -08:00
More Glo-related new things
This commit is contained in:
parent
9364993b15
commit
a6db457599
4 changed files with 42 additions and 6 deletions
16
functions.h
16
functions.h
|
@ -106,6 +106,9 @@ namespace {
|
|||
config.close();
|
||||
return 0;
|
||||
};
|
||||
void setDefaultWorkDir() {
|
||||
QDir::setCurrent("/mnt/onboard/.adds/inkbox");
|
||||
}
|
||||
int brightness_checkconfig(QString file) {
|
||||
QFile config(file);
|
||||
config.open(QIODevice::ReadWrite);
|
||||
|
@ -306,8 +309,16 @@ namespace {
|
|||
|
||||
kernelVersion = proc->readAllStandardOutput();
|
||||
kernelVersion = kernelVersion.trimmed();
|
||||
string_writeconfig("get_kernel_build_id", "/external_root/run/initrd-fifo");
|
||||
|
||||
setDefaultWorkDir();
|
||||
QString fifo_prog("sh");
|
||||
QStringList fifo_args;
|
||||
fifo_args << "get_kernel_build_id.sh";
|
||||
QProcess *fifo_proc = new QProcess();
|
||||
fifo_proc->start(fifo_prog, fifo_args);
|
||||
fifo_proc->waitForFinished();
|
||||
QThread::msleep(100);
|
||||
|
||||
string_checkconfig_ro("/external_root/run/build_id");
|
||||
QString kernelBuildID = checkconfig_str_val.trimmed();
|
||||
kernelVersion.append(", build ");
|
||||
|
@ -333,9 +344,6 @@ namespace {
|
|||
global::kobox::resetKoboxUserDataBool = true;
|
||||
reboot(true);
|
||||
}
|
||||
void setDefaultWorkDir() {
|
||||
QDir::setCurrent("/mnt/onboard/.adds/inkbox");
|
||||
}
|
||||
QString findEpubMetadata(QString book_file, QString metadata) {
|
||||
setDefaultWorkDir();
|
||||
QString prog ("sh");
|
||||
|
|
|
@ -97,7 +97,17 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
|||
// DPI setting
|
||||
string_checkconfig(".config/00-kobox/dpiSetting");
|
||||
if(checkconfig_str_val == "") {
|
||||
dpiSetting = "125";
|
||||
string_checkconfig_ro("/opt/inkbox_device\n");
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||
dpiSetting = "125";
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
dpiSetting = "175";
|
||||
}
|
||||
else {
|
||||
dpiSetting = "125";
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
dpiSetting = checkconfig_str_val.toStdString();
|
||||
|
@ -114,7 +124,15 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
|||
else if(itemText == "KTerm") {
|
||||
string_writeconfig("/external_root/tmp/X_program", "/usr/local/bin/kterm -l /usr/local/share/kterm/layouts/keyboard-kt.xml -k 1");
|
||||
dpModeSetting = "fullscreen";
|
||||
dpiSetting = "175";
|
||||
string_checkconfig_ro("/opt/inkbox_device");
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||
dpiSetting = "175";
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n")
|
||||
dpiSetting = "225";
|
||||
else {
|
||||
dpiSetting = "175";
|
||||
}
|
||||
}
|
||||
else if(itemText == "Geany") {
|
||||
string_writeconfig("/external_root/tmp/X_program", "geany");
|
||||
|
|
|
@ -832,6 +832,9 @@ void reader::on_brightnessDecBtn_clicked()
|
|||
;
|
||||
}
|
||||
int set_bval = bval - 1;
|
||||
if(set_bval < 0) {
|
||||
set_bval = 0;
|
||||
}
|
||||
pre_set_brightness(set_bval);
|
||||
brightness_writeconfig(set_bval);
|
||||
|
||||
|
@ -853,6 +856,9 @@ void reader::on_brightnessIncBtn_clicked()
|
|||
;
|
||||
}
|
||||
int set_bval = bval + 1;
|
||||
if(set_bval > 100) {
|
||||
set_bval = 100;
|
||||
}
|
||||
pre_set_brightness(set_bval);
|
||||
brightness_writeconfig(set_bval);
|
||||
|
||||
|
|
|
@ -46,6 +46,10 @@ settingsChooser::settingsChooser(QWidget *parent) :
|
|||
ui->inkboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
|
||||
ui->koboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
ui->inkboxSettingsBtn->setStyleSheet("padding: 25px; Text-align: left");
|
||||
ui->koboxSettingsBtn->setStyleSheet("padding:25px; Text-align: left");
|
||||
}
|
||||
else {
|
||||
ui->inkboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left");
|
||||
ui->koboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left");
|
||||
|
|
Loading…
Reference in a new issue