mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-28 08:37: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();
|
config.close();
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
void setDefaultWorkDir() {
|
||||||
|
QDir::setCurrent("/mnt/onboard/.adds/inkbox");
|
||||||
|
}
|
||||||
int brightness_checkconfig(QString file) {
|
int brightness_checkconfig(QString file) {
|
||||||
QFile config(file);
|
QFile config(file);
|
||||||
config.open(QIODevice::ReadWrite);
|
config.open(QIODevice::ReadWrite);
|
||||||
|
@ -306,8 +309,16 @@ namespace {
|
||||||
|
|
||||||
kernelVersion = proc->readAllStandardOutput();
|
kernelVersion = proc->readAllStandardOutput();
|
||||||
kernelVersion = kernelVersion.trimmed();
|
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);
|
QThread::msleep(100);
|
||||||
|
|
||||||
string_checkconfig_ro("/external_root/run/build_id");
|
string_checkconfig_ro("/external_root/run/build_id");
|
||||||
QString kernelBuildID = checkconfig_str_val.trimmed();
|
QString kernelBuildID = checkconfig_str_val.trimmed();
|
||||||
kernelVersion.append(", build ");
|
kernelVersion.append(", build ");
|
||||||
|
@ -333,9 +344,6 @@ namespace {
|
||||||
global::kobox::resetKoboxUserDataBool = true;
|
global::kobox::resetKoboxUserDataBool = true;
|
||||||
reboot(true);
|
reboot(true);
|
||||||
}
|
}
|
||||||
void setDefaultWorkDir() {
|
|
||||||
QDir::setCurrent("/mnt/onboard/.adds/inkbox");
|
|
||||||
}
|
|
||||||
QString findEpubMetadata(QString book_file, QString metadata) {
|
QString findEpubMetadata(QString book_file, QString metadata) {
|
||||||
setDefaultWorkDir();
|
setDefaultWorkDir();
|
||||||
QString prog ("sh");
|
QString prog ("sh");
|
||||||
|
|
|
@ -97,8 +97,18 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
||||||
// DPI setting
|
// DPI setting
|
||||||
string_checkconfig(".config/00-kobox/dpiSetting");
|
string_checkconfig(".config/00-kobox/dpiSetting");
|
||||||
if(checkconfig_str_val == "") {
|
if(checkconfig_str_val == "") {
|
||||||
|
string_checkconfig_ro("/opt/inkbox_device\n");
|
||||||
|
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||||
dpiSetting = "125";
|
dpiSetting = "125";
|
||||||
}
|
}
|
||||||
|
else if(checkconfig_str_val == "n613\n") {
|
||||||
|
dpiSetting = "175";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dpiSetting = "125";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
dpiSetting = checkconfig_str_val.toStdString();
|
dpiSetting = checkconfig_str_val.toStdString();
|
||||||
}
|
}
|
||||||
|
@ -114,8 +124,16 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
||||||
else if(itemText == "KTerm") {
|
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");
|
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";
|
||||||
|
string_checkconfig_ro("/opt/inkbox_device");
|
||||||
|
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||||
dpiSetting = "175";
|
dpiSetting = "175";
|
||||||
}
|
}
|
||||||
|
else if(checkconfig_str_val == "n613\n")
|
||||||
|
dpiSetting = "225";
|
||||||
|
else {
|
||||||
|
dpiSetting = "175";
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(itemText == "Geany") {
|
else if(itemText == "Geany") {
|
||||||
string_writeconfig("/external_root/tmp/X_program", "geany");
|
string_writeconfig("/external_root/tmp/X_program", "geany");
|
||||||
}
|
}
|
||||||
|
|
|
@ -832,6 +832,9 @@ void reader::on_brightnessDecBtn_clicked()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
int set_bval = bval - 1;
|
int set_bval = bval - 1;
|
||||||
|
if(set_bval < 0) {
|
||||||
|
set_bval = 0;
|
||||||
|
}
|
||||||
pre_set_brightness(set_bval);
|
pre_set_brightness(set_bval);
|
||||||
brightness_writeconfig(set_bval);
|
brightness_writeconfig(set_bval);
|
||||||
|
|
||||||
|
@ -853,6 +856,9 @@ void reader::on_brightnessIncBtn_clicked()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
int set_bval = bval + 1;
|
int set_bval = bval + 1;
|
||||||
|
if(set_bval > 100) {
|
||||||
|
set_bval = 100;
|
||||||
|
}
|
||||||
pre_set_brightness(set_bval);
|
pre_set_brightness(set_bval);
|
||||||
brightness_writeconfig(set_bval);
|
brightness_writeconfig(set_bval);
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,10 @@ settingsChooser::settingsChooser(QWidget *parent) :
|
||||||
ui->inkboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
|
ui->inkboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
|
||||||
ui->koboxSettingsBtn->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 {
|
else {
|
||||||
ui->inkboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left");
|
ui->inkboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left");
|
||||||
ui->koboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left");
|
ui->koboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left");
|
||||||
|
|
Loading…
Reference in a new issue