Revert "Add support for multi-user decryption"
This reverts commit 0b25b1d79b79bc4d45dfff2aaf575e10bd24ef2d.
Reason for revert: Changes need to be made to libtwrpfscrypt to include this patchset. Will cherry-pick this patch later and make necessary modifications.
Change-Id: I7601d7b820129709b05d9b4368573b6f1048de02
diff --git a/gui/listbox.cpp b/gui/listbox.cpp
index 3386465..9fbe092 100644
--- a/gui/listbox.cpp
+++ b/gui/listbox.cpp
@@ -26,7 +26,6 @@
#include "rapidxml.hpp"
#include "objects.hpp"
#include "../data.hpp"
-#include "../partitions.hpp"
#include "pages.hpp"
extern std::vector<language_struct> Language_List;
@@ -83,28 +82,10 @@
data.selected = 0;
mListItems.push_back(data);
}
- } else if (mVariable == "tw_crypto_user_id") {
- std::vector<users_struct>::iterator iter;
- std::vector<users_struct>* Users_List = PartitionManager.Get_Users_List();
- for (iter = Users_List->begin(); iter != Users_List->end(); iter++) {
- if (!(*iter).isDecrypted) {
- ListItem data;
- data.displayName = (*iter).userName;
- data.variableValue = (*iter).userId;
- data.action = NULL;
- DataManager::GetValue("tw_crypto_user_id", currentValue);
- if (currentValue == (*iter).userId || currentValue == "") {
- data.selected = 1;
- DataManager::SetValue("tw_crypto_user_id", (*iter).userId);
- DataManager::SetValue("tw_crypto_pwtype", (*iter).type);
- } else
- data.selected = 0;
- mListItems.push_back(data);
- }
- }
}
- } else
- allowSelection = false; // allows using listbox as a read-only list or menu
+ }
+ else
+ allowSelection = false; // allows using listbox as a read-only list or menu
// Get the data for the list
child = FindNode(node, "listitem");
@@ -113,14 +94,16 @@
ListItem item;
attr = child->first_attribute("name");
- if (!attr) continue;
+ if (!attr)
+ continue;
// We will parse display names when we get page focus to ensure that translating takes place
item.displayName = attr->value();
item.variableValue = gui_parse_text(child->value());
item.selected = (child->value() == currentValue);
item.action = NULL;
xml_node<>* action = child->first_node("action");
- if (!action) action = child->first_node("actions");
+ if (!action)
+ action = child->first_node("actions");
if (action) {
item.action = new GUIAction(child);
allowSelection = true;
@@ -139,7 +122,7 @@
LoadConditions(child, item.mConditions);
mListItems.push_back(item);
- mVisibleItems.push_back(mListItems.size() - 1);
+ mVisibleItems.push_back(mListItems.size()-1);
child = child->next_sibling("listitem");
}
@@ -154,33 +137,6 @@
if (!isConditionTrue())
return 0;
- if (mVariable == "tw_crypto_user_id") {
- mListItems.clear();
- std::vector<users_struct>::iterator iter;
- std::vector<users_struct>* Users_List = PartitionManager.Get_Users_List();
- for (iter = Users_List->begin(); iter != Users_List->end(); iter++) {
- if (!(*iter).isDecrypted) {
- ListItem data;
- data.displayName = (*iter).userName;
- data.variableValue = (*iter).userId;
- data.action = NULL;
- DataManager::GetValue("tw_crypto_user_id", currentValue);
- if (currentValue == (*iter).userId || currentValue == "") {
- data.selected = 1;
- DataManager::SetValue("tw_crypto_user_id", (*iter).userId);
- DataManager::SetValue("tw_crypto_pwtype", (*iter).type);
- } else
- data.selected = 0;
- mListItems.push_back(data);
- }
- }
- mVisibleItems.clear();
- for (size_t i = 0; i < mListItems.size(); i++) {
- mVisibleItems.push_back(i);
- }
- mUpdate = 1;
- }
-
GUIScrollList::Update();
if (mUpdate) {