mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 21:42:32 +00:00
KDB files now get saved without telling the user he looses data. Extended info display in save dialog
This commit is contained in:
@@ -1177,7 +1177,6 @@
|
||||
4C6AEF041A0441F800CA2420 /* AccessoryViews */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4C0728BE17B68ED0005A7DD9 /* SavePanelAccessoryView.xib */,
|
||||
4C6AEF021A04400E00CA2420 /* OpenPanelAccessoryView.xib */,
|
||||
);
|
||||
name = AccessoryViews;
|
||||
@@ -1357,6 +1356,7 @@
|
||||
6021FE7918E15FF300C3BC51 /* DatePickingView.xib */,
|
||||
4C0F647917B6BC9C00D9522A /* MPSavePanelAccessoryViewController.h */,
|
||||
4C0F647A17B6BC9C00D9522A /* MPSavePanelAccessoryViewController.m */,
|
||||
4C0728BE17B68ED0005A7DD9 /* SavePanelAccessoryView.xib */,
|
||||
4C1E9883185F71A800943563 /* MPContextBarViewController.h */,
|
||||
4C1E9884185F71A800943563 /* MPContextBarViewController.m */,
|
||||
4C3FFD9D16DAF60600DF9186 /* ContextBar.xib */,
|
||||
|
||||
@@ -258,7 +258,6 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
||||
}
|
||||
|
||||
- (NSString *)fileTypeFromLastRunSavePanel {
|
||||
/* TODO evaluate if this is still necessary! */
|
||||
if(self.savePanelViewController) {
|
||||
return [self.class fileTypeForVersion:self.savePanelViewController.selectedVersion];
|
||||
}
|
||||
|
||||
@@ -210,9 +210,10 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
#pragma mark Actions
|
||||
- (void)saveDocument:(id)sender {
|
||||
MPDocument *document = self.document;
|
||||
/* did we open as legacy ?
|
||||
|
||||
NSString *fileType = document.fileType;
|
||||
/* we did open as legacy */
|
||||
if([fileType isEqualToString:MPKdbDocumentUTI]) {
|
||||
if([fileType isEqualToString:MPKdbxDocumentUTI]) {
|
||||
if(document.tree.minimumVersion.format != KPKDatabaseFormatKdb) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.alertStyle = NSWarningAlertStyle;
|
||||
@@ -225,7 +226,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
[alert beginSheetModalForWindow:((NSDocument *)self.document).windowForSheet completionHandler:^(NSModalResponse returnCode) {
|
||||
switch(returnCode) {
|
||||
case NSAlertFirstButtonReturn:
|
||||
/* Save lossy */
|
||||
// save lossy
|
||||
[self.document saveDocument:nil];
|
||||
return;
|
||||
|
||||
@@ -242,21 +243,19 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(!document.compositeKey) {
|
||||
__weak MPDocument *weakDocument = self.document;
|
||||
|
||||
else*/
|
||||
if(!document.compositeKey) {
|
||||
[self editPasswordWithCompetionHandler:^(NSInteger result) {
|
||||
if(result == NSModalResponseOK) {
|
||||
[weakDocument saveDocument:sender];
|
||||
[self saveDocument:sender];
|
||||
}
|
||||
}];
|
||||
return;
|
||||
}
|
||||
else if(document.shouldEnforcePasswordChange) {
|
||||
__weak MPDocument *weakDocument = [self document];
|
||||
[self editPasswordWithCompetionHandler:^(NSInteger result) {
|
||||
if(result == NSModalResponseOK) {
|
||||
[weakDocument saveDocument:sender];
|
||||
[self saveDocument:sender];
|
||||
}
|
||||
}];
|
||||
[self _presentPasswordIntervalAlerts];
|
||||
@@ -272,10 +271,9 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
return;
|
||||
}
|
||||
/* we need to make sure that a password is set */
|
||||
__weak MPDocument *weakDocument = self.document;
|
||||
[self editPasswordWithCompetionHandler:^(NSInteger result) {
|
||||
if(result == NSModalResponseOK) {
|
||||
[weakDocument saveDocumentAs:sender];
|
||||
[self saveDocumentAs:sender];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
- (void)_updateNote {
|
||||
NSString *uti = self.fileTypePopupButton.selectedItem.representedObject;
|
||||
BOOL showInfoText = (self.document.tree.minimumVersion.format == KPKDatabaseFormatKdbx && [uti isEqualToString:MPKdbDocumentUTI]);
|
||||
BOOL showInfoText = [uti isEqualToString:MPKdbDocumentUTI] && (self.document.tree.minimumVersion.format == KPKDatabaseFormatKdbx) && [self.document.fileType isEqualToString:MPKdbxDocumentUTI];
|
||||
self.infoTextField.hidden = !showInfoText;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user