1 |
|
/* |
2 |
|
* prefs_editor_beos.cpp - Preferences editor, BeOS implementation |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2001 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
33 |
|
#include "cdrom.h" |
34 |
|
#include "xpram.h" |
35 |
|
#include "prefs.h" |
36 |
< |
#include "version.h" |
36 |
> |
#include "about_window.h" |
37 |
|
#include "user_strings.h" |
38 |
|
#include "prefs_editor.h" |
39 |
|
|
84 |
|
const uint32 MSG_RAMSIZE = 'rmsz'; // "Memory/Misc" pane |
85 |
|
const uint32 MSG_MODELID_5 = 'mi05'; |
86 |
|
const uint32 MSG_MODELID_14 = 'mi14'; |
87 |
< |
const uint32 MSG_FPU = 'fpu '; |
87 |
> |
const uint32 MSG_CPU_68020 = 'cpu2'; |
88 |
> |
const uint32 MSG_CPU_68020_FPU = 'cpf2'; |
89 |
> |
const uint32 MSG_CPU_68030 = 'cpu3'; |
90 |
> |
const uint32 MSG_CPU_68030_FPU = 'cpf3'; |
91 |
> |
const uint32 MSG_CPU_68040 = 'cpu4'; |
92 |
|
|
93 |
|
|
94 |
|
// RAM size slider class |
302 |
|
bar->AddItem(menu); |
303 |
|
AddChild(bar); |
304 |
|
SetKeyMenuBar(bar); |
305 |
< |
int mbar_height = bar->Bounds().bottom + 1; |
305 |
> |
int mbar_height = int(bar->Bounds().bottom) + 1; |
306 |
|
|
307 |
|
// Resize window to fit menu bar |
308 |
|
ResizeBy(0, mbar_height); |
425 |
|
menu->AddItem(new BMenuItem(GetString(STR_BOOT_ANY_LAB), new BMessage(MSG_BOOT_ANY))); |
426 |
|
menu->AddItem(new BMenuItem(GetString(STR_BOOT_CDROM_LAB), new BMessage(MSG_BOOT_CDROM))); |
427 |
|
pane->AddChild(menu_field); |
428 |
< |
int16 i16 = PrefsFindInt16("bootdriver"); |
428 |
> |
int32 i32 = PrefsFindInt32("bootdriver"); |
429 |
|
BMenuItem *item; |
430 |
< |
if (i16 == 0) { |
430 |
> |
if (i32 == 0) { |
431 |
|
if ((item = menu->FindItem(GetString(STR_BOOT_ANY_LAB))) != NULL) |
432 |
|
item->SetMarked(true); |
433 |
< |
} else if (i16 == CDROMRefNum) { |
433 |
> |
} else if (i32 == CDROMRefNum) { |
434 |
|
if ((item = menu->FindItem(GetString(STR_BOOT_CDROM_LAB))) != NULL) |
435 |
|
item->SetMarked(true); |
436 |
|
} |
712 |
|
item->SetMarked(true); |
713 |
|
pane->AddChild(menu_field); |
714 |
|
|
715 |
< |
rom_control = new PathControl(false, BRect(10, 82, right, 97), "rom", GetString(STR_ROM_FILE_CTRL), PrefsFindString("rom"), NULL); |
715 |
> |
int cpu = PrefsFindInt32("cpu"); |
716 |
> |
bool fpu = PrefsFindBool("fpu"); |
717 |
> |
menu = new BPopUpMenu(""); |
718 |
> |
menu_field = new BMenuField(BRect(10, 82, right, 97), "cpu", GetString(STR_CPU_CTRL), menu); |
719 |
> |
menu_field->SetDivider(120); |
720 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68020_LAB), new BMessage(MSG_CPU_68020))); |
721 |
> |
if (cpu == 2 && !fpu) |
722 |
> |
item->SetMarked(true); |
723 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68020_FPU_LAB), new BMessage(MSG_CPU_68020_FPU))); |
724 |
> |
if (cpu == 2 && fpu) |
725 |
> |
item->SetMarked(true); |
726 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68030_LAB), new BMessage(MSG_CPU_68030))); |
727 |
> |
if (cpu == 3 && !fpu) |
728 |
> |
item->SetMarked(true); |
729 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68030_FPU_LAB), new BMessage(MSG_CPU_68030_FPU))); |
730 |
> |
if (cpu == 3 && fpu) |
731 |
> |
item->SetMarked(true); |
732 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68040_LAB), new BMessage(MSG_CPU_68040))); |
733 |
> |
if (cpu == 4) |
734 |
> |
item->SetMarked(true); |
735 |
> |
pane->AddChild(menu_field); |
736 |
> |
|
737 |
> |
rom_control = new PathControl(false, BRect(10, 104, right, 119), "rom", GetString(STR_ROM_FILE_CTRL), PrefsFindString("rom"), NULL); |
738 |
|
rom_control->SetDivider(117); |
739 |
|
pane->AddChild(rom_control); |
740 |
|
|
715 |
– |
fpu_checkbox = new BCheckBox(BRect(10, 100, right, 115), "fpu", GetString(STR_FPU_CTRL), new BMessage(MSG_FPU)); |
716 |
– |
pane->AddChild(fpu_checkbox); |
717 |
– |
fpu_checkbox->SetValue(PrefsFindBool("fpu") ? B_CONTROL_ON : B_CONTROL_OFF); |
718 |
– |
|
741 |
|
return pane; |
742 |
|
} |
743 |
|
|
767 |
|
break; |
768 |
|
|
769 |
|
case B_ABOUT_REQUESTED: { // "About" menu item selected |
770 |
< |
char str[256]; |
749 |
< |
sprintf(str, GetString(STR_ABOUT_TEXT1), VERSION_MAJOR, VERSION_MINOR); |
750 |
< |
strcat(str, " "); |
751 |
< |
strcat(str, GetString(STR_ABOUT_TEXT2)); |
752 |
< |
BAlert *about = new BAlert(GetString(STR_WINDOW_TITLE), str, GetString(STR_OK_BUTTON)); |
753 |
< |
about->Go(); |
770 |
> |
ShowAboutWindow(); |
771 |
|
break; |
772 |
|
} |
773 |
|
|
870 |
|
} |
871 |
|
|
872 |
|
case MSG_BOOT_ANY: |
873 |
< |
PrefsReplaceInt16("bootdriver", 0); |
873 |
> |
PrefsReplaceInt32("bootdriver", 0); |
874 |
|
break; |
875 |
|
|
876 |
|
case MSG_BOOT_CDROM: |
877 |
< |
PrefsReplaceInt16("bootdriver", CDROMRefNum); |
877 |
> |
PrefsReplaceInt32("bootdriver", CDROMRefNum); |
878 |
|
break; |
879 |
|
|
880 |
|
case MSG_NOCDROM: |
950 |
|
PrefsReplaceInt32("modelid", 14); |
951 |
|
break; |
952 |
|
|
953 |
< |
case MSG_FPU: |
954 |
< |
PrefsReplaceBool("fpu", fpu_checkbox->Value() == B_CONTROL_ON); |
953 |
> |
case MSG_CPU_68020: |
954 |
> |
PrefsReplaceInt32("cpu", 2); |
955 |
> |
PrefsReplaceBool("fpu", false); |
956 |
> |
break; |
957 |
> |
|
958 |
> |
case MSG_CPU_68020_FPU: |
959 |
> |
PrefsReplaceInt32("cpu", 2); |
960 |
> |
PrefsReplaceBool("fpu", true); |
961 |
> |
break; |
962 |
> |
|
963 |
> |
case MSG_CPU_68030: |
964 |
> |
PrefsReplaceInt32("cpu", 3); |
965 |
> |
PrefsReplaceBool("fpu", false); |
966 |
> |
break; |
967 |
> |
|
968 |
> |
case MSG_CPU_68030_FPU: |
969 |
> |
PrefsReplaceInt32("cpu", 3); |
970 |
> |
PrefsReplaceBool("fpu", true); |
971 |
> |
break; |
972 |
> |
|
973 |
> |
case MSG_CPU_68040: |
974 |
> |
PrefsReplaceInt32("cpu", 4); |
975 |
> |
PrefsReplaceBool("fpu", true); |
976 |
|
break; |
977 |
|
|
978 |
|
default: { |