Copy Kernel Logs

Give user option to copy kernel logs to current storage

Change-Id: I0c61122fb34826ddb08977e6cbf98e3adf477acd
diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml
index 5c92fcc..3aed198 100644
--- a/gui/theme/common/landscape.xml
+++ b/gui/theme/common/landscape.xml
@@ -3132,6 +3132,45 @@
 			</action>
 		</page>
 
+                <page name="copylog">
+                        <template name="page"/>
+
+                        <text style="text_l">
+                                <placement x="%col1_x_header%" y="%row3_header_y%"/>
+                                <text>{@copying_log=Copy Logs to SD Card}</text>
+                        </text>
+
+                        <checkbox>
+                                <placement x="%indent%" y="%row4_y%"/>
+                                <text>{@include_kernel_log=Include Kernel Log}</text>
+                                <data variable="tw_include_kernel_log" value="1"/>
+                        </checkbox>
+
+                        <slider>
+                                <text>{@copying_log=Copy Logs to SD Card}</text>
+                                <actions>
+                                        <action function="set">tw_back=advanced</action>
+                                        <action function="set">tw_action=copylog</action>
+                                        <action function="set">tw_action_text1={@copying_log=Copy Logs to SD Card}</action>
+                                        <action function="set">tw_complete_text1={@copy_log_complete=Logs Copy Completed}</action>
+                                        <action function="page">action_page</action>
+                                </actions>
+                        </slider>
+
+                        <action>
+                                <touch key="home"/>
+                                <action function="page">main</action>
+                        </action>
+
+                        <action>
+                                <touch key="back"/>
+                                <actions>
+                                        <action function="page">advanced</action>
+                                </actions>
+                        </action>
+
+                </page>
+
 		<page name="advanced">
 			<template name="page"/>
 
@@ -3143,15 +3182,7 @@
 			<button style="main_button">
 				<placement x="%col1_x_left%" y="%row2_y%"/>
 				<text>{@copy_log_btn=Copy Log}</text>
-				<actions>
-					<action function="set">tw_back=advanced</action>
-					<action function="set">tw_action=copylog</action>
-					<action function="set">tw_text1={@copy_log_confirm=Copy Log to SD Card?}</action>
-					<action function="set">tw_action_text1={@copying_log=Copying Log to SD Card...}</action>
-					<action function="set">tw_complete_text1={@copy_log_complete=Log Copy Complete}</action>
-					<action function="set">tw_slider_text={@swipe_to_confirm=Swipe to Confirm}</action>
-					<action function="page">confirm_action</action>
-				</actions>
+				<action function="page">copylog</action>
 			</button>
 
 			<button style="main_button">
diff --git a/gui/theme/common/languages/en.xml b/gui/theme/common/languages/en.xml
index 6b05a86..f4344a0 100644
--- a/gui/theme/common/languages/en.xml
+++ b/gui/theme/common/languages/en.xml
@@ -364,8 +364,8 @@
 		<string name="set_language_btn">Set Language</string>
 		<string name="advanced_hdr">Advanced</string>
 		<string name="copy_log_confirm">Copy Log to SD Card?</string>
-		<string name="copying_log">Copying Log to SD Card...</string>
-		<string name="copy_log_complete">Log Copy Complete</string>
+		<string name="copying_log" version="2">Copying Logs to SD Card...</string>
+		<string name="copy_log_complete" version="2">Logs Copy Complete</string>
 		<string name="fix_context_btn">Fix Contexts</string>
 		<string name="part_sd_btn">Partition SD Card</string>
 		<string name="part_sd_s_btn">SD Card</string>
@@ -673,5 +673,7 @@
 		<string name="adbbackup_control_error">Cannot write to adb control channel</string>
 		<string name="twrp_adbbu_option">--twrp option is required to enable twrp adb backup</string>
 		<string name="partition_not_found">path: {1} not found in partititon list</string>
+		<string name="copy_kernel_log">Copied kernel log to {1}</string>
+		<string name="include_kernel_log">Include Kernel Log</string>
 	</resources>
 </language>
diff --git a/gui/theme/common/portrait.xml b/gui/theme/common/portrait.xml
index e9be654..11ae874 100644
--- a/gui/theme/common/portrait.xml
+++ b/gui/theme/common/portrait.xml
@@ -3216,6 +3216,45 @@
 			</action>
 		</page>
 
+		<page name="copylog">
+			<template name="page"/>
+
+			<text style="text_l">
+				<placement x="%col1_x_header%" y="%row3_header_y%"/>
+				<text>{@copying_log=Copy Logs to SD Card}</text>
+			</text>
+
+			<checkbox>
+				<placement x="%indent%" y="%row4_y%"/>
+				<text>{@include_kernel_log=Include Kernel Log}</text>
+				<data variable="tw_include_kernel_log" value="1"/>
+			</checkbox>
+
+			<slider>
+				<text>{@copying_log=Copy Logs to SD Card}</text>
+				<actions>
+					<action function="set">tw_back=advanced</action>
+					<action function="set">tw_action=copylog</action>
+                                        <action function="set">tw_action_text1={@copying_log=Copy Logs to SD Card}</action>
+                                        <action function="set">tw_complete_text1={@copy_log_complete=Logs Copy Completed}</action>
+					<action function="page">action_page</action>
+				</actions>
+			</slider>
+
+			<action>
+				<touch key="home"/>
+				<action function="page">main</action>
+			</action>
+
+			<action>
+				<touch key="back"/>
+				<actions>
+					<action function="page">advanced</action>
+				</actions>
+			</action>
+
+		</page>
+
 		<page name="advanced">
 			<template name="page"/>
 
@@ -3227,15 +3266,7 @@
 			<button style="main_button">
 				<placement x="%indent%" y="%row2a_y%"/>
 				<text>{@copy_log_btn=Copy Log}</text>
-				<actions>
-					<action function="set">tw_back=advanced</action>
-					<action function="set">tw_action=copylog</action>
-					<action function="set">tw_text1={@copy_log_confirm=Copy Log to SD Card?}</action>
-					<action function="set">tw_action_text1={@copying_log=Copying Log to SD Card...}</action>
-					<action function="set">tw_complete_text1={@copy_log_complete=Log Copy Complete}</action>
-					<action function="set">tw_slider_text={@swipe_to_confirm=Swipe to Confirm}</action>
-					<action function="page">confirm_action</action>
-				</actions>
+				<action function="page">copylog</action>
 			</button>
 
 			<button style="main_button">
diff --git a/gui/theme/common/watch.xml b/gui/theme/common/watch.xml
index f198409..921e72c 100644
--- a/gui/theme/common/watch.xml
+++ b/gui/theme/common/watch.xml
@@ -237,6 +237,37 @@
 			</button>
 		</page>
 
+                <page name="copylog">
+                        <template name="page"/>
+
+                        <checkbox>
+				<placement x="%indent%" y="%row1_y%"/>
+                                <text>{@include_kernel_log=Include Kernel Log}</text>
+                                <data variable="tw_include_kernel_log" value="1"/>
+                        </checkbox>
+
+			<slider>
+				<text>{@swipe_confirm=   Confirm}</text>
+				<actions>
+                                        <action function="set">tw_back=main3</action>
+                                        <action function="set">tw_action=copylog</action>
+                                        <action function="set">tw_action_text1={@copying_log=Copy Logs to SD Card}</action>
+                                        <action function="set">tw_complete_text1={@copy_log_complete=Logs Copy Completed}</action>
+					<action function="page">action_page</action>
+				</actions>
+			</slider>
+
+			<action>
+				<touch key="back"/>
+				<action function="page">main2</action>
+			</action>
+
+			<action>
+				<touch key="home"/>
+				<action function="page">main</action>
+			</action>
+                </page>
+
 		<page name="main3">
 			<template name="page"/>
 
@@ -261,15 +292,7 @@
 			<button style="main_button">
 				<placement x="%col1_x_right%" y="%row6_y%"/>
 				<text>{@copy_log_btn=Copy Log}</text>
-				<actions>
-					<action function="set">tw_back=main3</action>
-					<action function="set">tw_action=copylog</action>
-					<action function="set">tw_text1={@copy_log_confirm=Copy Log to SD Card?}</action>
-					<action function="set">tw_action_text1={@copying_log=Copying Log to SD Card...}</action>
-					<action function="set">tw_complete_text1={@copy_log_complete=Log Copy Complete}</action>
-					<action function="set">tw_slider_text={@swipe_confirm=   Confirm}</action>
-					<action function="page">confirm_action</action>
-				</actions>
+				<action function="page">copylog</action>
 			</button>
 
 			<button style="main_button">