From: Jay Freeman (saurik) Date: Tue, 18 Feb 2014 05:12:15 +0000 (-0800) Subject: Add RememberPosition setting (by popular demand). X-Git-Tag: v0.9.4011~2 X-Git-Url: https://git.saurik.com/cydget.git/commitdiff_plain/9eadaa6d54684db07f426514f7032efdaebd132f?ds=inline Add RememberPosition setting (by popular demand). --- diff --git a/CydgetLoader.mm b/CydgetLoader.mm index 6df3bbc..2e70816 100644 --- a/CydgetLoader.mm +++ b/CydgetLoader.mm @@ -82,6 +82,7 @@ static _H 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 diff --git a/CydgetSettings.bundle/Cydget.plist b/CydgetSettings.bundle/Cydget.plist index 9c5c69f..3dcf690 100644 --- a/CydgetSettings.bundle/Cydget.plist +++ b/CydgetSettings.bundle/Cydget.plist @@ -74,6 +74,52 @@ 800 + + cell + PSGroupCell + footerText + Normally, locking your phone returns to the first Cydget in the selected order; this setting avoids that behavior + + + cell + PSSwitchCell + default + + key + RememberPosition + label + Remember Position + + + cell + PSGroupCell + isStaticText + 1 + requiredCapabilities + + + voip + + wildcat + + + + + + cell + PSTitleValueCell + label + Normally, locking your phone returns to the first Cydget in the selected order; this setting avoids that behavior + requiredCapabilities + + + voip + + wildcat + + + + title Cydget