Menu - Preferences Sync. There is still a bug with unread count ...

This commit is contained in:
relikd
2018-08-19 04:04:36 +02:00
parent f2281b91c4
commit 733ce7af79
9 changed files with 126 additions and 87 deletions

View File

@@ -24,10 +24,6 @@
#import "PyHandler.h"
#import "BarMenu.h"
@interface AppHook()
@property (strong) BarMenu *barMenu;
@end
@implementation AppHook
- (instancetype)init {
@@ -37,7 +33,7 @@
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
self.barMenu = [BarMenu new];
_barMenu = [BarMenu new];
[PyHandler prepare];
printf("up and running\n");
}
@@ -46,10 +42,6 @@
[PyHandler shutdown];
}
- (IBAction)closePreferences:(id)sender {
NSLog(@"closing in %@", sender);
}
#pragma mark - Core Data stack
@@ -67,13 +59,8 @@
abort();
}
}];
NSUndoManager *um = [[NSUndoManager alloc] init];
um.groupsByEvent = NO;
um.levelsOfUndo = 30;
_persistentContainer.viewContext.undoManager = um;
}
}
return _persistentContainer;
}
@@ -81,26 +68,6 @@
#pragma mark - Core Data Saving and Undo support
- (IBAction)saveAction:(id)sender {
// Performs the save action for the application, which is to send the save: message to the application's managed object context. Any encountered errors are presented to the user.
NSManagedObjectContext *context = self.persistentContainer.viewContext;
if (![context commitEditing]) {
NSLog(@"%@:%@ unable to commit editing before saving", [self class], NSStringFromSelector(_cmd));
}
NSError *error = nil;
if (context.hasChanges && ![context save:&error]) {
// Customize this code block to include application-specific recovery steps.
[[NSApplication sharedApplication] presentError:error];
}
}
- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window {
// Returns the NSUndoManager for the application. In this case, the manager returned is that of the managed object context for the application.
return self.persistentContainer.viewContext.undoManager;
}
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
// Save changes in the application's managed object context before the application terminates.
NSManagedObjectContext *context = self.persistentContainer.viewContext;