mirror of
https://github.com/hholtmann/smcFanControl.git
synced 2025-11-04 19:49:16 +01:00
Fixed deletion of favorites on OS X 10.9
This commit is contained in:
@ -290,21 +290,26 @@ NSUserDefaults *defaults;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)delete_favorite:(id)sender{
|
|
||||||
int pressesButton=NSRunCriticalAlertPanelRelativeToWindow(
|
|
||||||
NSLocalizedString(@"Delete favorite",nil),
|
- (void) deleteAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
|
||||||
[NSString stringWithFormat:NSLocalizedString(@"Do you really want to delete the favorite %@?",nil), [ [ [FavoritesController arrangedObjects] objectAtIndex:[FavoritesController selectionIndex]] objectForKey:@"Title"] ],
|
{
|
||||||
NSLocalizedString(@"No",nil),
|
if (returnCode==0) {
|
||||||
NSLocalizedString(@"Yes",nil),nil,mainwindow);
|
|
||||||
if (pressesButton==0) {
|
|
||||||
//delete favorite, but resets presets before
|
//delete favorite, but resets presets before
|
||||||
[self check_deletion:@"selbatt"];
|
[self check_deletion:@"selbatt"];
|
||||||
[self check_deletion:@"selac"];
|
[self check_deletion:@"selac"];
|
||||||
[self check_deletion:@"selload"];
|
[self check_deletion:@"selload"];
|
||||||
[FavoritesController removeObjects:[FavoritesController selectedObjects]];
|
[FavoritesController removeObjects:[FavoritesController selectedObjects]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)delete_favorite:(id)sender{
|
||||||
|
|
||||||
|
NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Delete favorite",nil) defaultButton:NSLocalizedString(@"No",nil) alternateButton:NSLocalizedString(@"Yes",nil) otherButton:nil informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"Do you really want to delete the favorite %@?",nil), [ [ [FavoritesController arrangedObjects] objectAtIndex:[FavoritesController selectionIndex]] objectForKey:@"Title"] ]];
|
||||||
|
|
||||||
|
[alert beginSheetModalForWindow:mainwindow modalDelegate:self didEndSelector:@selector(deleteAlertDidEnd:returnCode:contextInfo:) contextInfo:NULL];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Called via a timer mechanism. This is where all the temp / RPM reading is done.
|
// Called via a timer mechanism. This is where all the temp / RPM reading is done.
|
||||||
//reads fan data and updates the gui
|
//reads fan data and updates the gui
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user