mirror of
https://github.com/hholtmann/smcFanControl.git
synced 2025-11-04 19:49:16 +01:00
Compare commits
88 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad77a7b2e8 | |||
| e1bd672bcd | |||
| 21db698f1f | |||
| 4df0a0577e | |||
| c065120eee | |||
| 8ff458b441 | |||
| 8a68395f96 | |||
| 23b6083523 | |||
| 346eceb501 | |||
| a38133947f | |||
| 569b18b9d3 | |||
| 71c252571f | |||
| 53b337f15f | |||
| 618c22ea89 | |||
| ae318d4bd7 | |||
| ad374ffb1d | |||
| 442cc1e588 | |||
| 939f86584f | |||
| 244413718d | |||
| 5b78c6f462 | |||
| 0edcda181a | |||
| 407b7ecaa6 | |||
| d10498f2b3 | |||
| 875c68b0d3 | |||
| 78b25bc3d4 | |||
| 065dc3bdcd | |||
| 1a09635c80 | |||
| 8f64f2c8a8 | |||
| c6de965292 | |||
| 4962df7488 | |||
| 3373ab1ab0 | |||
| a2e290859e | |||
| de3988463a | |||
| 6d6a6e8df5 | |||
| 8dd7096e96 | |||
| 65071b3bda | |||
| df1fdde5a1 | |||
| d1dff0106f | |||
| 2c8c9ce9b0 | |||
| e4257f547f | |||
| 37d3f97221 | |||
| 8bac767ee2 | |||
| ebe1cb6db6 | |||
| e35ada4887 | |||
| c37ad48839 | |||
| cbe7057bb2 | |||
| 757dd0083f | |||
| 679e6c659c | |||
| 11c0565924 | |||
| 2308d9b194 | |||
| 6f41bb6552 | |||
| 2d69dcc399 | |||
| b5103c8f64 | |||
| df287a7bf4 | |||
| 96aecc00f2 | |||
| 59ba7232fe | |||
| 9536827e73 | |||
| a37e18d227 | |||
| 3109288146 | |||
| 97683b91b7 | |||
| 6d2a6ed863 | |||
| 3c84277cef | |||
| 411ba5a485 | |||
| 2804ac0c85 | |||
| 252fc40328 | |||
| 3e00b8e79a | |||
| b956d0efe0 | |||
| 825feeebfc | |||
| b01a8cd165 | |||
| 2075ad0793 | |||
| c78366cebb | |||
| 62059ede9b | |||
| 052664221c | |||
| d4dee3b02f | |||
| f271718c71 | |||
| 4a94a92620 | |||
| 2abb74a087 | |||
| ee8f96e45f | |||
| bb9eb56faf | |||
| b5d8d8838e | |||
| 47c1d38d4c | |||
| 8d9b496dd4 | |||
| 93c7f15214 | |||
| 1eae87aede | |||
| b47bbf0177 | |||
| 65fef1adc3 | |||
| 7489cd8239 | |||
| 3dbea4bd98 |
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/build/
|
||||
/smcFanControl.xcodeproj/project.xcworkspace/xcshareddata/
|
||||
/smcFanControl.xcodeproj/project.xcworkspace/xcuserdata/
|
||||
/smcFanControl.xcodeproj/xcuserdata/
|
||||
29
Classes/Constants.h
Normal file
29
Classes/Constants.h
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
// Constants.h
|
||||
// smcFanControl
|
||||
//
|
||||
// Created by Hendrik Holtmann on 16/10/16.
|
||||
//
|
||||
//
|
||||
|
||||
#define PREF_TEMP_UNIT @"Unit"
|
||||
#define PREF_SELECTION_DEFAULT @"SelDefault"
|
||||
#define PREF_AUTOSTART_ENABLED @"AutoStart"
|
||||
#define PREF_AUTOMATIC_CHANGE @"AutomaticChange"
|
||||
#define PREF_BATTERY_SELECTION @"selbatt"
|
||||
#define PREF_AC_SELECTION @"selac"
|
||||
#define PREF_CHARGING_SELECTION @"selload"
|
||||
#define PREF_MENU_DISPLAYMODE @"MenuBar"
|
||||
#define PREF_TEMPERATURE_SENSOR @"TSensor"
|
||||
#define PREF_NUMBEROF_LAUNCHES @"NumLaunches"
|
||||
#define PREF_DONATIONMESSAGE_DISPLAY @"DonationMessageDisplay"
|
||||
#define PREF_MENU_TEXTCOLOR @"MenuColor"
|
||||
#define PREF_FAVORITES_ARRAY @"Favorites"
|
||||
|
||||
#define PREF_FAN_ARRAY @"FanData"
|
||||
#define PREF_FAN_TITLE @"Title"
|
||||
#define PREF_FAN_MINSPEED @"Minspeed"
|
||||
#define PREF_FAN_SELSPEED @"selspeed"
|
||||
#define PREF_FAN_SYNC @"sync"
|
||||
#define PREF_FAN_SHOWMENU @"menu"
|
||||
#define PREF_FAN_AUTO @"auto"
|
||||
@ -23,17 +23,19 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "NSFileManager+DirectoryLocations.h"
|
||||
#import <smc.h>
|
||||
#import <smcWrapper.h>
|
||||
#import <MachineDefaults.h>
|
||||
#import "smc.h"
|
||||
#import "smcWrapper.h"
|
||||
#import "IOHIDSensor.h"
|
||||
#import "MachineDefaults.h"
|
||||
|
||||
#import <Power.h>
|
||||
#import "Power.h"
|
||||
#include <mach/mach_port.h>
|
||||
#include <mach/mach_interface.h>
|
||||
#include <mach/mach_init.h>
|
||||
|
||||
#include <IOKit/pwr_mgt/IOPMLib.h>
|
||||
#include <IOKit/IOMessage.h>
|
||||
#import "Constants.h"
|
||||
|
||||
|
||||
#define kMenuBarHeight 22
|
||||
@ -99,7 +101,6 @@
|
||||
IBOutlet id DefaultsController;
|
||||
|
||||
MachineDefaults *mdefaults;
|
||||
NSDictionary *s_sed;
|
||||
|
||||
NSDictionary *undo_dic;
|
||||
|
||||
@ -107,6 +108,9 @@
|
||||
NSImage *menu_image_alt;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong ) NSMutableDictionary *machineDefaultsDict;
|
||||
|
||||
|
||||
-(void)terminate:(id)sender;
|
||||
|
||||
- (IBAction)paypal:(id)sender;
|
||||
@ -115,6 +119,7 @@
|
||||
- (IBAction)closePreferences:(id)sender;
|
||||
- (IBAction)savePreferences:(id)sender;
|
||||
- (IBAction)updateCheck:(id)sender;
|
||||
- (IBAction)resetSettings:(id)sender;
|
||||
|
||||
- (void)init_statusitem;
|
||||
|
||||
@ -136,8 +141,8 @@
|
||||
|
||||
|
||||
@interface NSNumber (NumberAdditions)
|
||||
- (NSString *) tohex;
|
||||
- (NSNumber*) celsius_fahrenheit;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *tohex;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSNumber *celsius_fahrenheit;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -32,8 +32,9 @@
|
||||
|
||||
@interface FanControl ()
|
||||
+ (void)copyMachinesIfNecessary;
|
||||
- (BOOL)isInAutoStart;
|
||||
@property (NS_NONATOMIC_IOSONLY, getter=isInAutoStart, readonly) BOOL inAutoStart;
|
||||
- (void)setStartAtLogin:(BOOL)enabled;
|
||||
+ (void)checkRightStatus:(OSStatus)status;
|
||||
@end
|
||||
|
||||
@implementation FanControl
|
||||
@ -41,6 +42,7 @@
|
||||
// Number of fans reported by the hardware.
|
||||
int g_numFans = 0;
|
||||
|
||||
|
||||
NSUserDefaults *defaults;
|
||||
|
||||
#pragma mark **Init-Methods**
|
||||
@ -79,14 +81,14 @@ NSUserDefaults *defaults;
|
||||
for (i=0;i<[rfavorites count];i++)
|
||||
{
|
||||
BOOL selected = NO;
|
||||
NSArray *fans = [[rfavorites objectAtIndex:i] objectForKey:@"FanData"];
|
||||
NSArray *fans = rfavorites[i][PREF_FAN_ARRAY];
|
||||
for (j=0;j<[fans count];j++) {
|
||||
if ([[[fans objectAtIndex:j] objectForKey:@"menu"] boolValue] == YES ) {
|
||||
if ([fans[j][PREF_FAN_SHOWMENU] boolValue] == YES ) {
|
||||
selected = YES;
|
||||
}
|
||||
}
|
||||
if (selected==NO) {
|
||||
[[[[rfavorites objectAtIndex:i] objectForKey:@"FanData"] objectAtIndex:0] setObject:[NSNumber numberWithBool:YES] forKey:@"menu"];
|
||||
rfavorites[i][PREF_FAN_ARRAY][0][PREF_FAN_SHOWMENU] = @YES;
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,97 +96,93 @@ NSUserDefaults *defaults;
|
||||
|
||||
-(void) awakeFromNib {
|
||||
|
||||
s_sed = nil;
|
||||
pw=[[Power alloc] init];
|
||||
[pw setDelegate:self];
|
||||
[pw registerForSleepWakeNotification];
|
||||
[pw registerForPowerChange];
|
||||
|
||||
|
||||
//load defaults
|
||||
|
||||
[DefaultsController setAppliesImmediately:NO];
|
||||
|
||||
mdefaults=[[MachineDefaults alloc] init:nil];
|
||||
|
||||
s_sed=[mdefaults get_machine_defaults];
|
||||
self.machineDefaultsDict=[[NSMutableDictionary alloc] initWithDictionary:[mdefaults get_machine_defaults]];
|
||||
|
||||
NSMutableArray *favorites = [[NSMutableArray alloc] init];
|
||||
|
||||
NSMutableDictionary *defaultFav = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Default", PREF_FAN_TITLE,
|
||||
[NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:[[mdefaults get_machine_defaults] objectForKey:@"Fans"]]], PREF_FAN_ARRAY,nil];
|
||||
|
||||
[favorites addObject:defaultFav];
|
||||
|
||||
|
||||
NSMutableArray *favorites=[NSMutableArray arrayWithObjects:
|
||||
[NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
@"Default", @"Title",
|
||||
[s_sed objectForKey:@"Fans"], @"FanData",nil],nil];
|
||||
NSRange range=[[MachineDefaults computerModel] rangeOfString:@"MacBook"];
|
||||
if (range.length>0) {
|
||||
//for macbooks add a second default
|
||||
MachineDefaults *msdefaults=[[MachineDefaults alloc] init:nil];
|
||||
NSMutableDictionary *sec_fav=[NSMutableDictionary dictionaryWithObjectsAndKeys:@"Higher RPM", @"Title",
|
||||
[[msdefaults get_machine_defaults] objectForKey:@"Fans"], @"FanData",nil];
|
||||
[favorites addObject:sec_fav];
|
||||
int i;
|
||||
for (i=0;i<[[s_sed objectForKey:@"Fans"] count];i++) {
|
||||
int min_value=([[[[s_sed objectForKey:@"Fans"] objectAtIndex:i] valueForKey:@"Minspeed"] intValue])*2;
|
||||
[[[[favorites objectAtIndex:1] objectForKey:@"FanData"] objectAtIndex:i] setObject:[NSNumber numberWithInt:min_value] forKey:@"selspeed"];
|
||||
NSMutableDictionary *higherFav=[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Higher RPM", PREF_FAN_TITLE,
|
||||
[NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:[[mdefaults get_machine_defaults] objectForKey:@"Fans"]]], PREF_FAN_ARRAY,nil];
|
||||
for (NSUInteger i=0;i<[_machineDefaultsDict[@"Fans"] count];i++) {
|
||||
|
||||
int min_value=([[[[_machineDefaultsDict objectForKey:@"Fans"] objectAtIndex:i] objectForKey:PREF_FAN_MINSPEED] intValue])*2;
|
||||
[[[higherFav objectForKey:PREF_FAN_ARRAY] objectAtIndex:i] setObject:[NSNumber numberWithInt:min_value] forKey:PREF_FAN_SELSPEED];
|
||||
}
|
||||
[msdefaults release];
|
||||
[favorites addObject:higherFav];
|
||||
|
||||
}
|
||||
|
||||
//sync option for Macbook Pro's
|
||||
NSRange range_mbp=[[MachineDefaults computerModel] rangeOfString:@"MacBookPro"];
|
||||
if (range_mbp.length>0) {
|
||||
if (range_mbp.length>0 && [_machineDefaultsDict[@"Fans"] count] == 2) {
|
||||
[sync setHidden:NO];
|
||||
}
|
||||
|
||||
|
||||
NSString *feedURL = nil;
|
||||
if ([SystemVersion isTiger]) {
|
||||
feedURL = @"http://www.eidac.de/smcfancontrol/smcfancontrol_tiger.xml";
|
||||
} else {
|
||||
feedURL = @"http://www.eidac.de/smcfancontrol/smcfancontrol.xml";
|
||||
}
|
||||
|
||||
//load user defaults
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults registerDefaults:
|
||||
[NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:0], @"Unit",
|
||||
[NSNumber numberWithInt:0], @"SelDefault",
|
||||
[NSNumber numberWithBool:NO], @"AutoStart",
|
||||
[NSNumber numberWithBool:NO],@"AutomaticChange",
|
||||
[NSNumber numberWithInt:0],@"selbatt",
|
||||
[NSNumber numberWithInt:0],@"selac",
|
||||
[NSNumber numberWithInt:0],@"selload",
|
||||
[NSNumber numberWithInt:0],@"MenuBar",
|
||||
@"TC0D",@"TSensor",
|
||||
feedURL,@"SUFeedURL",
|
||||
[NSArchiver archivedDataWithRootObject:[NSColor blackColor]],@"MenuColor",
|
||||
favorites,@"Favorites",
|
||||
@0, PREF_TEMP_UNIT,
|
||||
@0, PREF_SELECTION_DEFAULT,
|
||||
@NO,PREF_AUTOSTART_ENABLED,
|
||||
@NO,PREF_AUTOMATIC_CHANGE,
|
||||
@0, PREF_BATTERY_SELECTION,
|
||||
@0, PREF_AC_SELECTION,
|
||||
@0, PREF_CHARGING_SELECTION,
|
||||
@0, PREF_MENU_DISPLAYMODE,
|
||||
#if TARGET_CPU_ARM64
|
||||
@"Tp0D",PREF_TEMPERATURE_SENSOR,
|
||||
#else
|
||||
@"TC0D",PREF_TEMPERATURE_SENSOR,
|
||||
#endif
|
||||
@0, PREF_NUMBEROF_LAUNCHES,
|
||||
@NO,PREF_DONATIONMESSAGE_DISPLAY,
|
||||
[NSArchiver archivedDataWithRootObject:[NSColor blackColor]],PREF_MENU_TEXTCOLOR,
|
||||
favorites,PREF_FAVORITES_ARRAY,
|
||||
nil]];
|
||||
|
||||
|
||||
|
||||
g_numFans = [smcWrapper get_fan_num];
|
||||
s_menus=[[NSMutableArray alloc] init];
|
||||
[s_menus autorelease];
|
||||
int i;
|
||||
for(i=0;i<g_numFans;i++){
|
||||
NSMenuItem *mitem=[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"Fan: %d",i] action:NULL keyEquivalent:@""];
|
||||
[mitem setTag:(i+1)*10];
|
||||
[s_menus insertObject:mitem atIndex:i];
|
||||
[mitem release];
|
||||
}
|
||||
|
||||
[FavoritesController bind:@"content"
|
||||
toObject:[NSUserDefaultsController sharedUserDefaultsController]
|
||||
withKeyPath:@"values.Favorites"
|
||||
withKeyPath:[@"values." stringByAppendingString:PREF_FAVORITES_ARRAY]
|
||||
options:nil];
|
||||
[FavoritesController setEditable:YES];
|
||||
|
||||
// set slider sync - only for MBP
|
||||
for (i=0;i<[[FavoritesController arrangedObjects] count];i++) {
|
||||
if([[[[FavoritesController arrangedObjects] objectAtIndex:i] objectForKey:@"sync"] boolValue]==YES) {
|
||||
if([[FavoritesController arrangedObjects][i][PREF_FAN_SYNC] boolValue]==YES) {
|
||||
[FavoritesController setSelectionIndex:i];
|
||||
[self syncBinder:[[[[FavoritesController arrangedObjects] objectAtIndex:i] objectForKey:@"sync"] boolValue]];
|
||||
[self syncBinder:[[FavoritesController arrangedObjects][i][PREF_FAN_SYNC] boolValue]];
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,40 +203,70 @@ NSUserDefaults *defaults;
|
||||
[autochange setEnabled:false];
|
||||
}
|
||||
[faqText replaceCharactersInRange:NSMakeRange(0,0) withRTF: [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"F.A.Q" ofType:@"rtf"]]];
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:@"SelDefault"] intValue]];
|
||||
[[[[theMenu itemWithTag:1] submenu] itemAtIndex:[[defaults objectForKey:@"SelDefault"] intValue]] setState:NSOnState];
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:PREF_SELECTION_DEFAULT] intValue]];
|
||||
[[[[theMenu itemWithTag:1] submenu] itemAtIndex:[[defaults objectForKey:PREF_SELECTION_DEFAULT] intValue]] setState:NSOnState];
|
||||
[[sliderCell dataCell] setControlSize:NSSmallControlSize];
|
||||
[self changeMenu:nil];
|
||||
|
||||
//seting toolbar image
|
||||
menu_image = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"smc" ofType:@"png"]];
|
||||
menu_image_alt = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"smcover" ofType:@"png"]];
|
||||
if ([menu_image respondsToSelector:@selector(setTemplate:)]) {
|
||||
[menu_image setTemplate:YES];
|
||||
[menu_image_alt setTemplate:YES];
|
||||
}
|
||||
|
||||
//release MachineDefaults class first call
|
||||
//add timer for reading to RunLoop
|
||||
_readTimer = [NSTimer scheduledTimerWithTimeInterval:4.0 target:self selector:@selector(readFanData:) userInfo:nil repeats:YES];
|
||||
if ([_readTimer respondsToSelector:@selector(setTolerance:)]) {
|
||||
[_readTimer setTolerance:2.0];
|
||||
}
|
||||
[_readTimer fire];
|
||||
|
||||
//autoapply settings if valid
|
||||
[self upgradeFavorites];
|
||||
|
||||
//autostart
|
||||
[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithBool:[self isInAutoStart]] forKey:@"AutoStart"];
|
||||
[[NSUserDefaults standardUserDefaults] setValue:@([self isInAutoStart]) forKey:PREF_AUTOSTART_ENABLED];
|
||||
NSUInteger numLaunches = [[[NSUserDefaults standardUserDefaults] objectForKey:PREF_NUMBEROF_LAUNCHES] integerValue];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@(numLaunches+1) forKey:PREF_NUMBEROF_LAUNCHES];
|
||||
if (numLaunches != 0 && (numLaunches % 3 == 0) && ![[[NSUserDefaults standardUserDefaults] objectForKey:PREF_DONATIONMESSAGE_DISPLAY] boolValue]) {
|
||||
[self displayDonationMessage];
|
||||
}
|
||||
|
||||
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(readFanData:) name:@"AppleInterfaceThemeChangedNotification" object:nil];
|
||||
|
||||
}
|
||||
|
||||
-(void)displayDonationMessage
|
||||
{
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Consider a donation",nil)
|
||||
defaultButton:NSLocalizedString(@"Donate over Paypal",nil) alternateButton:NSLocalizedString(@"Never ask me again",nil) otherButton:NSLocalizedString(@"Remind me later",nil)
|
||||
informativeTextWithFormat:NSLocalizedString(@"smcFanControl keeps your Mac cool since 2006.\n\nIf smcFanControl is helfpul for you and you want to support further development, a small donation over Paypal is much appreciated.",nil)];
|
||||
NSModalResponse code=[alert runModal];
|
||||
if (code == NSAlertDefaultReturn) {
|
||||
[self paypal:nil];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:PREF_DONATIONMESSAGE_DISPLAY];
|
||||
} else if (code == NSAlertAlternateReturn) {
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:PREF_DONATIONMESSAGE_DISPLAY];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)init_statusitem{
|
||||
statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength: NSVariableStatusItemLength] retain];
|
||||
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength: NSVariableStatusItemLength];
|
||||
[statusItem setMenu: theMenu];
|
||||
|
||||
if ([statusItem respondsToSelector:@selector(button)]) {
|
||||
[statusItem.button setTitle:@"smc..."];
|
||||
} else {
|
||||
[statusItem setEnabled: YES];
|
||||
[statusItem setHighlightMode:YES];
|
||||
[statusItem setTitle:@"smc..."];
|
||||
}
|
||||
int i;
|
||||
for(i=0;i<[s_menus count];i++) {
|
||||
[theMenu insertItem:[s_menus objectAtIndex:i] atIndex:i];
|
||||
[theMenu insertItem:s_menus[i] atIndex:i];
|
||||
};
|
||||
|
||||
// Sign up for menuNeedsUpdate call
|
||||
@ -273,21 +301,19 @@ NSUserDefaults *defaults;
|
||||
- (IBAction)save_favorite:(id)sender{
|
||||
MachineDefaults *msdefaults=[[MachineDefaults alloc] init:nil];
|
||||
if ([[newfavorite_title stringValue] length]>0) {
|
||||
NSMutableDictionary *toinsert=[[NSMutableDictionary alloc] initWithObjectsAndKeys:[newfavorite_title stringValue],@"Title",[[msdefaults get_machine_defaults] objectForKey:@"Fans"],@"FanData",nil]; //default as template
|
||||
[toinsert setValue:[NSNumber numberWithInt:0] forKey:@"Standard"];
|
||||
NSMutableDictionary *toinsert=[[NSMutableDictionary alloc] initWithObjectsAndKeys:[newfavorite_title stringValue],@"Title",[msdefaults get_machine_defaults][@"Fans"],PREF_FAN_ARRAY,nil]; //default as template
|
||||
[toinsert setValue:@0 forKey:@"Standard"];
|
||||
[FavoritesController addObject:toinsert];
|
||||
[toinsert release];
|
||||
[newfavoritewindow close];
|
||||
[[NSApplication sharedApplication] endSheet:newfavoritewindow];
|
||||
}
|
||||
[msdefaults release];
|
||||
[self upgradeFavorites];
|
||||
}
|
||||
|
||||
|
||||
-(void) check_deletion:(id)combo{
|
||||
if ([FavoritesController selectionIndex]==[[defaults objectForKey:combo] intValue]) {
|
||||
[defaults setObject:[NSNumber numberWithInt:0] forKey:combo];
|
||||
[defaults setObject:@0 forKey:combo];
|
||||
}
|
||||
}
|
||||
|
||||
@ -297,29 +323,37 @@ NSUserDefaults *defaults;
|
||||
{
|
||||
if (returnCode==0) {
|
||||
//delete favorite, but resets presets before
|
||||
[self check_deletion:@"selbatt"];
|
||||
[self check_deletion:@"selac"];
|
||||
[self check_deletion:@"selload"];
|
||||
[self check_deletion:PREF_BATTERY_SELECTION];
|
||||
[self check_deletion:PREF_AC_SELECTION];
|
||||
[self check_deletion:PREF_CHARGING_SELECTION];
|
||||
[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"] ]];
|
||||
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][[FavoritesController selectionIndex]][@"Title"] ]];
|
||||
|
||||
[alert beginSheetModalForWindow:mainwindow modalDelegate:self didEndSelector:@selector(deleteAlertDidEnd:returnCode:contextInfo:) contextInfo:NULL];
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)usesIOHIDForTemperature {
|
||||
#if TARGET_CPU_ARM64
|
||||
return [[MachineDefaults computerModel] rangeOfString:@"MacBookPro17"].length > 0;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Called via a timer mechanism. This is where all the temp / RPM reading is done.
|
||||
//reads fan data and updates the gui
|
||||
-(void) readFanData:(NSTimer*)timer{
|
||||
-(void) readFanData:(id)caller{
|
||||
|
||||
int i = 0;
|
||||
|
||||
//on init handling
|
||||
if (s_sed==nil) {
|
||||
if (_machineDefaultsDict==nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -327,7 +361,7 @@ NSUserDefaults *defaults;
|
||||
// as low as possible.
|
||||
bool bNeedTemp = false;
|
||||
bool bNeedRpm = false;
|
||||
const int menuBarSetting = [[defaults objectForKey:@"MenuBar"] intValue];
|
||||
const int menuBarSetting = [[defaults objectForKey:PREF_MENU_DISPLAYMODE] intValue];
|
||||
switch (menuBarSetting) {
|
||||
default:
|
||||
case 1:
|
||||
@ -358,16 +392,16 @@ NSUserDefaults *defaults;
|
||||
|
||||
if (bNeedRpm == true) {
|
||||
// Read the current fan speed for the desired fan and format text for display in the menubar.
|
||||
NSArray *fans = [[[FavoritesController arrangedObjects] objectAtIndex:[FavoritesController selectionIndex]] objectForKey:@"FanData"];
|
||||
NSArray *fans = [FavoritesController arrangedObjects][[FavoritesController selectionIndex]][PREF_FAN_ARRAY];
|
||||
for (i=0; i<g_numFans && i<[fans count]; i++)
|
||||
{
|
||||
if ([[[fans objectAtIndex:i] objectForKey:@"menu"] boolValue]==YES) {
|
||||
if ([fans[i][PREF_FAN_SHOWMENU] boolValue]==YES) {
|
||||
selectedRpm = [smcWrapper get_fan_rpm:i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
NSNumberFormatter *nc=[[[NSNumberFormatter alloc] init] autorelease];
|
||||
NSNumberFormatter *nc=[[NSNumberFormatter alloc] init];
|
||||
//avoid jumping in menu bar
|
||||
[nc setFormat:@"000;000;-000"];
|
||||
|
||||
@ -376,14 +410,18 @@ NSUserDefaults *defaults;
|
||||
|
||||
if (bNeedTemp == true) {
|
||||
// Read current temperature and format text for the menubar.
|
||||
c_temp = [smcWrapper get_maintemp];
|
||||
|
||||
if ([[defaults objectForKey:@"Unit"] intValue]==0) {
|
||||
temp = [NSString stringWithFormat:@"%@%CC",[NSNumber numberWithFloat:c_temp],(unsigned short)0xb0];
|
||||
if ([self usesIOHIDForTemperature]) {
|
||||
c_temp = [IOHIDSensor getSOCTemperature];
|
||||
} else {
|
||||
NSNumberFormatter *ncf=[[[NSNumberFormatter alloc] init] autorelease];
|
||||
c_temp = [smcWrapper get_maintemp];
|
||||
}
|
||||
|
||||
if ([[defaults objectForKey:PREF_TEMP_UNIT] intValue]==0) {
|
||||
temp = [NSString stringWithFormat:@"%@%CC",@(c_temp),(unsigned short)0xb0];
|
||||
} else {
|
||||
NSNumberFormatter *ncf=[[NSNumberFormatter alloc] init];
|
||||
[ncf setFormat:@"00;00;-00"];
|
||||
temp = [NSString stringWithFormat:@"%@%CF",[ncf stringForObjectValue:[[NSNumber numberWithFloat:c_temp] celsius_fahrenheit]],(unsigned short)0xb0];
|
||||
temp = [NSString stringWithFormat:@"%@%CF",[ncf stringForObjectValue:[@(c_temp) celsius_fahrenheit]],(unsigned short)0xb0];
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,6 +429,19 @@ NSUserDefaults *defaults;
|
||||
NSMutableAttributedString *s_status = nil;
|
||||
NSMutableParagraphStyle *paragraphStyle = nil;
|
||||
|
||||
NSColor *menuColor = (NSColor*)[NSUnarchiver unarchiveObjectWithData:[defaults objectForKey:PREF_MENU_TEXTCOLOR]];
|
||||
BOOL setColor = NO;
|
||||
if (!([[menuColor colorUsingColorSpaceName:
|
||||
NSCalibratedWhiteColorSpace] whiteComponent] == 0.0) || ![statusItem respondsToSelector:@selector(button)]) setColor = YES;
|
||||
|
||||
|
||||
NSString *osxMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
|
||||
|
||||
if (osxMode && !setColor) {
|
||||
menuColor = [NSColor whiteColor];
|
||||
setColor = YES;
|
||||
}
|
||||
|
||||
switch (menuBarSetting) {
|
||||
default:
|
||||
case 1: {
|
||||
@ -411,10 +462,21 @@ NSUserDefaults *defaults;
|
||||
[paragraphStyle setAlignment:NSLeftTextAlignment];
|
||||
[s_status addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Lucida Grande" size:fsize] range:NSMakeRange(0,[s_status length])];
|
||||
[s_status addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0,[s_status length])];
|
||||
[s_status addAttribute:NSForegroundColorAttributeName value:(NSColor*)[NSUnarchiver unarchiveObjectWithData:[defaults objectForKey:@"MenuColor"]] range:NSMakeRange(0,[s_status length])];
|
||||
if (menuBarSetting == 0)
|
||||
[s_status addAttribute:NSBaselineOffsetAttributeName value:[NSNumber numberWithFloat: -6] range:NSMakeRange(0, [s_status length])];
|
||||
|
||||
if (setColor) [s_status addAttribute:NSForegroundColorAttributeName value:menuColor range:NSMakeRange(0,[s_status length])];
|
||||
|
||||
|
||||
if ([statusItem respondsToSelector:@selector(button)]) {
|
||||
[statusItem.button setAttributedTitle:s_status];
|
||||
[statusItem.button setImage:nil];
|
||||
[statusItem.button setAlternateImage:nil];
|
||||
} else {
|
||||
[statusItem setAttributedTitle:s_status];
|
||||
[statusItem setImage:nil];
|
||||
[statusItem setAlternateImage:nil];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -422,41 +484,58 @@ NSUserDefaults *defaults;
|
||||
// TODO: Big waste of energy to update this tooltip every X seconds when the user
|
||||
// is unlikely to hover the smcFanControl icon over and over again.
|
||||
[statusItem setLength:26];
|
||||
if ([statusItem respondsToSelector:@selector(button)]) {
|
||||
[statusItem.button setTitle:nil];
|
||||
[statusItem.button setToolTip:[NSString stringWithFormat:@"%@\n%@",temp,fan]];
|
||||
[statusItem.button setImage:menu_image];
|
||||
[statusItem.button setAlternateImage:menu_image_alt];
|
||||
} else {
|
||||
[statusItem setTitle:nil];
|
||||
[statusItem setToolTip:[NSString stringWithFormat:@"%@\n%@",temp,fan]];
|
||||
[statusItem setImage:menu_image];
|
||||
[statusItem setAlternateImage:menu_image_alt];
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
[statusItem setLength:46];
|
||||
s_status=[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",temp]];
|
||||
[s_status addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Lucida Grande" size:12] range:NSMakeRange(0,[s_status length])];
|
||||
[s_status addAttribute:NSForegroundColorAttributeName value:(NSColor*)[NSUnarchiver unarchiveObjectWithData:[defaults objectForKey:@"MenuColor"]] range:NSMakeRange(0,[s_status length])];
|
||||
if (setColor) [s_status addAttribute:NSForegroundColorAttributeName value:menuColor range:NSMakeRange(0,[s_status length])];
|
||||
if ([statusItem respondsToSelector:@selector(button)]) {
|
||||
[statusItem.button setAttributedTitle:s_status];
|
||||
[statusItem.button setImage:nil];
|
||||
[statusItem.button setAlternateImage:nil];
|
||||
} else {
|
||||
[statusItem setAttributedTitle:s_status];
|
||||
[statusItem setImage:nil];
|
||||
[statusItem setAlternateImage:nil];
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
[statusItem setLength:65];
|
||||
s_status=[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",fan]];
|
||||
[s_status addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Lucida Grande" size:12] range:NSMakeRange(0,[s_status length])];
|
||||
[s_status addAttribute:NSForegroundColorAttributeName value:(NSColor*)[NSUnarchiver unarchiveObjectWithData:[defaults objectForKey:@"MenuColor"]] range:NSMakeRange(0,[s_status length])];
|
||||
if (setColor) [s_status addAttribute:NSForegroundColorAttributeName value:menuColor range:NSMakeRange(0,[s_status length])];
|
||||
if ([statusItem respondsToSelector:@selector(button)]) {
|
||||
[statusItem.button setAttributedTitle:s_status];
|
||||
[statusItem.button setImage:nil];
|
||||
[statusItem.button setAlternateImage:nil];
|
||||
} else {
|
||||
[statusItem setAttributedTitle:s_status];
|
||||
[statusItem setImage:nil];
|
||||
[statusItem setAlternateImage:nil];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
[paragraphStyle release];
|
||||
[s_status release];
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)savePreferences:(id)sender{
|
||||
[(NSUserDefaultsController *)DefaultsController save:sender];
|
||||
[defaults setValue:[FavoritesController content] forKey:@"Favorites"];
|
||||
[defaults setValue:[FavoritesController content] forKey:PREF_FAVORITES_ARRAY];
|
||||
[defaults synchronize];
|
||||
[mainwindow close];
|
||||
[self apply_settings:sender controllerindex:[FavoritesController selectionIndex]];
|
||||
@ -470,6 +549,15 @@ NSUserDefaults *defaults;
|
||||
[DefaultsController revert:sender];
|
||||
}
|
||||
|
||||
-(void)setFansToAuto:(bool)is_auto {
|
||||
for (int fan_index=0;fan_index<[[FavoritesController arrangedObjects][0][PREF_FAN_ARRAY] count];fan_index++) {
|
||||
[self setFanToAuto:fan_index is_auto:is_auto];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setFanToAuto:(int)fan_index is_auto:(bool)is_auto {
|
||||
[smcWrapper setKey_external:[NSString stringWithFormat:@"F%dMd",fan_index] value:is_auto ? @"00" : @"01"];
|
||||
}
|
||||
|
||||
//set the new fan settings
|
||||
|
||||
@ -477,17 +565,30 @@ NSUserDefaults *defaults;
|
||||
int i;
|
||||
[FanControl setRights];
|
||||
[FavoritesController setSelectionIndex:cIndex];
|
||||
for (i=0;i<[[[[FavoritesController arrangedObjects] objectAtIndex:cIndex] objectForKey:@"FanData"] count];i++) {
|
||||
[smcWrapper setKey_external:[NSString stringWithFormat:@"F%dMn",i] value:[[[[FanController arrangedObjects] objectAtIndex:i] objectForKey:@"selspeed"] tohex]];
|
||||
|
||||
for (i=0;i<[[FavoritesController arrangedObjects][cIndex][PREF_FAN_ARRAY] count];i++) {
|
||||
int fan_mode = [smcWrapper get_mode:i];
|
||||
// Auto/forced mode is not available
|
||||
if (fan_mode < 0) {
|
||||
[smcWrapper setKey_external:[NSString stringWithFormat:@"F%dMn",i] value:[[FanController arrangedObjects][i][PREF_FAN_SELSPEED] tohex]];
|
||||
} else {
|
||||
bool is_auto = [[FanController arrangedObjects][i][PREF_FAN_AUTO] boolValue];
|
||||
[self setFanToAuto:i is_auto:is_auto];
|
||||
float f_val = [[FanController arrangedObjects][i][PREF_FAN_SELSPEED] floatValue];
|
||||
uint8 *vals = (uint8*)&f_val;
|
||||
//NSString str_val = ;
|
||||
[smcWrapper setKey_external:[NSString stringWithFormat:@"F%dTg",i] value:[NSString stringWithFormat:@"%02x%02x%02x%02x",vals[0],vals[1],vals[2],vals[3]]];
|
||||
}
|
||||
NSMenu *submenu = [[[NSMenu alloc] init] autorelease];
|
||||
}
|
||||
|
||||
NSMenu *submenu = [[NSMenu alloc] init];
|
||||
|
||||
for(i=0;i<[[FavoritesController arrangedObjects] count];i++){
|
||||
NSMenuItem *submenuItem = [[[NSMenuItem alloc] initWithTitle:[[[FavoritesController arrangedObjects] objectAtIndex:i] objectForKey:@"Title"] action:@selector(apply_quickselect:) keyEquivalent:@""] autorelease];
|
||||
NSMenuItem *submenuItem = [[NSMenuItem alloc] initWithTitle:[FavoritesController arrangedObjects][i][@"Title"] action:@selector(apply_quickselect:) keyEquivalent:@""];
|
||||
[submenuItem setTag:i*100]; //for later manipulation
|
||||
[submenuItem setEnabled:YES];
|
||||
[submenuItem setTarget:self];
|
||||
[submenuItem setRepresentedObject:[[FavoritesController arrangedObjects] objectAtIndex:i]];
|
||||
[submenuItem setRepresentedObject:[FavoritesController arrangedObjects][i]];
|
||||
[submenu addItem:submenuItem];
|
||||
}
|
||||
|
||||
@ -496,9 +597,9 @@ NSUserDefaults *defaults;
|
||||
[[[[theMenu itemWithTag:1] submenu] itemAtIndex:i] setState:NSOffState];
|
||||
}
|
||||
[[[[theMenu itemWithTag:1] submenu] itemAtIndex:cIndex] setState:NSOnState];
|
||||
[defaults setObject:[NSNumber numberWithInt:cIndex] forKey:@"SelDefault"];
|
||||
[defaults setObject:@(cIndex) forKey:PREF_SELECTION_DEFAULT];
|
||||
//change active setting display
|
||||
[[theMenu itemWithTag:1] setTitle:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Active Setting",nil),[ [ [FavoritesController arrangedObjects] objectAtIndex:[FavoritesController selectionIndex]] objectForKey:@"Title"] ]];
|
||||
[[theMenu itemWithTag:1] setTitle:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Active Setting",nil),[FavoritesController arrangedObjects][[FavoritesController selectionIndex]][PREF_FAN_TITLE] ]];
|
||||
}
|
||||
|
||||
|
||||
@ -523,13 +624,6 @@ NSUserDefaults *defaults;
|
||||
[_readTimer invalidate];
|
||||
[pw deregisterForSleepWakeNotification];
|
||||
[pw deregisterForPowerChange];
|
||||
[pw release];
|
||||
[menu_image release];
|
||||
[menu_image_alt release];
|
||||
//[mdefaults release];
|
||||
//[statusItem release];
|
||||
//[s_menus release];
|
||||
//[theMenu release];
|
||||
[[NSApplication sharedApplication] terminate:self];
|
||||
}
|
||||
|
||||
@ -545,7 +639,7 @@ NSUserDefaults *defaults;
|
||||
|
||||
|
||||
- (IBAction) changeMenu:(id)sender{
|
||||
if ([[[[NSUserDefaultsController sharedUserDefaultsController] values] valueForKey:@"MenuBar"] intValue]==2) {
|
||||
if ([[[[NSUserDefaultsController sharedUserDefaultsController] values] valueForKey:PREF_MENU_DISPLAYMODE] intValue]==2) {
|
||||
[colorSelector setEnabled:NO];
|
||||
} else {
|
||||
[colorSelector setEnabled:YES];
|
||||
@ -558,7 +652,7 @@ NSUserDefaults *defaults;
|
||||
int i;
|
||||
for (i=0;i<[[FanController arrangedObjects] count];i++) {
|
||||
if (i!=[sender selectedRow]) {
|
||||
[[[FanController arrangedObjects] objectAtIndex:i] setValue:[NSNumber numberWithBool:NO] forKey:@"menu"];
|
||||
[[FanController arrangedObjects][i] setValue:@NO forKey:PREF_FAN_SHOWMENU];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -568,16 +662,18 @@ NSUserDefaults *defaults;
|
||||
// menu items are now only updated here in order to
|
||||
// reduce the energy impact of -readFanData.
|
||||
- (void)menuNeedsUpdate:(NSMenu*)menu {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (theMenu == menu) {
|
||||
if (s_sed == nil)
|
||||
if (_machineDefaultsDict == nil)
|
||||
return;
|
||||
|
||||
int i;
|
||||
for(i=0; i<g_numFans; ++i){
|
||||
NSString *fandesc=[[[s_sed objectForKey:@"Fans"] objectAtIndex:i] objectForKey:@"Description"];
|
||||
[[theMenu itemWithTag:(i+1)*10] setTitle:[NSString stringWithFormat:@"%@: %@ rpm",fandesc,[[NSNumber numberWithInt:[smcWrapper get_fan_rpm:i]] stringValue]]];
|
||||
NSString *fandesc=_machineDefaultsDict[@"Fans"][i][@"Description"];
|
||||
[[theMenu itemWithTag:(i+1)*10] setTitle:[NSString stringWithFormat:@"%@: %@ rpm",fandesc,[@([smcWrapper get_fan_rpm:i]) stringValue]]];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -586,12 +682,56 @@ NSUserDefaults *defaults;
|
||||
|
||||
//just a helper to bringt update-info-window to the front
|
||||
- (IBAction)updateCheck:(id)sender{
|
||||
[[[SUUpdater alloc] init] checkForUpdates:sender];
|
||||
SUUpdater *updater = [[SUUpdater alloc] init];
|
||||
[updater checkForUpdates:sender];
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
|
||||
-(void)performReset
|
||||
{
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
|
||||
NSError *error;
|
||||
NSString *machinesPath = [[fileManager applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"];
|
||||
[fileManager removeItemAtPath:machinesPath error:&error];
|
||||
if (error) {
|
||||
NSLog(@"Error deleting %@",machinesPath);
|
||||
}
|
||||
error = nil;
|
||||
if ([[MachineDefaults computerModel] rangeOfString:@"MacBookPro15"].location != NSNotFound) {
|
||||
[self setFansToAuto:true];
|
||||
}
|
||||
|
||||
NSString *domainName = [[NSBundle mainBundle] bundleIdentifier];
|
||||
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:domainName];
|
||||
|
||||
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Shutdown required",nil)
|
||||
defaultButton:NSLocalizedString(@"OK",nil) alternateButton:nil otherButton:nil
|
||||
informativeTextWithFormat:NSLocalizedString(@"Please shutdown your computer now to return to default fan settings.",nil)];
|
||||
NSModalResponse code=[alert runModal];
|
||||
if (code == NSAlertDefaultReturn) {
|
||||
[[NSApplication sharedApplication] terminate:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)resetSettings:(id)sender
|
||||
{
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Reset Settings",nil)
|
||||
defaultButton:NSLocalizedString(@"Yes",nil) alternateButton:NSLocalizedString(@"No",nil) otherButton:nil
|
||||
informativeTextWithFormat:NSLocalizedString(@"Do you want to reset smcFanControl to default settings? Favorites will be deleted and fans will return to default speed.",nil)];
|
||||
NSModalResponse code=[alert runModal];
|
||||
if (code == NSAlertDefaultReturn) {
|
||||
[self performReset];
|
||||
} else if (code == NSAlertAlternateReturn) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (IBAction)visitHomepage:(id)sender{
|
||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.eidac.de/products"]];
|
||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://www.eidac.de/products"]];
|
||||
}
|
||||
|
||||
|
||||
@ -603,11 +743,11 @@ NSUserDefaults *defaults;
|
||||
//in case plist is corrupt, don't bind
|
||||
if ([[FanController arrangedObjects] count]>1 ) {
|
||||
if (bind==YES) {
|
||||
[[[FanController arrangedObjects] objectAtIndex:1] bind:@"selspeed" toObject:[[FanController arrangedObjects] objectAtIndex:0] withKeyPath:@"selspeed" options:nil];
|
||||
[[[FanController arrangedObjects] objectAtIndex:0] bind:@"selspeed" toObject:[[FanController arrangedObjects] objectAtIndex:1] withKeyPath:@"selspeed" options:nil];
|
||||
[[FanController arrangedObjects][1] bind:PREF_FAN_SELSPEED toObject:[FanController arrangedObjects][0] withKeyPath:PREF_FAN_SELSPEED options:nil];
|
||||
[[FanController arrangedObjects][0] bind:PREF_FAN_SELSPEED toObject:[FanController arrangedObjects][1] withKeyPath:PREF_FAN_SELSPEED options:nil];
|
||||
} else {
|
||||
[[[FanController arrangedObjects] objectAtIndex:1] unbind:@"selspeed"];
|
||||
[[[FanController arrangedObjects] objectAtIndex:0] unbind:@"selspeed"];
|
||||
[[FanController arrangedObjects][1] unbind:PREF_FAN_SELSPEED];
|
||||
[[FanController arrangedObjects][0] unbind:PREF_FAN_SELSPEED];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -615,28 +755,35 @@ NSUserDefaults *defaults;
|
||||
|
||||
#pragma mark **Power Watchdog-Methods**
|
||||
|
||||
- (void)systemWillSleep:(id)sender{
|
||||
#if TARGET_CPU_ARM64
|
||||
[FanControl setRights];
|
||||
[self setFansToAuto:true];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)systemDidWakeFromSleep:(id)sender{
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:@"SelDefault"] intValue]];
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:PREF_SELECTION_DEFAULT] intValue]];
|
||||
}
|
||||
|
||||
|
||||
- (void)powerChangeToBattery:(id)sender{
|
||||
|
||||
if ([[defaults objectForKey:@"AutomaticChange"] boolValue]==YES) {
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:@"selbatt"] intValue]];
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:PREF_BATTERY_SELECTION] intValue]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)powerChangeToAC:(id)sender{
|
||||
if ([[defaults objectForKey:@"AutomaticChange"] boolValue]==YES) {
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:@"selac"] intValue]];
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:PREF_AC_SELECTION] intValue]];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (void)powerChangeToACLoading:(id)sender{
|
||||
if ([[defaults objectForKey:@"AutomaticChange"] boolValue]==YES) {
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:@"selload"] intValue]];
|
||||
[self apply_settings:nil controllerindex:[[defaults objectForKey:PREF_CHARGING_SELECTION] intValue]];
|
||||
|
||||
}
|
||||
}
|
||||
@ -650,14 +797,14 @@ NSUserDefaults *defaults;
|
||||
BOOL found = NO;
|
||||
LSSharedFileListRef loginItems = LSSharedFileListCreate(kCFAllocatorDefault, kLSSharedFileListSessionLoginItems, /*options*/ NULL);
|
||||
NSString *path = [[NSBundle mainBundle] bundlePath];
|
||||
CFURLRef URLToToggle = (CFURLRef)[NSURL fileURLWithPath:path];
|
||||
LSSharedFileListItemRef existingItem = NULL;
|
||||
CFURLRef URLToToggle = (__bridge CFURLRef)[NSURL fileURLWithPath:path];
|
||||
//LSSharedFileListItemRef existingItem = NULL;
|
||||
|
||||
UInt32 seed = 0U;
|
||||
NSArray *currentLoginItems = [NSMakeCollectable(LSSharedFileListCopySnapshot(loginItems, &seed)) autorelease];
|
||||
NSArray *currentLoginItems = CFBridgingRelease(LSSharedFileListCopySnapshot(loginItems, &seed));
|
||||
|
||||
for (id itemObject in currentLoginItems) {
|
||||
LSSharedFileListItemRef item = (LSSharedFileListItemRef)itemObject;
|
||||
LSSharedFileListItemRef item = (__bridge LSSharedFileListItemRef)itemObject;
|
||||
|
||||
UInt32 resolutionFlags = kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes;
|
||||
CFURLRef URL = NULL;
|
||||
@ -667,7 +814,7 @@ NSUserDefaults *defaults;
|
||||
CFRelease(URL);
|
||||
|
||||
if (foundIt) {
|
||||
existingItem = item;
|
||||
//existingItem = item;
|
||||
found = YES;
|
||||
break;
|
||||
}
|
||||
@ -684,14 +831,14 @@ NSUserDefaults *defaults;
|
||||
NSString *path = [[NSBundle mainBundle] bundlePath];
|
||||
|
||||
OSStatus status;
|
||||
CFURLRef URLToToggle = (CFURLRef)[NSURL fileURLWithPath:path];
|
||||
CFURLRef URLToToggle = (__bridge CFURLRef)[NSURL fileURLWithPath:path];
|
||||
LSSharedFileListItemRef existingItem = NULL;
|
||||
|
||||
UInt32 seed = 0U;
|
||||
NSArray *currentLoginItems = [NSMakeCollectable(LSSharedFileListCopySnapshot(loginItems, &seed)) autorelease];
|
||||
NSArray *currentLoginItems = CFBridgingRelease(LSSharedFileListCopySnapshot(loginItems, &seed));
|
||||
|
||||
for (id itemObject in currentLoginItems) {
|
||||
LSSharedFileListItemRef item = (LSSharedFileListItemRef)itemObject;
|
||||
LSSharedFileListItemRef item = (__bridge LSSharedFileListItemRef)itemObject;
|
||||
|
||||
UInt32 resolutionFlags = kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes;
|
||||
CFURLRef URL = NULL;
|
||||
@ -723,12 +870,24 @@ NSUserDefaults *defaults;
|
||||
icon = NULL;
|
||||
}
|
||||
|
||||
LSSharedFileListInsertItemURL(loginItems, kLSSharedFileListItemBeforeFirst, (CFStringRef)displayName, icon, URLToToggle, /*propertiesToSet*/ NULL, /*propertiesToClear*/ NULL);
|
||||
LSSharedFileListInsertItemURL(loginItems, kLSSharedFileListItemBeforeFirst, (__bridge CFStringRef)displayName, icon, URLToToggle, /*propertiesToSet*/ NULL, /*propertiesToClear*/ NULL);
|
||||
} else if (!enabled && (existingItem != NULL))
|
||||
LSSharedFileListItemRemove(loginItems, existingItem);
|
||||
}
|
||||
|
||||
|
||||
+(void) checkRightStatus:(OSStatus) status
|
||||
{
|
||||
if (status != errAuthorizationSuccess) {
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:@"Authorization failed" defaultButton:@"Quit" alternateButton:nil otherButton:nil informativeTextWithFormat:[NSString stringWithFormat:@"Authorization failed with code %d",status]];
|
||||
[alert setAlertStyle:2];
|
||||
NSInteger result = [alert runModal];
|
||||
|
||||
if (result == NSAlertDefaultReturn) {
|
||||
[[NSApplication sharedApplication] terminate:self];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark **SMC-Binary Owner/Right Check**
|
||||
//TODO: It looks like this function is called inefficiently.
|
||||
@ -748,26 +907,39 @@ NSUserDefaults *defaults;
|
||||
AuthorizationRights gencright = { 1, &gencitem };
|
||||
int flags = kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed;
|
||||
OSStatus status = AuthorizationCreate(&gencright, kAuthorizationEmptyEnvironment, flags, &authorizationRef);
|
||||
|
||||
[self checkRightStatus:status];
|
||||
|
||||
NSString *tool=@"/usr/sbin/chown";
|
||||
NSArray *argsArray = [NSArray arrayWithObjects: @"root:admin",smcpath,nil];
|
||||
NSArray *argsArray = @[@"root:admin",smcpath];
|
||||
int i;
|
||||
char *args[255];
|
||||
for(i = 0;i < [argsArray count];i++){
|
||||
args[i] = (char *)[[argsArray objectAtIndex:i]cString];
|
||||
args[i] = (char *)[argsArray[i]cString];
|
||||
}
|
||||
args[i] = NULL;
|
||||
status=AuthorizationExecuteWithPrivileges(authorizationRef,[tool UTF8String],0,args,&commPipe);
|
||||
|
||||
[self checkRightStatus:status];
|
||||
|
||||
//second call for suid-bit
|
||||
tool=@"/bin/chmod";
|
||||
argsArray = [NSArray arrayWithObjects: @"6555",smcpath,nil];
|
||||
argsArray = @[@"6555",smcpath];
|
||||
for(i = 0;i < [argsArray count];i++){
|
||||
args[i] = (char *)[[argsArray objectAtIndex:i]cString];
|
||||
args[i] = (char *)[argsArray[i]cString];
|
||||
}
|
||||
args[i] = NULL;
|
||||
status=AuthorizationExecuteWithPrivileges(authorizationRef,[tool UTF8String],0,args,&commPipe);
|
||||
|
||||
[self checkRightStatus:status];
|
||||
}
|
||||
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
[[NSDistributedNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -783,7 +955,7 @@ NSUserDefaults *defaults;
|
||||
- (NSNumber*) celsius_fahrenheit{
|
||||
float celsius=[self floatValue];
|
||||
float fahrenheit=(celsius*9)/5+32;
|
||||
return [NSNumber numberWithFloat:fahrenheit];
|
||||
return @(fahrenheit);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
57
Classes/IOHIDSensor.h
Normal file
57
Classes/IOHIDSensor.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* FanControl
|
||||
*
|
||||
* Copyright (c) 2006-2012 Hendrik Holtmann
|
||||
*
|
||||
* IOHIDSensor.h - MacBook(Pro) FanControl application
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <IOKit/hidsystem/IOHIDEventSystemClient.h>
|
||||
#import <IOKit/hidsystem/IOHIDServiceClient.h>
|
||||
|
||||
// https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-1035.70.7/IOHIDFamily/AppleHIDUsageTables.h.auto.html
|
||||
#define kHIDPage_AppleVendor 0xff00
|
||||
#define kHIDUsage_AppleVendor_TemperatureSensor 0x0005
|
||||
|
||||
// https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-1035.70.7/IOHIDFamily/IOHIDEventTypes.h.auto.html
|
||||
#ifdef __LP64__
|
||||
typedef double IOHIDFloat;
|
||||
#else
|
||||
typedef float IOHIDFloat;
|
||||
#endif
|
||||
|
||||
// https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-1035.70.7/IOHIDFamily/IOHIDEventTypes.h.auto.html
|
||||
#define IOHIDEventFieldBase(type) (type << 16)
|
||||
#define kIOHIDEventTypeTemperature 15
|
||||
|
||||
|
||||
typedef struct __IOHIDEvent *IOHIDEventRef;
|
||||
typedef struct __IOHIDServiceClient *IOHIDServiceClientRef;
|
||||
|
||||
IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef);
|
||||
void IOHIDEventSystemClientSetMatching(IOHIDEventSystemClientRef, CFDictionaryRef);
|
||||
IOHIDEventRef IOHIDServiceClientCopyEvent(IOHIDServiceClientRef, int64_t, int32_t, int64_t);
|
||||
IOHIDFloat IOHIDEventGetFloatValue(IOHIDEventRef event, uint32_t field);
|
||||
|
||||
@interface IOHIDSensor : NSObject {
|
||||
}
|
||||
|
||||
+ (float) getSOCTemperature;
|
||||
|
||||
@end
|
||||
70
Classes/IOHIDSensor.m
Normal file
70
Classes/IOHIDSensor.m
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* FanControl
|
||||
*
|
||||
* Copyright (c) 2006-2012 Hendrik Holtmann
|
||||
*
|
||||
* IOHIDSensor.m - MacBook(Pro) FanControl application
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#import "IOHIDSensor.h"
|
||||
|
||||
@implementation IOHIDSensor
|
||||
|
||||
static BOOL isSOCSensor(CFStringRef sensorName) {
|
||||
return CFStringFind(sensorName, CFSTR("SOC"), kCFCompareCaseInsensitive).location != kCFNotFound;
|
||||
}
|
||||
|
||||
static float toOneDecimalPlace(float value) {
|
||||
return roundf(10.0f * value) / 10.0f;
|
||||
}
|
||||
|
||||
+ (float) getSOCTemperature {
|
||||
IOHIDEventSystemClientRef eventSystemClient = IOHIDEventSystemClientCreate(kCFAllocatorDefault);
|
||||
CFArrayRef services = IOHIDEventSystemClientCopyServices(eventSystemClient);
|
||||
if (services) {
|
||||
|
||||
float socSensorSum = 0.0f;
|
||||
int socSensorCount = 0;
|
||||
|
||||
for (int i = 0; i < CFArrayGetCount(services); i++) {
|
||||
IOHIDServiceClientRef serviceClientRef = (IOHIDServiceClientRef)CFArrayGetValueAtIndex(services, i);
|
||||
CFStringRef sensorName = IOHIDServiceClientCopyProperty(serviceClientRef, CFSTR("Product"));
|
||||
if (sensorName) {
|
||||
if (isSOCSensor(sensorName)) {
|
||||
IOHIDEventRef event = IOHIDServiceClientCopyEvent(serviceClientRef, kIOHIDEventTypeTemperature, 0, 0);
|
||||
if (event) {
|
||||
IOHIDFloat sensorTemperature = IOHIDEventGetFloatValue(event, IOHIDEventFieldBase(kIOHIDEventTypeTemperature));
|
||||
CFRelease(event);
|
||||
socSensorSum += sensorTemperature;
|
||||
socSensorCount++;
|
||||
}
|
||||
}
|
||||
CFRelease(sensorName);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(services);
|
||||
CFRelease(eventSystemClient);
|
||||
|
||||
float avgSOCTemp = socSensorCount > 0 ? socSensorSum / socSensorCount : 0.0f;
|
||||
return toOneDecimalPlace(avgSOCTemp);
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@end
|
||||
@ -20,7 +20,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <smcWrapper.h>
|
||||
#import "smcWrapper.h"
|
||||
|
||||
|
||||
@interface MachineDefaults : NSObject {
|
||||
@ -31,7 +31,8 @@
|
||||
}
|
||||
|
||||
+ (NSString *)computerModel;
|
||||
- (id)init:(NSString*)p_machine;
|
||||
-(NSDictionary*)get_machine_defaults;
|
||||
- (void)dealloc;
|
||||
- (instancetype)init:(NSString*)p_machine ;
|
||||
|
||||
@property (NS_NONATOMIC_IOSONLY, getter=get_machine_defaults, readonly, copy) NSDictionary *_machine_defaults;
|
||||
|
||||
@end
|
||||
|
||||
@ -23,57 +23,67 @@
|
||||
#import "MachineDefaults.h"
|
||||
#import "NSFileManager+DirectoryLocations.h"
|
||||
|
||||
@interface MachineDefaults ()
|
||||
{
|
||||
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation MachineDefaults
|
||||
|
||||
|
||||
- (id)init:(NSString*)p_machine{
|
||||
- (instancetype)init:(NSString*)p_machine{
|
||||
if (self = [super init]){
|
||||
machine=[MachineDefaults computerModel];
|
||||
supported_machines=[[NSArray alloc] initWithContentsOfFile:[[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"]];
|
||||
[self refreshPlist];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
-(Boolean)is_supported{
|
||||
int i;
|
||||
-(void)refreshPlist
|
||||
{
|
||||
supported_machines=[[NSArray alloc] initWithContentsOfFile:[[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"]];
|
||||
supported=NO;
|
||||
int i;
|
||||
for(i=0;i<[supported_machines count];i++) {
|
||||
if ([machine isEqualToString:[[supported_machines objectAtIndex:i] objectForKey:@"Machine"]]) {
|
||||
if ([machine isEqualToString:supported_machines[i][@"Machine"]]) {
|
||||
supported=YES;
|
||||
machine_num=i;
|
||||
}
|
||||
}
|
||||
return supported;
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(NSDictionary*) readfrom_plist{
|
||||
-(NSDictionary*) readFromPlist{
|
||||
if (!supported) {return nil;}
|
||||
return [supported_machines objectAtIndex:machine_num];
|
||||
return supported_machines[machine_num];
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(NSDictionary*) readfrom_smc{
|
||||
if (supported) {return nil;}
|
||||
int num_fans,i;
|
||||
[smcWrapper init];
|
||||
num_fans=[smcWrapper get_fan_num];
|
||||
-(void) readFromSMC{
|
||||
NSUInteger num_fans=[smcWrapper get_fan_num];
|
||||
NSString *desc;
|
||||
NSNumber *min,*max;
|
||||
NSData *xmldata;
|
||||
NSString *error;
|
||||
NSMutableArray *fans=[[NSMutableArray alloc] init];
|
||||
for (i = 0; i < num_fans; i++) {
|
||||
min=[NSNumber numberWithInt:[smcWrapper get_min_speed:i]];
|
||||
max=[NSNumber numberWithInt:[smcWrapper get_max_speed:i]];
|
||||
for (NSUInteger i = 0; i < num_fans; i++) {
|
||||
min=@([smcWrapper get_min_speed:i]);
|
||||
max=@([smcWrapper get_max_speed:i]);
|
||||
desc=[smcWrapper get_fan_descr:i];
|
||||
[fans addObject:[NSDictionary dictionaryWithObjectsAndKeys:desc,@"Description",min,@"Minspeed",max,@"Maxspeed",min,@"selspeed",nil]];
|
||||
[fans addObject:[[NSMutableDictionary alloc] initWithDictionary:@{@"Description": desc,@"Minspeed": min,@"Maxspeed": max,@"selspeed": min}]];
|
||||
}
|
||||
//save to plist for future
|
||||
NSMutableArray *supported_m=[[NSMutableArray alloc] initWithContentsOfFile:[[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"]];
|
||||
NSDictionary *new_machine= [NSDictionary dictionaryWithObjectsAndKeys:fans,@"Fans",[NSNumber numberWithInt:num_fans],@"NumFans",machine,@"Machine",@"Autogenerated",@"Comment",nil];
|
||||
[fans release];
|
||||
NSMutableDictionary *new_machine;
|
||||
if (fans == nil)
|
||||
{
|
||||
new_machine= [[NSMutableDictionary alloc] initWithDictionary:@{@"Fans": [NSNull null],@"NumFans": @(0),@"Machine": machine,@"Comment": @"Autogenerated",@"Minspeed": min,@"Maxspeed": max}];
|
||||
|
||||
} else {
|
||||
new_machine= [[NSMutableDictionary alloc] initWithDictionary:@{@"Fans": fans,@"NumFans": @(num_fans),@"Machine": machine,@"Comment": @"Autogenerated",@"Minspeed": min,@"Maxspeed": max}];
|
||||
}
|
||||
[supported_m addObject:new_machine];
|
||||
|
||||
//save to plist
|
||||
@ -81,37 +91,36 @@
|
||||
format:NSPropertyListXMLFormat_v1_0
|
||||
errorDescription:&error];
|
||||
[xmldata writeToFile:[[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"] atomically:YES];
|
||||
[supported_m release];
|
||||
//return new machine-live-data
|
||||
return [new_machine retain];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-(NSDictionary*)get_machine_defaults{
|
||||
NSDictionary *m_defaults=nil;
|
||||
if ([self is_supported]) {
|
||||
m_defaults=[self readfrom_plist];
|
||||
int i;
|
||||
//localize fan-descriptions
|
||||
for (i=0;i<[[m_defaults objectForKey:@"Fans"] count];i++) {
|
||||
NSString *newvalue=NSLocalizedString([[[m_defaults objectForKey:@"Fans"] objectAtIndex:i] objectForKey:@"Description"],nil);
|
||||
[[[m_defaults objectForKey:@"Fans"] objectAtIndex:i] setValue:newvalue forKey:@"Description"];
|
||||
}
|
||||
} else {
|
||||
|
||||
if (!supported) {
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Alert!",nil)
|
||||
defaultButton:NSLocalizedString(@"Continue",nil) alternateButton:NSLocalizedString(@"Quit",nil) otherButton:nil
|
||||
informativeTextWithFormat:NSLocalizedString(@"smcFanControl has not been tested on this machine yet, but it should run if you follow the instructions. \n\nIf you choose to continue, please make you have no other FanControl-software running. Otherwise please quit, deinstall the other software, restart your machine and rerun smcFanControl!",nil)];
|
||||
int code=[alert runModal];
|
||||
informativeTextWithFormat:NSLocalizedString(@"smcFanControl has not been tested on this machine yet, but it should run if you follow the instructions. \n\nIf you choose to continue, please make sure you have no other FanControl-software running. Otherwise please quit, deinstall the other software, restart your machine and rerun smcFanControl!",nil)];
|
||||
NSModalResponse code=[alert runModal];
|
||||
if (code == NSAlertDefaultReturn) {
|
||||
m_defaults=[self readfrom_smc];
|
||||
[self readFromSMC];
|
||||
[self refreshPlist];
|
||||
} else {
|
||||
[[NSApplication sharedApplication] terminate:nil];
|
||||
}
|
||||
|
||||
}
|
||||
return m_defaults;
|
||||
|
||||
NSDictionary *defaultsDict=[self readFromPlist];
|
||||
NSUInteger i;
|
||||
//localize fan-descriptions
|
||||
for (i=0;i<[defaultsDict[@"Fans"] count];i++) {
|
||||
NSString *newvalue=NSLocalizedString(defaultsDict[@"Fans"][i][@"Description"],nil);
|
||||
[defaultsDict[@"Fans"][i] setValue:newvalue forKey:@"Description"];
|
||||
}
|
||||
|
||||
return defaultsDict;
|
||||
}
|
||||
|
||||
+ (NSString *)computerModel
|
||||
@ -122,18 +131,13 @@
|
||||
if ((pexpdev = IOServiceGetMatchingService (kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"))))
|
||||
{
|
||||
NSData *data;
|
||||
if ((data = (id)IORegistryEntryCreateCFProperty(pexpdev, CFSTR("model"), kCFAllocatorDefault, 0))) {
|
||||
if ((data = (id)CFBridgingRelease(IORegistryEntryCreateCFProperty(pexpdev, CFSTR("model"), kCFAllocatorDefault, 0)))) {
|
||||
computerModel = [[NSString allocWithZone:NULL] initWithCString:[data bytes] encoding:NSASCIIStringEncoding];
|
||||
[data release];
|
||||
}
|
||||
}
|
||||
}
|
||||
return computerModel;
|
||||
}
|
||||
|
||||
- (void)dealloc{
|
||||
[super dealloc];
|
||||
//[supported_machines release];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -31,6 +31,6 @@
|
||||
inDomain:(NSSearchPathDomainMask)domainMask
|
||||
appendPathComponent:(NSString *)appendComponent
|
||||
error:(NSError **)errorOut;
|
||||
- (NSString *)applicationSupportDirectory;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *applicationSupportDirectory;
|
||||
|
||||
@end
|
||||
|
||||
@ -31,117 +31,90 @@ NSString * const DirectoryLocationDomain = @"DirectoryLocationDomain";
|
||||
|
||||
@implementation NSFileManager (DirectoryLocations)
|
||||
|
||||
//
|
||||
// findOrCreateDirectory:inDomain:appendPathComponent:error:
|
||||
//
|
||||
// Method to tie together the steps of:
|
||||
// 1) Locate a standard directory by search path and domain mask
|
||||
// 2) Select the first path in the results
|
||||
// 3) Append a subdirectory to that path
|
||||
// 4) Create the directory and intermediate directories if needed
|
||||
// 5) Handle errors by emitting a proper NSError object
|
||||
//
|
||||
// Parameters:
|
||||
// searchPathDirectory - the search path passed to NSSearchPathForDirectoriesInDomains
|
||||
// domainMask - the domain mask passed to NSSearchPathForDirectoriesInDomains
|
||||
// appendComponent - the subdirectory appended
|
||||
// errorOut - any error from file operations
|
||||
//
|
||||
// returns the path to the directory (if path found and exists), nil otherwise
|
||||
//
|
||||
|
||||
/*! Method to tie together the steps of:
|
||||
1) Locate a standard directory by search path and domain mask
|
||||
2) Select the first path in the results
|
||||
3) Append a subdirectory to that path
|
||||
4) Create the directory and intermediate directories if needed
|
||||
5) Handle errors by emitting a proper NSError object
|
||||
|
||||
* \pararm searchPathDirectory - the search path passed to NSSearchPathForDirectoriesInDomains
|
||||
* \pararm domainMask - the domain mask passed to NSSearchPathForDirectoriesInDomains
|
||||
* \pararm appendComponent - the subdirectory appended
|
||||
* \pararm errorOut - any error from file operations
|
||||
|
||||
* \returns returns the path to the directory (if path found and exists), nil otherwise
|
||||
*/
|
||||
- (NSString *)findOrCreateDirectory:(NSSearchPathDirectory)searchPathDirectory
|
||||
inDomain:(NSSearchPathDomainMask)domainMask
|
||||
appendPathComponent:(NSString *)appendComponent
|
||||
error:(NSError **)errorOut
|
||||
{
|
||||
// Declare an NSError first, so we don't need to check errorOut again and again
|
||||
NSError *error;
|
||||
|
||||
if (errorOut) {
|
||||
error = *errorOut;
|
||||
}
|
||||
else {
|
||||
error = nil;
|
||||
}
|
||||
|
||||
//
|
||||
// Search for the path
|
||||
//
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(
|
||||
searchPathDirectory,
|
||||
domainMask,
|
||||
YES);
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(searchPathDirectory,domainMask,YES);
|
||||
|
||||
if ([paths count] == 0)
|
||||
{
|
||||
if (errorOut)
|
||||
{
|
||||
NSDictionary *userInfo =
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
NSLocalizedStringFromTable(
|
||||
@"No path found for directory in domain.",
|
||||
@"Errors",
|
||||
nil),
|
||||
NSLocalizedDescriptionKey,
|
||||
[NSNumber numberWithInteger:searchPathDirectory],
|
||||
@"NSSearchPathDirectory",
|
||||
[NSNumber numberWithInteger:domainMask],
|
||||
@"NSSearchPathDomainMask",
|
||||
nil];
|
||||
*errorOut =
|
||||
[NSError
|
||||
errorWithDomain:DirectoryLocationDomain
|
||||
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: NSLocalizedStringFromTable(@"No path found for directory in domain.",@"Errors",nil),
|
||||
@"NSSearchPathDirectory":@(searchPathDirectory),
|
||||
@"NSSearchPathDomainMask":@(domainMask)};
|
||||
|
||||
error = [NSError errorWithDomain:DirectoryLocationDomain
|
||||
code:DirectoryLocationErrorNoPathFound
|
||||
userInfo:userInfo];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
//
|
||||
// Normally only need the first path returned
|
||||
//
|
||||
NSString *resolvedPath = [paths objectAtIndex:0];
|
||||
NSString *resolvedPath = paths[0];
|
||||
|
||||
//
|
||||
// Append the extra path component
|
||||
//
|
||||
if (appendComponent)
|
||||
{
|
||||
resolvedPath = [resolvedPath
|
||||
stringByAppendingPathComponent:appendComponent];
|
||||
resolvedPath = [resolvedPath stringByAppendingPathComponent:appendComponent];
|
||||
}
|
||||
|
||||
//
|
||||
// Create the path if it doesn't exist
|
||||
//
|
||||
NSError *error = nil;
|
||||
BOOL success = [self
|
||||
createDirectoryAtPath:resolvedPath
|
||||
withIntermediateDirectories:YES
|
||||
attributes:nil
|
||||
error:&error];
|
||||
if (!success)
|
||||
{
|
||||
if (errorOut)
|
||||
{
|
||||
*errorOut = error;
|
||||
}
|
||||
|
||||
|
||||
if ([self createDirectoryAtPath:resolvedPath withIntermediateDirectories:YES
|
||||
attributes:nil error:&error])
|
||||
return resolvedPath;
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
|
||||
//
|
||||
// If we've made it this far, we have a success
|
||||
//
|
||||
if (errorOut)
|
||||
{
|
||||
*errorOut = nil;
|
||||
}
|
||||
return resolvedPath;
|
||||
}
|
||||
|
||||
//
|
||||
// applicationSupportDirectory
|
||||
//
|
||||
// Returns the path to the applicationSupportDirectory (creating it if it doesn't
|
||||
// exist).
|
||||
//
|
||||
/*! applicationSupportDirectory
|
||||
|
||||
* \returns The path to the applicationSupportDirectory (creating it if it doesn't exist).
|
||||
*/
|
||||
- (NSString *)applicationSupportDirectory
|
||||
{
|
||||
NSString *executableName =
|
||||
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleExecutable"];
|
||||
NSError *error;
|
||||
NSString *result =
|
||||
[self
|
||||
findOrCreateDirectory:NSApplicationSupportDirectory
|
||||
NSString *executableName = [[NSBundle mainBundle] infoDictionary][@"CFBundleExecutable"];
|
||||
|
||||
NSError *error = nil;
|
||||
|
||||
NSString *result = [self findOrCreateDirectory:NSApplicationSupportDirectory
|
||||
inDomain:NSUserDomainMask
|
||||
appendPathComponent:executableName
|
||||
error:&error];
|
||||
|
||||
@ -37,10 +37,9 @@
|
||||
|
||||
}
|
||||
|
||||
- (id)init;
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
- (id)delegate;
|
||||
- (void)setDelegate:(id)new_delegate;
|
||||
@property (NS_NONATOMIC_IOSONLY, unsafe_unretained) id delegate;
|
||||
|
||||
- (void)registerForSleepWakeNotification;
|
||||
- (void)deregisterForSleepWakeNotification;
|
||||
@ -59,6 +58,8 @@
|
||||
//delegate Prototypes
|
||||
@interface NSObject (PowerDelegate)
|
||||
|
||||
- (void)systemWillSleep:(id)sender;
|
||||
|
||||
- (void)systemDidWakeFromSleep:(id)sender;
|
||||
|
||||
- (void)powerChangeToBattery:(id)sender;
|
||||
|
||||
@ -31,7 +31,7 @@ static int lastsource=0;
|
||||
|
||||
|
||||
void SleepWatcher( void * refCon, io_service_t service, natural_t messageType, void * messageArgument ){
|
||||
[(Power *)refCon powerMessageReceived: messageType withArgument: messageArgument];
|
||||
[(__bridge Power *)refCon powerMessageReceived: messageType withArgument: messageArgument];
|
||||
}
|
||||
|
||||
|
||||
@ -48,14 +48,14 @@ static void powerSourceChanged(void * refCon)
|
||||
powerSource = CFArrayGetValueAtIndex(powerSourcesList, i);
|
||||
description = IOPSGetPowerSourceDescription(powerBlob, powerSource);
|
||||
//work with NSArray from here
|
||||
NSDictionary *n_description = (NSDictionary *)description;
|
||||
[(Power *)refCon powerSourceMesssageReceived:n_description];
|
||||
NSDictionary *n_description = (__bridge NSDictionary *)description;
|
||||
[(__bridge Power *)refCon powerSourceMesssageReceived:n_description];
|
||||
}
|
||||
CFRelease(powerBlob);
|
||||
CFRelease(powerSourcesList);
|
||||
}
|
||||
|
||||
- (id)init{
|
||||
- (instancetype)init{
|
||||
if (self = [super init]) {
|
||||
|
||||
}
|
||||
@ -65,14 +65,14 @@ static void powerSourceChanged(void * refCon)
|
||||
|
||||
- (void)registerForSleepWakeNotification
|
||||
{
|
||||
root_port = IORegisterForSystemPower(self, ¬ificationPort, SleepWatcher, ¬ifier);
|
||||
root_port = IORegisterForSystemPower((__bridge void *)(self), ¬ificationPort, SleepWatcher, ¬ifier);
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notificationPort), kCFRunLoopDefaultMode);
|
||||
}
|
||||
|
||||
|
||||
- (void)registerForPowerChange
|
||||
{
|
||||
powerNotifierRunLoopSource = IOPSNotificationCreateRunLoopSource(powerSourceChanged,self);
|
||||
powerNotifierRunLoopSource = IOPSNotificationCreateRunLoopSource(powerSourceChanged,(__bridge void *)(self));
|
||||
if (powerNotifierRunLoopSource) {
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), powerNotifierRunLoopSource, kCFRunLoopDefaultMode);
|
||||
}
|
||||
@ -101,6 +101,7 @@ static void powerSourceChanged(void * refCon)
|
||||
switch (messageType)
|
||||
{
|
||||
case kIOMessageSystemWillSleep:
|
||||
[_delegate systemWillSleep:self];
|
||||
IOAllowPowerChange(root_port, (long)messageArgument);
|
||||
break;
|
||||
case kIOMessageCanSystemSleep:
|
||||
@ -118,7 +119,7 @@ static void powerSourceChanged(void * refCon)
|
||||
}
|
||||
|
||||
- (void)powerSourceMesssageReceived:(NSDictionary *)n_description{
|
||||
if (([[n_description objectForKey:@"Power Source State"] isEqualToString:@"AC Power"] && [[n_description objectForKey:@"Is Charging"] intValue]==1) && lastsource!=1) {
|
||||
if (([n_description[@"Power Source State"] isEqualToString:@"AC Power"] && [n_description[@"Is Charging"] intValue]==1) && lastsource!=1) {
|
||||
lastsource=1;
|
||||
if ([_delegate respondsToSelector:@selector(powerChangeToACLoading:)])
|
||||
[_delegate powerChangeToACLoading:self];
|
||||
@ -129,7 +130,7 @@ static void powerSourceChanged(void * refCon)
|
||||
}
|
||||
|
||||
|
||||
if (([[n_description objectForKey:@"Power Source State"] isEqualToString:@"AC Power"] && [[n_description objectForKey:@"Is Charging"] intValue]==0) && lastsource!=2) {
|
||||
if (([n_description[@"Power Source State"] isEqualToString:@"AC Power"] && [n_description[@"Is Charging"] intValue]==0) && lastsource!=2) {
|
||||
lastsource=2;
|
||||
if ([_delegate respondsToSelector:@selector(powerChangeToAC:)])
|
||||
[_delegate powerChangeToAC:self];
|
||||
@ -139,7 +140,7 @@ static void powerSourceChanged(void * refCon)
|
||||
}
|
||||
}
|
||||
|
||||
if (([[n_description objectForKey:@"Power Source State"] isEqualToString:@"Battery Power"]) && lastsource!=3) {
|
||||
if (([n_description[@"Power Source State"] isEqualToString:@"Battery Power"]) && lastsource!=3) {
|
||||
lastsource=3;
|
||||
if ([_delegate respondsToSelector:@selector(powerChangeToBattery:)])
|
||||
[_delegate powerChangeToBattery:self];
|
||||
@ -171,7 +172,6 @@ static void powerSourceChanged(void * refCon)
|
||||
if (_delegate)
|
||||
[nc removeObserver:_delegate name:nil object:self];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -68,18 +68,18 @@ static NSString *const kSystemVersionPlistPath = @"/System/Library/CoreServices/
|
||||
#endif // MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_3
|
||||
|
||||
#else // GTM_MACOS_SDK
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
@autoreleasepool {
|
||||
NSDictionary *systemVersionPlist
|
||||
= [NSDictionary dictionaryWithContentsOfFile:kSystemVersionPlistPath];
|
||||
NSString *version = [systemVersionPlist objectForKey:@"ProductVersion"];
|
||||
NSString *version = systemVersionPlist[@"ProductVersion"];
|
||||
NSArray *versionInfo = [version componentsSeparatedByString:@"."];
|
||||
int length = [versionInfo count];
|
||||
sGTMSystemVersionMajor = [[versionInfo objectAtIndex:0] intValue];
|
||||
sGTMSystemVersionMinor = [[versionInfo objectAtIndex:1] intValue];
|
||||
sGTMSystemVersionMajor = [versionInfo[0] intValue];
|
||||
sGTMSystemVersionMinor = [versionInfo[1] intValue];
|
||||
if (length == 3) {
|
||||
sGTMSystemVersionBugFix = [[versionInfo objectAtIndex:2] intValue];
|
||||
sGTMSystemVersionBugFix = [versionInfo[2] intValue];
|
||||
}
|
||||
}
|
||||
[pool release];
|
||||
#endif // GTM_MACOS_SDK
|
||||
}
|
||||
}
|
||||
@ -104,7 +104,7 @@ static NSString *const kSystemVersionPlistPath = @"/System/Library/CoreServices/
|
||||
if (!sBuild) {
|
||||
NSDictionary *systemVersionPlist
|
||||
= [NSDictionary dictionaryWithContentsOfFile:kSystemVersionPlistPath];
|
||||
sBuild = [[systemVersionPlist objectForKey:@"ProductBuildVersion"] retain];
|
||||
sBuild = systemVersionPlist[@"ProductBuildVersion"];
|
||||
}
|
||||
}
|
||||
return sBuild;
|
||||
|
||||
@ -21,10 +21,10 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <smc.h>
|
||||
#import <MachineDefaults.h>
|
||||
#import "smc.h"
|
||||
#import "MachineDefaults.h"
|
||||
#import "Constants.h"
|
||||
|
||||
@interface smcWrapper : NSObject {
|
||||
}
|
||||
@ -37,6 +37,7 @@
|
||||
+(int) get_fan_num;
|
||||
+(int) get_min_speed:(int)fan_number;
|
||||
+(int) get_max_speed:(int)fan_number;
|
||||
+(int) get_mode:(int)fan_number;
|
||||
+(void)setKey_external:(NSString *)key value:(NSString *)value;
|
||||
+(NSString*) get_fan_descr:(int)fan_number;
|
||||
|
||||
|
||||
@ -23,45 +23,84 @@
|
||||
|
||||
#import "smcWrapper.h"
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
NSString * const smc_checksum=@"4fc00a0979970ee8b55f078a0c793c4d";
|
||||
|
||||
//TODO: This is the smcFanControl 2.5ß checksum, it needs to be updated for the next release.
|
||||
NSString * const smc_checksum=@"03548c5634bd01315b19c46bf329cceb";
|
||||
static NSArray *allSensors = nil;
|
||||
|
||||
NSArray *allSensors;
|
||||
|
||||
@implementation smcWrapper
|
||||
io_connect_t conn;
|
||||
|
||||
+(void)init{
|
||||
SMCOpen(&conn);
|
||||
allSensors = [[NSArray alloc] initWithObjects:@"TC0D",@"TC0H",@"TC0F",@"TCAH",@"TCBH",@"TC0P",nil];
|
||||
}
|
||||
+(void)cleanUp{
|
||||
SMCClose(conn);
|
||||
}
|
||||
|
||||
+(float) get_maintemp{
|
||||
float c_temp;
|
||||
+(int)convertToNumber:(SMCVal_t) val
|
||||
{
|
||||
float fval = -1.0f;
|
||||
|
||||
if (strcmp(val.dataType, DATATYPE_FLT) == 0 && val.dataSize == 4) {
|
||||
memcpy(&fval,val.bytes,sizeof(float));
|
||||
}
|
||||
else if (strcmp(val.dataType, DATATYPE_FPE2) == 0 && val.dataSize == 2) {
|
||||
fval = _strtof(val.bytes, val.dataSize, 2);
|
||||
}
|
||||
else if (strcmp(val.dataType, DATATYPE_UINT16) == 0 && val.dataSize == 2) {
|
||||
fval = (float)_strtoul((char *)val.bytes, val.dataSize, 10);
|
||||
}
|
||||
else if (strcmp(val.dataType, DATATYPE_UINT8) == 0 && val.dataSize == 1) {
|
||||
fval = (float)val.bytes[0];
|
||||
}
|
||||
else if (strcmp(val.dataType, DATATYPE_SP78) == 0 && val.dataSize == 2) {
|
||||
fval = ((val.bytes[0] * 256 + val.bytes[1]) >> 2)/64;
|
||||
}
|
||||
else {
|
||||
NSLog(@"%@", [NSString stringWithFormat:@"Unknown val:%s size-%d",val.dataType,val.dataSize]);
|
||||
}
|
||||
|
||||
return (int)fval;
|
||||
}
|
||||
|
||||
+(float)readTempSensors
|
||||
{
|
||||
float retValue;
|
||||
SMCVal_t val;
|
||||
NSString *sensor = [[NSUserDefaults standardUserDefaults] objectForKey:@"TSensor"];
|
||||
NSString *sensor = [[NSUserDefaults standardUserDefaults] objectForKey:PREF_TEMPERATURE_SENSOR];
|
||||
SMCReadKey2((char*)[sensor UTF8String], &val,conn);
|
||||
c_temp= ((val.bytes[0] * 256 + val.bytes[1]) >> 2)/64;
|
||||
|
||||
if (c_temp<=0) {
|
||||
retValue = [self convertToNumber:val];
|
||||
#if TARGET_CPU_ARM64
|
||||
allSensors = [NSArray arrayWithObjects:@"Tp01",@"Tp05",@"Tp09",@"Tp0b",@"Tp0D",@"Tp0H",@"Tp0L",@"Tp0P",@"Tp0T",@"Tp0X",nil];
|
||||
#else
|
||||
allSensors = [NSArray arrayWithObjects:@"TC0D",@"TC0P",@"TCAD",@"TC0H",@"TC0F",@"TCAH",@"TCBH",nil];
|
||||
#endif
|
||||
if (retValue<=0 || floor(retValue) == 129 ) { //workaround for some iMac Models
|
||||
for (NSString *sensor in allSensors) {
|
||||
SMCReadKey2((char*)[sensor UTF8String], &val,conn);
|
||||
c_temp= ((val.bytes[0] * 256 + val.bytes[1]) >> 2)/64;
|
||||
if (c_temp>0) {
|
||||
[[NSUserDefaults standardUserDefaults] setObject:sensor forKey:@"TSensor"];
|
||||
retValue= [self convertToNumber:val];
|
||||
if (retValue>0 && floor(retValue) != 129 ) {
|
||||
[[NSUserDefaults standardUserDefaults] setObject:sensor forKey:PREF_TEMPERATURE_SENSOR];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return retValue;
|
||||
}
|
||||
|
||||
|
||||
return c_temp;
|
||||
+(float) get_maintemp{
|
||||
float retValue;
|
||||
NSRange range_pro=[[MachineDefaults computerModel] rangeOfString:@"MacPro"];
|
||||
if (range_pro.length > 0) {
|
||||
retValue = [smcWrapper get_mptemp];
|
||||
if (retValue<=0 || floor(retValue) == 129 ) {
|
||||
retValue = [smcWrapper readTempSensors];
|
||||
}
|
||||
} else {
|
||||
retValue = [smcWrapper readTempSensors];
|
||||
}
|
||||
return retValue;
|
||||
}
|
||||
|
||||
|
||||
@ -77,8 +116,8 @@ static NSArray *allSensors = nil;
|
||||
SMCReadKey2(keyA, &valA,conn);
|
||||
sprintf(keyB, "TCBH");
|
||||
SMCReadKey2(keyB, &valB,conn);
|
||||
float c_tempA= ((valA.bytes[0] * 256 + valA.bytes[1]) >> 2)/64.0;
|
||||
float c_tempB= ((valB.bytes[0] * 256 + valB.bytes[1]) >> 2)/64.0;
|
||||
float c_tempA= [self convertToNumber:valA];
|
||||
float c_tempB= [self convertToNumber:valB];
|
||||
int i_tempA, i_tempB;
|
||||
if (c_tempA < c_tempB)
|
||||
{
|
||||
@ -96,9 +135,9 @@ static NSArray *allSensors = nil;
|
||||
UInt32Char_t key;
|
||||
SMCVal_t val;
|
||||
//kern_return_t result;
|
||||
sprintf(key, "F%dAc", fan_number);
|
||||
sprintf(key, "F%cAc", fannum[fan_number]);
|
||||
SMCReadKey2(key, &val,conn);
|
||||
int running= _strtof(val.bytes, val.dataSize, 2);
|
||||
int running= [self convertToNumber:val];
|
||||
return running;
|
||||
}
|
||||
|
||||
@ -107,7 +146,7 @@ static NSArray *allSensors = nil;
|
||||
SMCVal_t val;
|
||||
int totalFans;
|
||||
SMCReadKey2("FNum", &val,conn);
|
||||
totalFans = _strtoul(val.bytes, val.dataSize, 10);
|
||||
totalFans = [self convertToNumber:val];
|
||||
return totalFans;
|
||||
}
|
||||
|
||||
@ -117,10 +156,12 @@ static NSArray *allSensors = nil;
|
||||
SMCVal_t val;
|
||||
//kern_return_t result;
|
||||
NSMutableString *desc;
|
||||
// desc=[[NSMutableString alloc] initWithFormat:@"Fan #%d: ",fan_number+1];
|
||||
desc=[[[NSMutableString alloc]init] autorelease];
|
||||
sprintf(key, "F%dID", fan_number);
|
||||
|
||||
sprintf(key, "F%cID", fannum[fan_number]);
|
||||
SMCReadKey2(key, &val,conn);
|
||||
|
||||
if(val.dataSize>0){
|
||||
desc=[[NSMutableString alloc]init];
|
||||
int i;
|
||||
for (i = 0; i < val.dataSize; i++) {
|
||||
if ((int)val.bytes[i]>32) {
|
||||
@ -128,6 +169,11 @@ static NSArray *allSensors = nil;
|
||||
[desc appendFormat:@"%c",temp];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
//On MacBookPro 15.1 descriptions aren't available
|
||||
desc=[[NSMutableString alloc] initWithFormat:@"Fan #%d: ",fan_number+1];
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
@ -136,9 +182,9 @@ static NSArray *allSensors = nil;
|
||||
UInt32Char_t key;
|
||||
SMCVal_t val;
|
||||
//kern_return_t result;
|
||||
sprintf(key, "F%dMn", fan_number);
|
||||
sprintf(key, "F%cMn", fannum[fan_number]);
|
||||
SMCReadKey2(key, &val,conn);
|
||||
int min= _strtof(val.bytes, val.dataSize, 2);
|
||||
int min= [self convertToNumber:val];
|
||||
return min;
|
||||
}
|
||||
|
||||
@ -146,20 +192,65 @@ static NSArray *allSensors = nil;
|
||||
UInt32Char_t key;
|
||||
SMCVal_t val;
|
||||
//kern_return_t result;
|
||||
sprintf(key, "F%dMx", fan_number);
|
||||
sprintf(key, "F%cMx", fannum[fan_number]);
|
||||
SMCReadKey2(key, &val,conn);
|
||||
int max= _strtof(val.bytes, val.dataSize, 2);
|
||||
int max= [self convertToNumber:val];
|
||||
return max;
|
||||
}
|
||||
|
||||
+(int) get_mode:(int)fan_number{
|
||||
UInt32Char_t key;
|
||||
SMCVal_t val;
|
||||
kern_return_t result;
|
||||
|
||||
sprintf(key, "F%dMd", fan_number);
|
||||
result = SMCReadKey2(key, &val,conn);
|
||||
// Auto mode's key is not available
|
||||
if (result != kIOReturnSuccess) {
|
||||
return -1;
|
||||
}
|
||||
int mode = [self convertToNumber:val];
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
+ (BOOL)validateSMC:(NSString*)path
|
||||
{
|
||||
SecStaticCodeRef ref = NULL;
|
||||
|
||||
NSURL * url = [NSURL URLWithString:path];
|
||||
|
||||
OSStatus status;
|
||||
|
||||
// obtain the cert info from the executable
|
||||
status = SecStaticCodeCreateWithPath((__bridge CFURLRef)url, kSecCSDefaultFlags, &ref);
|
||||
|
||||
if (status != noErr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@try {
|
||||
status = SecStaticCodeCheckValidity(ref, kSecCSDefaultFlags, nil);
|
||||
|
||||
if (status != noErr) {
|
||||
NSLog(@"Codesign verification failed: Error id = %d",status);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"Codesign exception %@",exception);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+ (NSString*)createCheckSum:(NSString*)path {
|
||||
NSData *d=[NSData dataWithContentsOfMappedFile:path];
|
||||
unsigned char result[CC_MD5_DIGEST_LENGTH];
|
||||
CC_MD5((void *)[d bytes], [d length], result);
|
||||
NSMutableString *ret = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH*2];
|
||||
int i;
|
||||
for(i = 0; i<CC_MD5_DIGEST_LENGTH; i++) {
|
||||
for(int i = 0; i<CC_MD5_DIGEST_LENGTH; i++) {
|
||||
[ret appendFormat:@"%02x",result[i]];
|
||||
}
|
||||
return ret;
|
||||
@ -169,20 +260,13 @@ static NSArray *allSensors = nil;
|
||||
// The smc binary is given root permissions in FanControl.m with the setRights method.
|
||||
+(void)setKey_external:(NSString *)key value:(NSString *)value{
|
||||
NSString *launchPath = [[NSBundle mainBundle] pathForResource:@"smc" ofType:@""];
|
||||
NSString *checksum=[smcWrapper createCheckSum:launchPath];
|
||||
//first check if it's the right binary (security)
|
||||
// MW: Disabled smc binary checksum. This should be re-enabled in an official release.
|
||||
if (![checksum isEqualToString:smc_checksum]) {
|
||||
NSLog(@"smcFanControl: Security Error: smc-binary is not the distributed one");
|
||||
return;
|
||||
}
|
||||
NSArray *argsArray = [NSArray arrayWithObjects: @"-k",key,@"-w",value,nil];
|
||||
|
||||
NSArray *argsArray = @[@"-k",key,@"-w",value];
|
||||
NSTask *task;
|
||||
task = [[NSTask alloc] init];
|
||||
[task setLaunchPath: launchPath];
|
||||
[task setArguments: argsArray];
|
||||
[task launch];
|
||||
[task release];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
12
Info.plist
12
Info.plist
@ -7,11 +7,11 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>smcFanControl</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>smcFanControl 2.5ß, Hendrik Holtmann (GPL)</string>
|
||||
<string>smcFanControl 2.6, Hendrik Holtmann (GPL)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>smcfancontrol_v2</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.eidac.smcFanControl2</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@ -19,11 +19,13 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.5ß</string>
|
||||
<string>2.6.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.5ß</string>
|
||||
<string>2.6.1</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSUIElement</key>
|
||||
<string>1</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
@ -32,5 +34,7 @@
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>SUFeedURL</key>
|
||||
<string>https://www.eidac.de/smcfancontrol/smcfancontrol.xml</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
24
Readme.md
24
Readme.md
@ -1,13 +1,27 @@
|
||||
smcFanControl
|
||||
=============
|
||||
# smcFanControl
|
||||
|
||||
smcFanControl lets the user set a minimum speed for built-in fans. It allows you to increase your minimum fan speed to make your Intel Mac run cooler. In order to not damage your machine, smcFanControl does not let you set a minimum speed to a value below Apple's defaults.
|
||||
|
||||

|
||||

|
||||
|
||||
Requirements: Intel Mac / OS X 10.5 or higher
|
||||
|
||||
Compiled version: http://www.eidac.de/smcfancontrol/smcfancontrol_2_4.zip
|
||||
## Installing it using Homebrew & Cask
|
||||
|
||||
Make sure you have both [Homebrew](http://brew.sh/) and [Cask](https://caskroom.github.io/) installed. You'll find intructions to install both tools on their respective websites.
|
||||
|
||||
After installing Homebrew and Cask, run:
|
||||
|
||||
```
|
||||
$ brew install --cask smcfancontrol
|
||||
```
|
||||
|
||||
After that you'll be able to use Spotlight to launch smcFanControl normally. :-)
|
||||
|
||||
|
||||
Requirements: Apple Silicon or Intel Mac / OS X 10.7 or higher
|
||||
|
||||
|
||||
Compiled version: https://www.eidac.de/smcfancontrol/smcfancontrol_2_6.zip
|
||||
|
||||
FAQ / More info: Found in project under "Ressources/*.lproj/F.A.Q.rtf" or included in above .zip
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1187
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf340
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
|
||||
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}}
|
||||
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}
|
||||
\paperw12240\paperh15840\viewkind0
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs62 \cf0 F.A.Q for smcFanControl 2.4\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\f0\fs62 \cf0 F.A.Q for smcFanControl 2.6\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\fs24 \cf0 \
|
||||
|
||||
@ -30,7 +30,7 @@ All changes smcFanControl does to the fan controlling get lost after you shutdow
|
||||
|
||||
\b I get a "smcFanControl has not been tested on this machine" warning. What does that mean?\
|
||||
|
||||
\b0 Technically smcFanControl supports every intel mac, but it does not come with defaults for every machine. If you get the warning, smcFanControl tries to read out the fan-details directly from the System Management Controller. If you follow the instructions (no other fan control software is running etc.) you should have no problem running smcFanControl on a machine it has not been tested on.\
|
||||
\b0 Technically smcFanControl supports every Apple Silicon & Intel Mac, but it does not come with defaults for every machine. If you get the warning, smcFanControl tries to read out the fan-details directly from the System Management Controller. If you follow the instructions (no other fan control software is running etc.) you should have no problem running smcFanControl on a machine it has not been tested on.\
|
||||
\
|
||||
|
||||
\b How can I restore the Apple defaults for fanspeed?\
|
||||
@ -74,7 +74,7 @@ Will there be a version of smcFanControl for Powerbooks or other PPC based Macs?
|
||||
|
||||
\b Wouldn't it be even better to read out the temperature and set the fan speeds depending on the readout than just set the minimum fan speed and let automatic fan control as defined by apple do the rest?\
|
||||
|
||||
\b0 Yes, that approach is even better and could make your machine running cooler, when you are at higher loads. BUT: I did not take this route for smcFanControl, cause it has some risks. Adjusting the fan speed to CPU temperature requires you have a program running in the background (e.g. a daemon) that adjust fan speed continuously . If that program ever crashes or becomes incompatible cause of a System Update (or the readouts of the temperature sensor get inappropriate) , the fans could get set to a wrong (too low) speed and this could probably damage the machine. In addition to that the fan-control-logic is quite complicate. An intel mac has about 10 temperature sensors, that are continuously read out and are used for monitoring and setting the right fan speeds. So it would be "not so great" to read out just the CPU temperature as a foundation for the fan-controlling.\
|
||||
\b0 Yes, that approach is even better and could make your machine running cooler, when you are at higher loads. BUT: I did not take this route for smcFanControl, cause it has some risks. Adjusting the fan speed to CPU temperature requires you have a program running in the background (e.g. a daemon) that adjust fan speed continuously . If that program ever crashes or becomes incompatible cause of a System Update (or the readouts of the temperature sensor get inappropriate) , the fans could get set to a wrong (too low) speed and this could probably damage the machine. In addition to that the fan-control-logic is quite complicate. A Mac has about 10 temperature sensors, that are continuously read out and are used for monitoring and setting the right fan speeds. So it would be "not so great" to read out just the CPU temperature as a foundation for the fan-controlling.\
|
||||
\
|
||||
|
||||
\b I have got a MBP and smcFanControl is reporting 0rpm for one of my fans?\
|
||||
@ -87,7 +87,7 @@ Will there be a version of smcFanControl for Powerbooks or other PPC based Macs?
|
||||
\
|
||||
|
||||
\b What are the main-differences between Version 1.2x and Version 2.x of smcFanControl?\
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0
|
||||
\ls1\ilvl0
|
||||
\b0 \cf0 {\listtext \'95 }Version 2.x is a completely rewritten application.\
|
||||
{\listtext \'95 }Version 1.x was a "regular" application located in the dock. Version 2.x sits in the menubar for quicker access to the fan settings, easier monitoring and a better overall user-experience\
|
||||
@ -97,16 +97,16 @@ Will there be a version of smcFanControl for Powerbooks or other PPC based Macs?
|
||||
{\listtext \'95 }Version 2.x has got an "add to login-items option" now\
|
||||
{\listtext \'95 }Version 2.x uses standard OS X authentication now\
|
||||
{\listtext \'95 }Version 2.x uses the Sparkle-Framework to automatically check for updates\
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\b \cf0 \
|
||||
Sourcecode: https://github.com/hholtmann/smcFanControl
|
||||
\b0 \
|
||||
|
||||
\b \
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\b0 \cf0 \
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0
|
||||
\ls2\ilvl0\cf0 \
|
||||
}
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
"Right Fan" = "Rechter Fan";
|
||||
|
||||
"smcFanControl has not been tested on this machine yet, but it should run if you follow the instructions. \n\nIf you choose to continue, please make you have no other FanControl-software running. Otherwise please quit, deinstall the other software, restart your machine and rerun smcFanControl!" = "smcFanControl is nog niet getest op deze machine, maar het zou moeten werken als je de instructies volgt. \n\nAls je doorgaat, zorg dan dat er geen andere FanControl-software draait. Als dat wel zo is, de-installeer deze software dan, stop smcFanControl en restart je computer voor je smcFanControl installeert!";
|
||||
"smcFanControl has not been tested on this machine yet, but it should run if you follow the instructions. \n\nIf you choose to continue, please make sure you have no other FanControl-software running. Otherwise please quit, deinstall the other software, restart your machine and rerun smcFanControl!" = "smcFanControl is nog niet getest op deze machine, maar het zou moeten werken als je de instructies volgt. \n\nAls je doorgaat, zorg dan dat er geen andere FanControl-software draait. Als dat wel zo is, de-installeer deze software dan, stop smcFanControl en restart je computer voor je smcFanControl installeert!";
|
||||
|
||||
"Continue" = "Doorgaan";
|
||||
|
||||
@ -21,3 +21,22 @@
|
||||
"Alert!" = "Let op!";
|
||||
|
||||
"Active Setting" = "Actieve Instelling";
|
||||
|
||||
|
||||
"Remind me later" = "Remind me later";
|
||||
|
||||
"Consider a donation" = "Consider a donation";
|
||||
|
||||
"Never ask me again" = "Never ask me again";
|
||||
|
||||
"Donate over Paypal" = "Donate over Paypal";
|
||||
|
||||
"smcFanControl keeps your Mac cool since 2006.\n\nIf smcFanControl is helfpul for you and you want to support further development, a small donation over Paypal is much appreciated." = "smcFanControl keeps your Mac cool since 2006.\n\nIf smcFanControl is helfpul for you and you want to support further development, a small donation over Paypal is much appreciated.";
|
||||
|
||||
"Do you want to reset smcFanControl to default settings? Favorites will be deleted and fans will return to default speed." = "Do you want to reset smcFanControl to default settings?\nFavorites will be deleted and fans will return to default speed.";
|
||||
|
||||
"Please shutdown your computer now to return to default fan settings." = "Please shutdown your computer now to return to default fan settings.";
|
||||
|
||||
"Reset Settings" = "Reset Settings";
|
||||
|
||||
"Shutdown required" = "Shutdown required";
|
||||
5838
Ressources/Dutch.lproj/MainMenu.nib/designable.nib
generated
5838
Ressources/Dutch.lproj/MainMenu.nib/designable.nib
generated
File diff suppressed because it is too large
Load Diff
BIN
Ressources/Dutch.lproj/MainMenu.nib/keyedobjects.nib
generated
BIN
Ressources/Dutch.lproj/MainMenu.nib/keyedobjects.nib
generated
Binary file not shown.
@ -1,13 +1,13 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1187
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf340
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
|
||||
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
|
||||
\paperw12240\paperh15840\vieww10800\viewh8400\viewkind0
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs62 \cf0 F.A.Q for smcFanControl 2.4\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\f0\fs62 \cf0 F.A.Q for smcFanControl 2.6\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\fs24 \cf0 \
|
||||
|
||||
@ -29,7 +29,7 @@ All changes smcFanControl does to the fan controlling get lost after you shutdow
|
||||
|
||||
\b I get a "smcFanControl has not been tested on this machine" warning. What does that mean?\
|
||||
|
||||
\b0 Technically smcFanControl supports every intel mac, but it does not come with defaults for every machine. If you get the warning, smcFanControl tries to read out the fan-details directly from the System Management Controller. If you follow the instructions (no other fan control software is running etc.) you should have no problem running smcFanControl on a machine it has not been tested on.\
|
||||
\b0 Technically smcFanControl supports every Apple Silicon & Intel Mac, but it does not come with defaults for every machine. If you get the warning, smcFanControl tries to read out the fan-details directly from the System Management Controller. If you follow the instructions (no other fan control software is running etc.) you should have no problem running smcFanControl on a machine it has not been tested on.\
|
||||
\
|
||||
|
||||
\b How can I restore the Apple defaults for fanspeed?\
|
||||
@ -73,7 +73,7 @@ Will there be a version of smcFanControl for Powerbooks or other PPC based Macs?
|
||||
|
||||
\b Wouldn't it be even better to read out the temperature and set the fan speeds depending on the readout than just set the minimum fan speed and let automatic fan control as defined by apple do the rest?\
|
||||
|
||||
\b0 Yes, that approach is even better and could make your machine running cooler, when you are at higher loads. BUT: I did not take this route for smcFanControl, cause it has some risks. Adjusting the fan speed to CPU temperature requires you have a program running in the background (e.g. a daemon) that adjust fan speed continuously . If that program ever crashes or becomes incompatible cause of a System Update (or the readouts of the temperature sensor get inappropriate) , the fans could get set to a wrong (too low) speed and this could probably damage the machine. In addition to that the fan-control-logic is quite complicate. An intel mac has about 10 temperature sensors, that are continuously read out and are used for monitoring and setting the right fan speeds. So it would be "not so great" to read out just the CPU temperature as a foundation for the fan-controlling.\
|
||||
\b0 Yes, that approach is even better and could make your machine running cooler, when you are at higher loads. BUT: I did not take this route for smcFanControl, cause it has some risks. Adjusting the fan speed to CPU temperature requires you have a program running in the background (e.g. a daemon) that adjust fan speed continuously . If that program ever crashes or becomes incompatible cause of a System Update (or the readouts of the temperature sensor get inappropriate) , the fans could get set to a wrong (too low) speed and this could probably damage the machine. In addition to that the fan-control-logic is quite complicate. A Mac has about 10 temperature sensors, that are continuously read out and are used for monitoring and setting the right fan speeds. So it would be "not so great" to read out just the CPU temperature as a foundation for the fan-controlling.\
|
||||
\
|
||||
|
||||
\b I have got a MBP and smcFanControl is reporting 0rpm for one of my fans?\
|
||||
@ -86,10 +86,10 @@ Will there be a version of smcFanControl for Powerbooks or other PPC based Macs?
|
||||
\b \
|
||||
|
||||
\b0 \
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
\ls1\ilvl0
|
||||
\b \cf0 {\listtext \'95 }What are the main-differences between Version 1.2x and Version 2.x of smcFanControl?\
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0
|
||||
\ls1\ilvl0
|
||||
\b0 \cf0 {\listtext \'95 }Version 2.x is a completely rewritten application.\
|
||||
{\listtext \'95 }Version 1.x was a "regular" application located in the dock. Version 2.x sits in the menubar for quicker access to the fan settings, easier monitoring and a better overall user-experience\
|
||||
@ -100,7 +100,7 @@ Will there be a version of smcFanControl for Powerbooks or other PPC based Macs?
|
||||
{\listtext \'95 }Version 2.x uses standard OS X authentication now\
|
||||
{\listtext \'95 }Version 2.x uses the Sparkle-Framework to automatically check for updates\
|
||||
{\listtext \'95 }\
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
\cf0 \
|
||||
|
||||
\b Sourcecode: https://github.com/hholtmann/smcFanControl
|
||||
|
||||
Binary file not shown.
Binary file not shown.
5711
Ressources/English.lproj/MainMenu.nib/designable.nib
generated
5711
Ressources/English.lproj/MainMenu.nib/designable.nib
generated
File diff suppressed because it is too large
Load Diff
BIN
Ressources/English.lproj/MainMenu.nib/keyedobjects.nib
generated
BIN
Ressources/English.lproj/MainMenu.nib/keyedobjects.nib
generated
Binary file not shown.
95
Ressources/French.lproj/F.A.Q.rtf
Normal file
95
Ressources/French.lproj/F.A.Q.rtf
Normal file
@ -0,0 +1,95 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf340
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
|
||||
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
|
||||
\paperw12240\paperh15840\vieww10800\viewh8400\viewkind0
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs62 \cf0 F.A.Q smcFanControl 2.6\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\fs24 \cf0 \
|
||||
|
||||
\b Comment installer ou d\'e9sinstaller smcFanControl?\
|
||||
|
||||
\b0 smcFanControl est une simple application. Ainsi apr\'e8s son t\'e9l\'e9chargement, d\'e9placez-le o\'f9 vous le souhaitez (ex. le dossier Applications). Pour le d\'e9sinstaller, il suffit de le d\'e9placer dans la corbeille. smcFanControl n'installer aucun d\'e9mon ou processus en arri\'e8re plan. \
|
||||
To les changements op\'e9r\'e9s par smcFanControl sur le contr\'f4leur de ventilation sont perdus \'e0 l'extinction de la machine (pas lors d'un red\'e9marrage) ou lorsque la machine entre veille (si smcFanControl n'est plus en cours d'ex\'e9cution \'e0 la reprise d'activit\'e9). La vitesse minimum de rotation revient alors \'e0 la valeur par d\'e9faut d\'e9finie par le syst\'e8me.\
|
||||
\
|
||||
|
||||
\b Lorsque j'utilise smcFanControl et d\'e9finis une vitesse minimum, la vitesse augmente-t-elle tout de m\'eame lorsque la temp\'e9rature du CPU augmente ?\
|
||||
Oui
|
||||
\b0 , la vitesse augmentera comme d\'e9fini par Apple. smcFanControl laissera toujours vos ventilateur en mode automatique et ne modifiera \ul que la vitesse minimum\ulnone du ventilateur. Ainsi, plus la vitesse minimum d\'e9finie est \'e9lev\'e9e, plus le contr\'f4leur de ventilation mettra du temps \'e0 juger n\'e9c\'e9ssaire l'augmentation de vitesse \'e0 mesure que la temp\'e9rature augmente.\
|
||||
\
|
||||
|
||||
\b Pourquoi smcFanControl me demande un identifiant et un mot de passe et quels identifiants dois-je utiliser ?\
|
||||
|
||||
\b0 smcFanControl a besoin des identifiants d'un compte administrateur afin de pouvoir modifier la vitesse de rotation des ventilateurs. Vous n'aurez \'e0 les rentrer qu'une seuls fois. Pour autant, ces identifiants ne sont pas sauvegard\'e9s par smcFanControl. Ils sont justes utilis\'e9s pour voir d\'e9finir correctement les droits d'ex\'e9cution du programme.\
|
||||
\
|
||||
|
||||
\b J'obtiens le message d'avertissement "smcFanControl n'a pas encore \'e9t\'e9 test\'e9 sur cette machine". Qu'est ce que cela signifie?\
|
||||
|
||||
\b0 Techniquement, smcFanControl fonctionne avec tous les Mac Apple Silicon et Intel, mais ces machines ont des valeurs par d\'e9faut diff\'e9rente. Si vous obtenez ce message, smcFanControl tente de lire la valeur par d\'e9faut directement du System Management Controller. Si vous suivez les instructions (ne pas lancer d'autres logiciels de gestion de ventilation, etc.) vous devriez pouvoir utiliser smcFanControl sur une machine que n'a pas encore \'e9t\'e9 test\'e9e par nos soins.\
|
||||
\
|
||||
|
||||
\b Comment revenir au valeur par d\'e9fauts d\'e9finies par Apple ?\
|
||||
|
||||
\b0 Placer les curseurs \'e0 gaucher et cliquer "enregistrer". Les valeurs minimales autoris\'e9es sont celles d\'e9finies par d\'e9faut par Apple. Depuis la derni\'e8re mise \'e0 jour Apple du contr\'f4leur SMC les valeurs minimum par d\'e9faut sont de 1000rpm pour les MBP 15,4", 1500rpm pour le MB 13,3". 2000rpm les MBP Core2Duo et 1800rpm pour les MB Core2Duo.\
|
||||
|
||||
\b \
|
||||
Pourquoi ne puis-je pas d\'e9finir 0 rpm?\
|
||||
|
||||
\b0 smcFanControl ne vous permet que de d\'e9finir une valeur comprise entre les minimum et maximum d'Apple. D\'e9finir une valeur \'e0 0 est possible sur le plan technique mais provoquerait probablement des dommages \'e0 votre mat\'e9riel.\
|
||||
\
|
||||
|
||||
\b Quand les r\'e9glages smcFanControl sont-ils perdus ?\
|
||||
|
||||
\b0 Les r\'e9glages de vitesse minimum de rotation des ventilateurs sont perdus dans deux sc\'e9narios :\
|
||||
a) L'ordinateur est entr\'e9 en veille et smcFanControl n'est plus en cours d'ex\'e9cution (dans le cas contraire, smcFanControl v\'e9rifie l'\'e9tat de veille et applique \'e0 nouveau les r\'e9glages au r\'e9veil de la machine).\
|
||||
b) \'c9teindre votre machine.\
|
||||
\
|
||||
|
||||
\b Quelle sonde est utilis\'e9e pour lire la temp\'e9rature affich\'e9e?\
|
||||
|
||||
\b0 Ce n'est pas directement la sonde du CPU CoreDuo. Cela permet en outre de ne pas charg\'e9 une extension Kernel afin de lire la temp\'e9rature. La sonde utilis\'e9e est tr\'e8s proche de celle du CoreDuo, mais n'est effectivement pas exactement pareil.\
|
||||
\
|
||||
|
||||
\b Qu'en est il de Windows avec Bootcamp?\
|
||||
\
|
||||
|
||||
\b0 smcFanControl \'e9tant une application native OSX, vous ne pouvez d\'e9finir la valeur minimum des rotation lorsque vous \'eates sous windows.\
|
||||
Toutefois, vous pouvez d\'e9finir une vitesse minimale sous OSX puis red\'e9marrer sous windows, vos r\'e9glages n'\'e9tant pas perdu lors du red\'e9marrage. Certes personnes ont report\'e9s que cette m\'e9thode permettait de se pr\'e9venir de certain crash de jeux sous Windows.\
|
||||
\
|
||||
|
||||
\b Ne serait-il pas mieux de d\'e9finir la vitesse de rotation en fonction de la temp\'e9rature plut\'f4t que de choisir une vitesse minimale et laisse Apple faire le reste ?\
|
||||
|
||||
\b0 Oui, cette approche serait probablement plus int\'e9ressante. MAIS : cette m\'e9thode n'a pas \'e9t\'e9 retenue car elle comporte des risques. D\'e9finir la vitesse en fonction de la temp\'e9rature requiert un programme qui tourne en continue. Si ce programme crash ou devient incompatible \'e0 la suite d'une mise \'e0 jour, le ventilateur pourrait \'eatre d\'e9fini \'e0 une valeur trop basse qui pourrait endommager votre machine. D'autre part, cette logique est complexe \'e0 mettre en oeuvre. Un Mac poss\'e8de une dizaine de sondes de temp\'e9rature, lues continuellement afin de d\'e9finir la vitesse ad\'e9quate de rotation des ventilateurs. Ainsi il ne serait pas judicieux de se reposer sur la lecture d'une seule sonde pour le contr\'f4le de la ventilation.\
|
||||
\
|
||||
|
||||
\b Je poss\'e8de un MBP et smcFanControl m'indique 0 rpm pour l'un des ventilateurs\
|
||||
|
||||
\b0 Dans ce cas, le ventilateur n'a remont\'e9 aucune information \'e0 smcFanControl.
|
||||
\b
|
||||
\b0 Il est possible que le ventilateur subisse un disfonctionnement. Vous pouvez diagnostiquer vitre Mac \'e0 l'aide du Test Hardware d'Apple (cette outils est livr\'e9 avec le DVD d'installation de votre machine).
|
||||
\b \
|
||||
|
||||
\b0 \
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
\ls1\ilvl0
|
||||
\b \cf0 Quelles sont les principales diff\'e9rence entre les versions 1.2x et 2.x de smcFanControl ?\
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0
|
||||
\ls1\ilvl0
|
||||
\b0 \cf0 {\listtext \'95 }La version 2.x a \'e9t\'e9 enti\'e8rement r\'e9\'e9crites.\
|
||||
{\listtext \'95 }La version 1.x \'e9tait une application "normale" plac\'e9e dans le dock. La version 2.x se trouve d\'e9sormais dans la bar des menus, permettant un acc\'e8s rapide ainsi qu'un contr\'f4le plus simple de la temp\'e9rature et vitesse de rotation.\
|
||||
{\listtext \'95 }La version 2.x supporte tous les Macs intel.\
|
||||
{\listtext \'95 }Dans la version 2.x vous pouvez d\'e9finir plusieurs r\'e9glages favoris et les activer en un clic.\
|
||||
{\listtext \'95 }Sur les Macs portables, vous pouvez activer automatiquement un r\'e9glage favoris en fonction de la source d'alimentation. Ainsi vous pouvez choisir de rafraichir automatique votre mac lorsque que celui-ci est branch\'e9 ou en charge (et que typiquement dans ces conditions il chauffe davantage).\
|
||||
{\listtext \'95 }La version 2.x poss\'e8de d\'e9sormais une option de d\'e9marrage automatique avec la session.\
|
||||
{\listtext \'95 }La version 2.x utilise la fen\'eatre standard d'authentification d'OSX\
|
||||
{\listtext \'95 }La version 2.x uses the Framework Sparkle pour v\'e9rifier automatiquement les mises \'e0 jour\
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
\cf0 \
|
||||
|
||||
\b Code source : https://github.com/hholtmann/smcFanControl
|
||||
\b0 \
|
||||
}
|
||||
BIN
Ressources/French.lproj/Localizable.strings
Normal file
BIN
Ressources/French.lproj/Localizable.strings
Normal file
Binary file not shown.
1097
Ressources/French.lproj/MainMenu.nib/designable.nib
generated
Normal file
1097
Ressources/French.lproj/MainMenu.nib/designable.nib
generated
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Ressources/French.lproj/MainMenu.nib/keyedobjects.nib
generated
Normal file
BIN
Ressources/French.lproj/MainMenu.nib/keyedobjects.nib
generated
Normal file
Binary file not shown.
@ -1,14 +1,14 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1187
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf340
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
|
||||
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}}
|
||||
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}
|
||||
\paperw12240\paperh15840\viewkind0
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs62 \cf0 F.A.Q for smcFanControl 2.4\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\f0\fs62 \cf0 F.A.Q for smcFanControl 2.6\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\fs24 \cf0 \
|
||||
|
||||
@ -30,7 +30,7 @@ All changes smcFanControl does to the fan controlling get lost after you shutdow
|
||||
|
||||
\b I get a "smcFanControl has not been tested on this machine" warning. What does that mean?\
|
||||
|
||||
\b0 Technically smcFanControl supports every intel mac, but it does not come with defaults for every machine. If you get the warning, smcFanControl tries to read out the fan-details directly from the System Management Controller. If you follow the instructions (no other fan control software is running etc.) you should have no problem running smcFanControl on a machine it has not been tested on.\
|
||||
\b0 Technically smcFanControl supports every Apple Silicon & Intel Mac, but it does not come with defaults for every machine. If you get the warning, smcFanControl tries to read out the fan-details directly from the System Management Controller. If you follow the instructions (no other fan control software is running etc.) you should have no problem running smcFanControl on a machine it has not been tested on.\
|
||||
\
|
||||
|
||||
\b How can I restore the Apple defaults for fanspeed?\
|
||||
@ -74,7 +74,7 @@ Will there be a version of smcFanControl for Powerbooks or other PPC based Macs?
|
||||
|
||||
\b Wouldn't it be even better to read out the temperature and set the fan speeds depending on the readout than just set the minimum fan speed and let automatic fan control as defined by apple do the rest?\
|
||||
|
||||
\b0 Yes, that approach is even better and could make your machine running cooler, when you are at higher loads. BUT: I did not take this route for smcFanControl, cause it has some risks. Adjusting the fan speed to CPU temperature requires you have a program running in the background (e.g. a daemon) that adjust fan speed continuously . If that program ever crashes or becomes incompatible cause of a System Update (or the readouts of the temperature sensor get inappropriate) , the fans could get set to a wrong (too low) speed and this could probably damage the machine. In addition to that the fan-control-logic is quite complicate. An intel mac has about 10 temperature sensors, that are continuously read out and are used for monitoring and setting the right fan speeds. So it would be "not so great" to read out just the CPU temperature as a foundation for the fan-controlling.\
|
||||
\b0 Yes, that approach is even better and could make your machine running cooler, when you are at higher loads. BUT: I did not take this route for smcFanControl, cause it has some risks. Adjusting the fan speed to CPU temperature requires you have a program running in the background (e.g. a daemon) that adjust fan speed continuously . If that program ever crashes or becomes incompatible cause of a System Update (or the readouts of the temperature sensor get inappropriate) , the fans could get set to a wrong (too low) speed and this could probably damage the machine. In addition to that the fan-control-logic is quite complicate. A Mac has about 10 temperature sensors, that are continuously read out and are used for monitoring and setting the right fan speeds. So it would be "not so great" to read out just the CPU temperature as a foundation for the fan-controlling.\
|
||||
\
|
||||
|
||||
\b I have got a MBP and smcFanControl is reporting 0rpm for one of my fans?\
|
||||
@ -89,7 +89,7 @@ Will there be a version of smcFanControl for Powerbooks or other PPC based Macs?
|
||||
\b0 \
|
||||
|
||||
\b What are the main-differences between Version 1.2x and Version 2.x of smcFanControl?\
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0
|
||||
\ls1\ilvl0
|
||||
\b0 \cf0 {\listtext \'95 }Version 2.x is a completely rewritten application.\
|
||||
{\listtext \'95 }Version 1.x was a "regular" application located in the dock. Version 2.x sits in the menubar for quicker access to the fan settings, easier monitoring and a better overall user-experience\
|
||||
@ -99,12 +99,12 @@ Will there be a version of smcFanControl for Powerbooks or other PPC based Macs?
|
||||
{\listtext \'95 }Version 2.x has got an "add to login-items option" now\
|
||||
{\listtext \'95 }Version 2.x uses standard OS X authentication now\
|
||||
{\listtext \'95 }Version 2.x uses the Sparkle-Framework to automatically check for updates\
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\b \cf0 \
|
||||
Sourcecode: https://github.com/hholtmann/smcFanControl
|
||||
\b0 \
|
||||
\
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0
|
||||
\ls2\ilvl0\cf0 \
|
||||
}
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
"Right Fan" = "Rechter Lüfter";
|
||||
|
||||
"smcFanControl has not been tested on this machine yet, but it should run if you follow the instructions. \n\nIf you choose to continue, please make you have no other FanControl-software running. Otherwise please quit, deinstall the other software, restart your machine and rerun smcFanControl!" = "smcFanControl wurde auf Ihrem Computermodel noch nicht getestet! Es sollte jedoch problemlos funktionieren, wenn Sie die Hinweise beachten.\n\nBevor Sie auf Weiter klicken, stellen Sie sicher das keine andere FanControl-Software läuft. Sollte dies noch der Fall sein, wählen Sie Abbrechen, deinstallieren Sie die andere Software, starten Sie Ihren Rechner neu und rufen Sie smcFanControl erneut auf!";
|
||||
"smcFanControl has not been tested on this machine yet, but it should run if you follow the instructions. \n\nIf you choose to continue, please make sure you have no other FanControl-software running. Otherwise please quit, deinstall the other software, restart your machine and rerun smcFanControl!" = "smcFanControl wurde auf Ihrem Computermodel noch nicht getestet! Es sollte jedoch problemlos funktionieren, wenn Sie die Hinweise beachten.\n\nBevor Sie auf Weiter klicken, stellen Sie sicher das keine andere FanControl-Software läuft. Sollte dies noch der Fall sein, wählen Sie Abbrechen, deinstallieren Sie die andere Software, starten Sie Ihren Rechner neu und rufen Sie smcFanControl erneut auf!";
|
||||
|
||||
"Continue" = "Weiter";
|
||||
|
||||
@ -21,3 +21,21 @@
|
||||
"Alert!" = "Achtung!";
|
||||
|
||||
"Active Setting" = "Aktive Einstellung";
|
||||
|
||||
"Remind me later" = "Später erinnern";
|
||||
|
||||
"Consider a donation" = "Spenden...";
|
||||
|
||||
"Never ask me again" = "Nie wieder fragen";
|
||||
|
||||
"Donate over Paypal" = "Spenden über PayPal";
|
||||
|
||||
"smcFanControl keeps your Mac cool since 2006.\n\nIf smcFanControl is helfpul for you and you want to support further development, a small donation over Paypal is much appreciated." = "smcFanControl hält seit 2006 Macs in aller Welt kühl.\n\nWenn Sie smcFanControl gerne benutzen und Sie die Weiterentwicklung unterstützen wollen, freuen wir uns über eine kleine Spende über PayPal.";
|
||||
|
||||
"Do you want to reset smcFanControl to default settings? Favorites will be deleted and fans will return to default speed." = "Wollen Sie smcFanControl auf die Default-Einstellungen zurücksetzen?\nDie Favoriten werden gelöscht und die Lüfter auf Werkseinstellung gesetzt.";
|
||||
|
||||
"Please shutdown your computer now to return to default fan settings." = "Bitte schalten Sie den Computer jetzt aus, um die Werkseinstellung für die Lüfter wiederherzustellen.";
|
||||
|
||||
"Reset Settings" = "Einstellungen zurücksetzen";
|
||||
|
||||
"Shutdown required" = "Ausschalten erforderlich";
|
||||
5578
Ressources/German.lproj/MainMenu.nib/designable.nib
generated
5578
Ressources/German.lproj/MainMenu.nib/designable.nib
generated
File diff suppressed because it is too large
Load Diff
BIN
Ressources/German.lproj/MainMenu.nib/keyedobjects.nib
generated
BIN
Ressources/German.lproj/MainMenu.nib/keyedobjects.nib
generated
Binary file not shown.
@ -572,5 +572,104 @@
|
||||
<key>NumFans</key>
|
||||
<integer>4</integer>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Fans</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Description</key>
|
||||
<string>Left Fan</string>
|
||||
<key>Maxspeed</key>
|
||||
<integer>5927</integer>
|
||||
<key>Minspeed</key>
|
||||
<real>2160</real>
|
||||
<key>selspeed</key>
|
||||
<integer>2160</integer>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Description</key>
|
||||
<string>Right Fan</string>
|
||||
<key>Maxspeed</key>
|
||||
<integer>5489</integer>
|
||||
<key>Minspeed</key>
|
||||
<real>2000</real>
|
||||
<key>selspeed</key>
|
||||
<integer>2000</integer>
|
||||
</dict>
|
||||
</array>
|
||||
<key>Machine</key>
|
||||
<string>MacBookPro15,1</string>
|
||||
<key>Maxspeed</key>
|
||||
<integer>5927</integer>
|
||||
<key>Minspeed</key>
|
||||
<integer>2000</integer>
|
||||
<key>NumFans</key>
|
||||
<integer>2</integer>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Fans</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Description</key>
|
||||
<string>Left Fan</string>
|
||||
<key>Maxspeed</key>
|
||||
<integer>5616</integer>
|
||||
<key>Minspeed</key>
|
||||
<real>1836</real>
|
||||
<key>selspeed</key>
|
||||
<integer>1836</integer>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Description</key>
|
||||
<string>Right Fan</string>
|
||||
<key>Maxspeed</key>
|
||||
<integer>5200</integer>
|
||||
<key>Minspeed</key>
|
||||
<real>1700</real>
|
||||
<key>selspeed</key>
|
||||
<integer>1700</integer>
|
||||
</dict>
|
||||
</array>
|
||||
<key>Machine</key>
|
||||
<string>MacBookPro16,1</string>
|
||||
<key>Maxspeed</key>
|
||||
<integer>5927</integer>
|
||||
<key>Minspeed</key>
|
||||
<integer>1700</integer>
|
||||
<key>NumFans</key>
|
||||
<integer>2</integer>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Fans</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Description</key>
|
||||
<string>Left Fan</string>
|
||||
<key>Maxspeed</key>
|
||||
<integer>4296</integer>
|
||||
<key>Minspeed</key>
|
||||
<integer>1499</integer>
|
||||
<key>selspeed</key>
|
||||
<integer>1499</integer>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Description</key>
|
||||
<string>Right Fan</string>
|
||||
<key>Maxspeed</key>
|
||||
<integer>4744</integer>
|
||||
<key>Minspeed</key>
|
||||
<integer>1499</integer>
|
||||
<key>selspeed</key>
|
||||
<integer>1499</integer>
|
||||
</dict>
|
||||
</array>
|
||||
<key>Machine</key>
|
||||
<string>MacBookPro18,1</string>
|
||||
<key>Maxspeed</key>
|
||||
<integer>4744</integer>
|
||||
<key>Minspeed</key>
|
||||
<integer>1499</integer>
|
||||
<key>NumFans</key>
|
||||
<integer>2</integer>
|
||||
</dict>
|
||||
</array>
|
||||
</plist>
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1187
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf340
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
|
||||
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
|
||||
\paperw12240\paperh15840\viewkind0
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs62 \cf0 F.A.Q para smcFanControl 2.4\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\f0\fs62 \cf0 F.A.Q para smcFanControl 2.6\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\fs24 \cf0 \
|
||||
|
||||
@ -29,7 +29,7 @@ Todos los cambios realizados por smcFanControl se pierden al apagar el ordenador
|
||||
|
||||
\b Me sale el aviso "smcFanControl no ha sido probado en esta m\'e1quina". \'bfQu\'e9 significa?\
|
||||
|
||||
\b0 T\'e9cnicamente smcFanControl funciona en todos los mac Intel, pero no trae los valores por defecto para todos los modelos. Si sale este aviso smcFanControl tratar\'e1 de leer los valores por defecto del SMC (System Management Controller) Si sigue las instrucciones (no hay otro controlador de ventiladoes, etc) no deber\'eda de tener ning\'fan problema en usarlo en un modelo en el que no haya sido probado a\'fan.\
|
||||
\b0 T\'e9cnicamente smcFanControl funciona en todos los Mac Apple Silicon o Intel, pero no trae los valores por defecto para todos los modelos. Si sale este aviso smcFanControl tratar\'e1 de leer los valores por defecto del SMC (System Management Controller) Si sigue las instrucciones (no hay otro controlador de ventiladoes, etc) no deber\'eda de tener ning\'fan problema en usarlo en un modelo en el que no haya sido probado a\'fan.\
|
||||
\
|
||||
|
||||
\b \'bfComo puedo recobrar los valores por defecto de Apple para la velocidad de los ventiladores?\
|
||||
@ -73,7 +73,7 @@ b) La m\'e1quina se apaga.\
|
||||
|
||||
\b \'bfNo ser\'eda mejor leer los valores de temperaura y ajustar la velocidad que limitarse a cambiar el valor m\'ednimo y dejar que el control autom\'e1tico de ventiladores de Apple haga el resto?\
|
||||
|
||||
\b0 Si, ese camino es mejor y puede que haga que la m\'e1quina funcione m\'e1s fresca cuando la carga es alta... PERO: No eleg\'ed este camino por los los riesgos que tiene. Requiere un programa en segundo plano (un daemon) ajustando constantemente la velocidad. Si este programa es incompatible con una fuura actualiaci\'f3n del sistema o se cuelga puede fijar la velocidad a un valor demasiado bajo y estropear la m\'e1quina. Adem\'e1s la l\'f3gica que hay que a\'f1adir es muy complicada, un mac intel tiene en torno a 10 sensores de temperatura, con lo que simplemente "leer la temperatura de la CPU y ajustar el ventilador" no es tan buena idea.\
|
||||
\b0 Si, ese camino es mejor y puede que haga que la m\'e1quina funcione m\'e1s fresca cuando la carga es alta... PERO: No eleg\'ed este camino por los los riesgos que tiene. Requiere un programa en segundo plano (un daemon) ajustando constantemente la velocidad. Si este programa es incompatible con una fuura actualiaci\'f3n del sistema o se cuelga puede fijar la velocidad a un valor demasiado bajo y estropear la m\'e1quina. Adem\'e1s la l\'f3gica que hay que a\'f1adir es muy complicada, un Mac tiene en torno a 10 sensores de temperatura, con lo que simplemente "leer la temperatura de la CPU y ajustar el ventilador" no es tan buena idea.\
|
||||
\
|
||||
|
||||
\b \'bfTengo un MBP y smcFanControl dice que un ventilador gira a 0rpm?\
|
||||
@ -84,7 +84,7 @@ b) La m\'e1quina se apaga.\
|
||||
\
|
||||
|
||||
\b \'bfCuales son las principales diferencias entre las versiones 1.2.x y 2.x de smcFanControl?\
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural
|
||||
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0
|
||||
\ls1\ilvl0
|
||||
\b0 \cf0 {\listtext \'95 }La versi\'f3n 2.x est\'e1 completamente rescrita.\
|
||||
{\listtext \'95 }La versi\'f3n 1.x era una aplicaci\'f3n "regular" en el dock. La versi\'f3n 2.x se coloca en la barra de menu, por lo que se accede r\'e1pidamente a los ajustes de los ventiladores, al control de temperatura y en general un uso m\'e1s agradable\
|
||||
@ -94,11 +94,10 @@ b) La m\'e1quina se apaga.\
|
||||
{\listtext \'95 }La versi\'f3n 2.x tiene la opci\'f3n de "a\'f1adir a los elementos de inicio"\
|
||||
{\listtext \'95 }La versi\'f3n 2.x usa la autenticaci\'f3n est\'e1ndard de OS X\
|
||||
{\listtext \'95 }La versi\'f3n 2.x usa el "Sparkle-Framework" para busca autom\'e1ticamente actualizaciones\
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
\cf0 \
|
||||
\pard\tx560\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
|
||||
|
||||
\b \cf0 Sourcecode: https://github.com/hholtmann/smcFanControl
|
||||
\b Sourcecode: https://github.com/hholtmann/smcFanControl
|
||||
\b0 \
|
||||
\
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
NSHumanReadableCopyright = "by Hendrik Holtmann, 2009 (GPL License)";
|
||||
@ -1,6 +1,6 @@
|
||||
"Do you really want to delete the favorite %@?" = "¿Seguro qu desea eliminar el favorito: %@?";
|
||||
"Do you really want to delete the favorite %@?" = "¿Seguro que desea eliminar el favorito: %@?";
|
||||
|
||||
"Yes" = "Si";
|
||||
"Yes" = "Sí";
|
||||
|
||||
"No" = "No";
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
"Right Fan" = "Ventilador derecho";
|
||||
|
||||
"smcFanControl has not been tested on this machine yet, but it should run if you follow the instructions. \n\nIf you choose to continue, please make you have no other FanControl-software running. Otherwise please quit, deinstall the other software, restart your machine and rerun smcFanControl!" = "smcFanControl no ha sido probado en esta máquina, pero debería de funcionar si sigue esta insrucciones. \n\nSi decide continuar aseguresé de que no hay otro programa de control de ventiladores; si no salga, desinstale los otros programas, reinicie y lance otra vez smcFanControl";
|
||||
"smcFanControl has not been tested on this machine yet, but it should run if you follow the instructions. \n\nIf you choose to continue, please make sure you have no other FanControl-software running. Otherwise please quit, deinstall the other software, restart your machine and rerun smcFanControl!" = "smcFanControl no ha sido probado en esta máquina, pero debería de funcionar si sigue esta insrucciones. \n\nSi decide continuar asegúrese de que no hay otro programa de control de ventiladores; si es así salga, desinstale los otros programas, reinicie y lance otra vez smcFanControl";
|
||||
|
||||
"Continue" = "Continuar";
|
||||
|
||||
@ -21,3 +21,21 @@
|
||||
"Alert!" = "¡Atención!";
|
||||
|
||||
"Active Setting" = "Configuración activa";
|
||||
|
||||
"Remind me later" = "Recuérdame luego";
|
||||
|
||||
"Consider a donation" = "Considera una donación";
|
||||
|
||||
"Never ask me again" = "No volver a preguntar";
|
||||
|
||||
"Donate over Paypal" = "Dona mediante Paypal";
|
||||
|
||||
"smcFanControl keeps your Mac cool since 2006.\n\nIf smcFanControl is helfpul for you and you want to support further development, a small donation over Paypal is much appreciated." = "smcFanControl mantiene tu Mac fresco desde 2006.\nSi smcFanControl es útil para ti y quieres apoyar su desarrollo, apreciamos que nos aportes una pequeña donación a través de Paypal.";
|
||||
|
||||
"Do you want to reset smcFanControl to default settings? Favorites will be deleted and fans will return to default speed." = "¿Desea restablecer la configuración predeterminada de smcFanControl?\n- Los favoritos se eliminarán y los ventiladores volverán a la velocidad predeterminada.";
|
||||
|
||||
"Please shutdown your computer now to return to default fan settings." = "Por favor, apaga el ordenador ahora para restaurar la configuración de los ventiladores";
|
||||
|
||||
"Reset Settings" = "Ajustes de fábrica";
|
||||
|
||||
"Shutdown required" = "Se necesita apagar";
|
||||
|
||||
5649
Ressources/Spanish.lproj/MainMenu.nib/designable.nib
generated
5649
Ressources/Spanish.lproj/MainMenu.nib/designable.nib
generated
File diff suppressed because it is too large
Load Diff
BIN
Ressources/Spanish.lproj/MainMenu.nib/keyedobjects.nib
generated
BIN
Ressources/Spanish.lproj/MainMenu.nib/keyedobjects.nib
generated
Binary file not shown.
1
Sparkle.framework/Autoupdate
Symbolic link
1
Sparkle.framework/Autoupdate
Symbolic link
@ -0,0 +1 @@
|
||||
Versions/Current/Autoupdate
|
||||
1
Sparkle.framework/Modules
Symbolic link
1
Sparkle.framework/Modules
Symbolic link
@ -0,0 +1 @@
|
||||
Versions/Current/Modules
|
||||
1
Sparkle.framework/PrivateHeaders
Symbolic link
1
Sparkle.framework/PrivateHeaders
Symbolic link
@ -0,0 +1 @@
|
||||
Versions/Current/PrivateHeaders
|
||||
1
Sparkle.framework/Updater.app
Symbolic link
1
Sparkle.framework/Updater.app
Symbolic link
@ -0,0 +1 @@
|
||||
Versions/Current/Updater.app
|
||||
@ -1,13 +0,0 @@
|
||||
//
|
||||
// NSApplication+AppCopies.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/16/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSApplication (SUAppCopies)
|
||||
- (int)copiesRunning;
|
||||
@end
|
||||
@ -1,11 +0,0 @@
|
||||
//
|
||||
// NSFileManager+Authentication.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/9/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
@interface NSFileManager (SUAuthenticationAdditions)
|
||||
- (BOOL)movePathWithAuthentication:(NSString *)src toPath:(NSString *)dst;
|
||||
@end
|
||||
@ -1,15 +0,0 @@
|
||||
//
|
||||
// NSFileManager+Verification.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/16/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
// For the paranoid folks!
|
||||
@interface NSFileManager (SUVerification)
|
||||
- (BOOL)validatePath:(NSString *)path withMD5Hash:(NSString *)hash;
|
||||
- (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature;
|
||||
@end
|
||||
@ -1,61 +0,0 @@
|
||||
/*
|
||||
|
||||
BSD License
|
||||
|
||||
Copyright (c) 2002, Brent Simmons
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of ranchero.com or Brent Simmons nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
NSString+extras.h
|
||||
NetNewsWire
|
||||
|
||||
Created by Brent Simmons on Fri Jun 14 2002.
|
||||
Copyright (c) 2002 Brent Simmons. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
|
||||
@interface NSString (extras)
|
||||
|
||||
- (NSString *)stringWithSubstitute:(NSString *)subs forCharactersFromSet:(NSCharacterSet *)set;
|
||||
|
||||
- (NSString *) trimWhiteSpace;
|
||||
|
||||
- (NSString *) stripHTML;
|
||||
|
||||
- (NSString *) ellipsizeAfterNWords: (int) n;
|
||||
|
||||
+ (BOOL) stringIsEmpty: (NSString *) s;
|
||||
|
||||
|
||||
@end
|
||||
@ -1,98 +0,0 @@
|
||||
/*
|
||||
|
||||
BSD License
|
||||
|
||||
Copyright (c) 2002, Brent Simmons
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of ranchero.com or Brent Simmons nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
RSS.h
|
||||
A class for reading RSS feeds.
|
||||
|
||||
Created by Brent Simmons on Wed Apr 17 2002.
|
||||
Copyright (c) 2002 Brent Simmons. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
#import "NSString+extras.h"
|
||||
|
||||
|
||||
@interface RSS : NSObject {
|
||||
|
||||
NSDictionary *headerItems;
|
||||
NSMutableArray *newsItems;
|
||||
NSString *version;
|
||||
|
||||
BOOL flRdf;
|
||||
BOOL normalize;
|
||||
}
|
||||
|
||||
|
||||
/*Public*/
|
||||
|
||||
- (RSS *) initWithTitle: (NSString *) title andDescription: (NSString *) description;
|
||||
|
||||
- (RSS *) initWithData: (NSData *) rssData normalize: (BOOL) fl;
|
||||
|
||||
- (RSS *) initWithURL: (NSURL *) url normalize: (BOOL) fl;
|
||||
- (RSS *) initWithURL: (NSURL *) url normalize: (BOOL) fl userAgent:(NSString *)userAgent;
|
||||
|
||||
- (NSDictionary *) headerItems;
|
||||
|
||||
- (NSMutableArray *) newsItems;
|
||||
|
||||
- (NSString *) version;
|
||||
|
||||
// AMM's extensions for Sparkle
|
||||
- (NSDictionary *)newestItem;
|
||||
|
||||
|
||||
/*Private*/
|
||||
|
||||
- (void) createheaderdictionary: (CFXMLTreeRef) tree;
|
||||
|
||||
- (void) createitemsarray: (CFXMLTreeRef) tree;
|
||||
|
||||
- (void) setversionstring: (CFXMLTreeRef) tree;
|
||||
|
||||
- (void) flattenimagechildren: (CFXMLTreeRef) tree into: (NSMutableDictionary *) dictionary;
|
||||
|
||||
- (void) flattensourceattributes: (CFXMLNodeRef) node into: (NSMutableDictionary *) dictionary;
|
||||
|
||||
- (CFXMLTreeRef) getchanneltree: (CFXMLTreeRef) tree;
|
||||
|
||||
- (CFXMLTreeRef) getnamedtree: (CFXMLTreeRef) currentTree name: (NSString *) name;
|
||||
|
||||
- (void) normalizeRSSItem: (NSMutableDictionary *) rssItem;
|
||||
|
||||
- (NSString *) getelementvalue: (CFXMLTreeRef) tree;
|
||||
|
||||
@end
|
||||
@ -1,27 +0,0 @@
|
||||
//
|
||||
// SUAppcast.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/12/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class RSS, SUAppcastItem;
|
||||
@interface SUAppcast : NSObject {
|
||||
NSArray *items;
|
||||
id delegate;
|
||||
}
|
||||
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url;
|
||||
- (void)setDelegate:delegate;
|
||||
|
||||
- (SUAppcastItem *)newestItem;
|
||||
- (NSArray *)items;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (SUAppcastDelegate)
|
||||
- appcastDidFinishLoading:(SUAppcast *)appcast;
|
||||
@end
|
||||
@ -1,57 +0,0 @@
|
||||
//
|
||||
// SUAppcastItem.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/12/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface SUAppcastItem : NSObject {
|
||||
NSString *title;
|
||||
NSDate *date;
|
||||
NSString *description;
|
||||
|
||||
NSURL *releaseNotesURL;
|
||||
|
||||
NSString *DSASignature;
|
||||
NSString *MD5Sum;
|
||||
|
||||
NSURL *fileURL;
|
||||
NSString *fileVersion;
|
||||
NSString *versionString;
|
||||
}
|
||||
|
||||
// Initializes with data from a dictionary provided by the RSS class.
|
||||
- initWithDictionary:(NSDictionary *)dict;
|
||||
|
||||
- (NSString *)title;
|
||||
- (void)setTitle:(NSString *)aTitle;
|
||||
|
||||
- (NSDate *)date;
|
||||
- (void)setDate:(NSDate *)aDate;
|
||||
|
||||
- (NSString *)description;
|
||||
- (void)setDescription:(NSString *)aDescription;
|
||||
|
||||
- (NSURL *)releaseNotesURL;
|
||||
- (void)setReleaseNotesURL:(NSURL *)aReleaseNotesURL;
|
||||
|
||||
- (NSString *)DSASignature;
|
||||
- (void)setDSASignature:(NSString *)aDSASignature;
|
||||
|
||||
- (NSString *)MD5Sum;
|
||||
- (void)setMD5Sum:(NSString *)aMd5Sum;
|
||||
|
||||
- (NSURL *)fileURL;
|
||||
- (void)setFileURL:(NSURL *)aFileURL;
|
||||
|
||||
- (NSString *)fileVersion;
|
||||
- (void)setFileVersion:(NSString *)aFileVersion;
|
||||
|
||||
- (NSString *)versionString;
|
||||
- (void)setVersionString:(NSString *)versionString;
|
||||
|
||||
@end
|
||||
@ -1,21 +0,0 @@
|
||||
//
|
||||
// SUAutomaticUpdateAlert.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/18/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class SUAppcastItem;
|
||||
@interface SUAutomaticUpdateAlert : NSWindowController {
|
||||
SUAppcastItem *updateItem;
|
||||
}
|
||||
|
||||
- initWithAppcastItem:(SUAppcastItem *)item;
|
||||
|
||||
- (IBAction)relaunchNow:sender;
|
||||
- (IBAction)relaunchLater:sender;
|
||||
|
||||
@end
|
||||
@ -1,20 +0,0 @@
|
||||
//
|
||||
// SUConstants.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/16/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
extern NSString *SUUpdaterWillRestartNotification;
|
||||
|
||||
extern NSString *SUCheckAtStartupKey;
|
||||
extern NSString *SUFeedURLKey;
|
||||
extern NSString *SUShowReleaseNotesKey;
|
||||
extern NSString *SUSkippedVersionKey;
|
||||
extern NSString *SUScheduledCheckIntervalKey;
|
||||
extern NSString *SULastCheckTimeKey;
|
||||
extern NSString *SUExpectsDSASignatureKey;
|
||||
extern NSString *SUPublicDSAKeyKey;
|
||||
extern NSString *SUAutomaticallyUpdateKey;
|
||||
extern NSString *SUAllowsAutomaticUpdatesKey;
|
||||
@ -1,26 +0,0 @@
|
||||
//
|
||||
// SUStatusChecker.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Evan Schoenberg on 7/6/06.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Sparkle/SUUpdater.h>
|
||||
|
||||
@class SUStatusChecker;
|
||||
|
||||
@protocol SUStatusCheckerDelegate <NSObject>
|
||||
//versionString will be nil and isNewVersion will be NO if version checking fails.
|
||||
- (void)statusChecker:(SUStatusChecker *)statusChecker foundVersion:(NSString *)versionString isNewVersion:(BOOL)isNewVersion;
|
||||
@end
|
||||
|
||||
@interface SUStatusChecker : SUUpdater {
|
||||
id<SUStatusCheckerDelegate> scDelegate;
|
||||
}
|
||||
|
||||
// Create a status checker which will notifiy delegate once the appcast version is determined.
|
||||
// Notification occurs via the method defined in the SUStatusCheckerDelegate informal protocol.
|
||||
+ (SUStatusChecker *)statusCheckerForDelegate:(id<SUStatusCheckerDelegate>)delegate;
|
||||
|
||||
@end
|
||||
@ -1,33 +0,0 @@
|
||||
//
|
||||
// SUStatusController.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/14/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface SUStatusController : NSWindowController {
|
||||
double progressValue, maxProgressValue;
|
||||
NSString *title, *statusText, *buttonTitle;
|
||||
IBOutlet NSButton *actionButton;
|
||||
}
|
||||
|
||||
// Pass 0 for the max progress value to get an indeterminate progress bar.
|
||||
// Pass nil for the status text to not show it.
|
||||
- (void)beginActionWithTitle:(NSString *)title maxProgressValue:(double)maxProgressValue statusText:(NSString *)statusText;
|
||||
|
||||
// If isDefault is YES, the button's key equivalent will be \r.
|
||||
- (void)setButtonTitle:(NSString *)buttonTitle target:target action:(SEL)action isDefault:(BOOL)isDefault;
|
||||
- (void)setButtonEnabled:(BOOL)enabled;
|
||||
|
||||
- (double)progressValue;
|
||||
- (void)setProgressValue:(double)value;
|
||||
- (double)maxProgressValue;
|
||||
- (void)setMaxProgressValue:(double)value;
|
||||
|
||||
- (void)setStatusText:(NSString *)statusText;
|
||||
|
||||
@end
|
||||
@ -1,25 +0,0 @@
|
||||
//
|
||||
// SUUnarchiver.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/16/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface SUUnarchiver : NSObject {
|
||||
id delegate;
|
||||
}
|
||||
|
||||
- (void)unarchivePath:(NSString *)path;
|
||||
- (void)setDelegate:delegate;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (SUUnarchiverDelegate)
|
||||
- (void)unarchiver:(SUUnarchiver *)unarchiver extractedLength:(long)length;
|
||||
- (void)unarchiverDidFinish:(SUUnarchiver *)unarchiver;
|
||||
- (void)unarchiverDidFail:(SUUnarchiver *)unarchiver;
|
||||
@end
|
||||
@ -1,40 +0,0 @@
|
||||
//
|
||||
// SUUpdateAlert.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/12/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SUInstallUpdateChoice,
|
||||
SURemindMeLaterChoice,
|
||||
SUSkipThisVersionChoice
|
||||
} SUUpdateAlertChoice;
|
||||
|
||||
@class WebView, SUAppcastItem;
|
||||
@interface SUUpdateAlert : NSWindowController {
|
||||
SUAppcastItem *updateItem;
|
||||
id delegate;
|
||||
|
||||
IBOutlet WebView *releaseNotesView;
|
||||
IBOutlet NSTextField *description;
|
||||
NSProgressIndicator *releaseNotesSpinner;
|
||||
BOOL webViewFinishedLoading;
|
||||
}
|
||||
|
||||
- initWithAppcastItem:(SUAppcastItem *)item;
|
||||
- (void)setDelegate:delegate;
|
||||
|
||||
- (IBAction)installUpdate:sender;
|
||||
- (IBAction)skipThisVersion:sender;
|
||||
- (IBAction)remindMeLater:sender;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (SUUpdateAlertDelegate)
|
||||
- (void)updateAlert:(SUUpdateAlert *)updateAlert finishedWithChoice:(SUUpdateAlertChoice)updateChoice;
|
||||
@end
|
||||
@ -1,55 +0,0 @@
|
||||
//
|
||||
// SUUpdater.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 1/4/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
// Before you use Sparkle in your app, you must set SUFeedURL in Info.plist to the
|
||||
// address of the appcast on your webserver. If you don't already have an
|
||||
// appcast, please see the Sparkle documentation to learn about how to set one up.
|
||||
|
||||
// .zip, .dmg, .tar, .tbz, .tgz archives are supported at this time.
|
||||
|
||||
// By default, Sparkle offers to show the user the release notes of the build they'll be
|
||||
// getting, which it assumes are in the description (or body) field of the relevant RSS item.
|
||||
// Set SUShowReleaseNotes to <false/> in Info.plist to hide the button.
|
||||
|
||||
@class SUAppcastItem, SUUpdateAlert, SUStatusController;
|
||||
@interface SUUpdater : NSObject {
|
||||
SUAppcastItem *updateItem;
|
||||
|
||||
SUStatusController *statusController;
|
||||
SUUpdateAlert *updateAlert;
|
||||
|
||||
NSURLDownload *downloader;
|
||||
NSString *downloadPath;
|
||||
|
||||
NSTimer *checkTimer;
|
||||
NSTimeInterval checkInterval;
|
||||
|
||||
BOOL verbose;
|
||||
BOOL updateInProgress;
|
||||
}
|
||||
|
||||
// This IBAction is meant for a main menu item. Hook up any menu item to this action,
|
||||
// and Sparkle will check for updates and report back its findings verbosely.
|
||||
- (IBAction)checkForUpdates:sender;
|
||||
|
||||
// This method is similar to the above, but it's intended for updates initiated by
|
||||
// the computer instead of by the user. It does not alert the user when he is up to date,
|
||||
// and it remains silent about network errors in fetching the feed. This is what you
|
||||
// want to call to update programmatically; only use checkForUpdates: with buttons and menu items.
|
||||
- (void)checkForUpdatesInBackground;
|
||||
|
||||
// This method allows you to schedule a check to run every time interval. You can
|
||||
// pass 0 to this method to cancel a previously scheduled timer. You probably don't want
|
||||
// to call this directly: if you set a SUScheduledCheckInterval key in Info.plist or
|
||||
// the user defaults, Sparkle will set this up for you automatically on startup. You might
|
||||
// just want to call this every time the user changes the setting in the preferences.
|
||||
- (void)scheduleCheckWithInterval:(NSTimeInterval)interval;
|
||||
|
||||
@end
|
||||
@ -1,20 +0,0 @@
|
||||
//
|
||||
// SUUtilities.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/12/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
id SUInfoValueForKey(NSString *key);
|
||||
NSString *SUHostAppName();
|
||||
NSString *SUHostAppDisplayName();
|
||||
NSString *SUHostAppVersion();
|
||||
NSString *SUHostAppVersionString();
|
||||
|
||||
NSComparisonResult SUStandardVersionComparison(NSString * versionA, NSString * versionB);
|
||||
|
||||
// If running make localizable-strings for genstrings, ignore the error on this line.
|
||||
NSString *SULocalizedString(NSString *key, NSString *comment);
|
||||
@ -1,22 +0,0 @@
|
||||
//
|
||||
// Sparkle.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/16/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUUpdater.h"
|
||||
#import "SUUtilities.h"
|
||||
#import "SUConstants.h"
|
||||
#import "SUAppcast.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SUUpdateAlert.h"
|
||||
#import "SUAutomaticUpdateAlert.h"
|
||||
#import "SUStatusController.h"
|
||||
#import "SUUnarchiver.h"
|
||||
#import "SUStatusChecker.h"
|
||||
|
||||
#import "NSApplication+AppCopies.h"
|
||||
#import "NSFileManager+Authentication.h"
|
||||
#import "NSFileManager+Verification.h"
|
||||
BIN
Sparkle.framework/Versions/A/Resources/SUStatus.nib
generated
BIN
Sparkle.framework/Versions/A/Resources/SUStatus.nib
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user