mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-19 10:49:24 +00:00
Fixed deprecation warnings
This commit is contained in:
@@ -241,7 +241,7 @@ typedef NS_OPTIONS(NSInteger, MPAppStartupState) {
|
||||
self.saveMenuItem.title = saveTitle;
|
||||
}
|
||||
else if(menu == self.fixAutotypeMenuItem.menu) {
|
||||
self.fixAutotypeMenuItem.hidden = !(NSEvent.modifierFlags & NSAlternateKeyMask);
|
||||
self.fixAutotypeMenuItem.hidden = !(NSEvent.modifierFlags & NSEventModifierFlagOption);
|
||||
}
|
||||
else if(menu == self.importMenu) {
|
||||
NSMenuItem *exportXML = menu.itemArray.firstObject;
|
||||
|
||||
@@ -84,7 +84,7 @@ static void MPContextmenuHelperBeginSection(NSMutableArray *items) {
|
||||
NSMenuItem *emptyTrash = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"EMPTY_TRASH", @"Menu item to empty the trash")
|
||||
action:[MPActionHelper actionOfType:MPActionEmptyTrash]
|
||||
keyEquivalent:@""];
|
||||
emptyTrash.keyEquivalentModifierMask = (NSShiftKeyMask | NSCommandKeyMask);
|
||||
emptyTrash.keyEquivalentModifierMask = (NSEventModifierFlagShift | NSEventModifierFlagCommand);
|
||||
unichar backSpace = NSBackspaceCharacter;
|
||||
emptyTrash.keyEquivalent = [NSString stringWithCharacters:&backSpace length:1];
|
||||
[items addObject:emptyTrash];
|
||||
@@ -99,7 +99,7 @@ static void MPContextmenuHelperBeginSection(NSMutableArray *items) {
|
||||
NSMenuItem *copyPassword = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"COPY_PASSWORD", @"Menu item to copy the password of an entry")
|
||||
action:[MPActionHelper actionOfType:MPActionCopyPassword]
|
||||
keyEquivalent:@"c"];
|
||||
copyPassword.keyEquivalentModifierMask = (copyPassword.keyEquivalentModifierMask | NSAlternateKeyMask);
|
||||
copyPassword.keyEquivalentModifierMask = (copyPassword.keyEquivalentModifierMask | NSEventModifierFlagOption);
|
||||
NSMenu *urlMenu = [[NSMenu alloc] init];
|
||||
NSMenuItem *urlItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"URL", @"Submenu with options what to do with the URL of an entry")
|
||||
action:0
|
||||
@@ -129,7 +129,7 @@ static void MPContextmenuHelperBeginSection(NSMutableArray *items) {
|
||||
NSMenuItem *showHistory = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SHOW_HISTORY", @"Menu item to show the history of the selected entry")
|
||||
action:[MPActionHelper actionOfType:MPActionShowEntryHistory]
|
||||
keyEquivalent:@"h"];
|
||||
showHistory.keyEquivalentModifierMask = (showHistory.keyEquivalentModifierMask | NSCommandKeyMask | NSControlKeyMask);
|
||||
showHistory.keyEquivalentModifierMask = (showHistory.keyEquivalentModifierMask | NSEventModifierFlagCommand | NSEventModifierFlagControl);
|
||||
[items addObject:showHistory];
|
||||
}
|
||||
if(insertShowGroupInOutline) {
|
||||
|
||||
@@ -295,7 +295,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
||||
return;
|
||||
}
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.alertStyle = NSWarningAlertStyle;
|
||||
alert.alertStyle = NSAlertStyleWarning;
|
||||
alert.messageText = NSLocalizedString(@"FILE_CHANGED_BY_OTHERS_MESSAGE_TEXT", @"Message displayed when an open file was changed from another application");
|
||||
alert.informativeText = NSLocalizedString(@"FILE_CHANGED_BY_OTHERS_INFO_TEXT", @"Informative text displayed when the file was change from another application");
|
||||
alert.showsSuppressionButton = YES;
|
||||
@@ -369,7 +369,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
||||
|
||||
if(mergeKDB) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.alertStyle = NSWarningAlertStyle;
|
||||
alert.alertStyle = NSAlertStyleWarning;
|
||||
alert.messageText = NSLocalizedString(@"ALERT_MERGE_KDB_FILE_MESSAGE", @"Alert message warning user about KDB file merge");
|
||||
alert.informativeText = NSLocalizedString(@"ALERT_MERGE_KDB_FILE_INFO_TEXT", @"Informative text displayed when merging KDB files");
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"ALERT_MERGE_CONTINUE", @"Button in dialog to merge KDB changes into file!")];
|
||||
@@ -751,7 +751,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
||||
#pragma mark Actions
|
||||
- (void)emptyTrash:(id)sender {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.alertStyle = NSWarningAlertStyle;
|
||||
alert.alertStyle = NSAlertStyleWarning;
|
||||
alert.messageText = NSLocalizedString(@"WARNING_ON_EMPTY_TRASH_TITLE", "Message text for the alert displayed when clearing the Trash");
|
||||
alert.informativeText = NSLocalizedString(@"WARNING_ON_EMPTY_TRASH_DESCRIPTION", "Informative Text displayed when clearing the Trash");
|
||||
|
||||
@@ -770,7 +770,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
||||
KPKEntry *entry = node.asEntry;
|
||||
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.alertStyle = NSWarningAlertStyle;
|
||||
alert.alertStyle = NSAlertStyleWarning;
|
||||
alert.messageText = NSLocalizedString(@"WARNING_ON_DELETE_TRASHED_NODE_TITLE", "Message text for the alert displayed when deleting a node");
|
||||
alert.informativeText = NSLocalizedString(@"WARNING_ON_DELETE_TRASHED_NODE_DESCRIPTION", "Informative Text displayed when clearing the Trash");
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.messageText = NSLocalizedString(@"FILE_OPEN_ERROR", "Error while reopening last known documents");
|
||||
alert.informativeText = error.localizedDescription;
|
||||
alert.alertStyle = NSCriticalAlertStyle;
|
||||
alert.alertStyle = NSAlertStyleCritical;
|
||||
[alert runModal];
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
savePanel.allowedFileTypes = @[(id)kUTTypeXML];
|
||||
savePanel.canSelectHiddenExtension = YES;
|
||||
[savePanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
|
||||
if(result == NSFileHandlingPanelOKButton) {
|
||||
if(result == NSModalResponseOK) {
|
||||
[document writeXMLToURL:savePanel.URL];
|
||||
}
|
||||
}];
|
||||
@@ -219,7 +219,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
openPanel.prompt = NSLocalizedString(@"OPEN_BUTTON_IMPORT_XML_OPEN_PANEL", "Open button in the open panel to import an XML file");
|
||||
openPanel.message = NSLocalizedString(@"MESSAGE_XML_OPEN_PANEL", "Message in the open panel to import an XML file");
|
||||
[openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
|
||||
if(result == NSFileHandlingPanelOKButton) {
|
||||
if(result == NSModalResponseOK) {
|
||||
[document readXMLfromURL:openPanel.URL];
|
||||
[self.splitViewController showOutline];
|
||||
}
|
||||
@@ -284,7 +284,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
openPanel.message = NSLocalizedString(@"SELECT_FILE_TO_MERGE", @"Message for the dialog to open a file for merge");
|
||||
//openPanel.allowedFileTypes = @[(id)kUTTypeXML];
|
||||
[openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
|
||||
if(result == NSFileHandlingPanelOKButton) {
|
||||
if(result == NSModalResponseOK) {
|
||||
[document mergeWithContentsFromURL:openPanel.URL key:document.compositeKey];
|
||||
}
|
||||
}];
|
||||
@@ -504,7 +504,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
if(document.shouldEnforcePasswordChange) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
|
||||
alert.alertStyle = NSCriticalAlertStyle;
|
||||
alert.alertStyle = NSAlertStyleCritical;
|
||||
alert.messageText = NSLocalizedString(@"ENFORCE_PASSWORD_CHANGE_ALERT_TITLE", "Message text for the enforce password change alert");
|
||||
alert.informativeText = NSLocalizedString(@"ENFORCE_PASSWORD_CHANGE_ALERT_DESCRIPTION", "Informative text for the enforce password change alert");
|
||||
|
||||
@@ -535,7 +535,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
else if(document.shouldRecommendPasswordChange) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
|
||||
alert.alertStyle = NSInformationalAlertStyle;
|
||||
alert.alertStyle = NSAlertStyleInformational;
|
||||
alert.messageText = NSLocalizedString(@"RECOMMEND_PASSWORD_CHANGE_ALERT_TITLE", "Message text for the recommend password change alert");
|
||||
alert.informativeText = NSLocalizedString(@"RECOMMEND_PASSWORD_CHANGE_ALERT_DESCRIPTION", "Informative text for the recommend password change alert");
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
savePanel.nameFieldStringValue = binary.name;
|
||||
|
||||
[savePanel beginSheetModalForWindow:self.windowController.window completionHandler:^(NSInteger result) {
|
||||
if(result == NSFileHandlingPanelOKButton) {
|
||||
if(result == NSModalResponseOK) {
|
||||
NSError *error;
|
||||
BOOL sucess = [binary saveToLocation:savePanel.URL error:&error];
|
||||
if(!sucess && error) {
|
||||
@@ -237,7 +237,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
openPanel.prompt = NSLocalizedString(@"OPEN_BUTTON_ADD_ATTACHMENT_OPEN_PANEL", "Open button in the open panel to add attachments to an entry");
|
||||
openPanel.message = NSLocalizedString(@"MESSAGE_ADD_ATTACHMENT_OPEN_PANEL", "Message in the open panel to add attachments to an entry");
|
||||
[openPanel beginSheetModalForWindow:self.windowController.window completionHandler:^(NSInteger result) {
|
||||
if(result == NSFileHandlingPanelOKButton) {
|
||||
if(result == NSModalResponseOK) {
|
||||
for (NSURL *attachmentURL in openPanel.URLs) {
|
||||
KPKBinary *binary = [[KPKBinary alloc] initWithContentsOfURL:attachmentURL];
|
||||
[self.observer willChangeModelProperty];
|
||||
|
||||
@@ -212,7 +212,7 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au
|
||||
if(!descriptorData) {
|
||||
return; // No user defaults
|
||||
}
|
||||
NSArray *sortDescriptors = [NSUnarchiver unarchiveObjectWithData:descriptorData];
|
||||
NSArray *sortDescriptors = [NSKeyedUnarchiver unarchiveObjectWithData:descriptorData];
|
||||
|
||||
for(NSSortDescriptor *descriptor in sortDescriptors) {
|
||||
/* Brute force, just kill the settings if they might cause trouble */
|
||||
|
||||
@@ -41,15 +41,15 @@
|
||||
NSImageRep *rep = [self.image bestRepresentationForRect:NSMakeRect(0, 0, 100, 100) context:nil hints:nil];
|
||||
CGFloat scale = rep.size.width / rep.size.height;
|
||||
switch (controlSize) {
|
||||
case NSRegularControlSize:
|
||||
case NSControlSizeRegular:
|
||||
self.image.size = NSMakeSize(16 * scale, 16);
|
||||
break;
|
||||
|
||||
case NSSmallControlSize:
|
||||
case NSControlSizeSmall:
|
||||
self.image.size = NSMakeSize(14 * scale, 14);
|
||||
break;
|
||||
|
||||
case NSMiniControlSize:
|
||||
case NSControlSizeMini:
|
||||
self.image.size = NSMakeSize(8 * scale, 8);
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user