Add 'Reduced CPU Usage' menu option and config entry.

This commit is contained in:
Charles J. Cliffe
2016-03-31 21:32:50 -04:00
parent cd41a8197e
commit b828b3636f
6 changed files with 66 additions and 4 deletions
+16 -1
View File
@@ -199,6 +199,7 @@ AppConfig::AppConfig() : configName("") {
winH.store(0);
winMax.store(false);
showTips.store(true);
lowPerfMode.store(false);
themeId.store(0);
snap.store(1);
centerFreq.store(100000000);
@@ -265,6 +266,14 @@ bool AppConfig::getShowTips() {
return showTips.load();
}
void AppConfig::setLowPerfMode(bool show) {
lowPerfMode.store(show);
}
bool AppConfig::getLowPerfMode() {
return lowPerfMode.load();
}
wxRect *AppConfig::getWindow() {
wxRect *r = NULL;
if (winH.load() && winW.load()) {
@@ -360,6 +369,7 @@ bool AppConfig::save() {
*window_node->newChild("max") = winMax.load();
*window_node->newChild("tips") = showTips.load();
*window_node->newChild("low_perf_mode") = lowPerfMode.load();
*window_node->newChild("theme") = themeId.load();
*window_node->newChild("snap") = snap.load();
*window_node->newChild("center_freq") = centerFreq.load();
@@ -444,7 +454,7 @@ bool AppConfig::load() {
if (cfg.rootNode()->hasAnother("window")) {
int x,y,w,h;
int max,tips;
int max,tips,lpm;
DataNode *win_node = cfg.rootNode()->getNext("window");
@@ -470,6 +480,11 @@ bool AppConfig::load() {
showTips.store(tips?true:false);
}
if (win_node->hasAnother("low_perf_mode")) {
win_node->getNext("low_perf_mode")->element()->get(lpm);
lowPerfMode.store(lpm?true:false);
}
if (win_node->hasAnother("theme")) {
int theme;
win_node->getNext("theme")->element()->get(theme);