Skip to content
Closed
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
20 changes: 20 additions & 0 deletions Classes/FanControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ +(void) initialize {

//talk to smc
[smcWrapper init];

[FanControl terminateIfNoFans];

//app in foreground for update notifications
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
Expand Down Expand Up @@ -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
{
Expand Down
6 changes: 5 additions & 1 deletion Ressources/Dutch.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@

"Reset Settings" = "Reset Settings";

"Shutdown required" = "Shutdown required";
"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";
Binary file modified Ressources/English.lproj/Localizable.strings
Binary file not shown.
Binary file modified Ressources/French.lproj/Localizable.strings
Binary file not shown.
6 changes: 5 additions & 1 deletion Ressources/German.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@

"Reset Settings" = "Einstellungen zurücksetzen";

"Shutdown required" = "Ausschalten erforderlich";
"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";
4 changes: 4 additions & 0 deletions Ressources/Spanish.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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";