summaryrefslogtreecommitdiffstats
path: root/gui/fileselector.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-02-18 21:35:00 +0100
committerEthan Yonker <dees_troy@teamw.in>2015-02-21 15:14:24 +0100
commit21ff02a69331fbcd53dc93a1af9a93618225b4bf (patch)
tree623fe5a07a506362b91a16b34d62a875b3d45c32 /gui/fileselector.cpp
parentgui: make kinetic scrolling deceleration more awesome (diff)
downloadandroid_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.gz
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.bz2
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.lz
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.xz
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.zst
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.zip
Diffstat (limited to 'gui/fileselector.cpp')
-rw-r--r--gui/fileselector.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/gui/fileselector.cpp b/gui/fileselector.cpp
index 5c287c34d..2602eb257 100644
--- a/gui/fileselector.cpp
+++ b/gui/fileselector.cpp
@@ -70,8 +70,10 @@ GUIFileSelector::GUIFileSelector(xml_node<>* node) : GUIScrollList(node)
if (attr)
mPathVar = attr->value();
attr = child->first_attribute("default");
- if (attr)
+ if (attr) {
+ mPathDefault = attr->value();
DataManager::SetValue(mPathVar, attr->value());
+ }
}
// Handle the result variable
@@ -168,6 +170,8 @@ int GUIFileSelector::NotifyVarChange(const std::string& varName, const std::stri
} else {
// Reset the list to the top
SetVisibleListLocation(0);
+ if (value.empty())
+ DataManager::SetValue(mPathVar, mPathDefault);
}
updateFileList = true;
mUpdate = 1;
@@ -288,6 +292,10 @@ void GUIFileSelector::SetPageFocus(int inFocus)
{
GUIScrollList::SetPageFocus(inFocus);
if (inFocus) {
+ std::string value;
+ DataManager::GetValue(mPathVar, value);
+ if (value.empty())
+ DataManager::SetValue(mPathVar, mPathDefault);
updateFileList = true;
mUpdate = 1;
}