diff --git a/Classes/FanControl.m b/Classes/FanControl.m index 0508033..7de1423 100755 --- a/Classes/FanControl.m +++ b/Classes/FanControl.m @@ -58,6 +58,8 @@ +(void) initialize { //talk to smc [smcWrapper init]; + + [FanControl terminateIfNoFans]; //app in foreground for update notifications [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; @@ -934,6 +936,24 @@ +(void)setRights{ [self checkRightStatus:status]; } ++(void) terminateIfNoFans { + if ([smcWrapper get_fan_num] == 0) { + NSAlert *alert = [NSAlert alertWithError:nil]; + NSString * _Nonnull messageText = NSLocalizedString(@"No Fans", nil); + messageText = [messageText stringByAppendingString:@"\nhttps://github.com/hholtmann/smcFanControl/issues"]; + [alert setMessageText:messageText]; + NSString *modelIdentifier = NSLocalizedString(@"Model Identifier", nil); + modelIdentifier = [modelIdentifier stringByAppendingString:@": "]; + modelIdentifier = [modelIdentifier stringByAppendingString:[MachineDefaults computerModel]]; + [alert setInformativeText: modelIdentifier]; + [alert addButtonWithTitle:@"Quit"]; + NSModalResponse code=[alert runModal]; + if (code == NSAlertDefaultReturn) { + [[NSApplication sharedApplication] terminate:self]; + } + } +} + -(void)dealloc { diff --git a/Ressources/Dutch.lproj/Localizable.strings b/Ressources/Dutch.lproj/Localizable.strings index 23bbea5..d31e3c7 100644 --- a/Ressources/Dutch.lproj/Localizable.strings +++ b/Ressources/Dutch.lproj/Localizable.strings @@ -39,4 +39,8 @@ "Reset Settings" = "Reset Settings"; -"Shutdown required" = "Shutdown required"; \ No newline at end of file +"Shutdown required" = "Shutdown required"; + +"No Fans" = "Je Mac wordt niet ondersteund omdat deze geen ventilatoren heeft. Als u denkt dat dit een fout is, kunt u een probleem melden via"; + +"Model Identification" = "Modell-Identifizierung"; diff --git a/Ressources/English.lproj/Localizable.strings b/Ressources/English.lproj/Localizable.strings index d830c65..c27eaab 100644 Binary files a/Ressources/English.lproj/Localizable.strings and b/Ressources/English.lproj/Localizable.strings differ diff --git a/Ressources/French.lproj/Localizable.strings b/Ressources/French.lproj/Localizable.strings index 5a4131f..e57ec43 100644 Binary files a/Ressources/French.lproj/Localizable.strings and b/Ressources/French.lproj/Localizable.strings differ diff --git a/Ressources/German.lproj/Localizable.strings b/Ressources/German.lproj/Localizable.strings index 393ff8c..c4a4148 100644 --- a/Ressources/German.lproj/Localizable.strings +++ b/Ressources/German.lproj/Localizable.strings @@ -38,4 +38,8 @@ "Reset Settings" = "Einstellungen zurücksetzen"; -"Shutdown required" = "Ausschalten erforderlich"; \ No newline at end of file +"Shutdown required" = "Ausschalten erforderlich"; + +"No Fans" = "Ihr Mac wird nicht unterstützt, da er keine Lüfter hat. Wenn Sie der Meinung sind, dass es sich hierbei um einen Fehler handelt, melden Sie bitte ein Problem über"; + +"Model Identification" = "Modellkennung"; diff --git a/Ressources/Spanish.lproj/Localizable.strings b/Ressources/Spanish.lproj/Localizable.strings index cf51781..c7c12b2 100644 --- a/Ressources/Spanish.lproj/Localizable.strings +++ b/Ressources/Spanish.lproj/Localizable.strings @@ -39,3 +39,7 @@ "Reset Settings" = "Ajustes de fábrica"; "Shutdown required" = "Se necesita apagar"; + +"No Fans" = "Tu Mac no es compatible porque no tiene ventiladores. Si cree que se trata de un error, plantee un problema a través de"; + +"Model Identification" = "Identificador del modelo";