Chromium Updater
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.3 KiB

13 years ago
  1. //
  2. // MGMGeneralPane.m
  3. // Chromatic
  4. //
  5. // Created by Mr. Gecko on 6/10/11.
  6. // Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
  7. //
  8. // Permission to use, copy, modify, and/or distribute this software for any purpose
  9. // with or without fee is hereby granted, provided that the above copyright notice
  10. // and this permission notice appear in all copies.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  13. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  14. // FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
  15. // OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  16. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  17. // ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  18. //
  19. #import "MGMGeneralPane.h"
  20. #import "MGMController.h"
  21. #import <MGMUsers/MGMUsers.h>
  22. @implementation MGMGeneralPane
  23. - (id)initWithPreferences:(MGMPreferences *)thePreferences {
  24. if ((self = [super initWithPreferences:thePreferences])) {
  25. if (![NSBundle loadNibNamed:@"GeneralPane" owner:self]) {
  26. NSLog(@"Unable to load Nib for General Preferences");
  27. [self release];
  28. self = nil;
  29. } else {
  30. [doneSoundButton setState:([preferences boolForKey:MGMDoneSound] ? NSOnState : NSOffState)];
  31. [launchWhenDoneButton setState:([preferences boolForKey:MGMLaunchWhenDone] ? NSOnState : NSOffState)];
  32. [quitAfterLaunchButton setState:([preferences boolForKey:MGMQuitAfterLaunch] ? NSOnState : NSOffState)];
  33. }
  34. }
  35. return self;
  36. }
  37. - (void)dealloc {
  38. [mainView release];
  39. [super dealloc];
  40. }
  41. + (void)setUpToolbarItem:(NSToolbarItem *)theItem {
  42. [theItem setLabel:[self title]];
  43. [theItem setPaletteLabel:[theItem label]];
  44. [theItem setImage:[NSImage imageNamed:@"General"]];
  45. }
  46. + (NSString *)title {
  47. return @"General";
  48. }
  49. - (NSView *)preferencesView {
  50. return mainView;
  51. }
  52. - (IBAction)save:(id)sender {
  53. [preferences setBool:([doneSoundButton state]==NSOnState) forKey:MGMDoneSound];
  54. [preferences setBool:([launchWhenDoneButton state]==NSOnState) forKey:MGMLaunchWhenDone];
  55. [preferences setBool:([quitAfterLaunchButton state]==NSOnState) forKey:MGMQuitAfterLaunch];
  56. }
  57. @end