void KbMode::save(CkbSettings& settings){ _needsSave = false; _id.newModified(); settings.setValue("GUID", _id.guidString()); settings.setValue("Modified", _id.modifiedString()); settings.setValue("HwModified", _id.hwModifiedString()); settings.setValue("Name", _name); _light->save(settings); _bind->save(settings); _perf->save(settings); }
void KbPerf::save(CkbSettings& settings){ _needsSave = false; SGroup group(settings, "Performance"); { SGroup group(settings, "DPI"); for(int i = 0; i < DPI_COUNT; i++){ QString iStr = QString::number(i); settings.setValue(iStr, QPoint(dpiX[i], dpiY[i])); settings.setValue(iStr + "RGB", dpiClr[i].name(QColor::HexArgb)); if(i != 0) settings.setValue(iStr + "Disabled", !dpiOn[i]); } settings.setValue("6RGB", dpiClr[OTHER].name(QColor::HexArgb)); // Ignore pushed modes when saving current DPI. settings.setValue("CurIdx", dpiBaseIdx); } settings.setValue("LiftHeight", _liftHeight); settings.setValue("AngleSnap", _angleSnap); { SGroup group(settings, "Indicators"); settings.setValue("DPI", _dpiIndicator); for(int i = 0; i < I_COUNT; i++){ SGroup group(settings, QString::number(i)); settings.setValue("RGB0", iColor[i][0].name(QColor::HexArgb)); settings.setValue("RGB1", iColor[i][1].name(QColor::HexArgb)); if(i == LIGHT) settings.setValue("RGB2", light100Color.name(QColor::HexArgb)); else if(i == MUTE) settings.setValue("RGB2", muteNAColor.name(QColor::HexArgb)); settings.setValue("Enable", iEnable[i]); if(i <= HW_IMAX) settings.setValue("Hardware", (int)hwIType[i]); } } }