mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
Fixed export double confirmation dialogues.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2724 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
901b6f3882
commit
d377b417df
@ -462,7 +462,7 @@
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textDirection">
|
||||
<enum>QProgressBar::TopToBottom</enum>
|
||||
|
@ -1243,9 +1243,7 @@ void PipXtremeGadgetWidget::importSettings()
|
||||
options
|
||||
).trimmed();
|
||||
if (filename.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!QFileInfo(filename).isReadable())
|
||||
{
|
||||
@ -1257,6 +1255,12 @@ void PipXtremeGadgetWidget::importSettings()
|
||||
|
||||
QSettings settings(filename, QSettings::IniFormat);
|
||||
|
||||
uint32_t serial_number = settings.value("details/serial_number", 0).toUInt();
|
||||
if (serial_number && serial_number != pipx_config_details.serial_number)
|
||||
{
|
||||
// return;
|
||||
}
|
||||
|
||||
pipx_config_settings.destination_id = settings.value("settings/paired_serial_number", 0).toUInt();
|
||||
pipx_config_settings.rf_xtal_cap = settings.value("settings/frequency_calibration", 0x7f).toUInt();
|
||||
pipx_config_settings.frequency_Hz = settings.value("settings/frequency", (pipx_config_details.min_frequency_Hz + pipx_config_details.max_frequency_Hz) / 2).toUInt();
|
||||
@ -1291,10 +1295,8 @@ void PipXtremeGadgetWidget::exportSettings()
|
||||
tr("PipX settings (*.ini)")
|
||||
).trimmed();
|
||||
if (filename.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
if (QFileInfo(filename).exists())
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
@ -1307,16 +1309,20 @@ void PipXtremeGadgetWidget::exportSettings()
|
||||
else
|
||||
return;
|
||||
}
|
||||
QDir dir = QFileInfo(filename).absoluteDir();
|
||||
*/ QDir dir = QFileInfo(filename).absoluteDir();
|
||||
if (!dir.exists())
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("Can't write file ") + QFileInfo(filename).absoluteFilePath() + " since directory "+ dir.absolutePath() + " doesn't exist!");
|
||||
msgBox.setText(tr("Can't write file ") + QFileInfo(filename).absoluteFilePath() + " since directory " + dir.absolutePath() + " doesn't exist!");
|
||||
msgBox.exec();
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings settings(filename, QSettings::IniFormat);
|
||||
settings.setValue("details/serial_number", pipx_config_details.serial_number);
|
||||
settings.setValue("details/min_frequency", pipx_config_details.min_frequency_Hz);
|
||||
settings.setValue("details/max_frequency", pipx_config_details.max_frequency_Hz);
|
||||
settings.setValue("details/frequency_band", pipx_config_details.frequency_band);
|
||||
settings.setValue("settings/paired_serial_number", pipx_config_settings.destination_id);
|
||||
settings.setValue("settings/frequency_calibration", pipx_config_settings.rf_xtal_cap);
|
||||
settings.setValue("settings/frequency", pipx_config_settings.frequency_Hz);
|
||||
|
Loading…
Reference in New Issue
Block a user