summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-09 22:22:03 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-09 22:22:34 -0800
commit9dd3045d98e3d2905f4b656c44b933a06fbe7736 (patch)
treefb82b13a14dab8db1036da28bfdf7f7df98acf9b
parent37fa9338c8b79e1212a8709b688fe13686837db5 (diff)
Save the state during abnormal terminations.
-rw-r--r--MobileCydia.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 096c4ab..fd5c1c4 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -871,6 +871,7 @@ static NSString *CYHex(NSData *data, bool reverse = false) {
@class CYPackageController;
@protocol CydiaDelegate
+- (void) saveState;
- (void) retainNetworkActivityIndicator;
- (void) releaseNetworkActivityIndicator;
- (void) clearPackage:(Package *)package;
@@ -5072,6 +5073,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
- (void) close {
UpdateExternalStatus(0);
+ if (Finish_ > 1)
+ [delegate_ saveState];
+
switch (Finish_) {
case 0:
break;
@@ -9478,15 +9482,19 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
[super applicationWillResignActive:application];
}
-- (void) applicationWillTerminate:(UIApplication *)application {
- Changed_ = true;
+- (void) saveState {
[Metadata_ setObject:[tabbar_ navigationURLCollection] forKey:@"InterfaceState"];
[Metadata_ setObject:[NSDate date] forKey:@"LastClosed"];
[Metadata_ setObject:[NSNumber numberWithInt:[tabbar_ selectedIndex]] forKey:@"InterfaceIndex"];
+ Changed_ = true;
[self _saveConfig];
}
+- (void) applicationWillTerminate:(UIApplication *)application {
+ [self saveState];
+}
+
- (void) setConfigurationData:(NSString *)data {
static Pcre conffile_r("^'(.*)' '(.*)' ([01]) ([01])$");