Add skip usb detect / start rework system to qprocess
This commit is contained in:
parent
ea285c84b0
commit
f3fe0e7e77
@ -29,6 +29,7 @@
|
||||
#include <QFont>
|
||||
#include <QScreen>
|
||||
#include <QRect>
|
||||
#include <QProcess>
|
||||
|
||||
namespace f1x
|
||||
{
|
||||
@ -425,22 +426,21 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
||||
}
|
||||
|
||||
// Load configured brightness values
|
||||
system("/usr/local/bin/autoapp_helper getbrightnessvalues");
|
||||
QProcess processbrigthness;
|
||||
processbrigthness.start("/usr/local/bin/autoapp_helper getbrightnessvalues");
|
||||
processbrigthness.waitForFinished();
|
||||
QString brigthness = processbrigthness.readAllStandardOutput();
|
||||
brigthness.resize(brigthness.size()-1); // remove last line break
|
||||
QStringList brigthnessvalues = brigthness.split("#");
|
||||
|
||||
// read brightness slider attribs
|
||||
QFile paramFile(QString("/tmp/br_values"));
|
||||
paramFile.open(QIODevice::ReadOnly);
|
||||
QTextStream data_param(¶mFile);
|
||||
QStringList getparams = data_param.readAll().split("#");
|
||||
paramFile.close();
|
||||
// set brightness slider attribs
|
||||
ui_->horizontalSliderBrightness->setMinimum(getparams[0].toInt());
|
||||
ui_->horizontalSliderBrightness->setMaximum(getparams[1].toInt());
|
||||
ui_->horizontalSliderBrightness->setSingleStep(getparams[2].toInt());
|
||||
ui_->horizontalSliderBrightness->setTickInterval(getparams[2].toInt());
|
||||
ui_->horizontalSliderBrightness->setMinimum(brigthnessvalues[0].toInt());
|
||||
ui_->horizontalSliderBrightness->setMaximum(brigthnessvalues[1].toInt());
|
||||
ui_->horizontalSliderBrightness->setSingleStep(brigthnessvalues[2].toInt());
|
||||
ui_->horizontalSliderBrightness->setTickInterval(brigthnessvalues[2].toInt());
|
||||
|
||||
// run monitor for custom brightness command if enabled in crankshaft_env.sh
|
||||
if (getparams[3] == "1") {
|
||||
if (brigthnessvalues[3] == "1") {
|
||||
ui_->pushButtonBrightness->show();
|
||||
this->customBrightnessControl = true;
|
||||
system("/usr/local/bin/autoapp_helper startcustombrightness &");
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <QTextStream>
|
||||
#include <string>
|
||||
#include <QDateTime>
|
||||
#include <QProcess>
|
||||
|
||||
namespace f1x
|
||||
{
|
||||
@ -257,6 +258,12 @@ void SettingsWindow::onSave()
|
||||
params.append("0");
|
||||
}
|
||||
params.append("#");
|
||||
if (ui_->radioButtonUSBDetectEnabled->isChecked()) {
|
||||
params.append("1");
|
||||
} else {
|
||||
params.append("0");
|
||||
}
|
||||
params.append("#");
|
||||
|
||||
system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str());
|
||||
|
||||
@ -440,17 +447,13 @@ void SettingsWindow::syncNTPTime()
|
||||
|
||||
void SettingsWindow::loadSystemValues()
|
||||
{
|
||||
// Generate param file
|
||||
system("/usr/local/bin/autoapp_helper getparams");
|
||||
QProcess process;
|
||||
process.start("/usr/local/bin/autoapp_helper getparams");
|
||||
process.waitForFinished();
|
||||
QString output = process.readAllStandardOutput();
|
||||
output.resize(output.size()-1); // remove last line break
|
||||
QStringList getparams = output.split("#");
|
||||
|
||||
// read param file
|
||||
QFileInfo paramFile("/tmp/return_value");
|
||||
if (paramFile.exists()) {
|
||||
QFile paramFile(QString("/tmp/return_value"));
|
||||
paramFile.open(QIODevice::ReadOnly);
|
||||
QTextStream data_param(¶mFile);
|
||||
QStringList getparams = data_param.readAll().split("#");
|
||||
paramFile.close();
|
||||
// version string
|
||||
ui_->valueSystemVersion->setText(getparams[0]);
|
||||
// date string
|
||||
@ -500,45 +503,33 @@ void SettingsWindow::loadSystemValues()
|
||||
// set cpu temp
|
||||
ui_->valueSystemCPUTemp->setText(getparams[20]);
|
||||
|
||||
QFileInfo inputsFile("/tmp/get_inputs");
|
||||
if (inputsFile.exists()) {
|
||||
QFile inputsFile(QString("/tmp/get_inputs"));
|
||||
inputsFile.open(QIODevice::ReadOnly);
|
||||
QTextStream data_return(&inputsFile);
|
||||
QStringList inputs = data_return.readAll().split("\n");
|
||||
inputsFile.close();
|
||||
int cleaner = ui_->comboBoxPulseInput->count();
|
||||
while (cleaner > -1) {
|
||||
ui_->comboBoxPulseInput->removeItem(cleaner);
|
||||
cleaner--;
|
||||
}
|
||||
int indexin = inputs.count();
|
||||
int countin = 0;
|
||||
while (countin < indexin-1) {
|
||||
ui_->comboBoxPulseInput->addItem(inputs[countin]);
|
||||
countin++;
|
||||
}
|
||||
}
|
||||
QProcess processinput;
|
||||
processinput.start("/usr/local/bin/autoapp_helper getinputs");
|
||||
processinput.waitForFinished();
|
||||
QString inputs = processinput.readAllStandardOutput();
|
||||
inputs.resize(inputs.size()-1); // remove last line break
|
||||
QStringList inputdevices = inputs.split("\n");
|
||||
|
||||
QFileInfo outputsFile("/tmp/get_outputs");
|
||||
if (outputsFile.exists()) {
|
||||
QFile outputsFile(QString("/tmp/get_outputs"));
|
||||
outputsFile.open(QIODevice::ReadOnly);
|
||||
QTextStream data_return(&outputsFile);
|
||||
QStringList outputs = data_return.readAll().split("\n");
|
||||
outputsFile.close();
|
||||
int cleaner = ui_->comboBoxPulseOutput->count();
|
||||
while (cleaner > -1) {
|
||||
ui_->comboBoxPulseOutput->removeItem(cleaner);
|
||||
cleaner--;
|
||||
}
|
||||
int indexout = outputs.count();
|
||||
int countout = 0;
|
||||
while (countout < indexout-1) {
|
||||
ui_->comboBoxPulseOutput->addItem(outputs[countout]);
|
||||
countout++;
|
||||
int cleanerin = ui_->comboBoxPulseInput->count();
|
||||
while (cleanerin > -1) {
|
||||
ui_->comboBoxPulseInput->removeItem(cleanerin);
|
||||
cleanerin--;
|
||||
}
|
||||
ui_->comboBoxPulseInput->addItems(inputdevices);
|
||||
|
||||
QProcess processoutput;
|
||||
processoutput.start("/usr/local/bin/autoapp_helper getoutputs");
|
||||
processoutput.waitForFinished();
|
||||
QString outputs = processoutput.readAllStandardOutput();
|
||||
outputs.resize(outputs.size()-1); // remove last line break
|
||||
QStringList outputdevices = outputs.split("\n");
|
||||
|
||||
int cleanerout = ui_->comboBoxPulseOutput->count();
|
||||
while (cleanerout > -1) {
|
||||
ui_->comboBoxPulseOutput->removeItem(cleanerout);
|
||||
cleanerout--;
|
||||
}
|
||||
ui_->comboBoxPulseOutput->addItems(outputdevices);
|
||||
|
||||
QFileInfo defaultoutputFile("/tmp/get_default_output");
|
||||
if (defaultoutputFile.exists()) {
|
||||
@ -694,8 +685,13 @@ void SettingsWindow::loadSystemValues()
|
||||
} else {
|
||||
ui_->checkBoxBluetoothAutoPair->setChecked(false);
|
||||
}
|
||||
// set timezone
|
||||
// set bluetooth type
|
||||
ui_->comboBoxBluetooth->setCurrentText(getparams[38]);
|
||||
// set usb detect
|
||||
if (getparams[39] == "1") {
|
||||
ui_->radioButtonUSBDetectEnabled->setChecked(true);
|
||||
} else {
|
||||
ui_->radioButtonUSBDetectDisabled->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>3120</height>
|
||||
<height>3192</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -1527,36 +1527,6 @@ QComboBox::item:selected {
|
||||
min-height: 32px;
|
||||
}</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
@ -1623,31 +1593,6 @@ QComboBox::item:selected {
|
||||
min-height: 32px;
|
||||
}</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neues Element</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
@ -5127,7 +5072,7 @@ subcontrol-position: center left;
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButtonDebugmodeDisabled">
|
||||
@ -5174,7 +5119,7 @@ subcontrol-position: center left;
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelCustomBrightnessCommand">
|
||||
@ -5201,6 +5146,93 @@ subcontrol-position: center left;
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxUSBDetect">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>USB Detect during boot</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButtonUSBDetectDisabled">
|
||||
<property name="text">
|
||||
<string>Disabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButtonUSBDetectEnabled">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="formWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_7">
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/ico_info.png"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<italic>true</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>If disabled the checks for flash files (system updates), dev mode trigger file and debug mode trigger file will complete disabled. This allows a faster boot.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
|
Loading…
x
Reference in New Issue
Block a user