From: Jay Freeman (saurik) <saurik@saurik.com>
Date: Thu, 20 Oct 2011 23:18:13 +0000 (+0000)
Subject: Make UIImage dumper user friendly.
X-Git-Tag: v0.9.3902~13
X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/8e699a8292b89f59ae0d4effd986307e16f2379c

Make UIImage dumper user friendly.
---

diff --git a/Library.mm b/Library.mm
index 66317a0..48eca47 100644
--- a/Library.mm
+++ b/Library.mm
@@ -1836,6 +1836,8 @@ MSInitialize {
             SummerBoard_ = [value boolValue];
         if (NSNumber *value = [settings objectForKey:@"Debug"])
             Debug_ = [value boolValue];
+        if (NSNumber *value = [settings objectForKey:@"RecordUI"])
+            UIDebug_ = [value boolValue];
 
         NSArray *themes([settings objectForKey:@"Themes"]);
         if (themes == nil)
@@ -1946,8 +1948,13 @@ MSInitialize {
     }
     // }}}
 
-    if (Debug_ && [Manager_ fileExistsAtPath:@"/tmp/UIImages"])
-        UIDebug_ = true;
+    if (UIDebug_ && ![Manager_ fileExistsAtPath:@"/tmp/UIImages"]) {
+        NSError *error(nil);
+        if (![Manager_ createDirectoryAtPath:@"/tmp/UIImages" withIntermediateDirectories:NO attributes:[NSDictionary dictionaryWithObjectsAndKeys:
+            [NSNumber numberWithShort:0777], NSFilePosixPermissions,
+        nil] error:&error])
+            NSLog(@"WB:Error: cannot create /tmp/UIImages (%@)", error);
+    }
 
     [pool release];
 }
diff --git a/WinterBoardSettings.bundle/WinterBoard.plist b/WinterBoardSettings.bundle/WinterBoard.plist
index dd5c922..2852398 100644
--- a/WinterBoardSettings.bundle/WinterBoard.plist
+++ b/WinterBoardSettings.bundle/WinterBoard.plist
@@ -164,6 +164,52 @@
 				</dict>
 			</array>
 		</dict>
+		<dict>
+			<key>cell</key>
+			<string>PSGroupCell</string>
+			<key>footerText</key>
+			<string>All UIImages that are not themed will be saved as PNGs into /tmp/UIImages.</string>
+		</dict>
+		<dict>
+			<key>cell</key>
+			<string>PSSwitchCell</string>
+			<key>default</key>
+			<false/>
+			<key>key</key>
+			<string>RecordUI</string>
+			<key>label</key>
+			<string>Record UIImages</string>
+		</dict>
+		<dict>
+			<key>cell</key>
+			<string>PSGroupCell</string>
+			<key>isStaticText</key>
+			<string>true</string>
+			<key>requiredCapabilities</key>
+			<array>
+				<dict>
+					<key>wildcat</key>
+					<false/>
+					<key>voip</key>
+					<false/>
+				</dict>
+			</array>
+		</dict>
+		<dict>
+			<key>cell</key>
+			<string>PSTitleValueCell</string>
+			<key>label</key>
+			<string>All UIImages that are not themed will be saved as PNGs into /tmp/UIImages.</string>
+			<key>requiredCapabilities</key>
+			<array>
+				<dict>
+					<key>wildcat</key>
+					<false/>
+					<key>voip</key>
+					<false/>
+				</dict>
+			</array>
+		</dict>
 	</array>
 	<key>title</key>
 	<string>WinterBoard</string>