Prefs designing! I really need to look into a color picker now...
This commit is contained in:
@ -49,7 +49,7 @@
|
||||
<key>cellClass</key>
|
||||
<string>HBTintedTableCell</string>
|
||||
<key>action</key>
|
||||
<string>doAFancyRespring</string>
|
||||
<string>respringPopUp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
@ -72,6 +72,6 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>title</key>
|
||||
<string>ZenithDark</string>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -14,25 +14,3 @@
|
||||
@property (nonatomic, strong) UIVisualEffectView *respringEffectView;
|
||||
@property (nonatomic, strong) UIWindow *mainAppRootWindow;
|
||||
@end
|
||||
|
||||
// we use this to respring our device!
|
||||
@interface NSTask : NSObject
|
||||
@property (copy) NSArray *arguments;
|
||||
@property (copy) NSString *currentDirectoryPath;
|
||||
@property (copy) NSDictionary *environment;
|
||||
@property (copy) NSString *launchPath;
|
||||
@property (readonly) int processIdentifier;
|
||||
@property (retain) id standardError;
|
||||
@property (retain) id standardInput;
|
||||
@property (retain) id standardOutput;
|
||||
+ (id)currentTaskDictionary;
|
||||
+ (id)launchedTaskWithDictionary:(id)arg1;
|
||||
+ (id)launchedTaskWithLaunchPath:(id)arg1 arguments:(id)arg2;
|
||||
- (id)init;
|
||||
- (void)interrupt;
|
||||
- (bool)isRunning;
|
||||
- (void)launch;
|
||||
- (bool)resume;
|
||||
- (bool)suspend;
|
||||
- (void)terminate;
|
||||
@end
|
||||
|
@ -1,5 +1,7 @@
|
||||
#import "ZNDarkPrefsRootListController.h"
|
||||
#import <CepheiPrefs/HBAppearanceSettings.h>
|
||||
#import <Cephei/HBRespringController.h>
|
||||
#import <Cephei/HBPreferences.h>
|
||||
|
||||
#define THEME_COLOR \
|
||||
[UIColor colorWithRed:0.82 \
|
||||
@ -44,6 +46,7 @@
|
||||
}
|
||||
// End of "Hide Large Title"
|
||||
|
||||
|
||||
//share button action
|
||||
- (void)shareTapped {
|
||||
|
||||
@ -78,30 +81,16 @@
|
||||
}
|
||||
|
||||
- (void)respring {
|
||||
NSTask *task = [[[NSTask alloc] init] autorelease];
|
||||
[task setLaunchPath:@"/usr/bin/killall"];
|
||||
[task setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
|
||||
[task launch];
|
||||
|
||||
[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil]; // Dismisses keyboard
|
||||
[HBRespringController respringAndReturnTo:[NSURL URLWithString:@"prefs:root=ZenithDark"]];
|
||||
}
|
||||
|
||||
-(void)doAFancyRespring {
|
||||
-(void)respringPopUp {
|
||||
|
||||
UIAlertController *confirmRespringAlert = [UIAlertController alertControllerWithTitle:@"Apply Settings?" message:@"This will respring your device." preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
UIAlertAction *confirm = [UIAlertAction actionWithTitle:@"Respring" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
|
||||
|
||||
// blur then respring our device!
|
||||
self.mainAppRootWindow = [UIApplication sharedApplication].keyWindow;
|
||||
self.respringBlur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
|
||||
self.respringEffectView = [[UIVisualEffectView alloc] initWithEffect:self.respringBlur];
|
||||
self.respringEffectView.frame = [[UIScreen mainScreen] bounds];
|
||||
[self.mainAppRootWindow addSubview:self.respringEffectView];
|
||||
[UIView beginAnimations:nil context:NULL];
|
||||
[UIView setAnimationDuration:5.0];
|
||||
[self.respringEffectView setAlpha:0];
|
||||
[UIView commitAnimations];
|
||||
|
||||
[self performSelector:@selector(respring) withObject:nil afterDelay:3.0];
|
||||
[self performSelector:@selector(respring) withObject:nil afterDelay:0.0];
|
||||
|
||||
}];
|
||||
|
||||
@ -110,6 +99,7 @@
|
||||
[confirmRespringAlert addAction:cancel];
|
||||
[confirmRespringAlert addAction:confirm];
|
||||
|
||||
|
||||
[self presentViewController:confirmRespringAlert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user