Save font scale in global settings

This commit is contained in:
vsonnier
2016-06-20 19:28:26 +02:00
parent f3d4b8868a
commit 92221bccdd
6 changed files with 58 additions and 8 deletions
+16
View File
@@ -284,6 +284,7 @@ AppConfig::AppConfig() : configName("") {
showTips.store(true);
lowPerfMode.store(false);
themeId.store(0);
fontScale.store(0);
snap.store(1);
centerFreq.store(100000000);
waterfallLinesPerSec.store(DEFAULT_WATERFALL_LPS);
@@ -373,6 +374,14 @@ int AppConfig::getTheme() {
return themeId.load();
}
void AppConfig::setFontScale(int fontScale) {
this->fontScale.store(fontScale);
}
int AppConfig::getFontScale() {
return fontScale.load();
}
void AppConfig::setSnap(long long snapVal) {
this->snap.store(snapVal);
@@ -454,6 +463,7 @@ bool AppConfig::save() {
*window_node->newChild("tips") = showTips.load();
*window_node->newChild("low_perf_mode") = lowPerfMode.load();
*window_node->newChild("theme") = themeId.load();
*window_node->newChild("font_scale") = fontScale.load();
*window_node->newChild("snap") = snap.load();
*window_node->newChild("center_freq") = centerFreq.load();
*window_node->newChild("waterfall_lps") = waterfallLinesPerSec.load();
@@ -574,6 +584,12 @@ bool AppConfig::load() {
themeId.store(theme);
}
if (win_node->hasAnother("font_scale")) {
int fscale;
win_node->getNext("font_scale")->element()->get(fscale);
fontScale.store(fscale);
}
if (win_node->hasAnother("snap")) {
long long snapVal;
win_node->getNext("snap")->element()->get(snapVal);