ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/MacOSX/PrefsEditor.mm
(Generate patch)

Comparing BasiliskII/src/MacOSX/PrefsEditor.mm (file contents):
Revision 1.10 by nigel, 2003-04-02T02:19:53Z vs.
Revision 1.13 by cebix, 2004-01-12T15:29:24Z

# Line 4 | Line 4
4   *
5   *      $Id$
6   *
7 < *  Basilisk II (C) 1997-2003 Christian Bauer
7 > *  Basilisk II (C) 1997-2004 Christian Bauer
8   *
9   *  This program is free software; you can redistribute it and/or modify
10   *  it under the terms of the GNU General Public License as published by
# Line 295 | Line 295 | extern string UserPrefsPath;   // from pre
295          edited = YES;
296   }
297  
298 + - (IBAction) ChangeKeyboard: (NSPopUpButton *)sender
299 + {
300 +        // Deselest current item
301 +        int  current = [keyboard indexOfItemWithTag: PrefsFindInt32("keyboardtype")];
302 +        if ( current != -1 )
303 +                [[keyboard itemAtIndex: current] setState: FALSE];
304 +
305 +        PrefsReplaceInt32("keyboardtype", [[sender selectedItem] tag]);
306 +        edited = YES;
307 + }
308 +
309   - (IBAction) ChangeModel: (NSMatrix *)sender
310   {
311          PrefsReplaceInt32("modelid", [[sender selectedCell] tag]);
# Line 676 | Line 687 | shouldProceedAfterError: (NSDictionary *
687   {
688          NSTableColumn   *locks;
689          const char              *str;
690 <        int                             cpu, tmp;
690 >        int                             cpu, tmp, val;
691  
692  
693          // Set simple single field items
694  
695 <        tmp = PrefsFindInt32("frameskip");
696 <        [delay setIntValue: tmp];
697 <        if ( tmp )
698 <                [frequency      setFloatValue:  60.0 / tmp];
695 >        val = PrefsFindInt32("frameskip");
696 >        [delay setIntValue: val];
697 >        if ( val )
698 >                [frequency      setFloatValue:  60.0 / val];
699          else
700                  [frequency      setFloatValue:  60.0];
701  
702 <        tmp = PrefsFindInt32("ramsize");
703 <        [bytes  setIntValue:   tmp];
704 <        [MB             setFloatValue: tmp / (1024.0 * 1024.0)];
702 >        val = PrefsFindInt32("ramsize");
703 >        [bytes  setIntValue:   val];
704 >        [MB             setFloatValue: val / (1024.0 * 1024.0)];
705  
706          [disableCD              setState:       PrefsFindBool("nocdrom")];
707          [disableSound   setState:       PrefsFindBool("nosound")];
# Line 722 | Line 733 | shouldProceedAfterError: (NSDictionary *
733  
734          // Radio button groups:
735  
736 <        tmp = PrefsFindInt32("bootdriver");
737 <        [bootFromAny setState: tmp != CDROMRefNum];
738 <        [bootFromCD  setState: tmp == CDROMRefNum];
736 >        val = PrefsFindInt32("bootdriver");
737 >        [bootFromAny setState: val != CDROMRefNum];
738 >        [bootFromCD  setState: val == CDROMRefNum];
739  
740          cpu = PrefsFindInt32("cpu");
741 <        tmp = PrefsFindInt32("modelid");
741 >        val = PrefsFindInt32("modelid");
742  
743   #if REAL_ADDRESSING || DIRECT_ADDRESSING
744          puts("Current memory model does not support 24bit addressing");
745 <        if ( tmp == [classic tag] )
745 >        if ( val == [classic tag] )
746          {
747                  // Window already created by NIB file, just display
748                  [panel makeKeyAndOrderFront:self];
# Line 739 | Line 750 | shouldProceedAfterError: (NSDictionary *
750                                                  @"Disabling Mac Classic emulation", nil, panel);
751                  cpu = [CPU68030 tag];
752                  PrefsReplaceInt32("cpu", cpu);
753 <                tmp = [IIci tag];
754 <                PrefsReplaceInt32("modelid", tmp);
753 >                val = [IIci tag];
754 >                PrefsReplaceInt32("modelid", val);
755          }
756  
757          puts("Disabling 68000 & Mac Classic buttons");
# Line 753 | Line 764 | shouldProceedAfterError: (NSDictionary *
764          [CPU68030   setState: [CPU68030  tag] == cpu];
765          [CPU68040   setState: [CPU68040  tag] == cpu];
766  
767 <        [classic        setState: [classic       tag] == tmp];
768 <        [IIci           setState: [IIci          tag] == tmp];
769 <        [quadra900      setState: [quadra900 tag] == tmp];
767 >        [classic        setState: [classic       tag] == val];
768 >        [IIci           setState: [IIci          tag] == val];
769 >        [quadra900      setState: [quadra900 tag] == val];
770  
771  
772          // Lists of thingies:
773  
774 +        val = PrefsFindInt32("keyboardtype");
775 +        tmp = [keyboard indexOfItemWithTag: val];
776 +        if ( tmp != -1 )
777 +                [keyboard selectItemAtIndex: tmp];
778 +        for ( tmp = 0; tmp < [keyboard numberOfItems]; ++tmp )
779 +        {
780 +                NSMenuItem      *type = [keyboard itemAtIndex: tmp];
781 +                [type setState: [type tag] == val];
782 +        }
783 +
784 +
785          for ( tmp = 0; tmp < 7; ++tmp)
786          {
787                  char pref[6];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines