diff --git a/gui/action.cpp b/gui/action.cpp
index aa81dff1..f9de4e9d 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -226,9 +226,9 @@ GUIAction::GUIAction(xml_node<>* node)
}
// First, get the action
- actions = node->first_node("actions");
- if (actions) child = actions->first_node("action");
- else child = node->first_node("action");
+ actions = FindNode(node, "actions");
+ if (actions) child = FindNode(actions, "action");
+ else child = FindNode(node, "action");
if (!child) return;
@@ -247,7 +247,7 @@ GUIAction::GUIAction(xml_node<>* node)
}
// Now, let's get either the key or region
- child = node->first_node("touch");
+ child = FindNode(node, "touch");
if (child)
{
attr = child->first_attribute("key");
diff --git a/gui/animation.cpp b/gui/animation.cpp
index 1e9a87d3..888b4ab0 100644
--- a/gui/animation.cpp
+++ b/gui/animation.cpp
@@ -29,7 +29,6 @@ extern "C" {
GUIAnimation::GUIAnimation(xml_node<>* node) : GUIObject(node)
{
xml_node<>* child;
- xml_attribute<>* attr;
mAnimation = NULL;
mFrame = 1;
@@ -40,36 +39,26 @@ GUIAnimation::GUIAnimation(xml_node<>* node) : GUIObject(node)
if (!node) return;
- child = node->first_node("resource");
- if (child)
- {
- mAnimation = LoadAttrAnimation(child, "name");
- }
+ mAnimation = LoadAttrAnimation(FindNode(node, "resource"), "name");
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, NULL, NULL, &mPlacement);
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, NULL, NULL, &mPlacement);
- child = node->first_node("speed");
+ child = FindNode(node, "speed");
if (child)
{
- attr = child->first_attribute("fps");
- if (attr)
- mFPS = atoi(attr->value());
- attr = child->first_attribute("render");
- if (attr)
- mRender = atoi(attr->value());
+ mFPS = LoadAttrInt(child, "fps", mFPS);
+ mRender = LoadAttrInt(child, "render", mRender);
}
if (mFPS > 30) mFPS = 30;
- child = node->first_node("loop");
+ child = FindNode(node, "loop");
if (child)
{
- attr = child->first_attribute("frame");
+ xml_attribute<>* attr = child->first_attribute("frame");
if (attr)
mLoop = atoi(attr->value()) - 1;
- attr = child->first_attribute("start");
- if (attr)
- mFrame = atoi(attr->value());
+ mFrame = LoadAttrInt(child, "start", mFrame);
}
// Fetch the render sizes
diff --git a/gui/button.cpp b/gui/button.cpp
index 6ea0beec..18b5560c 100644
--- a/gui/button.cpp
+++ b/gui/button.cpp
@@ -63,15 +63,11 @@ GUIButton::GUIButton(xml_node<>* node)
mButtonLabel = new GUIText(node);
mAction = new GUIAction(node);
- child = node->first_node("image");
- if (child)
+ mButtonImg = new GUIImage(node);
+ if (mButtonImg->Render() < 0)
{
- mButtonImg = new GUIImage(node);
- if (mButtonImg->Render() < 0)
- {
- delete mButtonImg;
- mButtonImg = NULL;
- }
+ delete mButtonImg;
+ mButtonImg = NULL;
}
if (mButtonLabel->Render() < 0)
{
@@ -79,45 +75,22 @@ GUIButton::GUIButton(xml_node<>* node)
mButtonLabel = NULL;
}
// Load fill if it exists
- memset(&mFillColor, 0, sizeof(COLOR));
- child = node->first_node("fill");
- if (child)
- {
- attr = child->first_attribute("color");
- if (attr) {
- hasFill = true;
- std::string color = attr->value();
- ConvertStrToColor(color, &mFillColor);
- }
- }
+ mFillColor = LoadAttrColor(FindNode(node, "fill"), "color", &hasFill);
if (!hasFill && mButtonImg == NULL) {
LOGERR("No image resource or fill specified for button.\n");
}
// The icon is a special case
- child = node->first_node("icon");
- if (child)
- {
- mButtonIcon = LoadAttrImage(child, "resource");
- }
+ mButtonIcon = LoadAttrImage(FindNode(node, "icon"), "resource");
- memset(&mHighlightColor, 0, sizeof(COLOR));
- child = node->first_node("highlight");
- if (child) {
- attr = child->first_attribute("color");
- if (attr) {
- hasHighlightColor = true;
- std::string color = attr->value();
- ConvertStrToColor(color, &mHighlightColor);
- }
- }
+ mHighlightColor = LoadAttrColor(FindNode(node, "highlight"), "color", &hasHighlightColor);
int x, y, w, h;
TextPlacement = TOP_LEFT;
if (mButtonImg) {
mButtonImg->GetRenderPos(x, y, w, h);
} else if (hasFill) {
- LoadPlacement(node->first_node("placement"), &x, &y, &w, &h, &TextPlacement);
+ LoadPlacement(FindNode(node, "placement"), &x, &y, &w, &h, &TextPlacement);
}
SetRenderPos(x, y, w, h);
}
diff --git a/gui/checkbox.cpp b/gui/checkbox.cpp
index f4900ba2..46a77086 100644
--- a/gui/checkbox.cpp
+++ b/gui/checkbox.cpp
@@ -45,7 +45,7 @@ GUICheckbox::GUICheckbox(xml_node<>* node)
mLabel = new GUIText(node);
// Read the check states
- child = node->first_node("image");
+ child = FindNode(node, "image");
if (child)
{
mChecked = LoadAttrImage(child, "checked");
@@ -53,7 +53,7 @@ GUICheckbox::GUICheckbox(xml_node<>* node)
}
// Get the variable data
- child = node->first_node("data");
+ child = FindNode(node, "data");
if (child)
{
attr = child->first_attribute("variable");
diff --git a/gui/console.cpp b/gui/console.cpp
index bb70400c..3623f555 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -101,7 +101,6 @@ extern "C" void gui_set_FILE(FILE* f)
GUIConsole::GUIConsole(xml_node<>* node) : GUIObject(node)
{
- xml_attribute<>* attr;
xml_node<>* child;
mFont = NULL;
@@ -126,13 +125,9 @@ GUIConsole::GUIConsole(xml_node<>* node) : GUIObject(node)
}
else
{
- child = node->first_node("font");
- if (child)
- {
- mFont = LoadAttrFont(child, "resource");
- }
+ mFont = LoadAttrFont(FindNode(node, "font"), "resource");
- child = node->first_node("color");
+ child = FindNode(node, "color");
if (child)
{
mForegroundColor = LoadAttrColor(child, "foreground", mForegroundColor);
@@ -141,9 +136,9 @@ GUIConsole::GUIConsole(xml_node<>* node) : GUIObject(node)
}
// Load the placement
- LoadPlacement(node->first_node("placement"), &mConsoleX, &mConsoleY, &mConsoleW, &mConsoleH);
+ LoadPlacement(FindNode(node, "placement"), &mConsoleX, &mConsoleY, &mConsoleW, &mConsoleH);
- child = node->first_node("slideout");
+ child = FindNode(node, "slideout");
if (child)
{
mSlideout = 1;
diff --git a/gui/devices/landscape/res/landscape.xml b/gui/devices/landscape/res/landscape.xml
index eb6d9ddd..fd5fcfe4 100644
--- a/gui/devices/landscape/res/landscape.xml
+++ b/gui/devices/landscape/res/landscape.xml
@@ -1,6 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gui/devices/portrait/res/portrait.xml b/gui/devices/portrait/res/portrait.xml
index fe616715..6fb52f30 100644
--- a/gui/devices/portrait/res/portrait.xml
+++ b/gui/devices/portrait/res/portrait.xml
@@ -1,6 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -15,11 +111,8 @@
-
-
Install
-
install
@@ -27,66 +120,44 @@
-
-
Wipe
-
wipe
-
-
Backup
-
backup
-
-
Restore
-
restore
-
-
Mount
-
mount
-
-
Settings
-
settings
-
-
-
Advanced
-
advanced
-
-
Reboot
-
reboot
@@ -96,17 +167,13 @@
-
-
+
Select Zip to Install
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=install
@@ -115,16 +182,8 @@
-
-
-
%tw_zip_location%
-
-
-
-
-
@@ -133,12 +192,9 @@
-
-
+
-
Images...
-
install_image
@@ -168,99 +224,76 @@
-
-
+
This operation may install incompatible
-
-
+
software and render your device unusable.
-
-
+
Folder:
-
-
+
+
%tw_zip_location%
-
-
+
File to flash:
-
-
+
+
%tw_file%
-
-
+
Press back to cancel adding this zip.
-
Zip file signature verification.
-
-
Inject TWRP after install.
-
-
-
+
File %tw_zip_queue_count% of max of 10
-
-
+ Swipe to Confirm Flash
flash_zip
-
-
-
- Swipe to Confirm Flash
-
-
-
-
Add More Zips
-
install
-
-
Clear Zip Queue
-
install
@@ -288,18 +321,15 @@
-
-
-
-
+
Flashing file %tw_zip_index% of %tw_zip_queue_count%
-
-
+
+
%tw_filename%
@@ -315,24 +345,18 @@
-
-
+
Zip Install Complete
-
-
-
-
Wipe cache/dalvik
-
tw_back=flash_done
tw_action=wipe
@@ -349,50 +373,29 @@
-
+
-
- Reboot System
-
-
- tw_back=main2
- tw_action=reboot
- tw_action_param=system
- tw_has_action2=0
- tw_text1=No OS Installed! Are you
- tw_text2=sure you wish to reboot?
- tw_text3=
- tw_text4=
- tw_action_text1=Rebooting...
- tw_action_text2=
- tw_complete_text1=Rebooting...
- tw_slider_text=Swipe to Reboot
- rebootcheck
-
-
-
Home
-
tw_clear_destination=main2
clear_vars
-
+
-
+
Failed
-
+
-
+
Successful
@@ -417,17 +420,13 @@
-
-
+
Select Image to Install
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=install_image
@@ -436,16 +435,8 @@
-
-
-
%tw_zip_location%
-
-
-
-
-
@@ -454,12 +445,9 @@
-
-
+
-
Zips...
-
install
@@ -487,46 +475,37 @@
-
-
-
Select Partition to Flash Image:
-
-
-
-
-
+
Folder:
-
-
+
+
%tw_zip_location%
-
-
+
File to flash:
-
-
+
+
%tw_file%
-
-
+ Swipe to Confirm Flash
tw_back=flashimage_confirm
tw_action=flashimage
@@ -536,13 +515,6 @@
tw_complete_text1=Image Flashed
action_page
-
-
-
-
-
-
- Swipe to Confirm Flash
@@ -589,46 +561,34 @@
-
-
+
%tw_text1%
-
-
+
%tw_text2%
-
-
+
%tw_text3%
-
-
+
%tw_text4%
-
-
+
Press back button to cancel.
-
-
- action_page
-
-
-
-
-
%tw_slider_text%
+ action_page
@@ -650,27 +610,22 @@
-
-
+
%tw_action_text1%
-
-
+
%tw_action_text2%
-
-
+
-
Cancel
-
%tw_cancel_param%
@@ -702,14 +657,12 @@
-
-
+
%tw_action_text1%
-
-
+
%tw_action_text2%
@@ -744,22 +697,21 @@
-
-
+
%tw_complete_text1%
-
+
-
+
Failed
-
+
-
+
Successful
@@ -767,40 +719,18 @@
-
-
Back
-
tw_clear_destination=%tw_back%
clear_vars
-
-
+
-
- Reboot System
-
-
- tw_back=main2
- tw_action=reboot
- tw_action_param=system
- tw_has_action2=0
- tw_text1=No OS Installed! Are you
- tw_text2=sure you wish to reboot?
- tw_text3=
- tw_text4=
- tw_action_text1=Rebooting...
- tw_action_text2=
- tw_complete_text1=Rebooting...
- tw_slider_text=Swipe to Reboot
- rebootcheck
-
@@ -863,66 +793,55 @@
-
-
+
Factory Reset
-
-
+
Wipes Data, Cache, and Dalvik
-
+
-
(not including internal storage)
-
+
-
Android Secure
-
+
-
SD-EXT
-
-
+
Most of the time this is
-
-
+
the only wipe that you need.
-
-
+
Press back button to cancel.
-
-
Advanced Wipe
-
partitionlisterror=0
advancedwipe
@@ -931,11 +850,8 @@
-
-
Format Data
-
formatdata
@@ -946,11 +862,8 @@
-
-
Wipe Encryption
-
tw_back=wipe
tw_action=wipe
@@ -966,8 +879,7 @@
-
-
+ Swipe to Factory Reset
tw_back=wipe
tw_action=wipe
@@ -978,12 +890,6 @@
-
-
-
- Swipe to Factory Reset
-
-
main
@@ -1004,29 +910,20 @@
tw_wipe_list=
-
-
+
Wipe Menu
-
-
-
Select Partitions to Wipe:
-
-
-
-
-
-
+ Swipe to Wipe
tw_back=advancedwipe
tw_action=wipe
@@ -1038,11 +935,8 @@
-
-
-
+
-
Repair or Change File System
@@ -1050,19 +944,13 @@
-
+
+
-
Invalid partition selection
-
-
-
- Swipe to Wipe
-
-
main
@@ -1079,41 +967,33 @@
-
-
+
Format Data will wipe all of your apps,
-
-
+
backups, pictures, videos, media, and
-
-
+
removes encryption on internal storage.
-
-
+
This cannot be undone. Press back to cancel.
-
-
+
Type yes to continue.
-
-
-
%tw_confirm_formatdata%
@@ -1177,83 +1057,69 @@
-
-
+
Partition Options for: %tw_partition_name%
-
-
+
Mount Point: %tw_partition_mount_point%
-
-
+
Current file system: %tw_partition_file_system%
-
+
-
Present: Yes
-
+
-
Present: No
-
+
-
Removable: Yes
-
+
-
Removable: No
-
-
+
Size: %tw_partition_size%MB
-
-
+
Used: %tw_partition_used%MB
-
-
+
Free: %tw_partition_free%MB
-
-
+
Backup Size: %tw_partition_backup_size%MB
-
-
Repair
-
tw_back=partitionoptions
tw_action=repair
@@ -1269,11 +1135,8 @@
-
-
Change File System
-
selectfilesystem
@@ -1313,43 +1176,35 @@
-
-
+
Change file system for: %tw_partition_name%
-
-
+
Mount Point: %tw_partition_mount_point%
-
-
+
Current file system: %tw_partition_file_system%
-
-
+
Some ROMs or kernels may not support some
-
-
+
file systems. Proceed with caution!
-
-
EXT2
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1367,11 +1222,8 @@
-
-
EXT3
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1389,11 +1241,8 @@
-
-
EXT4
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1411,11 +1260,8 @@
-
-
F2FS
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1433,11 +1279,8 @@
-
-
FAT
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1455,11 +1298,8 @@
-
-
exFAT
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1491,11 +1331,8 @@
-
-
-
+
-
Backup Name: %tw_backup_name%
tw_fileexists=0
@@ -1504,43 +1341,30 @@
-
-
-
Select Partitions to Back Up:
-
-
-
-
-
+
-
-
-
No Encryption
backupencryption
-
+
-
-
-
Using Encryption
tw_password_not_match=0
@@ -1548,11 +1372,8 @@
-
-
-
+
-
Refresh Sizes
@@ -1560,11 +1381,8 @@
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=backup
@@ -1574,30 +1392,19 @@
-
Enable compression.
-
-
Skip MD5 generation during backup.
-
-
-
- backup_run
-
-
-
-
-
Swipe to Back Up
+ backup_run
@@ -1627,17 +1434,13 @@
-
+
-
Please Enter a Backup Name
-
-
-
%tw_backup_name%
@@ -1649,28 +1452,22 @@
-
+
-
+
A backup with that name already exists!
-
-
Append Date
-
-
-
Cancel
-
tw_backup_name=(Auto Generate)
backup
@@ -1701,42 +1498,34 @@
-
-
+
Encrypt your backup?
-
-
+
Please Enter A Password:
-
-
-
%tw_backup_encrypt_display%
backupencryption2
-
+
-
+
Passwords Do Not Match
-
-
Cancel
-
tw_encrypt_backup=0
tw_backup_password=
@@ -1765,23 +1554,18 @@
-
-
+
Encrypt your backup?
-
-
+
Please Enter Password Again:
-
-
-
%tw_backup_encrypt_display2%
@@ -1791,11 +1575,8 @@
-
-
Cancel
-
tw_encrypt_backup=0
tw_backup_password=
@@ -1847,32 +1628,26 @@
-
-
+
%tw_operation% %tw_partition%
-
-
+
%tw_file_progress%
-
-
+
%tw_size_progress%
-
-
+
-
Cancel
-
@@ -1910,11 +1685,8 @@
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=restore
@@ -1923,16 +1695,8 @@
-
-
-
Select Package to Restore:
-
-
-
-
-
@@ -1982,23 +1746,17 @@
-
-
+
Backup Encrypted
-
-
+
Please Enter Your Password:
-
-
-
-
%tw_restore_display%
@@ -2007,19 +1765,16 @@
-
+
-
+
Password Failed, Please Try Again
-
-
Cancel
-
tw_page_done=1
restore
@@ -2027,11 +1782,8 @@
-
-
Delete
-
tw_back=restore
tw_action=cmd
@@ -2063,8 +1815,7 @@
-
-
+
Trying Decryption with Your Password
@@ -2104,24 +1855,14 @@
-
-
-
Restoring: %tw_restore_name%
-
-
-
-
-
-
-
+
-
Rename Backup
tw_backup_rename=
@@ -2130,11 +1871,8 @@
-
-
-
+
-
Delete Backup
tw_back=restore
@@ -2151,28 +1889,18 @@
-
Enable MD5 verification of backup files.
-
-
-
+
Package Date: %tw_restore_file_date%
-
-
- restore_run
-
-
-
-
-
Swipe to Restore
+ restore_run
@@ -2191,17 +1919,13 @@
-
+
-
Please Enter a New Backup Name
-
-
-
%tw_backup_rename%
@@ -2221,19 +1945,16 @@
-
+
-
+
A backup with that name already exists!
-
-
Cancel
-
restore_select
@@ -2255,14 +1976,12 @@
-
-
+
%tw_operation% %tw_partition%
-
-
+
%tw_size_progress%
@@ -2290,25 +2009,16 @@
-
-
-
Select Storage:
-
-
-
-
-
OK
-
tw_clear_destination=%tw_back%
clear_vars
@@ -2334,23 +2044,13 @@
-
-
-
Select Partitions to Mount:
-
-
-
-
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=mount
@@ -2359,51 +2059,39 @@
-
-
Mount USB Storage
-
usb_mount
-
-
Enable MTP
-
-
-
Disable MTP
-
-
-
Decrypt Data
-
decrypt
@@ -2423,30 +2111,24 @@
-
-
+
USB Storage Mounted
-
+
-
Be sure to safely remove your device
-
+
-
from your computer before unmounting!
-
-
Unmount
-
usb_umount
@@ -2472,40 +2154,21 @@
-
-
+
Reboot Menu
-
-
+
-
System
-
-
- tw_back=reboot
- tw_action=reboot
- tw_action_param=system
- tw_has_action2=0
- tw_text1=No OS Installed! Are you
- tw_text2=sure you wish to reboot?
- tw_action_text1=Rebooting...
- tw_complete_text1=Rebooting...
- tw_slider_text=Swipe to Reboot
- rebootcheck
-
-
-
Power Off
-
tw_back=reboot
tw_action=reboot
@@ -2521,12 +2184,9 @@
-
-
Recovery
-
tw_back=reboot
tw_action=reboot
@@ -2542,12 +2202,9 @@
-
-
Bootloader
-
tw_back=reboot
tw_action=reboot
@@ -2563,12 +2220,9 @@
-
-
Download
-
tw_back=reboot
tw_action=reboot
@@ -2599,102 +2253,75 @@
-
-
+
Settings
-
Zip file signature verification.
-
-
Use rm -rf instead of formatting.
-
-
Skip MD5 generation during backup.
-
-
Enable MD5 verification of backup files.
-
-
Use 24-hour clock.
-
-
Simulate actions for theme testing.
-
-
Simulate failure for actions.
-
-
-
Time Zone
-
timezone
-
-
Screen
-
screen
-
-
Restore Defaults
-
-
-
Vibration Duration
-
Vibrate
@@ -2714,16 +2341,10 @@
-
-
+
-
-
Select Time Zone:
-
-
-
BST11;BDT
HST10;HDT
@@ -2753,65 +2374,46 @@
-
Do you use daylight savings time (DST)?
-
-
-
+
Offset (usually 0): %tw_time_zone_guioffset%
-
-
+
-
None
-
tw_time_zone_guioffset=0
-
-
+
-
15
-
tw_time_zone_guioffset=15
-
-
+
-
30
-
tw_time_zone_guioffset=30
-
-
+
-
45
-
tw_time_zone_guioffset=45
-
-
Set Time Zone
-
-
-
+
Current Time Zone: %tw_time_zone%
@@ -2832,8 +2434,7 @@
-
-
+
Screen Settings
@@ -2859,12 +2460,11 @@
-
-
+
+
+
+
-
-
-
Screen timeout in seconds:
@@ -2872,9 +2472,6 @@
-
-
-
Brightness: %tw_brightness_pct%%
@@ -2901,34 +2498,27 @@
-
-
+
Vibration Settings :
-
Button Vibration:
-
-
Keyboard Vibration:
-
-
Action Vibration:
-
@@ -2947,18 +2537,14 @@
-
-
+
Advanced
-
-
Copy Log to SD
-
tw_back=advanced
tw_action=copylog
@@ -2971,77 +2557,53 @@
-
-
Fix Permissions
-
fixperms
-
-
Partition SD Card
-
partsdcard
-
-
File Manager
-
filemanagerlist
-
-
Terminal Command
-
terminalfolder
-
-
Reload Theme
-
-
-
ADB Sideload
-
sideload
-
-
HTC Dumlock
-
htcdumlock
-
-
Re-Inject TWRP
-
tw_back=advanced
tw_action=reinjecttwrp
@@ -3069,100 +2631,79 @@
-
-
+
Partition SD Card
-
-
tw_sdext_size-128
-
-
tw_sdext_size+128
-
-
+
EXT Size: %tw_sdext_size%
-
-
tw_swap_size-32
-
-
tw_swap_size+32
-
-
+
Swap Size: %tw_swap_size%
-
-
+
File system: %tw_sdpart_file_system%
-
-
EXT3
-
tw_sdpart_file_system=ext3
-
-
EXT4
-
tw_sdpart_file_system=ext4
-
-
+
You will lose all files on your SD card!
-
-
+
This action cannot be undone!
-
-
+ Swipe to Partition
partsdcardaction
tw_back=partsdcard
@@ -3177,12 +2718,6 @@
-
-
-
- Swipe to Partition
-
-
main
@@ -3199,19 +2734,14 @@
-
-
+
HTC Dumlock
-
-
-
Restore Original Boot
-
tw_back=htcdumlock
tw_action=htcdumlockrestoreboot
@@ -3224,12 +2754,8 @@
-
-
-
Reflash Recovery
-
tw_back=htcdumlock
tw_action=htcdumlockreflashrecovery
@@ -3242,12 +2768,8 @@
-
-
-
Install HTC Dumlock
-
tw_back=htcdumlock
tw_action=installhtcdumlock
@@ -3281,38 +2803,22 @@
-
-
-
-
-
-
-
-
Swipe to Unlock
+
-
-
+
File Manager: Select a File or Folder
-
-
-
%tw_file_location1%
-
-
-
-
-
@@ -3345,12 +2851,9 @@
-
-
+
-
Select
-
tw_filename1=tw_file_location1
tw_fm_isfolder=1
@@ -3365,25 +2868,20 @@
-
-
+
%tw_fm_type% Selected:
-
-
+
%tw_filename1%
-
-
Copy File
-
tw_filemanager_command=cp
tw_fm_text1=Copying
@@ -3392,12 +2890,9 @@
-
-
Copy Folder
-
tw_filemanager_command=cd "%tw_file_location1%" && cd .. && cp -R
tw_fm_text1=Copying
@@ -3406,11 +2901,8 @@
-
-
Move
-
tw_filemanager_command=mv
tw_fm_text1=Moving
@@ -3419,11 +2911,8 @@
-
-
chmod 755
-
tw_filemanager_command=chmod 755
tw_fm_text1=chmod 755
@@ -3436,11 +2925,8 @@
-
-
chmod
-
tw_filemanager_rename=0000
tw_fm_text2=
@@ -3452,11 +2938,8 @@
-
-
Delete
-
tw_filemanager_command=rm -rf
tw_fm_text1=Deleting
@@ -3469,12 +2952,9 @@
-
-
Rename File
-
tw_filemanager_rename=tw_selection1
tw_fm_text1=Renaming
@@ -3484,12 +2964,9 @@
-
-
Rename Folder
-
tw_filemanager_rename=tw_selection1
tw_fm_text1=Renaming
@@ -3514,23 +2991,14 @@
-
-
+
Browse to Destination Folder & Press Select
-
-
-
%tw_file_location2%
-
-
-
-
-
@@ -3549,12 +3017,9 @@
filemanageroptions
-
-
+
-
Select
-
tw_fm_text2=to
tw_fm_text3=%tw_file_location2%
@@ -3570,17 +3035,13 @@
-
+
-
Please Enter a New %tw_fm_type% Name
-
-
-
%tw_filemanager_rename%
@@ -3594,11 +3055,8 @@
-
-
Cancel
-
filemanageroptions
@@ -3620,17 +3078,13 @@
-
+
-
Please Enter a New %tw_fm_type% Name
-
-
-
%tw_filemanager_rename%
@@ -3644,11 +3098,8 @@
-
-
Cancel
-
filemanageroptions
@@ -3670,17 +3121,13 @@
-
+
-
Please Enter New Permissions
-
-
-
%tw_filemanager_rename%
@@ -3693,11 +3140,8 @@
-
-
Cancel
-
filemanageroptions
@@ -3719,48 +3163,35 @@
-
-
+
%tw_fm_text1%
-
-
+
%tw_filename1%
-
-
+
%tw_fm_text2%
-
-
+
%tw_fm_text3%
-
-
+
Press back button to cancel.
-
-
filemanageracction
-
-
-
- Swipe to Confirm
-
-
%tw_back%
@@ -3777,9 +3208,7 @@
-
-
-
+
%tw_fm_text1%
@@ -3829,17 +3258,13 @@
-
-
+
Please Enter Your Password
-
-
-
%tw_crypto_display%
@@ -3848,19 +3273,16 @@
-
+
-
+
Password Failed, Please Try Again
-
-
Cancel
-
tw_page_done=1
main
@@ -3875,8 +3297,7 @@
-
-
+
Trying Decryption with Your Password
@@ -3915,23 +3336,14 @@
-
-
+
Browse to Starting Folder
-
-
-
%tw_terminal_location%
-
-
-
-
-
@@ -3950,12 +3362,9 @@
advanced
-
-
+
-
Select
-
terminalcommand
@@ -3969,35 +3378,26 @@
-
-
-
+
-
Starting Path: %tw_terminal_location%
-
-
-
%tw_terminal_command%
%tw_terminal_command%
-
-
+
-
KILL
-
@@ -4017,31 +3417,25 @@
-
-
+
ADB Sideload
-
Wipe Dalvik Cache.
-
-
Wipe Cache.
-
-
-
+ Swipe to Start Sideload
tw_back=advanced
tw_action=adbsideload
@@ -4055,12 +3449,6 @@
-
-
-
- Swipe to Start Sideload
-
-
main
@@ -4077,41 +3465,34 @@
-
-
+
Fix Permissions
-
-
+
Note: Fixing permissions is rarely needed.
-
Also fix SELinux contexts
-
-
-
+
Fixing SELinux contexts may cause
-
-
+
your device to not boot properly.
-
-
+ Swipe to Fix Permissions
tw_back=advanced
tw_action=fixpermissions
@@ -4123,12 +3504,6 @@
-
-
-
- Swipe to Fix Permissions
-
-
main
@@ -4145,42 +3520,34 @@
-
-
+
Install SuperSU?
-
-
+
Your device does not appear to be rooted.
-
-
+
Install SuperSU now?
-
-
+
This will root your device.
-
-
Do Not Install
- tw_page_done=1
-
-
+ Swipe to Install
tw_action=installsu
tw_action_text1=Installing SuperSU
@@ -4188,12 +3555,6 @@
singleaction_page
-
-
-
-
- Swipe to Install
-
diff --git a/gui/devices/watch/res/watch.xml b/gui/devices/watch/res/watch.xml
index 49e172e3..786049a0 100644
--- a/gui/devices/watch/res/watch.xml
+++ b/gui/devices/watch/res/watch.xml
@@ -1,6 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -17,75 +113,51 @@
-
-
Install
-
install_select
-
-
Wipe
-
wipe
-
-
Backup
-
backup
-
-
Restore
-
restore
-
-
Mount
-
mount
-
-
Settings
-
settings
-
-
Advanced
-
advanced
-
-
Reboot
-
reboot
@@ -98,11 +170,8 @@
-
-
Install Zips
-
install
@@ -110,11 +179,8 @@
-
-
Install Images
-
install_image
@@ -134,17 +200,13 @@
-
-
+
Select Zip to Install
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=install
@@ -153,16 +215,8 @@
-
-
-
%tw_zip_location%
-
-
-
-
-
@@ -195,93 +249,71 @@
-
-
+
This operation may install incompatible
-
-
+
software and render your device unusable.
-
-
+
Folder and File:
-
-
+
+
%tw_zip_location%
-
-
+
+
%tw_file%
-
-
+
Press back to cancel adding this zip.
-
Zip file signature verification.
-
-
Inject TWRP after install.
-
-
-
+
File %tw_zip_queue_count% of max of 10
-
-
+ Swipe to Confirm Flash
flash_zip
-
-
-
- Swipe to Confirm Flash
-
-
-
-
Add More Zips
-
install
-
-
Clear Zip Queue
-
install
@@ -307,19 +339,16 @@
-
-
-
-
-
+
+
Flashing file %tw_zip_index% of %tw_zip_queue_count%
-
-
-
+
+
+
%tw_filename%
@@ -334,24 +363,18 @@
-
-
+
Zip Install Complete
-
-
-
-
Wipe cache/dalvik
-
tw_back=flash_done
tw_action=wipe
@@ -367,39 +390,20 @@
-
-
+
-
- Reboot System
-
-
- tw_back=main2
- tw_action=reboot
- tw_action_param=system
- tw_has_action2=0
- tw_text1=No OS Installed! Are you
- tw_text2=sure you wish to reboot?
- tw_text3=
- tw_text4=
- tw_action_text1=Rebooting...
- tw_action_text2=
- tw_complete_text1=Rebooting...
- tw_slider_text=Swipe to Reboot
- rebootcheck
-
-
+
-
+
Failed
-
+
-
+
Successful
@@ -424,17 +428,13 @@
-
-
+
Select Image to Install
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=install_image
@@ -443,16 +443,8 @@
-
-
-
%tw_zip_location%
-
-
-
-
-
@@ -483,46 +475,37 @@
-
-
-
Select Partition to Flash Image:
-
-
-
-
-
+
Folder:
-
-
+
+
%tw_zip_location%
-
-
+
File to flash:
-
-
+
+
%tw_file%
-
-
+ Swipe to Confirm Flash
tw_back=flashimage_confirm
tw_action=flashimage
@@ -535,12 +518,6 @@
-
-
-
- Swipe to Confirm Flash
-
-
@@ -583,46 +560,34 @@
-
-
+
%tw_text1%
-
-
+
%tw_text2%
-
-
+
%tw_text3%
-
-
+
%tw_text4%
-
-
+
Press back button to cancel.
-
-
- action_page
-
-
-
-
-
%tw_slider_text%
+ action_page
@@ -642,27 +607,22 @@
-
-
+
%tw_action_text1%
-
-
+
%tw_action_text2%
-
-
+
-
Cancel
-
%tw_cancel_param%
@@ -694,14 +654,12 @@
-
-
+
%tw_action_text1%
-
-
+
%tw_action_text2%
@@ -736,22 +694,21 @@
-
-
+
%tw_complete_text1%
-
+
-
+
Failed
-
+
-
+
Successful
@@ -818,66 +775,55 @@
-
-
+
Factory Reset
-
-
+
Wipes Data, Cache, and Dalvik
-
+
-
(not including internal storage)
-
+
-
Android Secure
-
+
-
SD-EXT
-
-
+
Most of the time this is
-
-
+
the only wipe that you need.
-
-
+
Press back button to cancel.
-
-
Advanced Wipe
-
partitionlisterror=0
advancedwipe
@@ -886,11 +832,8 @@
-
-
Format Data
-
formatdata
@@ -901,11 +844,8 @@
-
-
Wipe Encryption
-
tw_back=wipe
tw_action=wipe
@@ -921,8 +861,7 @@
-
-
+ Swipe to Factory Reset
tw_back=wipe
tw_action=wipe
@@ -933,12 +872,6 @@
-
-
-
- Swipe to Factory Reset
-
-
main
@@ -957,29 +890,20 @@
tw_wipe_list=
-
-
+
Wipe Menu
-
-
-
Select Partitions to Wipe:
-
-
-
-
-
-
+ Swipe to Wipe
tw_back=advancedwipe
tw_action=wipe
@@ -991,11 +915,8 @@
-
-
-
+
-
Repair or Change File System
@@ -1003,19 +924,13 @@
-
+
-
+
Invalid partition selection
-
-
-
- Swipe to Wipe
-
-
main
@@ -1030,41 +945,33 @@
-
-
+
Format Data will wipe all of your apps,
-
-
+
backups, pictures, videos, media, and
-
-
+
removes encryption on internal storage.
-
-
+
This cannot be undone. Press back to cancel.
-
-
+
Type yes to continue.
-
-
-
%tw_confirm_formatdata%
@@ -1128,83 +1035,69 @@
-
-
+
Partition Options for: %tw_partition_name%
-
-
+
Mount Point: %tw_partition_mount_point%
-
-
+
Current file system: %tw_partition_file_system%
-
+
-
Present: Yes
-
+
-
Present: No
-
+
-
Removable: Yes
-
+
-
Removable: No
-
-
+
Size: %tw_partition_size%MB
-
-
+
Used: %tw_partition_used%MB
-
-
+
Free: %tw_partition_free%MB
-
-
+
Backup Size: %tw_partition_backup_size%MB
-
-
Repair
-
tw_back=partitionoptions
tw_action=repair
@@ -1220,11 +1113,8 @@
-
-
Change File Sys
-
selectfilesystem
@@ -1264,37 +1154,30 @@
-
-
+
Change file system for: %tw_partition_name%
-
-
+
Mount Point: %tw_partition_mount_point%
-
-
+
Current file system: %tw_partition_file_system%
-
-
+
Proceed with caution!
-
-
EXT2
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1312,11 +1195,8 @@
-
-
EXT3
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1334,11 +1214,8 @@
-
-
EXT4
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1356,11 +1233,8 @@
-
-
F2FS
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1378,11 +1252,8 @@
-
-
FAT
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1400,11 +1271,8 @@
-
-
exFAT
-
tw_back=refreshfilesystem
tw_action=changefilesystem
@@ -1436,11 +1304,8 @@
-
-
-
+
-
Backup Name: %tw_backup_name%
tw_fileexists=0
@@ -1449,33 +1314,20 @@
-
-
-
Select Partitions to Back Up:
-
-
-
-
-
-
-
+
-
More...
backupoptions
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=backup
@@ -1485,22 +1337,13 @@
-
Compression
-
-
-
- backup_run
-
-
-
-
-
Swipe to Back Up
+ backup_run
@@ -1517,36 +1360,29 @@
-
-
+
More Backup Options
-
+
-
-
-
No Encryption
backupencryption
-
+
-
-
-
Using Encryption
tw_password_not_match=0
@@ -1554,11 +1390,8 @@
-
-
-
+
-
Refresh Sizes
@@ -1566,11 +1399,8 @@
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=backupotions
@@ -1580,18 +1410,14 @@
-
Enable compression.
-
-
Skip MD5 generation during backup.
-
@@ -1619,17 +1445,13 @@
-
+
-
Please Enter a Backup Name
-
-
-
%tw_backup_name%
@@ -1641,28 +1463,22 @@
-
+
-
+
A backup with that name already exists!
-
-
Append Date
-
-
-
Cancel
-
tw_backup_name=(Auto Generate)
backup
@@ -1693,42 +1509,34 @@
-
-
+
Encrypt your backup?
-
-
+
Please Enter A Password:
-
-
-
%tw_backup_encrypt_display%
backupencryption2
-
+
-
+
Passwords Do Not Match
-
-
Cancel
-
tw_encrypt_backup=0
tw_backup_password=
@@ -1757,23 +1565,18 @@
-
-
+
Encrypt your backup?
-
-
+
Please Enter Password Again:
-
-
-
%tw_backup_encrypt_display2%
@@ -1783,11 +1586,8 @@
-
-
Cancel
-
tw_encrypt_backup=0
tw_backup_password=
@@ -1839,20 +1639,17 @@
-
-
+
%tw_operation% %tw_partition%
-
-
+
%tw_file_progress%
-
-
+
%tw_size_progress%
@@ -1863,12 +1660,9 @@
-
-
+
-
Cancel
-
@@ -1906,11 +1700,8 @@
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=restore
@@ -1919,16 +1710,8 @@
-
-
-
Select Package to Restore:
-
-
-
-
-
@@ -1978,23 +1761,18 @@
-
-
+
Backup Encrypted
-
-
+
Please Enter Your Password:
-
-
-
%tw_restore_display%
@@ -2003,19 +1781,16 @@
-
+
-
+
Password Failed, Please Try Again
-
-
Cancel
-
tw_page_done=1
restore
@@ -2023,11 +1798,8 @@
-
-
Delete
-
tw_back=restore
tw_action=cmd
@@ -2059,8 +1831,7 @@
-
-
+
Trying Decryption with Your Password
@@ -2100,24 +1871,14 @@
-
-
-
Restoring: %tw_restore_name%
-
-
-
-
-
-
-
+
-
Rename Backup
tw_backup_rename=
@@ -2126,11 +1887,8 @@
-
-
-
+
-
Delete Backup
tw_back=restore
@@ -2147,22 +1905,13 @@
-
Enable MD5 verification of backup.
-
-
-
- restore_run
-
-
-
-
-
Swipe to Restore
+ restore_run
@@ -2179,17 +1928,13 @@
-
+
-
Please Enter a New Backup Name
-
-
-
%tw_backup_rename%
@@ -2209,19 +1954,16 @@
-
+
-
+
A backup with that name already exists!
-
-
Cancel
-
restore_select
@@ -2243,14 +1985,12 @@
-
-
+
%tw_operation% %tw_partition%
-
-
+
%tw_size_progress%
@@ -2278,25 +2018,16 @@
-
-
-
Select Storage:
-
-
-
-
-
OK
-
tw_clear_destination=%tw_back%
clear_vars
@@ -2322,23 +2053,13 @@
-
-
-
Select Partitions to Mount:
-
-
-
-
-
-
-
+
-
Storage: %tw_storage_display_name% (%tw_storage_free_size% MB)
tw_back=mount
@@ -2347,51 +2068,39 @@
-
-
USB Storage
-
usb_mount
-
-
Enable MTP
-
-
-
Disable MTP
-
-
-
Decrypt Data
-
decrypt
@@ -2411,8 +2120,7 @@
-
-
+
USB Storage Mounted
@@ -2423,18 +2131,14 @@
Be sure to safely remove your device
-
+
-
from your computer before unmounting!
-
-
Unmount
-
usb_umount
@@ -2458,40 +2162,20 @@
-
-
+
Reboot Menu
-
-
-
System
-
-
- tw_back=reboot
- tw_action=reboot
- tw_action_param=system
- tw_has_action2=0
- tw_text1=No OS Installed! Are you
- tw_text2=sure you wish to reboot?
- tw_action_text1=Rebooting...
- tw_complete_text1=Rebooting...
- tw_slider_text=Swipe to Reboot
- rebootcheck
-
-
-
Power Off
-
tw_back=reboot
tw_action=reboot
@@ -2507,12 +2191,9 @@
-
-
Recovery
-
tw_back=reboot
tw_action=reboot
@@ -2528,12 +2209,9 @@
-
-
Bootloader
-
tw_back=reboot
tw_action=reboot
@@ -2549,12 +2227,9 @@
-
-
Download
-
tw_back=reboot
tw_action=reboot
@@ -2587,94 +2262,68 @@
-
Zip file signature verification.
-
-
Use rm -rf instead of formatting.
-
-
Skip MD5 generation during backup.
-
-
Enable MD5 verification of backup files.
-
-
Use 24-hour clock.
-
-
Simulate actions for theme testing.
-
-
Simulate failure for actions.
-
-
-
Time Zone
-
timezone
-
-
Screen
-
screen
-
-
Restore Defaults
-
-
-
Vibration
-
vibrate
@@ -2694,16 +2343,10 @@
-
-
+
-
-
Select Time Zone:
-
-
-
BST11;BDT
HST10;HDT
@@ -2733,65 +2376,46 @@
-
Do you use daylight savings time (DST)?
-
-
-
+
Offset (usually 0): %tw_time_zone_guioffset%
-
-
+
-
None
-
tw_time_zone_guioffset=0
-
-
+
-
15
-
tw_time_zone_guioffset=15
-
-
+
-
30
-
tw_time_zone_guioffset=30
-
-
+
-
45
-
tw_time_zone_guioffset=45
-
-
Set Time Zone
-
-
-
+
Current Time Zone: %tw_time_zone%
@@ -2810,8 +2434,7 @@
-
-
+
Screen Settings
@@ -2837,12 +2460,11 @@
-
-
+
+
+
+
-
-
-
Screen timeout in seconds:
@@ -2850,9 +2472,6 @@
-
-
-
Brightness: %tw_brightness_pct%%
@@ -2879,34 +2498,27 @@
-
-
+
Vibration Settings :
-
Button Vibration:
-
-
Keyboard Vibration:
-
-
Action Vibration:
-
@@ -2925,18 +2537,14 @@
-
-
+
Advanced
-
-
Copy Log to SD
-
tw_back=advanced
tw_action=copylog
@@ -2949,77 +2557,53 @@
-
-
Fix Permissions
-
fixperms
-
-
Partition SD Card
-
partsdcard
-
-
File Manager
-
filemanagerlist
-
-
Terminal Command
-
terminalfolder
-
-
Reload Theme
-
-
-
ADB Sideload
-
sideload
-
-
HTC Dumlock
-
htcdumlock
-
-
Re-Inject TWRP
-
tw_back=advanced
tw_action=reinjecttwrp
@@ -3047,101 +2631,81 @@
-
-
+
Partition SD Card
-
-
tw_sdext_size-128
-
-
tw_sdext_size+128
-
-
+
EXT Size: %tw_sdext_size%
-
-
tw_swap_size-32
-
-
tw_swap_size+32
-
-
+
Swap Size: %tw_swap_size%
-
-
+
File system: %tw_sdpart_file_system%
-
EXT3
-
tw_sdpart_file_system=ext3
-
-
EXT4
tw_sdpart_file_system=ext4
-
-
+
You will lose all files on your SD card!
-
-
+
This action cannot be undone!
-
-
- partsdcardaction
+ Swipe to Partition
tw_back=partsdcard
tw_action=partitionsd
@@ -3155,12 +2719,6 @@
-
-
-
- Swipe to Partition
-
-
main
@@ -3175,19 +2733,14 @@
-
-
+
HTC Dumlock
-
-
-
Restore Original Boot
-
tw_back=htcdumlock
tw_action=htcdumlockrestoreboot
@@ -3200,12 +2753,8 @@
-
-
-
Reflash Recovery
-
tw_back=htcdumlock
tw_action=htcdumlockreflashrecovery
@@ -3218,12 +2767,8 @@
-
-
-
Install HTC Dumlock
-
tw_back=htcdumlock
tw_action=installhtcdumlock
@@ -3257,38 +2802,22 @@
-
-
-
-
-
-
-
-
Swipe to Unlock
+
-
-
+
File Manager: Select a File or Folder
-
-
-
%tw_file_location1%
-
-
-
-
-
@@ -3321,12 +2850,9 @@
-
-
+
-
Select
-
tw_filename1=tw_file_location1
tw_fm_isfolder=1
@@ -3339,25 +2865,20 @@
-
-
+
%tw_fm_type% Selected:
-
-
+
%tw_filename1%
-
-
Copy File
-
tw_filemanager_command=cp
tw_fm_text1=Copying
@@ -3366,12 +2887,9 @@
-
-
Copy Folder
-
tw_filemanager_command=cd "%tw_file_location1%" && cd .. && cp -R
tw_fm_text1=Copying
@@ -3380,11 +2898,8 @@
-
-
Move
-
tw_filemanager_command=mv
tw_fm_text1=Moving
@@ -3393,11 +2908,8 @@
-
-
chmod 755
-
tw_filemanager_command=chmod 755
tw_fm_text1=chmod 755
@@ -3410,11 +2922,8 @@
-
-
chmod
-
tw_filemanager_rename=0000
tw_fm_text2=
@@ -3426,11 +2935,8 @@
-
-
Delete
-
tw_filemanager_command=rm -rf
tw_fm_text1=Deleting
@@ -3443,12 +2949,9 @@
-
-
Rename File
-
tw_filemanager_rename=tw_selection1
tw_fm_text1=Renaming
@@ -3458,12 +2961,9 @@
-
-
Rename Folder
-
tw_filemanager_rename=tw_selection1
tw_fm_text1=Renaming
@@ -3488,23 +2988,14 @@
-
-
+
Browse to Destination & Press Select
-
-
-
%tw_file_location2%
-
-
-
-
-
@@ -3523,12 +3014,9 @@
filemanageroptions
-
-
+
-
Select
-
tw_fm_text2=to
tw_fm_text3=%tw_file_location2%
@@ -3542,17 +3030,13 @@
-
+
-
Please Enter a New %tw_fm_type% Name
-
-
-
%tw_filemanager_rename%
@@ -3566,11 +3050,8 @@
-
-
Cancel
-
filemanageroptions
@@ -3592,17 +3073,13 @@
-
+
-
Please Enter a New %tw_fm_type% Name
-
-
-
%tw_filemanager_rename%
@@ -3616,11 +3093,8 @@
-
-
Cancel
-
filemanageroptions
@@ -3650,9 +3124,6 @@
-
-
-
%tw_filemanager_rename%
@@ -3665,11 +3136,8 @@
-
-
Cancel
-
filemanageroptions
@@ -3691,48 +3159,35 @@
-
-
+
%tw_fm_text1%
-
-
+
%tw_filename1%
-
-
+
%tw_fm_text2%
-
-
+
%tw_fm_text3%
-
-
+
Press back button to cancel.
-
-
filemanageracction
-
-
-
- Swipe to Confirm
-
-
%tw_back%
@@ -3747,9 +3202,7 @@
-
-
-
+
%tw_fm_text1%
@@ -3799,17 +3252,13 @@
-
-
+
Please Enter Your Password
-
-
-
%tw_crypto_display%
@@ -3818,19 +3267,16 @@
-
+
-
+
Password Failed, Please Try Again
-
-
Cancel
-
tw_page_done=1
main
@@ -3845,8 +3291,7 @@
-
-
+
Trying Decryption with Your Password
@@ -3885,23 +3330,14 @@
-
-
+
Browse to Starting Folder
-
-
-
%tw_terminal_location%
-
-
-
-
-
@@ -3920,12 +3356,9 @@
advanced
-
-
+
-
Select
-
terminalcommand
@@ -3937,35 +3370,26 @@
-
-
-
+
-
Starting Path: %tw_terminal_location%
-
-
-
%tw_terminal_command%
%tw_terminal_command%
-
-
+
-
KILL
-
@@ -3985,31 +3409,25 @@
-
-
+
ADB Sideload
-
Wipe Dalvik Cache.
-
-
Wipe Cache.
-
-
-
+ Swipe to Start Sideload
tw_back=advanced
tw_action=adbsideload
@@ -4023,12 +3441,6 @@
-
-
-
- Swipe to Start Sideload
-
-
main
@@ -4043,41 +3455,34 @@
-
-
+
Fix Permissions
-
-
+
Note: Fixing permissions is rarely needed.
-
Also fix SELinux contexts
-
-
-
+
Fixing SELinux contexts may cause
-
-
+
your device to not boot properly.
-
-
+ Swipe to Fix Permissions
tw_back=advanced
tw_action=fixpermissions
@@ -4089,12 +3494,6 @@
-
-
-
- Swipe to Fix Permissions
-
-
main
@@ -4111,42 +3510,34 @@
-
-
+
Install SuperSU?
-
-
+
Your device does not appear to be rooted.
-
-
+
Install SuperSU now?
-
-
+
This will root your device.
-
-
Do Not Install
-
tw_page_done=1
-
-
+ Swipe to Install
tw_action=installsu
tw_action_text1=Installing SuperSU
@@ -4154,12 +3545,6 @@
singleaction_page
-
-
-
-
- Swipe to Install
-
diff --git a/gui/fileselector.cpp b/gui/fileselector.cpp
index 5c287c34..2602eb25 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;
}
diff --git a/gui/fill.cpp b/gui/fill.cpp
index 1ddefaa9..b315cd08 100644
--- a/gui/fill.cpp
+++ b/gui/fill.cpp
@@ -27,23 +27,15 @@ extern "C" {
GUIFill::GUIFill(xml_node<>* node) : GUIObject(node)
{
- xml_attribute<>* attr;
- xml_node<>* child;
-
- if (!node)
- return;
-
- attr = node->first_attribute("color");
- if (!attr) {
+ bool has_color = false;
+ mColor = LoadAttrColor(node, "color", &has_color);
+ if (!has_color) {
LOGERR("No color specified for fill\n");
return;
}
- std::string color = attr->value();
- ConvertStrToColor(color, &mColor);
-
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH);
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH);
return;
}
diff --git a/gui/image.cpp b/gui/image.cpp
index 60b1cb95..8b43aaa3 100644
--- a/gui/image.cpp
+++ b/gui/image.cpp
@@ -27,9 +27,6 @@ extern "C" {
GUIImage::GUIImage(xml_node<>* node) : GUIObject(node)
{
- xml_attribute<>* attr;
- xml_node<>* child;
-
mImage = NULL;
mHighlightImage = NULL;
isHighlighted = false;
@@ -37,15 +34,11 @@ GUIImage::GUIImage(xml_node<>* node) : GUIObject(node)
if (!node)
return;
- child = node->first_node("image");
- if (child)
- {
- mImage = LoadAttrImage(child, "resource");
- mHighlightImage = LoadAttrImage(child, "highlightresource");
- }
+ mImage = LoadAttrImage(FindNode(node, "image"), "resource");
+ mHighlightImage = LoadAttrImage(FindNode(node, "image"), "highlightresource");
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, NULL, NULL, &mPlacement);
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, NULL, NULL, &mPlacement);
if (mImage && mImage->GetResource())
{
diff --git a/gui/input.cpp b/gui/input.cpp
index 299034a2..ca27ea81 100644
--- a/gui/input.cpp
+++ b/gui/input.cpp
@@ -85,7 +85,7 @@ GUIInput::GUIInput(xml_node<>* node)
}
// Load the background
- child = node->first_node("background");
+ child = FindNode(node, "background");
if (child)
{
mBackground = LoadAttrImage(child, "resource");
@@ -98,7 +98,7 @@ GUIInput::GUIInput(xml_node<>* node)
}
// Load the cursor color
- child = node->first_node("cursor");
+ child = FindNode(node, "cursor");
if (child)
{
mCursor = LoadAttrImage(child, "resource");
@@ -106,31 +106,26 @@ GUIInput::GUIInput(xml_node<>* node)
attr = child->first_attribute("hasfocus");
if (attr)
{
- std::string color = attr->value();
- SetInputFocus(atoi(color.c_str()));
- }
- attr = child->first_attribute("width");
- if (attr)
- {
- std::string cwidth = gui_parse_text(attr->value());
- CursorWidth = scale_theme_x(atoi(cwidth.c_str()));
+ std::string focus = attr->value();
+ SetInputFocus(atoi(focus.c_str()));
}
+ CursorWidth = LoadAttrIntScaleX(child, "width", CursorWidth);
}
DrawCursor = HasInputFocus;
// Load the font
- child = node->first_node("font");
+ child = FindNode(node, "font");
if (child)
{
mFont = LoadAttrFont(child, "resource");
mFontHeight = mFont->GetHeight();
}
- child = node->first_node("text");
+ child = FindNode(node, "text");
if (child) mText = child->value();
mLastValue = gui_parse_text(mText);
- child = node->first_node("data");
+ child = FindNode(node, "data");
if (child)
{
attr = child->first_attribute("name");
@@ -139,11 +134,8 @@ GUIInput::GUIInput(xml_node<>* node)
attr = child->first_attribute("default");
if (attr)
DataManager::SetValue(mVariable, attr->value());
- attr = child->first_attribute("mask");
- if (attr) {
- mMask = attr->value();
- HasMask = true;
- }
+ mMask = LoadAttrString(child, "mask");
+ HasMask = !mMask.empty();
attr = child->first_attribute("maskvariable");
if (attr)
mMaskVariable = attr->value();
@@ -152,33 +144,19 @@ GUIInput::GUIInput(xml_node<>* node)
}
// Load input restrictions
- child = node->first_node("restrict");
+ child = FindNode(node, "restrict");
if (child)
{
- attr = child->first_attribute("minlen");
- if (attr) {
- std::string attrib = attr->value();
- MinLen = atoi(attrib.c_str());
- }
- attr = child->first_attribute("maxlen");
- if (attr) {
- std::string attrib = attr->value();
- MaxLen = atoi(attrib.c_str());
- }
- attr = child->first_attribute("allow");
- if (attr) {
- HasAllowed = true;
- AllowedList = attr->value();
- }
- attr = child->first_attribute("disable");
- if (attr) {
- HasDisabled = true;
- DisabledList = attr->value();
- }
+ MinLen = LoadAttrInt(child, "minlen", MinLen);
+ MaxLen = LoadAttrInt(child, "maxlen", MaxLen);
+ AllowedList = LoadAttrString(child, "allow");
+ HasAllowed = !AllowedList.empty();
+ DisabledList = LoadAttrString(child, "disable");
+ HasDisabled = !DisabledList.empty();
}
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH);
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH);
SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH);
if (mInputText && mFontHeight && mFontHeight < (unsigned)mRenderH) {
diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp
index 5528be93..d0262aac 100644
--- a/gui/keyboard.cpp
+++ b/gui/keyboard.cpp
@@ -48,7 +48,8 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node)
{
int layoutindex, rowindex, keyindex, Xindex, Yindex, keyHeight = 0, keyWidth = 0;
rowY = colX = -1;
- highlightRenderCount = hasHighlight = hasCapsHighlight = 0;
+ highlightRenderCount = 0;
+ hasHighlight = hasCapsHighlight = false;
char resource[10], layout[8], row[5], key[6], longpress[7];
xml_attribute<>* attr;
xml_node<>* child;
@@ -66,36 +67,17 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node)
if (!node) return;
// Load the action
- child = node->first_node("action");
+ child = FindNode(node, "action");
if (child)
{
mAction = new GUIAction(node);
}
- memset(&mHighlightColor, 0, sizeof(COLOR));
- child = node->first_node("highlight");
- if (child) {
- attr = child->first_attribute("color");
- if (attr) {
- hasHighlight = 1;
- std::string color = attr->value();
- ConvertStrToColor(color, &mHighlightColor);
- }
- }
-
- memset(&mCapsHighlightColor, 0, sizeof(COLOR));
- child = node->first_node("capshighlight");
- if (child) {
- attr = child->first_attribute("color");
- if (attr) {
- hasCapsHighlight = 1;
- std::string color = attr->value();
- ConvertStrToColor(color, &mCapsHighlightColor);
- }
- }
+ mHighlightColor = LoadAttrColor(FindNode(node, "highlight"), "color", &hasHighlight);
+ mCapsHighlightColor = LoadAttrColor(FindNode(node, "capshighlight"), "color", &hasCapsHighlight);
// Load the images for the different layouts
- child = node->first_node("layout");
+ child = FindNode(node, "layout");
if (child)
{
layoutindex = 1;
@@ -120,7 +102,7 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node)
// Load all of the layout maps
layoutindex = 1;
strcpy(layout, "layout1");
- keylayout = node->first_node(layout);
+ keylayout = FindNode(node, layout);
while (keylayout)
{
if (layoutindex > MAX_KEYBOARD_LAYOUTS) {
@@ -212,12 +194,12 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node)
}
layoutindex++;
layout[6] = (char)(layoutindex + 48);
- keylayout = node->first_node(layout);
+ keylayout = FindNode(node, layout);
}
int x, y, w, h;
// Load the placement
- LoadPlacement(node->first_node("placement"), &x, &y, &w, &h);
+ LoadPlacement(FindNode(node, "placement"), &x, &y, &w, &h);
SetActionPos(x, y, KeyboardWidth, KeyboardHeight);
SetRenderPos(x, y, w, h);
return;
diff --git a/gui/listbox.cpp b/gui/listbox.cpp
index 7c7afa95..625b4b7d 100644
--- a/gui/listbox.cpp
+++ b/gui/listbox.cpp
@@ -37,7 +37,7 @@ GUIListBox::GUIListBox(xml_node<>* node) : GUIScrollList(node)
mUpdate = 0;
// Get the icons, if any
- child = node->first_node("icon");
+ child = FindNode(node, "icon");
if (child) {
mIconSelected = LoadAttrImage(child, "selected");
mIconUnselected = LoadAttrImage(child, "unselected");
@@ -47,7 +47,7 @@ GUIListBox::GUIListBox(xml_node<>* node) : GUIScrollList(node)
SetMaxIconSize(iconWidth, iconHeight);
// Handle the result variable
- child = node->first_node("data");
+ child = FindNode(node, "data");
if (child) {
attr = child->first_attribute("name");
if (attr)
@@ -60,7 +60,7 @@ GUIListBox::GUIListBox(xml_node<>* node) : GUIScrollList(node)
}
// Get the data for the list
- child = node->first_node("listitem");
+ child = FindNode(node, "listitem");
if (!child) return;
while (child) {
ListData data;
diff --git a/gui/mousecursor.cpp b/gui/mousecursor.cpp
index 62558862..84e6322a 100644
--- a/gui/mousecursor.cpp
+++ b/gui/mousecursor.cpp
@@ -51,11 +51,11 @@ void MouseCursor::LoadData(xml_node<>* node)
xml_attribute<>* attr;
xml_node<>* child;
- child = node->first_node("placement");
+ child = FindNode(node, "placement");
if(child)
LoadPlacement(child, &mRenderX, &mRenderY, &mRenderW, &mRenderH);
- child = node->first_node("background");
+ child = FindNode(node, "background");
if(child)
{
m_color = LoadAttrColor(child, "color", m_color);
@@ -67,7 +67,7 @@ void MouseCursor::LoadData(xml_node<>* node)
}
}
- child = node->first_node("speed");
+ child = FindNode(node, "speed");
if(child)
{
attr = child->first_attribute("multiplier");
diff --git a/gui/object.cpp b/gui/object.cpp
index d496414c..7cce5db8 100644
--- a/gui/object.cpp
+++ b/gui/object.cpp
@@ -35,9 +35,9 @@ GUIObject::GUIObject(xml_node<>* node)
if (!node) return;
// First, get the action
- xml_node<>* condition = node->first_node("conditions");
- if (condition) condition = condition->first_node("condition");
- else condition = node->first_node("condition");
+ xml_node<>* condition = FindNode(node, "conditions");
+ if (condition) condition = FindNode(condition, "condition");
+ else condition = FindNode(node, "condition");
if (!condition) return;
diff --git a/gui/objects.hpp b/gui/objects.hpp
index b6937a21..ceb2c6c0 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -649,6 +649,7 @@ protected:
std::vector mFolderList;
std::vector mFileList;
std::string mPathVar; // current path displayed, saved in the data manager
+ std::string mPathDefault; // default value for the path if none is set in mPathVar
std::string mExtn; // used for filtering the file list, for example, *.zip
std::string mVariable; // set when the user selects an item, pull path like /path/to/foo
std::string mSortVariable; // data manager variable used to change the sorting of files
@@ -812,6 +813,7 @@ public:
protected:
GUIAction* sAction;
+ GUIText* sSliderLabel;
ImageResource* sSlider;
ImageResource* sSliderUsed;
ImageResource* sTouch;
@@ -875,7 +877,8 @@ protected:
int currentLayout;
int row_heights[MAX_KEYBOARD_LAYOUTS][MAX_KEYBOARD_ROWS];
unsigned int KeyboardWidth, KeyboardHeight;
- int rowY, colX, highlightRenderCount, hasHighlight, hasCapsHighlight;
+ int rowY, colX, highlightRenderCount;
+ bool hasHighlight, hasCapsHighlight;
GUIAction* mAction;
COLOR mHighlightColor;
COLOR mCapsHighlightColor;
@@ -1064,10 +1067,12 @@ private:
};
// Helper APIs
+xml_node<>* FindNode(xml_node<>* parent, const char* nodename, int depth = 0);
std::string LoadAttrString(xml_node<>* element, const char* attrname, const char* defaultvalue = "");
int LoadAttrInt(xml_node<>* element, const char* attrname, int defaultvalue = 0);
int LoadAttrIntScaleX(xml_node<>* element, const char* attrname, int defaultvalue = 0);
int LoadAttrIntScaleY(xml_node<>* element, const char* attrname, int defaultvalue = 0);
+COLOR LoadAttrColor(xml_node<>* element, const char* attrname, bool* found_color, COLOR defaultvalue = COLOR(0,0,0,0));
COLOR LoadAttrColor(xml_node<>* element, const char* attrname, COLOR defaultvalue = COLOR(0,0,0,0));
FontResource* LoadAttrFont(xml_node<>* element, const char* attrname);
ImageResource* LoadAttrImage(xml_node<>* element, const char* attrname);
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 58e99e60..50c60a69 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -103,6 +103,56 @@ int ConvertStrToColor(std::string str, COLOR* color)
}
// Helper APIs
+xml_node<>* FindNode(xml_node<>* parent, const char* nodename, int depth /* = 0 */)
+{
+ xml_node<>* child = parent->first_node(nodename);
+ if (child)
+ return child;
+
+ if (depth == 10) {
+ LOGERR("Too many style loops detected.\n");
+ return NULL;
+ }
+
+ xml_node<>* style = parent->first_node("style");
+ if (style) {
+ while (style) {
+ if (!style->first_attribute("name")) {
+ LOGERR("No name given for style.\n");
+ continue;
+ } else {
+ std::string name = style->first_attribute("name")->value();
+ xml_node<>* node = PageManager::FindStyle(name);
+
+ if (node) {
+ // We found the style that was named
+ xml_node<>* stylenode = FindNode(node, nodename, depth + 1);
+ if (stylenode)
+ return stylenode;
+ }
+ }
+ style = style->next_sibling("style");
+ }
+ } else {
+ // Search for stylename in the parent node
+ xml_attribute<>* attr = parent->first_attribute("style");
+ // If no style is found anywhere else and the node wasn't found in the object itself
+ // as a special case we will search for a style that uses the same style name as the
+ // object type, so would search for a style named "button"
+ if (!attr)
+ attr = parent->first_attribute("type");
+ if (attr) {
+ xml_node<>* node = PageManager::FindStyle(attr->value());
+ if (node) {
+ xml_node<>* stylenode = FindNode(node, nodename, depth + 1);
+ if (stylenode)
+ return stylenode;
+ }
+ }
+ }
+ return NULL;
+}
+
std::string LoadAttrString(xml_node<>* element, const char* attrname, const char* defaultvalue)
{
if (!element)
@@ -130,9 +180,10 @@ int LoadAttrIntScaleY(xml_node<>* element, const char* attrname, int defaultvalu
return scale_theme_y(LoadAttrInt(element, attrname, defaultvalue));
}
-COLOR LoadAttrColor(xml_node<>* element, const char* attrname, COLOR defaultvalue)
+COLOR LoadAttrColor(xml_node<>* element, const char* attrname, bool* found_color, COLOR defaultvalue)
{
string value = LoadAttrString(element, attrname);
+ *found_color = !value.empty();
// resolve variables
DataManager::GetValue(value, value);
COLOR ret = defaultvalue;
@@ -142,6 +193,12 @@ COLOR LoadAttrColor(xml_node<>* element, const char* attrname, COLOR defaultvalu
return defaultvalue;
}
+COLOR LoadAttrColor(xml_node<>* element, const char* attrname, COLOR defaultvalue)
+{
+ bool found_color = false;
+ return LoadAttrColor(element, attrname, &found_color, defaultvalue);
+}
+
FontResource* LoadAttrFont(xml_node<>* element, const char* attrname)
{
std::string name = LoadAttrString(element, attrname, "");
@@ -621,8 +678,7 @@ int PageSet::Load(ZipArchive* package)
xml_node<>* parent;
xml_node<>* child;
xml_node<>* xmltemplate;
- xml_node<>* blank_templates;
- int pages_loaded = -1, ret;
+ xml_node<>* xmlstyle;
parent = mDoc.first_node("recovery");
if (!parent)
@@ -701,6 +757,11 @@ int PageSet::Load(ZipArchive* package)
if (xmltemplate)
templates.push_back(xmltemplate);
+ // Load styles if present
+ xmlstyle = parent->first_node("styles");
+ if (xmlstyle)
+ styles.push_back(xmlstyle);
+
child = parent->first_node("pages");
if (child) {
if (LoadPages(child)) {
@@ -720,6 +781,7 @@ int PageSet::CheckInclude(ZipArchive* package, xml_document<> *parentDoc)
xml_node<>* parent;
xml_node<>* child;
xml_node<>* xmltemplate;
+ xml_node<>* xmlstyle;
long len;
char* xmlFile = NULL;
string filename;
@@ -817,6 +879,11 @@ int PageSet::CheckInclude(ZipArchive* package, xml_document<> *parentDoc)
if (xmltemplate)
templates.push_back(xmltemplate);
+ // Load styles if present
+ xmlstyle = parent->first_node("styles");
+ if (xmlstyle)
+ styles.push_back(xmlstyle);
+
child = parent->first_node("pages");
if (child && LoadPages(child))
{
@@ -1288,6 +1355,23 @@ HardwareKeyboard *PageManager::GetHardwareKeyboard()
return mHardwareKeyboard;
}
+xml_node<>* PageManager::FindStyle(std::string name)
+{
+ for (std::vector*>::iterator itr = mCurrentSet->styles.begin(); itr != mCurrentSet->styles.end(); itr++) {
+ xml_node<>* node = (*itr)->first_node("style");
+
+ while (node) {
+ if (!node->first_attribute("name"))
+ continue;
+
+ if (name == node->first_attribute("name")->value())
+ return node;
+ node = node->next_sibling("style");
+ }
+ }
+ return NULL;
+}
+
MouseCursor *PageManager::GetMouseCursor()
{
if(!mMouseCursor)
diff --git a/gui/pages.hpp b/gui/pages.hpp
index 31ccadb5..8eec9a95 100644
--- a/gui/pages.hpp
+++ b/gui/pages.hpp
@@ -102,6 +102,8 @@ public:
int SetKeyBoardFocus(int inFocus);
int NotifyVarChange(std::string varName, std::string value);
+ std::vector*> styles;
+
protected:
int LoadPages(xml_node<>* pages);
int LoadVariables(xml_node<>* vars);
@@ -153,6 +155,8 @@ public:
static HardwareKeyboard *GetHardwareKeyboard();
+ static xml_node<>* FindStyle(std::string name);
+
protected:
static PageSet* FindPackage(std::string name);
diff --git a/gui/partitionlist.cpp b/gui/partitionlist.cpp
index 8facfe7e..ba8a94bb 100644
--- a/gui/partitionlist.cpp
+++ b/gui/partitionlist.cpp
@@ -39,7 +39,7 @@ GUIPartitionList::GUIPartitionList(xml_node<>* node) : GUIScrollList(node)
mUpdate = 0;
updateList = false;
- child = node->first_node("icon");
+ child = FindNode(node, "icon");
if (child)
{
mIconSelected = LoadAttrImage(child, "selected");
@@ -47,7 +47,7 @@ GUIPartitionList::GUIPartitionList(xml_node<>* node) : GUIScrollList(node)
}
// Handle the result variable
- child = node->first_node("data");
+ child = FindNode(node, "data");
if (child)
{
attr = child->first_attribute("name");
@@ -62,7 +62,7 @@ GUIPartitionList::GUIPartitionList(xml_node<>* node) : GUIScrollList(node)
int iconHeight = std::max(mIconSelected->GetHeight(), mIconUnselected->GetHeight());
SetMaxIconSize(iconWidth, iconHeight);
- child = node->first_node("listtype");
+ child = FindNode(node, "listtype");
if (child && (attr = child->first_attribute("name"))) {
ListType = attr->value();
updateList = true;
diff --git a/gui/progressbar.cpp b/gui/progressbar.cpp
index a49e0abb..a478a40d 100644
--- a/gui/progressbar.cpp
+++ b/gui/progressbar.cpp
@@ -42,7 +42,7 @@ GUIProgressBar::GUIProgressBar(xml_node<>* node) : GUIObject(node)
return;
}
- child = node->first_node("resource");
+ child = FindNode(node, "resource");
if (child)
{
mEmptyBar = LoadAttrImage(child, "empty");
@@ -50,10 +50,10 @@ GUIProgressBar::GUIProgressBar(xml_node<>* node) : GUIObject(node)
}
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY);
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY);
// Load the data
- child = node->first_node("data");
+ child = FindNode(node, "data");
if (child)
{
mMinValVar = LoadAttrString(child, "min");
diff --git a/gui/scrolllist.cpp b/gui/scrolllist.cpp
index 8d9ab42f..4b772d45 100644
--- a/gui/scrolllist.cpp
+++ b/gui/scrolllist.cpp
@@ -65,18 +65,9 @@ GUIScrollList::GUIScrollList(xml_node<>* node) : GUIObject(node)
mLastHeaderValue = gui_parse_text(mHeaderText);
mHeaderIsStatic = (mLastHeaderValue == mHeaderText);
- memset(&mHighlightColor, 0, sizeof(COLOR));
- child = node->first_node("highlight");
- if (child) {
- attr = child->first_attribute("color");
- if (attr) {
- hasHighlightColor = true;
- std::string color = attr->value();
- ConvertStrToColor(color, &mHighlightColor);
- }
- }
+ mHighlightColor = LoadAttrColor(FindNode(node, "highlight"), "color", &hasHighlightColor);
- child = node->first_node("background");
+ child = FindNode(node, "background");
if (child)
{
mBackground = LoadAttrImage(child, "resource");
@@ -84,11 +75,11 @@ GUIScrollList::GUIScrollList(xml_node<>* node) : GUIObject(node)
}
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH);
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH);
SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH);
// Load the font, and possibly override the color
- child = node->first_node("font");
+ child = FindNode(node, "font");
if (child)
{
mFont = LoadAttrFont(child, "resource");
@@ -98,7 +89,7 @@ GUIScrollList::GUIScrollList(xml_node<>* node) : GUIObject(node)
}
// Load the separator if it exists
- child = node->first_node("separator");
+ child = FindNode(node, "separator");
if (child)
{
mSeparatorColor = LoadAttrColor(child, "color");
@@ -106,7 +97,7 @@ GUIScrollList::GUIScrollList(xml_node<>* node) : GUIObject(node)
}
// Fast scroll
- child = node->first_node("fastscroll");
+ child = FindNode(node, "fastscroll");
if (child)
{
mFastScrollLineColor = LoadAttrColor(child, "linecolor");
@@ -123,7 +114,7 @@ GUIScrollList::GUIScrollList(xml_node<>* node) : GUIObject(node)
actualItemHeight = mFontHeight + mItemSpacing + mSeparatorH;
// Load the header if it exists
- child = node->first_node("header");
+ child = FindNode(node, "header");
if (child)
{
mHeaderH = mFontHeight;
diff --git a/gui/slider.cpp b/gui/slider.cpp
index c53dabc2..2fd114d8 100644
--- a/gui/slider.cpp
+++ b/gui/slider.cpp
@@ -33,6 +33,7 @@ GUISlider::GUISlider(xml_node<>* node) : GUIObject(node)
xml_node<>* child;
sAction = NULL;
+ sSliderLabel = NULL;
sSlider = NULL;
sSliderUsed = NULL;
sTouch = NULL;
@@ -44,7 +45,8 @@ GUISlider::GUISlider(xml_node<>* node) : GUIObject(node)
return;
}
- child = node->first_node("resource");
+ // Load the resources
+ child = FindNode(node, "resource");
if (child)
{
sSlider = LoadAttrImage(child, "base");
@@ -52,11 +54,27 @@ GUISlider::GUISlider(xml_node<>* node) : GUIObject(node)
sTouch = LoadAttrImage(child, "touch");
}
+ // Load the text label
+ sSliderLabel = new GUIText(node);
+ if (sSliderLabel->Render() < 0)
+ {
+ delete sSliderLabel;
+ sSliderLabel = NULL;
+ }
+
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY);
+ Placement TextPlacement = CENTER;
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH, &TextPlacement);
mRenderW = sSlider->GetWidth();
mRenderH = sSlider->GetHeight();
+ if (sSliderLabel) {
+ int sTextX = mRenderX + (mRenderW / 2);
+ int w, h;
+ sSliderLabel->GetCurrentBounds(w, h);
+ int sTextY = mRenderY + ((mRenderH - h) / 2);
+ sSliderLabel->SetRenderPos(sTextX, sTextY);
+ }
if (sTouch && sTouch->GetResource())
{
sTouchW = sTouch->GetWidth(); // Width of the "touch image" that follows the touch (arrow)
@@ -78,6 +96,7 @@ GUISlider::GUISlider(xml_node<>* node) : GUIObject(node)
GUISlider::~GUISlider()
{
delete sAction;
+ delete sSliderLabel;
}
int GUISlider::Render(void)
@@ -99,6 +118,11 @@ int GUISlider::Render(void)
if (sTouch && sTouch->GetResource())
gr_blit(sTouch->GetResource(), 0, 0, sTouchW, sTouchH, sCurTouchX, (mRenderY + ((mRenderH - sTouchH) / 2)));
+ if (sSliderLabel) {
+ int ret = sSliderLabel->Render();
+ if (ret < 0) return ret;
+ }
+
sUpdate = 0;
return 0;
}
diff --git a/gui/slidervalue.cpp b/gui/slidervalue.cpp
index 5be58dcf..3974c37d 100644
--- a/gui/slidervalue.cpp
+++ b/gui/slidervalue.cpp
@@ -70,7 +70,7 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node)
mAction = new GUIAction(node);
- child = node->first_node("font");
+ child = FindNode(node, "font");
if (child)
{
mFont = LoadAttrFont(child, "resource");
@@ -78,21 +78,16 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node)
}
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, &mRenderW);
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, &mRenderW);
- child = node->first_node("colors");
+ child = FindNode(node, "colors");
if (child)
{
- attr = child->first_attribute("line");
- if (attr)
- ConvertStrToColor(attr->value(), &mLineColor);
-
- attr = child->first_attribute("slider");
- if (attr)
- ConvertStrToColor(attr->value(), &mSliderColor);
+ mLineColor = LoadAttrColor(child, "line");
+ mSliderColor = LoadAttrColor(child, "slider");
}
- child = node->first_node("resource");
+ child = FindNode(node, "resource");
if (child)
{
mBackgroundImage = LoadAttrImage(child, "background");
@@ -100,7 +95,7 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node)
mHandleHoverImage = LoadAttrImage(child, "handlehover");
}
- child = node->first_node("data");
+ child = FindNode(node, "data");
if (child)
{
attr = child->first_attribute("variable");
@@ -150,37 +145,13 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node)
mChangeOnDrag = atoi(attr->value());
}
- child = node->first_node("dimensions");
+ child = FindNode(node, "dimensions");
if (child)
{
- attr = child->first_attribute("lineh");
- if (attr)
- {
- string parsevalue = gui_parse_text(attr->value());
- mLineH = scale_theme_y(atoi(parsevalue.c_str()));
- }
-
- attr = child->first_attribute("linepadding");
- if (attr)
- {
- string parsevalue = gui_parse_text(attr->value());
- mPadding = scale_theme_x(atoi(parsevalue.c_str()));
- mLinePadding = mPadding;
- }
-
- attr = child->first_attribute("sliderw");
- if (attr)
- {
- string parsevalue = gui_parse_text(attr->value());
- mSliderW = scale_theme_x(atoi(parsevalue.c_str()));
- }
-
- attr = child->first_attribute("sliderh");
- if (attr)
- {
- string parsevalue = gui_parse_text(attr->value());
- mSliderH = scale_theme_y(atoi(parsevalue.c_str()));
- }
+ mLineH = LoadAttrIntScaleY(child, "lineh", mLineH);
+ mLinePadding = LoadAttrIntScaleX(child, "linepadding", mLinePadding);
+ mSliderW = LoadAttrIntScaleX(child, "sliderw", mSliderW);
+ mSliderH = LoadAttrIntScaleY(child, "sliderh", mSliderH);
}
mFontHeight = mFont->GetHeight();
diff --git a/gui/text.cpp b/gui/text.cpp
index cc18b170..3487f7a8 100644
--- a/gui/text.cpp
+++ b/gui/text.cpp
@@ -44,18 +44,14 @@ GUIText::GUIText(xml_node<>* node)
mHighlightColor = LoadAttrColor(node, "highlightcolor", mColor);
// Load the font, and possibly override the color
- xml_node<>* child = node->first_node("font");
- if (child)
- {
- mFont = LoadAttrFont(child, "resource");
- mColor = LoadAttrColor(child, "color", mColor);
- mHighlightColor = LoadAttrColor(child, "highlightcolor", mColor);
- }
+ mFont = LoadAttrFont(FindNode(node, "font"), "resource");
+ mColor = LoadAttrColor(FindNode(node, "font"), "color", mColor);
+ mHighlightColor = LoadAttrColor(FindNode(node, "font"), "highlightcolor", mColor);
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH, &mPlacement);
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH, &mPlacement);
- child = node->first_node("text");
+ xml_node<>* child = FindNode(node, "text");
if (child) mText = child->value();
// Simple way to check for static state