Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Settings/MFSettingsController.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ MFLogViewerController, MGActionButton;
MFClient* client;
MFPreferencesController* preferencesController;
MFLogViewerController* logViewerController;

NSMutableArray *newFilesystemsToDelete;
}

- (IBAction)newFSPopupClicked:(id)sender;
Expand All @@ -50,4 +52,5 @@ MFLogViewerController, MGActionButton;
- (IBAction)openSupportSite:(id)sender;

@property(readonly) MFClient* client;
@property(readwrite, assign) NSMutableArray *newFilesystemsToDelete;
@end
11 changes: 8 additions & 3 deletions Settings/MFSettingsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#import "MFPreferences.h"
#import "MFLogging.h"



@interface MFSettingsController(PrivateAPI)
- (void)editFilesystem:(MFClientFS*)fs;
- (void)toggleFilesystem:(MFClientFS*)fs;
Expand Down Expand Up @@ -305,10 +307,11 @@ - (void)deleteFilesystems:(NSArray *)filesystems {
NSButton *cancelButton = [deleteConfirmation addButtonWithTitle:@"Cancel"];
[cancelButton setKeyEquivalent:@"\e"];
[deleteConfirmation setAlertStyle: NSCriticalAlertStyle];
[self setNewFilesystemsToDelete:filesystemsToDelete];
[deleteConfirmation beginSheetModalForWindow: [filesystemTableView window]
modalDelegate:self
didEndSelector:@selector(deleteConfirmationAlertDidEnd:returnCode:contextInfo:)
contextInfo:filesystemsToDelete];
contextInfo:nil];
}
}

Expand Down Expand Up @@ -366,13 +369,14 @@ - (IBAction)deleteSelectedFS:(id)sender {


- (void)deleteConfirmationAlertDidEnd:(NSAlert*)alert returnCode:(NSInteger)code contextInfo:(void *)context {
NSArray *filesystemsToDelete = (NSArray *)context;
if (code == NSAlertSecondButtonReturn) {

} else if (code == NSAlertFirstButtonReturn) {
for(MFClientFS *fs in filesystemsToDelete) {
for(MFClientFS *fs in [self newFilesystemsToDelete]) {
[client deleteFilesystem: fs];
}
[self setNewFilesystemsToDelete:[NSMutableArray alloc]];
}
}

Expand Down Expand Up @@ -584,4 +588,5 @@ - (void)finalize {
}

@synthesize client;
@synthesize newFilesystemsToDelete;
@end