feat(cpn): read and write to/from radio profile SD path, menu reorganisation (#5753)

This commit is contained in:
Neil Horne
2025-01-24 11:49:34 +10:00
committed by GitHub
parent d69de504fb
commit 35e8b61b7d
57 changed files with 1403 additions and 732 deletions
+16 -12
View File
@@ -189,21 +189,25 @@ bool readSettings(const QString & filename, ProgressWidget * progress)
return readSettingsEeprom(filename, progress);
}
bool readSettingsSDCard(const QString & filename, ProgressWidget * progress)
bool readSettingsSDCard(const QString & filename, ProgressWidget * progress, bool fromRadio)
{
QString radioPath = findMassstoragePath("RADIO", true, progress);
qDebug() << "Searching for SD card, found" << radioPath;
if (radioPath.isEmpty()) {
QMessageBox::critical(progress, CPN_STR_TTL_ERROR,
QCoreApplication::translate("RadioInterface", "Unable to find radio SD card!"));
return false;
QString radioPath;
if (fromRadio) {
radioPath = findMassstoragePath("RADIO", true, progress);
qDebug() << "Searching for SD card, found" << radioPath;
}
else {
radioPath = g.currentProfile().sdPath();
if (!QFile::exists(radioPath % "/RADIO"))
radioPath.clear();
}
// if radio.yml it is a converted radio
// if radio.bin unconverted pre 2.6
// if neither then unconverted eeprom or empty
if (!QFile::exists(radioPath % "/RADIO/radio.yml") && !QFile::exists(radioPath % "/RADIO/radio.bin"))
return readSettingsEeprom(filename, progress);
if (radioPath.isEmpty()) {
QMessageBox::critical(progress, CPN_STR_TTL_ERROR,
QCoreApplication::translate("RadioInterface", "Unable to find SD card!"));
return false;
}
RadioData radioData;
Storage inputStorage(radioPath);