summaryrefslogtreecommitdiffstats
path: root/gui/pages.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-08-05 16:20:30 +0200
committerDees Troy <dees_troy@teamw.in>2014-08-07 15:37:01 +0200
commit96acb3d14d42931a5157ff283d74a60cdb62c685 (patch)
tree1bb9cb75ba80b6cfc668d0e6dd40348cfda31131 /gui/pages.cpp
parentStop memory management on blanking overlay graphics (diff)
downloadandroid_bootable_recovery-96acb3d14d42931a5157ff283d74a60cdb62c685.tar
android_bootable_recovery-96acb3d14d42931a5157ff283d74a60cdb62c685.tar.gz
android_bootable_recovery-96acb3d14d42931a5157ff283d74a60cdb62c685.tar.bz2
android_bootable_recovery-96acb3d14d42931a5157ff283d74a60cdb62c685.tar.lz
android_bootable_recovery-96acb3d14d42931a5157ff283d74a60cdb62c685.tar.xz
android_bootable_recovery-96acb3d14d42931a5157ff283d74a60cdb62c685.tar.zst
android_bootable_recovery-96acb3d14d42931a5157ff283d74a60cdb62c685.zip
Diffstat (limited to 'gui/pages.cpp')
-rw-r--r--gui/pages.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 1bc15c6cd..72ffda3d5 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -783,7 +783,32 @@ int PageSet::LoadVariables(xml_node<>* vars)
if(name && value)
{
p = persist ? atoi(persist->value()) : 0;
- DataManager::SetValue(name->value(), value->value(), p);
+ string temp = value->value();
+ string valstr = gui_parse_text(temp);
+
+ if (valstr.find("+") != string::npos) {
+ string val1str = valstr;
+ val1str = val1str.substr(0, val1str.find('+'));
+ string val2str = valstr;
+ val2str = val2str.substr(val2str.find('+') + 1, string::npos);
+ int val1 = atoi(val1str.c_str());
+ int val2 = atoi(val2str.c_str());
+ int val = val1 + val2;
+
+ DataManager::SetValue(name->value(), val, p);
+ } else if (valstr.find("-") != string::npos) {
+ string val1str = valstr;
+ val1str = val1str.substr(0, val1str.find('-'));
+ string val2str = valstr;
+ val2str = val2str.substr(val2str.find('-') + 1, string::npos);
+ int val1 = atoi(val1str.c_str());
+ int val2 = atoi(val2str.c_str());
+ int val = val1 - val2;
+
+ DataManager::SetValue(name->value(), val, p);
+ } else {
+ DataManager::SetValue(name->value(), valstr, p);
+ }
}
child = child->next_sibling("variable");