summaryrefslogtreecommitdiffstats
path: root/gui/pages.cpp
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2014-02-08 00:32:31 +0100
committerVojtech Bocek <vbocek@gmail.com>2014-02-12 19:19:15 +0100
commitbfb6334ca85f370cae7bccc699026a39eae0128d (patch)
tree06f84bcc279b95d28c478b775cc452d1b4b6ecdf /gui/pages.cpp
parentConditional -> GUIObject and make all gui objects children of GUIObject (diff)
downloadandroid_bootable_recovery-bfb6334ca85f370cae7bccc699026a39eae0128d.tar
android_bootable_recovery-bfb6334ca85f370cae7bccc699026a39eae0128d.tar.gz
android_bootable_recovery-bfb6334ca85f370cae7bccc699026a39eae0128d.tar.bz2
android_bootable_recovery-bfb6334ca85f370cae7bccc699026a39eae0128d.tar.lz
android_bootable_recovery-bfb6334ca85f370cae7bccc699026a39eae0128d.tar.xz
android_bootable_recovery-bfb6334ca85f370cae7bccc699026a39eae0128d.tar.zst
android_bootable_recovery-bfb6334ca85f370cae7bccc699026a39eae0128d.zip
Diffstat (limited to 'gui/pages.cpp')
-rw-r--r--gui/pages.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/gui/pages.cpp b/gui/pages.cpp
index dc9edc798..73aab0352 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -193,6 +193,12 @@ Page::Page(xml_node<>* page, xml_node<>* templates /* = NULL */)
return;
}
+Page::~Page()
+{
+ for (std::vector<GUIObject*>::iterator itr = mObjects.begin(); itr != mObjects.end(); ++itr)
+ delete *itr;
+}
+
bool Page::ProcessNode(xml_node<>* page, xml_node<>* templates /* = NULL */, int depth /* = 0 */)
{
if (depth == 10)
@@ -225,86 +231,101 @@ bool Page::ProcessNode(xml_node<>* page, xml_node<>* templates /* = NULL */, int
if (type == "text")
{
GUIText* element = new GUIText(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "image")
{
GUIImage* element = new GUIImage(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
}
else if (type == "fill")
{
GUIFill* element = new GUIFill(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
}
else if (type == "action")
{
GUIAction* element = new GUIAction(child);
+ mObjects.push_back(element);
mActions.push_back(element);
}
else if (type == "console")
{
GUIConsole* element = new GUIConsole(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "button")
{
GUIButton* element = new GUIButton(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "checkbox")
{
GUICheckbox* element = new GUICheckbox(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "fileselector")
{
GUIFileSelector* element = new GUIFileSelector(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "animation")
{
GUIAnimation* element = new GUIAnimation(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
}
else if (type == "progressbar")
{
GUIProgressBar* element = new GUIProgressBar(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "slider")
{
GUISlider* element = new GUISlider(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "slidervalue")
{
GUISliderValue *element = new GUISliderValue(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "listbox")
{
GUIListBox* element = new GUIListBox(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "keyboard")
{
GUIKeyboard* element = new GUIKeyboard(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
else if (type == "input")
{
GUIInput* element = new GUIInput(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
mInputs.push_back(element);
@@ -312,6 +333,7 @@ bool Page::ProcessNode(xml_node<>* page, xml_node<>* templates /* = NULL */, int
else if (type == "partitionlist")
{
GUIPartitionList* element = new GUIPartitionList(child);
+ mObjects.push_back(element);
mRenders.push_back(element);
mActions.push_back(element);
}
@@ -526,6 +548,9 @@ PageSet::PageSet(char* xmlFile)
PageSet::~PageSet()
{
+ for (std::vector<Page*>::iterator itr = mPages.begin(); itr != mPages.end(); ++itr)
+ delete *itr;
+
delete mResources;
free(mXmlFile);
}
@@ -869,6 +894,8 @@ int PageManager::ReloadPackage(std::string name, std::string package)
}
if (mCurrentSet == set)
SelectPackage(name);
+ if (mBaseSet == set)
+ mBaseSet = mCurrentSet;
delete set;
return 0;
}