]> git.saurik.com Git - winterboard.git/commitdiff
Provide higher-level button to Restart SpringBoard.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 26 Nov 2014 21:25:01 +0000 (13:25 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 26 Nov 2014 21:25:01 +0000 (13:25 -0800)
Settings.mm
WinterBoardSettings.bundle/Advanced.plist

index 052b7c3676a1b92f410967798a97bf6ed34222c6..1f011fa10593dfec02ba79842dc8b5246f92c48d 100644 (file)
@@ -67,6 +67,42 @@ void AddThemes(NSMutableArray *themesOnDisk, NSString *folder) {
     }
 }
 
+static void RestartSpringBoard() {
+    unlink("/User/Library/Caches/com.apple.springboard-imagecache-icons");
+    unlink("/User/Library/Caches/com.apple.springboard-imagecache-icons.plist");
+    unlink("/User/Library/Caches/com.apple.springboard-imagecache-smallicons");
+    unlink("/User/Library/Caches/com.apple.springboard-imagecache-smallicons.plist");
+
+    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen");
+    unlink("/User/Library/Caches/com.apple.SpringBoard.notificationCenterLinen");
+
+    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen.0");
+    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen.1");
+    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen.2");
+    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen.3");
+
+    system("rm -rf /User/Library/Caches/SpringBoardIconCache");
+    system("rm -rf /User/Library/Caches/SpringBoardIconCache-small");
+    system("rm -rf /User/Library/Caches/com.apple.IconsCache");
+    system("rm -rf /User/Library/Caches/com.apple.newsstand");
+    system("rm -rf /User/Library/Caches/com.apple.springboard.sharedimagecache");
+    system("rm -rf /User/Library/Caches/com.apple.UIStatusBar");
+
+    system("rm -rf /User/Library/Caches/BarDialer");
+    system("rm -rf /User/Library/Caches/BarDialer_selected");
+    system("rm -rf /User/Library/Caches/BarRecents");
+    system("rm -rf /User/Library/Caches/BarRecents_selected");
+    system("rm -rf /User/Library/Caches/BarVM");
+    system("rm -rf /User/Library/Caches/BarVM_selected");
+
+    system("killall -9 lsd");
+
+    if (kCFCoreFoundationVersionNumber > 700) // XXX: iOS 6.x
+        system("killall backboardd");
+    else
+        system("killall SpringBoard");
+}
+
 /* [NSObject yieldToSelector:(withObject:)] {{{*/
 @interface NSObject (wb$yieldToSelector)
 - (id) wb$yieldToSelector:(SEL)selector withObject:(id)object;
@@ -411,6 +447,10 @@ void AddThemes(NSMutableArray *themesOnDisk, NSString *folder) {
     return plistValue;
 }
 
+- (void) restartSpringBoard {
+    RestartSpringBoard();
+}
+
 - (void) __optimizeThemes {
     system("/usr/libexec/winterboard/Optimize");
 }
@@ -523,39 +563,7 @@ void AddThemes(NSMutableArray *themesOnDisk, NSString *folder) {
     if (![data writeToFile:_plist options:NSAtomicWrite error:NULL])
         return;
 
-    unlink("/User/Library/Caches/com.apple.springboard-imagecache-icons");
-    unlink("/User/Library/Caches/com.apple.springboard-imagecache-icons.plist");
-    unlink("/User/Library/Caches/com.apple.springboard-imagecache-smallicons");
-    unlink("/User/Library/Caches/com.apple.springboard-imagecache-smallicons.plist");
-
-    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen");
-    unlink("/User/Library/Caches/com.apple.SpringBoard.notificationCenterLinen");
-
-    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen.0");
-    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen.1");
-    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen.2");
-    unlink("/User/Library/Caches/com.apple.SpringBoard.folderSwitcherLinen.3");
-
-    system("rm -rf /User/Library/Caches/SpringBoardIconCache");
-    system("rm -rf /User/Library/Caches/SpringBoardIconCache-small");
-    system("rm -rf /User/Library/Caches/com.apple.IconsCache");
-    system("rm -rf /User/Library/Caches/com.apple.newsstand");
-    system("rm -rf /User/Library/Caches/com.apple.springboard.sharedimagecache");
-    system("rm -rf /User/Library/Caches/com.apple.UIStatusBar");
-
-    system("rm -rf /User/Library/Caches/BarDialer");
-    system("rm -rf /User/Library/Caches/BarDialer_selected");
-    system("rm -rf /User/Library/Caches/BarRecents");
-    system("rm -rf /User/Library/Caches/BarRecents_selected");
-    system("rm -rf /User/Library/Caches/BarVM");
-    system("rm -rf /User/Library/Caches/BarVM_selected");
-
-    system("killall -9 lsd");
-
-    if (kCFCoreFoundationVersionNumber > 700) // XXX: iOS 6.x
-        system("killall backboardd");
-    else
-        system("killall SpringBoard");
+    RestartSpringBoard();
 }
 
 - (void) cancelChanges {
index 4d16efa1cdaa2b1d1481f4603317f1018d6f8daa..f0fbf5cd9d2a8fde6eb4b3c23516e827b4e42266 100644 (file)
                                </dict>
                        </array>
                </dict>
+               <dict>
+                       <key>cell</key>
+                       <string>PSGroupCell</string>
+                       <key>footerText</key>
+                       <string>When WinterBoard restarts SpringBoard it also clears many icon and image caches.</string>
+               </dict>
+               <dict>
+                       <key>action</key>
+                       <string>restartSpringBoard</string>
+                       <key>cell</key>
+                       <string>PSButtonCell</string>
+                       <key>label</key>
+                       <string>Restart SpringBoard</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>When WinterBoard restarts SpringBoard it also clears many icon and image caches.</string>
+                       <key>requiredCapabilities</key>
+                       <array>
+                               <dict>
+                                       <key>wildcat</key>
+                                       <false/>
+                                       <key>voip</key>
+                                       <false/>
+                               </dict>
+                       </array>
+               </dict>
        </array>
        <key>title</key>
        <string>Advanced</string>