]> git.saurik.com Git - winterboard.git/commitdiff
Make UIImage dumper user friendly.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 20 Oct 2011 23:18:13 +0000 (23:18 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 20 Oct 2011 23:19:08 +0000 (23:19 +0000)
Library.mm
WinterBoardSettings.bundle/WinterBoard.plist

index 66317a032fe8b468e4017c8b253a2e158a72d304..48eca476a4ad47f1555e4fccfce33d8eeec9ac9e 100644 (file)
@@ -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];
 }
index dd5c922660f0ed4d2dcc8be73a94ec7c1f406aee..28523981fefdc963fd36937958b745012dcefbe4 100644 (file)
                                </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>