summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-05-28 16:44:41 +0200
committerEthan Yonker <dees_troy@teamw.in>2015-05-28 16:47:25 +0200
commita2719156c236c8be02403ef028490f001d393d8e (patch)
treef61805a35f33ae82216d0123dc72488ef8ea2fc1 /gui/action.cpp
parentMount system as read-only by default (diff)
downloadandroid_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.gz
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.bz2
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.lz
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.xz
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.tar.zst
android_bootable_recovery-a2719156c236c8be02403ef028490f001d393d8e.zip
Diffstat (limited to 'gui/action.cpp')
-rw-r--r--gui/action.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index 7ecd0b46a..fc3973738 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -223,6 +223,7 @@ GUIAction::GUIAction(xml_node<>* node)
ADD_ACTION(installsu);
ADD_ACTION(decrypt_backup);
ADD_ACTION(repair);
+ ADD_ACTION(resize);
ADD_ACTION(changefilesystem);
ADD_ACTION(flashimage);
}
@@ -872,6 +873,10 @@ int GUIAction::getpartitiondetails(std::string arg)
DataManager::SetValue("tw_partition_can_repair", 1);
else
DataManager::SetValue("tw_partition_can_repair", 0);
+ if (Part->Can_Resize())
+ DataManager::SetValue("tw_partition_can_resize", 1);
+ else
+ DataManager::SetValue("tw_partition_can_resize", 0);
if (TWFunc::Path_Exists("/sbin/mkdosfs"))
DataManager::SetValue("tw_partition_vfat", 1);
else
@@ -1651,6 +1656,28 @@ int GUIAction::repair(std::string arg)
return 0;
}
+int GUIAction::resize(std::string arg)
+{
+ int op_status = 0;
+
+ operation_start("Resize Partition");
+ if (simulate) {
+ simulate_progress_bar();
+ } else {
+ string part_path;
+ DataManager::GetValue("tw_partition_mount_point", part_path);
+ if (PartitionManager.Resize_By_Path(part_path, true)) {
+ op_status = 0; // success
+ } else {
+ LOGERR("Error resizing file system.\n");
+ op_status = 1; // fail
+ }
+ }
+
+ operation_end(op_status);
+ return 0;
+}
+
int GUIAction::changefilesystem(std::string arg)
{
int op_status = 0;