Merge remote-tracking branch 'upstream/next' into next
Testing mouse wheel focus
This commit is contained in:
@@ -517,6 +517,7 @@ class GeneralSettings {
|
||||
unsigned int gpsFormat;
|
||||
int speakerVolume;
|
||||
unsigned int backlightBright;
|
||||
unsigned int switchesDelay;
|
||||
int currentCalib;
|
||||
int temperatureCalib;
|
||||
int temperatureWarn;
|
||||
|
||||
@@ -2703,7 +2703,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
internalField.Append(new SpareBitsField<3>());
|
||||
internalField.Append(new SignedField<2>((int &)generalData.hapticMode));
|
||||
|
||||
internalField.Append(new SpareBitsField<8>());
|
||||
if (IS_ARM(board))
|
||||
internalField.Append(new UnsignedField<8>(generalData.switchesDelay));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<8>());
|
||||
|
||||
internalField.Append(new UnsignedField<8>(generalData.backlightDelay));
|
||||
internalField.Append(new UnsignedField<8>(generalData.templateSetup));
|
||||
internalField.Append(new SignedField<8>(generalData.PPM_Multiplier));
|
||||
@@ -2736,7 +2740,6 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
|
||||
internalField.Append(new SignedField<8>(generalData.currentCalib));
|
||||
if (version >= 213) {
|
||||
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
|
||||
|
||||
@@ -51,7 +51,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->chkSG->setValue(switchstate & 0x3);
|
||||
switchstate >>= 2;
|
||||
ui->chkSH->setValue(switchstate & 0x3);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
for (int i=0; pmsl[i]; i++) {
|
||||
pmsl[i]->hide();
|
||||
}
|
||||
@@ -305,6 +306,14 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->backlightColor2_label->hide();
|
||||
}
|
||||
|
||||
if (IS_ARM(eepromInterface->getBoard())) {
|
||||
ui->switchesDelay->setValue(10*g_eeGeneral.switchesDelay);
|
||||
}
|
||||
else {
|
||||
ui->switchesDelay->hide();
|
||||
ui->switchesDelayLabel->hide();
|
||||
}
|
||||
|
||||
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " GeneralEdit");
|
||||
}
|
||||
|
||||
@@ -516,6 +525,12 @@ void GeneralEdit::on_backlightautoSB_editingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralEdit::on_switchesDelay_valueChanged()
|
||||
{
|
||||
g_eeGeneral.switchesDelay = ui->switchesDelay->value() / 10;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_backlightColor_SL_valueChanged()
|
||||
{
|
||||
g_eeGeneral.backlightColor = ui->backlightColor_SL->value();
|
||||
|
||||
@@ -29,10 +29,10 @@ private:
|
||||
void setSwitchDefPos();
|
||||
void updateVarioPitchRange();
|
||||
|
||||
signals:
|
||||
signals:
|
||||
void modelValuesChanged();
|
||||
|
||||
private slots:
|
||||
private slots:
|
||||
void on_faimode_CB_stateChanged(int );
|
||||
void on_speakerPitchSB_editingFinished();
|
||||
void on_timezoneSB_editingFinished();
|
||||
@@ -132,6 +132,7 @@ private slots:
|
||||
void setValues();
|
||||
void shrink();
|
||||
void stickReverseEdited();
|
||||
void on_switchesDelay_valueChanged();
|
||||
};
|
||||
|
||||
#endif // GENERALEDIT_H
|
||||
|
||||
@@ -1968,6 +1968,52 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="34" column="0">
|
||||
<widget class="QLabel" name="switchesDelayLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Switches Delay (mid position)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="34" column="1">
|
||||
<widget class="QSpinBox" name="switchesDelay">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LCD Screen Contrast</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Values can be 20-45</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> ms</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>250</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabTrainer">
|
||||
|
||||
@@ -1053,6 +1053,10 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
|
||||
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
QString path = FindMassstoragePath("EEPROM.BIN");
|
||||
if (path.isEmpty()) {
|
||||
// On previous OpenTX we called the EEPROM file "TARANIS.BIN" :(
|
||||
path = FindMassstoragePath("TARANIS.BIN");
|
||||
}
|
||||
if (path.isEmpty()) {
|
||||
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||
path = FindMassstoragePath("ERSKY9X.BIN");
|
||||
@@ -1098,6 +1102,10 @@ bool MainWindow::writeEepromToRadio(const QString filename, const QString messag
|
||||
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
QString path = FindMassstoragePath("EEPROM.BIN");
|
||||
if (path.isEmpty()) {
|
||||
// On previous OpenTX we called the EEPROM file "TARANIS.BIN" :(
|
||||
path = FindMassstoragePath("TARANIS.BIN");
|
||||
}
|
||||
if (path.isEmpty()) {
|
||||
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||
path = FindMassstoragePath("ERSKY9X.BIN");
|
||||
|
||||
@@ -61,14 +61,23 @@ void ModelPanel::addDoubleSpring(QGridLayout * gridLayout, int col, int row)
|
||||
|
||||
bool ModelPanel::eventFilter(QObject *object, QEvent * event)
|
||||
{
|
||||
if (event->type() == QEvent::Wheel && qobject_cast<QWidget*>(object)) {
|
||||
if (qobject_cast<QWidget*>(object)->focusPolicy() == Qt::WheelFocus) {
|
||||
event->accept();
|
||||
return false;
|
||||
QWidget * widget = qobject_cast<QWidget*>(object);
|
||||
if (widget) {
|
||||
if (event->type() == QEvent::Wheel) {
|
||||
if (widget->focusPolicy() == Qt::WheelFocus) {
|
||||
event->accept();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
event->ignore();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
event->ignore();
|
||||
return true;
|
||||
else if (event->type() == QEvent::FocusIn) {
|
||||
widget->setFocusPolicy(Qt::WheelFocus);
|
||||
}
|
||||
else if (event->type() == QEvent::FocusOut) {
|
||||
widget->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
}
|
||||
return QWidget::eventFilter(object, event);
|
||||
|
||||
@@ -418,6 +418,9 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
ui->centerBeepLayout->addWidget(checkbox, 0, i+1);
|
||||
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(onBeepCenterToggled(bool)));
|
||||
centerBeepCheckboxes << checkbox;
|
||||
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==6) {
|
||||
checkbox->hide();
|
||||
}
|
||||
}
|
||||
|
||||
// Startup switches warnings
|
||||
@@ -466,7 +469,7 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
ui->potWarningLayout->addWidget(cb, 0, i+1);
|
||||
connect(cb, SIGNAL(toggled(bool)), this, SLOT(potWarningToggled(bool)));
|
||||
potWarningCheckboxes << cb;
|
||||
if (!IS_TARANIS_PLUS(firmware->getBoard())) {
|
||||
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==2) {
|
||||
cb->hide();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user