[Companion] Radio profile/current firmware handling: (#4737)

* Fix possible confusion/data corruption when deleting radio profile (closes #4734, ref: #4686);
    * Add Delete Profile action to Radio Profiles menu (closes #4736) (but remove from from app prefs. panel);
    * Add confirmation prompt before deleting profile;
    * Open profile settings dialog when creating/copying a profile (closes #4735);
    * Make sure current (global) firmware flavor is properly updated when changing fw type/options in profile;
    * Append "-Copy" to name of copied profile;
    * Factor out Firmware global vars/functions in favor of static members.
This commit is contained in:
Max Paperno
2017-04-02 12:17:06 +02:00
committed by Bertrand Songis
parent 8d0db05e78
commit 36bb951314
11 changed files with 172 additions and 100 deletions
@@ -1198,7 +1198,7 @@ void registerOpenTxFirmware(OpenTxFirmware * firmware)
firmware->setEEpromInterface(eepromInterface);
opentxEEpromInterfaces.push_back(eepromInterface);
eepromInterfaces.push_back(eepromInterface);
firmwares.push_back(firmware);
Firmware::addRegisteredFirmware(firmware);
}
void registerOpenTxFirmwares()
@@ -1507,13 +1507,13 @@ void registerOpenTxFirmwares()
addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware);
default_firmware_variant = getFirmware("opentx-x9d+");
current_firmware_variant = default_firmware_variant;
Firmware::setDefaultVariant(Firmware::getFirmwareForId("opentx-x9d+"));
Firmware::setCurrentVariant(Firmware::getDefaultVariant());
}
void unregisterOpenTxFirmwares()
{
foreach (Firmware * f, firmwares) {
foreach (Firmware * f, Firmware::getRegisteredFirmwares()) {
delete f;
}
unregisterEEpromInterfaces();