]> git.saurik.com Git - cydget.git/commitdiff
Add RememberPosition setting (by popular demand).
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 18 Feb 2014 05:12:15 +0000 (21:12 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 18 Feb 2014 05:12:15 +0000 (21:12 -0800)
CydgetLoader.mm
CydgetSettings.bundle/Cydget.plist

index 6df3bbcc0c6171c7a36e418481f6b870ddaabf6d..2e7081657ac0301e779bf6fdae9f89fc415e2b61 100644 (file)
@@ -82,6 +82,7 @@ static _H<NSMutableArray> cydgets_;
 static size_t active_;
 static unsigned online_;
 static bool nowplaying_;
+static bool remember_;
 
 static bool NowPlaying() {
     if (kCFCoreFoundationVersionNumber < 800)
@@ -265,7 +266,8 @@ MSInstanceMessageHook1(void, SBAwayController, undimScreen, BOOL, undim) {
 static void Deactivate_() {
     if (active_ != _not(size_t))
         [[cydgets_ objectAtIndex:active_] disableCydget];
-    active_ = 0;
+    if (!remember_)
+        active_ = 0;
 }
 
 MSHook(void, BKSDisplayServicesSetScreenBlanked, BOOL blanked) {
@@ -325,6 +327,7 @@ static void CydgetSetup() {
     settings_ = [NSMutableDictionary dictionaryWithContentsOfFile:plist] ?: [NSMutableDictionary dictionary];
 
     nowplaying_ = [[settings_ objectForKey:@"NowPlaying"] boolValue];
+    remember_ = [[settings_ objectForKey:@"RememberPosition"] boolValue];
 
     NSArray *cydgets([settings_ objectForKey:@"LockCydgets"] ?: [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
         @"Welcome", @"Name", [NSNumber numberWithBool:YES], @"Active", nil
index 9c5c69fbe067b622f56e962ef00d53cd143caef9..3dcf69063f7bddd3b33b2285f06e7c464c8d6b9f 100644 (file)
                                <real>800</real>
                        </array>
                </dict>
+               <dict>
+                       <key>cell</key>
+                       <string>PSGroupCell</string>
+                       <key>footerText</key>
+                       <string>Normally, locking your phone returns to the first Cydget in the selected order; this setting avoids that behavior</string>
+               </dict>
+               <dict>
+                       <key>cell</key>
+                       <string>PSSwitchCell</string>
+                       <key>default</key>
+                       <false/>
+                       <key>key</key>
+                       <string>RememberPosition</string>
+                       <key>label</key>
+                       <string>Remember Position</string>
+               </dict>
+               <dict>
+                       <key>cell</key>
+                       <string>PSGroupCell</string>
+                       <key>isStaticText</key>
+                       <string>1</string>
+                       <key>requiredCapabilities</key>
+                       <array>
+                               <dict>
+                                       <key>voip</key>
+                                        <false/>
+                                       <key>wildcat</key>
+                                        <false/>
+                               </dict>
+                       </array>
+               </dict>
+               <dict>
+                       <key>cell</key>
+                       <string>PSTitleValueCell</string>
+                       <key>label</key>
+                       <string>Normally, locking your phone returns to the first Cydget in the selected order; this setting avoids that behavior</string>
+                       <key>requiredCapabilities</key>
+                       <array>
+                               <dict>
+                                       <key>voip</key>
+                                        <false/>
+                                       <key>wildcat</key>
+                                        <false/>
+                               </dict>
+                       </array>
+               </dict>
        </array>
        <key>title</key>
        <string>Cydget</string>