mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 08:15:17 +03:00
Almost all global settings wrapped in protective object to guarantee type safety and protect against tag spelling errors (I have found and corrected a lot of those!).
Joystick settings and burner configuration is not yet within the global object.
This commit is contained in:
parent
2633b61433
commit
c23a096a73
18 changed files with 204 additions and 1156 deletions
|
@ -7,6 +7,7 @@
|
|||
#include "firmwares/opentx/opentxinterface.h"
|
||||
#include "firmwares/ersky9x/ersky9xinterface.h"
|
||||
#include "qsettings.h"
|
||||
#include "appdata.h"
|
||||
#include "helpers.h"
|
||||
|
||||
QString EEPROMWarnings;
|
||||
|
@ -734,8 +735,8 @@ GeneralSettings::GeneralSettings()
|
|||
QSettings settings;
|
||||
templateSetup = settings.value("default_channel_order", 0).toInt();
|
||||
stickMode = settings.value("default_mode", 1).toInt();
|
||||
int profile_id = settings.value("profileId", 0).toInt();
|
||||
if (profile_id>0) {
|
||||
int profile_id = glob.profileId();
|
||||
if (profile_id>-1) {
|
||||
settings.beginGroup("Profiles");
|
||||
QString profile=QString("profile%1").arg(profile_id);
|
||||
settings.beginGroup(profile);
|
||||
|
@ -990,14 +991,12 @@ ModelData ModelData::removeGlobalVars()
|
|||
QList<EEPROMInterface *> eepromInterfaces;
|
||||
void RegisterEepromInterfaces()
|
||||
{
|
||||
QSettings settings;
|
||||
int rev4a = settings.value("rev4asupport",0).toInt();
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_STOCK));
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_M128));
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_GRUVIN9X));
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_SKY9X));
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_TARANIS));
|
||||
if (rev4a)
|
||||
if (glob.rev4asupport())
|
||||
eepromInterfaces.push_back(new Open9xInterface(BOARD_TARANIS_REV4a));
|
||||
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK));
|
||||
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue