Update of /cvsroot/macattrick/macattrick In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25064 Modified Files: Position.h Position.m PreferencesController.h PreferencesController.m Team.h Team.m Added Files: FormulasViewController.h FormulasViewController.m Log Message: formulas view added to preference panel, team logo loading added Index: Position.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Position.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Position.m 22 Jul 2004 11:54:01 -0000 1.5 --- Position.m 20 Jan 2005 20:46:01 -0000 1.6 *************** *** 161,164 **** --- 161,170 ---- } + - (double) playerFormRate { return playerFormRate; } + + + - (double) experienceRate { return experienceRate; } + + - (double)staminaRate { return staminaRate; --- NEW FILE: FormulasViewController.h --- //---- license ---------------------------------------------------------------// // // // Macattrick: a Manager Assistant Tool for the online Game Hattrick.org // // Copyright (C) 2004 Roman Bertolami // // // // this file is part of Macattrick application // // http://sourceforge.net/macattrick // // // // Macattrick 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. // // // // Macattrick 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. // // // // Macattrick, Copyright (C) 2004 Roman Bertolami // // Macattrick comes with ABSOLUTELY NO WARRANTY! // // // //---- eo licence ------------------------------------------------------------// #import <Cocoa/Cocoa.h> @interface FormulasViewController : NSObject { IBOutlet NSView *formulasView; } - (NSView *) formulasView; @end Index: PreferencesController.h =================================================================== RCS file: /cvsroot/macattrick/macattrick/PreferencesController.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PreferencesController.h 27 Jul 2004 19:32:28 -0000 1.2 --- PreferencesController.h 20 Jan 2005 20:46:01 -0000 1.3 *************** *** 28,35 **** --- 28,39 ---- #import <Cocoa/Cocoa.h> + #import "FormulasViewController.h" @interface PreferencesController : NSWindowController { IBOutlet NSUserDefaultsController *userDefaultsController; + FormulasViewController *formulasViewController; + IBOutlet NSTabView *tabView; + } - (IBAction)cancel:(id)sender; Index: Team.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Team.m,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Team.m 4 Jan 2005 18:23:29 -0000 1.19 --- Team.m 20 Jan 2005 20:46:01 -0000 1.20 *************** *** 38,41 **** --- 38,42 ---- - (void) setNumberOfVictories: (int) newNumberOfVictories; - (void) setNumberOfUndefeated: (int) newNumberOfUndefeated; + - (void) setLogo: (NSImage *) newLogo; @end *************** *** 97,100 **** --- 98,108 ---- } + - (NSImage *) logo { return logo; } + - (void) setLogo: (NSImage *) newLogo { + [newLogo retain]; + [logo release]; + logo = newLogo; + } + *************** *** 165,168 **** --- 173,188 ---- [url release]; } + else if ([elementName isEqualToString: @"LogoURL"]) { + NSURL *url = [[NSURL alloc] initWithString: currentStringValue]; + NSImage *image; + if(url) { + image = [[NSImage alloc]initWithContentsOfURL:url]; + } + if(!url || !image) { + image = [[NSImage alloc] initByReferencingFile: [NSString stringWithFormat: @"%@/icon.icns" , [[NSBundle mainBundle] resourcePath]]]; + } + [self setLogo:image]; + [image release]; + } [currentStringValue release]; currentStringValue = nil; --- NEW FILE: FormulasViewController.m --- //---- license ---------------------------------------------------------------// // // // Macattrick: a Manager Assistant Tool for the online Game Hattrick.org // // Copyright (C) 2004 Roman Bertolami // // // // this file is part of Macattrick application // // http://sourceforge.net/macattrick // // // // Macattrick 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. // // // // Macattrick 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. // // // // Macattrick, Copyright (C) 2004 Roman Bertolami // // Macattrick comes with ABSOLUTELY NO WARRANTY! // // // //---- eo licence ------------------------------------------------------------// #import "FormulasViewController.h" @implementation FormulasViewController -(FormulasViewController*) init { self = [super init]; [NSBundle loadNibNamed:@"FormulasView" owner: self]; return self; } - (NSView *) formulasView { return formulasView; } - (void) dealloc { [formulasView release]; [super dealloc]; } @end Index: Team.h =================================================================== RCS file: /cvsroot/macattrick/macattrick/Team.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Team.h 3 Oct 2004 12:33:47 -0000 1.13 --- Team.h 20 Jan 2005 20:46:01 -0000 1.14 *************** *** 46,50 **** NSString *teamName; NSURL *homepage; ! int numberOfVictories; int numberOfUndefeated; --- 46,50 ---- NSString *teamName; NSURL *homepage; ! NSImage *logo; int numberOfVictories; int numberOfUndefeated; *************** *** 86,90 **** */ - (NSURL *) homepage; ! /*! --- 86,94 ---- */ - (NSURL *) homepage; ! /*! ! @method logoURL ! @abstract URL of the Logo ! */ ! - (NSImage *) logo; /*! Index: PreferencesController.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/PreferencesController.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PreferencesController.m 27 Jul 2004 19:32:28 -0000 1.2 --- PreferencesController.m 20 Jan 2005 20:46:01 -0000 1.3 *************** *** 42,44 **** --- 42,60 ---- } + -(void) awakeFromNib { + if(!formulasViewController) { + formulasViewController = [[FormulasViewController alloc] init]; + } + [[tabView tabViewItemAtIndex:2] setView:[formulasViewController formulasView]]; + } + + + + - (void) dealloc { + [userDefaultsController release]; + [formulasViewController release]; + [super dealloc]; + } + + @end Index: Position.h =================================================================== RCS file: /cvsroot/macattrick/macattrick/Position.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Position.h 22 Jul 2004 11:54:01 -0000 1.4 --- Position.h 20 Jan 2005 20:46:01 -0000 1.5 *************** *** 58,61 **** --- 58,64 ---- - (NSString *)identifier; + + - (double) playerFormRate; + - (double) experienceRate; - (double)staminaRate; - (double)keeperRate; |