[Companion] MdiChild now use a QTreeWidget instead of a QListWidget (… (#4096)

* [Companion] MdiChild now use a QTreeWidget instead of a QListWidget (for Horus compatibility)

* [Companion] Horus models.txt parsing / writing implemented

* Fix for QT53 (#4109)
This commit is contained in:
Bertrand Songis
2016-12-08 21:26:08 +01:00
committed by GitHub
parent dd77670007
commit ec56d2dbdb
15 changed files with 443 additions and 385 deletions
+28 -1
View File
@@ -1079,7 +1079,9 @@ class ModelData {
QVector<const MixData *> mixes(int channel) const;
bool used;
char category[15+1];
char name[15+1];
char filename[16+1];
TimerData timers[CPN_MAX_TIMERS];
bool noGlobalFunctions;
bool thrTrim; // Enable Throttle Trim
@@ -1208,7 +1210,8 @@ class GeneralSettings {
int calibMid[CPN_MAX_STICKS+CPN_MAX_POTS+CPN_MAX_MOUSE_ANALOGS];
int calibSpanNeg[CPN_MAX_STICKS+CPN_MAX_POTS+CPN_MAX_MOUSE_ANALOGS];
int calibSpanPos[CPN_MAX_STICKS+CPN_MAX_POTS+CPN_MAX_MOUSE_ANALOGS];
unsigned int currModel; // 0..15
unsigned int currModelIndex;
char currModelFilename[16+1];
unsigned int contrast;
unsigned int vBatWarn;
int txVoltageCalibration;
@@ -1321,6 +1324,30 @@ class RadioData {
public:
GeneralSettings generalSettings;
ModelData models[CPN_MAX_MODELS];
void setCurrentModel(unsigned int index)
{
generalSettings.currModelIndex = index;
strcpy(generalSettings.currModelFilename, models[index].filename);
}
QString getNextModelFilename()
{
char filename[sizeof(ModelData::filename)];
int index = 0;
bool found = true;
while (found) {
sprintf(filename, "model%d.bin", ++index);
found = false;
for (int i=0; i<CPN_MAX_MODELS; i++) {
if (strcmp(filename, models[i].filename) == 0) {
found = true;
break;
}
}
}
return filename;
}
};
enum Capability {