45 |
|
static void create_volumes_pane(GtkWidget *top); |
46 |
|
static void create_scsi_pane(GtkWidget *top); |
47 |
|
static void create_graphics_pane(GtkWidget *top); |
48 |
+ |
static void create_input_pane(GtkWidget *top); |
49 |
|
static void create_serial_pane(GtkWidget *top); |
50 |
|
static void create_memory_pane(GtkWidget *top); |
51 |
|
static void read_settings(void); |
298 |
|
create_volumes_pane(notebook); |
299 |
|
create_scsi_pane(notebook); |
300 |
|
create_graphics_pane(notebook); |
301 |
+ |
create_input_pane(notebook); |
302 |
|
create_serial_pane(notebook); |
303 |
|
create_memory_pane(notebook); |
304 |
|
|
402 |
|
} |
403 |
|
|
404 |
|
// "Boot From" selected |
405 |
< |
static void mn_boot_any(...) {PrefsReplaceInt16("bootdriver", 0);} |
406 |
< |
static void mn_boot_cdrom(...) {PrefsReplaceInt16("bootdriver", CDROMRefNum);} |
405 |
> |
static void mn_boot_any(...) {PrefsReplaceInt32("bootdriver", 0);} |
406 |
> |
static void mn_boot_cdrom(...) {PrefsReplaceInt32("bootdriver", CDROMRefNum);} |
407 |
|
|
408 |
|
// "No CD-ROM Driver" button toggled |
409 |
|
static void tb_nocdrom(GtkWidget *widget) |
466 |
|
{STR_BOOT_CDROM_LAB, GTK_SIGNAL_FUNC(mn_boot_cdrom)}, |
467 |
|
{0, NULL} |
468 |
|
}; |
469 |
< |
int bootdriver = PrefsFindInt16("bootdriver"), active = 0; |
469 |
> |
int bootdriver = PrefsFindInt32("bootdriver"), active = 0; |
470 |
|
switch (bootdriver) { |
471 |
|
case 0: active = 0; break; |
472 |
|
case CDROMRefNum: active = 1; break; |
577 |
|
static void mn_15hz(...) {PrefsReplaceInt32("frameskip", 4);} |
578 |
|
static void mn_30hz(...) {PrefsReplaceInt32("frameskip", 2);} |
579 |
|
static void mn_60hz(...) {PrefsReplaceInt32("frameskip", 1);} |
580 |
+ |
static void mn_dynamic(...) {PrefsReplaceInt32("frameskip", 0);} |
581 |
|
|
582 |
|
// "Disable Sound Output" button toggled |
583 |
|
static void tb_nosound(GtkWidget *widget) |
683 |
|
add_menu_item(menu, STR_REF_15HZ_LAB, GTK_SIGNAL_FUNC(mn_15hz)); |
684 |
|
add_menu_item(menu, STR_REF_30HZ_LAB, GTK_SIGNAL_FUNC(mn_30hz)); |
685 |
|
add_menu_item(menu, STR_REF_60HZ_LAB, GTK_SIGNAL_FUNC(mn_60hz)); |
686 |
+ |
add_menu_item(menu, STR_REF_DYNAMIC_LAB, GTK_SIGNAL_FUNC(mn_dynamic)); |
687 |
|
int frameskip = PrefsFindInt32("frameskip"); |
688 |
+ |
int item = -1; |
689 |
|
switch (frameskip) { |
690 |
< |
case 12: |
691 |
< |
gtk_menu_set_active(GTK_MENU(menu), 0); |
692 |
< |
break; |
693 |
< |
case 8: |
694 |
< |
gtk_menu_set_active(GTK_MENU(menu), 1); |
695 |
< |
break; |
696 |
< |
case 6: |
692 |
< |
gtk_menu_set_active(GTK_MENU(menu), 2); |
693 |
< |
break; |
694 |
< |
case 4: |
695 |
< |
gtk_menu_set_active(GTK_MENU(menu), 3); |
696 |
< |
break; |
697 |
< |
case 2: |
698 |
< |
gtk_menu_set_active(GTK_MENU(menu), 4); |
699 |
< |
break; |
700 |
< |
case 1: |
701 |
< |
gtk_menu_set_active(GTK_MENU(menu), 5); |
702 |
< |
break; |
690 |
> |
case 12: item = 0; break; |
691 |
> |
case 8: item = 1; break; |
692 |
> |
case 6: item = 2; break; |
693 |
> |
case 4: item = 3; break; |
694 |
> |
case 2: item = 4; break; |
695 |
> |
case 1: item = 5; break; |
696 |
> |
case 0: item = 6; break; |
697 |
|
} |
698 |
+ |
if (item >= 0) |
699 |
+ |
gtk_menu_set_active(GTK_MENU(menu), item); |
700 |
|
gtk_option_menu_set_menu(GTK_OPTION_MENU(w_frameskip), menu); |
701 |
|
gtk_table_attach(GTK_TABLE(table), w_frameskip, 1, 2, 1, 2, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4); |
702 |
|
|
755 |
|
w_fbdevice_file = make_entry(box, STR_FBDEVICE_FILE_CTRL, "fbdevicefile"); |
756 |
|
#endif |
757 |
|
|
758 |
+ |
make_separator(box); |
759 |
|
make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound)); |
760 |
|
|
761 |
|
hide_show_graphics_widgets(); |
763 |
|
|
764 |
|
|
765 |
|
/* |
766 |
+ |
* "Input" pane |
767 |
+ |
*/ |
768 |
+ |
|
769 |
+ |
static GtkWidget *w_keycode_file; |
770 |
+ |
static GtkWidget *w_mouse_wheel_lines; |
771 |
+ |
|
772 |
+ |
// Set sensitivity of widgets |
773 |
+ |
static void set_input_sensitive(void) |
774 |
+ |
{ |
775 |
+ |
gtk_widget_set_sensitive(w_keycode_file, PrefsFindBool("keycodes")); |
776 |
+ |
gtk_widget_set_sensitive(w_mouse_wheel_lines, PrefsFindInt32("mousewheelmode") == 1); |
777 |
+ |
} |
778 |
+ |
|
779 |
+ |
// "Use Raw Keycodes" button toggled |
780 |
+ |
static void tb_keycodes(GtkWidget *widget) |
781 |
+ |
{ |
782 |
+ |
PrefsReplaceBool("keycodes", GTK_TOGGLE_BUTTON(widget)->active); |
783 |
+ |
set_input_sensitive(); |
784 |
+ |
} |
785 |
+ |
|
786 |
+ |
// "Mouse Wheel Mode" selected |
787 |
+ |
static void mn_wheel_page(...) {PrefsReplaceInt32("mousewheelmode", 0); set_input_sensitive();} |
788 |
+ |
static void mn_wheel_cursor(...) {PrefsReplaceInt32("mousewheelmode", 1); set_input_sensitive();} |
789 |
+ |
|
790 |
+ |
// Read settings from widgets and set preferences |
791 |
+ |
static void read_input_settings(void) |
792 |
+ |
{ |
793 |
+ |
const char *str = gtk_entry_get_text(GTK_ENTRY(w_keycode_file)); |
794 |
+ |
if (str && strlen(str)) |
795 |
+ |
PrefsReplaceString("keycodefile", str); |
796 |
+ |
else |
797 |
+ |
PrefsRemoveItem("keycodefile"); |
798 |
+ |
|
799 |
+ |
PrefsReplaceInt32("mousewheellines", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w_mouse_wheel_lines))); |
800 |
+ |
} |
801 |
+ |
|
802 |
+ |
// Create "Input" pane |
803 |
+ |
static void create_input_pane(GtkWidget *top) |
804 |
+ |
{ |
805 |
+ |
GtkWidget *box, *hbox, *menu, *label; |
806 |
+ |
GtkObject *adj; |
807 |
+ |
|
808 |
+ |
box = make_pane(top, STR_INPUT_PANE_TITLE); |
809 |
+ |
|
810 |
+ |
make_checkbox(box, STR_KEYCODES_CTRL, "keycodes", GTK_SIGNAL_FUNC(tb_keycodes)); |
811 |
+ |
w_keycode_file = make_entry(box, STR_KEYCODE_FILE_CTRL, "keycodefile"); |
812 |
+ |
|
813 |
+ |
make_separator(box); |
814 |
+ |
|
815 |
+ |
static const opt_desc options[] = { |
816 |
+ |
{STR_MOUSEWHEELMODE_PAGE_LAB, GTK_SIGNAL_FUNC(mn_wheel_page)}, |
817 |
+ |
{STR_MOUSEWHEELMODE_CURSOR_LAB, GTK_SIGNAL_FUNC(mn_wheel_cursor)}, |
818 |
+ |
{0, NULL} |
819 |
+ |
}; |
820 |
+ |
int wheelmode = PrefsFindInt32("mousewheelmode"), active = 0; |
821 |
+ |
switch (wheelmode) { |
822 |
+ |
case 0: active = 0; break; |
823 |
+ |
case 1: active = 1; break; |
824 |
+ |
} |
825 |
+ |
menu = make_option_menu(box, STR_MOUSEWHEELMODE_CTRL, options, active); |
826 |
+ |
|
827 |
+ |
hbox = gtk_hbox_new(FALSE, 4); |
828 |
+ |
gtk_widget_show(hbox); |
829 |
+ |
gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
830 |
+ |
|
831 |
+ |
label = gtk_label_new(GetString(STR_MOUSEWHEELLINES_CTRL)); |
832 |
+ |
gtk_widget_show(label); |
833 |
+ |
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
834 |
+ |
|
835 |
+ |
adj = gtk_adjustment_new(PrefsFindInt32("mousewheellines"), 1, 1000, 1, 5, 0); |
836 |
+ |
w_mouse_wheel_lines = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 0.0, 0); |
837 |
+ |
gtk_widget_show(w_mouse_wheel_lines); |
838 |
+ |
gtk_box_pack_start(GTK_BOX(hbox), w_mouse_wheel_lines, FALSE, FALSE, 0); |
839 |
+ |
|
840 |
+ |
set_input_sensitive(); |
841 |
+ |
} |
842 |
+ |
|
843 |
+ |
|
844 |
+ |
/* |
845 |
|
* "Serial/Network" pane |
846 |
|
*/ |
847 |
|
|
946 |
|
// Create "Serial/Network" pane |
947 |
|
static void create_serial_pane(GtkWidget *top) |
948 |
|
{ |
949 |
< |
GtkWidget *box, *table, *label, *combo; |
949 |
> |
GtkWidget *box, *table, *label, *combo, *sep; |
950 |
|
GList *glist = add_serial_names(); |
951 |
|
|
952 |
|
box = make_pane(top, STR_SERIAL_NETWORK_PANE_TITLE); |
953 |
< |
table = make_table(box, 2, 3); |
953 |
> |
table = make_table(box, 2, 4); |
954 |
|
|
955 |
|
label = gtk_label_new(GetString(STR_SERIALA_CTRL)); |
956 |
|
gtk_widget_show(label); |
980 |
|
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 1, 2, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
981 |
|
w_serialb = GTK_COMBO(combo)->entry; |
982 |
|
|
983 |
+ |
sep = gtk_hseparator_new(); |
984 |
+ |
gtk_widget_show(sep); |
985 |
+ |
gtk_table_attach(GTK_TABLE(table), sep, 0, 2, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
986 |
+ |
|
987 |
|
label = gtk_label_new(GetString(STR_ETHERNET_IF_CTRL)); |
988 |
|
gtk_widget_show(label); |
989 |
< |
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
989 |
> |
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
990 |
|
|
991 |
|
glist = add_ether_names(); |
992 |
|
combo = gtk_combo_new(); |
996 |
|
if (str == NULL) |
997 |
|
str = ""; |
998 |
|
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str); |
999 |
< |
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 2, 3, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
999 |
> |
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
1000 |
|
w_ether = GTK_COMBO(combo)->entry; |
1001 |
|
} |
1002 |
|
|
1007 |
|
|
1008 |
|
static GtkObject *w_ramsize_adj; |
1009 |
|
static GtkWidget *w_rom_file; |
930 |
– |
static GtkWidget *w_keycode_file; |
1010 |
|
|
1011 |
|
// Model ID selected |
1012 |
|
static void mn_modelid_5(...) {PrefsReplaceInt32("modelid", 5);} |
1019 |
|
static void mn_cpu_68030_fpu(...) {PrefsReplaceInt32("cpu", 3); PrefsReplaceBool("fpu", true);} |
1020 |
|
static void mn_cpu_68040(...) {PrefsReplaceInt32("cpu", 4); PrefsReplaceBool("fpu", true);} |
1021 |
|
|
943 |
– |
// "Use Raw Keycodes" button toggled |
944 |
– |
static void tb_keycodes(GtkWidget *widget) |
945 |
– |
{ |
946 |
– |
PrefsReplaceBool("keycodes", GTK_TOGGLE_BUTTON(widget)->active); |
947 |
– |
} |
948 |
– |
|
1022 |
|
// Read settings from widgets and set preferences |
1023 |
|
static void read_memory_settings(void) |
1024 |
|
{ |
1030 |
|
else |
1031 |
|
PrefsRemoveItem("rom"); |
1032 |
|
|
960 |
– |
str = gtk_entry_get_text(GTK_ENTRY(w_keycode_file)); |
961 |
– |
if (str && strlen(str)) |
962 |
– |
PrefsReplaceString("keycodefile", str); |
963 |
– |
else |
964 |
– |
PrefsRemoveItem("keycodefile"); |
1033 |
|
} |
1034 |
|
|
1035 |
|
// Create "Memory/Misc" pane |
1036 |
|
static void create_memory_pane(GtkWidget *top) |
1037 |
|
{ |
1038 |
< |
GtkWidget *box, *vbox, *hbox, *hbox2, *label, *scale, *menu; |
1038 |
> |
GtkWidget *box, *hbox, *vbox, *hbox2, *label, *scale, *menu; |
1039 |
|
|
1040 |
|
box = make_pane(top, STR_MEMORY_MISC_PANE_TITLE); |
1041 |
|
|
1110 |
|
#endif |
1111 |
|
|
1112 |
|
w_rom_file = make_entry(box, STR_ROM_FILE_CTRL, "rom"); |
1045 |
– |
|
1046 |
– |
make_checkbox(box, STR_KEYCODES_CTRL, "keycodes", GTK_SIGNAL_FUNC(tb_keycodes)); |
1047 |
– |
w_keycode_file = make_entry(box, STR_KEYCODE_FILE_CTRL, "keycodefile"); |
1113 |
|
} |
1114 |
|
|
1115 |
|
|
1122 |
|
read_volumes_settings(); |
1123 |
|
read_scsi_settings(); |
1124 |
|
read_graphics_settings(); |
1125 |
+ |
read_input_settings(); |
1126 |
|
read_serial_settings(); |
1127 |
|
read_memory_settings(); |
1128 |
|
} |