Store GC Settings in multiple .INI files instead of system specific (Registry, PLIST,..) format

... change storage format to .INI files (which is QTs cross-system format)
... differentiate between System, Global and Athlete specific settings
... store the Global Settings in the AthleteDirectory (root)
... store the Athlete specific Settings in the Athletes Names subdir /config
... migrate existing Settings from current location into new formats "on-the-fly"
This commit is contained in:
Joern
2015-09-18 18:02:32 +02:00
parent e42df848ec
commit 1a8d683303
27 changed files with 1137 additions and 352 deletions

View File

@@ -588,6 +588,9 @@ AddPair::AddPair(AddDeviceWizard *parent) : QWizardPage(parent), wizard(parent)
channelWidget = new QTreeWidget(this);
layout->addWidget(channelWidget);
cyclist = parent->context->athlete->cyclist;
}
static void
@@ -791,7 +794,7 @@ AddPair::getChannelValues()
dynamic_cast<QLabel *>(channelWidget->itemWidget(item,2))->setText(QString("%1 %2")
.arg((int)dynamic_cast<ANTlocalController*>(wizard->controller)->myANTlocal->channelValue2(i) //speed
* (appsettings->value(NULL, GC_WHEELSIZE, 2100).toInt()/1000) * 60 / 1000)
* (appsettings->cvalue(cyclist, GC_WHEELSIZE, 2100).toInt()/1000) * 60 / 1000)
.arg((int)dynamic_cast<ANTlocalController*>(wizard->controller)->myANTlocal->channelValue(i))); // cad
} else if (p->itemData(p->currentIndex()) == ANTChannel::CHANNEL_TYPE_MOXY) {
@@ -849,6 +852,9 @@ AddPairBTLE::AddPairBTLE(AddDeviceWizard *parent) : QWizardPage(parent), wizard(
channelWidget = new QTreeWidget(this);
layout->addWidget(channelWidget);
cyclist = parent->context->athlete->cyclist;
}
void
@@ -1026,7 +1032,7 @@ AddPairBTLE::getChannelValues()
if (p->itemData(p->currentIndex()) == ANTChannel::CHANNEL_TYPE_SandC) {
dynamic_cast<QLabel *>(channelWidget->itemWidget(item,2))->setText(QString("%1 %2")
.arg((int)dynamic_cast<ANTlocalController*>(wizard->controller)->myANTlocal->channelValue2(i) //speed
* (appsettings->value(NULL, GC_WHEELSIZE, 2100).toInt()/1000) * 60 / 1000)
* (appsettings->cvalue(cyclist, GC_WHEELSIZE, 2100).toInt()/1000) * 60 / 1000)
.arg((int)dynamic_cast<ANTlocalController*>(wizard->controller)->myANTlocal->channelValue(i))); // cad
} else {
dynamic_cast<QLabel *>(channelWidget->itemWidget(item,2))->setText(QString("%1")
@@ -1158,7 +1164,7 @@ AddFinal::AddFinal(AddDeviceWizard *parent) : QWizardPage(parent), wizard(parent
//
// Wheel size
//
int wheelSize = appsettings->value(this, GC_WHEELSIZE, 2100).toInt();
int wheelSize = appsettings->cvalue(parent->context->athlete->cyclist, GC_WHEELSIZE, 2100).toInt();
rimSizeCombo = new QComboBox();
rimSizeCombo->addItems(WheelSize::RIM_SIZES);