Merge pull request #671 from opentx/dvogonen/remove_profile_import_export
Import and Export of profiles removed.
This commit is contained in:
@@ -460,56 +460,6 @@ void fwPreferencesDialog::on_ProfSave_PB_clicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fwPreferencesDialog::on_export_PB_clicked()
|
|
||||||
{
|
|
||||||
QSettings settings;
|
|
||||||
QString profile=QString("profile%1").arg(ui->ProfSlot_SB->value());
|
|
||||||
QString name=ui->ProfName_LE->text();
|
|
||||||
if (!name.isEmpty()) {
|
|
||||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Export profile As"), settings.value("lastDir").toString() + "/" +name+".ini" , "*.ini");
|
|
||||||
if (fileName.isEmpty())
|
|
||||||
return;
|
|
||||||
QSettings exportfile(fileName, QSettings::IniFormat);
|
|
||||||
settings.beginGroup("Profiles");
|
|
||||||
settings.beginGroup(profile);
|
|
||||||
QStringList keys = settings.childKeys();
|
|
||||||
foreach (QString key, keys) {
|
|
||||||
exportfile.setValue(key,settings.value(key));
|
|
||||||
}
|
|
||||||
settings.endGroup();
|
|
||||||
}
|
|
||||||
settings.endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
void fwPreferencesDialog::on_import_PB_clicked()
|
|
||||||
{
|
|
||||||
QSettings settings;
|
|
||||||
QString profile=QString("profile%1").arg(ui->ProfSlot_SB->value());
|
|
||||||
QString name=ui->ProfName_LE->text();
|
|
||||||
if (!name.isEmpty()) {
|
|
||||||
int ret = QMessageBox::question(this, "Companion",
|
|
||||||
tr("Profile slot is not empty, profile slot %1 will we overwritten.<br>Are you sure ?").arg(ui->ProfSlot_SB->value()) ,
|
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
|
||||||
if (ret==QMessageBox::No) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Profile to import"), settings.value("lastDir").toString(), "*.ini");
|
|
||||||
if (fileName.isEmpty())
|
|
||||||
return;
|
|
||||||
QSettings importfile(fileName, QSettings::IniFormat);
|
|
||||||
settings.beginGroup("Profiles");
|
|
||||||
settings.beginGroup(profile);
|
|
||||||
QStringList keys = importfile.childKeys();
|
|
||||||
foreach (QString key, keys) {
|
|
||||||
settings.setValue(key,importfile.value(key));
|
|
||||||
}
|
|
||||||
settings.endGroup();
|
|
||||||
settings.endGroup();
|
|
||||||
on_ProfSlot_SB_valueChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void fwPreferencesDialog::on_SplashSelect_clicked()
|
void fwPreferencesDialog::on_SplashSelect_clicked()
|
||||||
{
|
{
|
||||||
QString supportedImageFormats;
|
QString supportedImageFormats;
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ private slots:
|
|||||||
void on_checkFWUpdates_clicked();
|
void on_checkFWUpdates_clicked();
|
||||||
void on_ProfSlot_SB_valueChanged();
|
void on_ProfSlot_SB_valueChanged();
|
||||||
void on_ProfSave_PB_clicked();
|
void on_ProfSave_PB_clicked();
|
||||||
void on_export_PB_clicked();
|
|
||||||
void on_import_PB_clicked();
|
|
||||||
void on_SplashSelect_clicked();
|
void on_SplashSelect_clicked();
|
||||||
void on_clearImageButton_clicked();
|
void on_clearImageButton_clicked();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -86,13 +86,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="42" column="5">
|
|
||||||
<widget class="QPushButton" name="ProfSave_PB">
|
|
||||||
<property name="text">
|
|
||||||
<string>Save Profile</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="12" column="4">
|
<item row="12" column="4">
|
||||||
<widget class="QCheckBox" name="optionCheckBox_19">
|
<widget class="QCheckBox" name="optionCheckBox_19">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -938,20 +931,6 @@ This is used by the templated to determine which channel goes to what number out
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="42" column="4">
|
|
||||||
<widget class="QPushButton" name="export_PB">
|
|
||||||
<property name="text">
|
|
||||||
<string>Export</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="42" column="3">
|
|
||||||
<widget class="QPushButton" name="import_PB">
|
|
||||||
<property name="text">
|
|
||||||
<string>Import</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="23" column="0">
|
<item row="23" column="0">
|
||||||
<widget class="QLabel" name="label_16">
|
<widget class="QLabel" name="label_16">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@@ -1126,6 +1105,13 @@ May be different from firmware language</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="35" column="5">
|
||||||
|
<widget class="QPushButton" name="ProfSave_PB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Save Profile</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
|||||||
Reference in New Issue
Block a user