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 |
298 |
|
- (IBAction) ChangeKeyboard: (NSPopUpButton *)sender |
299 |
|
{ |
300 |
|
// Deselest current item |
301 |
< |
int val = PrefsFindInt32("keyboardtype"); |
302 |
< |
int current = [keyboard indexOfItemWithTag: val]; |
303 |
< |
|
304 |
< |
if ( current ) |
301 |
> |
int current = [keyboard indexOfItemWithTag: PrefsFindInt32("keyboardtype")]; |
302 |
> |
if ( current != -1 ) |
303 |
|
[[keyboard itemAtIndex: current] setState: FALSE]; |
304 |
|
|
305 |
|
PrefsReplaceInt32("keyboardtype", [[sender selectedItem] tag]); |
772 |
|
// Lists of thingies: |
773 |
|
|
774 |
|
val = PrefsFindInt32("keyboardtype"); |
775 |
< |
[keyboard selectItemAtIndex: [keyboard indexOfItemWithTag: val]]; |
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]; |