From 9eadaa6d54684db07f426514f7032efdaebd132f Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 17 Feb 2014 21:12:15 -0800 Subject: [PATCH] Add RememberPosition setting (by popular demand). --- CydgetLoader.mm | 5 +++- CydgetSettings.bundle/Cydget.plist | 46 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) 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 -- 2.45.2