20 |
|
|
21 |
|
#include "sysdeps.h" |
22 |
|
|
23 |
< |
#include <gtk/gtk.h> |
23 |
> |
#include <fcntl.h> |
24 |
> |
#include <sys/stat.h> |
25 |
|
#include <stdlib.h> |
26 |
+ |
#include <gtk/gtk.h> |
27 |
|
|
28 |
|
#include "user_strings.h" |
29 |
|
#include "version.h" |
159 |
|
return table; |
160 |
|
} |
161 |
|
|
162 |
+ |
static GtkWidget *table_make_option_menu(GtkWidget *table, int row, int label_id, const opt_desc *options, int active) |
163 |
+ |
{ |
164 |
+ |
GtkWidget *label, *opt, *menu; |
165 |
+ |
|
166 |
+ |
label = gtk_label_new(GetString(label_id)); |
167 |
+ |
gtk_widget_show(label); |
168 |
+ |
gtk_table_attach(GTK_TABLE(table), label, 0, 1, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
169 |
+ |
|
170 |
+ |
opt = gtk_option_menu_new(); |
171 |
+ |
gtk_widget_show(opt); |
172 |
+ |
menu = gtk_menu_new(); |
173 |
+ |
|
174 |
+ |
while (options->label_id) { |
175 |
+ |
add_menu_item(menu, options->label_id, options->func); |
176 |
+ |
options++; |
177 |
+ |
} |
178 |
+ |
gtk_menu_set_active(GTK_MENU(menu), active); |
179 |
+ |
|
180 |
+ |
gtk_option_menu_set_menu(GTK_OPTION_MENU(opt), menu); |
181 |
+ |
gtk_table_attach(GTK_TABLE(table), opt, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
182 |
+ |
return menu; |
183 |
+ |
} |
184 |
+ |
|
185 |
+ |
static GtkWidget *table_make_combobox(GtkWidget *table, int row, int label_id, const char *default_value, GList *glist) |
186 |
+ |
{ |
187 |
+ |
GtkWidget *label, *combo; |
188 |
+ |
char str[32]; |
189 |
+ |
|
190 |
+ |
label = gtk_label_new(GetString(label_id)); |
191 |
+ |
gtk_widget_show(label); |
192 |
+ |
gtk_table_attach(GTK_TABLE(table), label, 0, 1, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
193 |
+ |
|
194 |
+ |
combo = gtk_combo_new(); |
195 |
+ |
gtk_widget_show(combo); |
196 |
+ |
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist); |
197 |
+ |
|
198 |
+ |
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), default_value); |
199 |
+ |
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
200 |
+ |
|
201 |
+ |
return combo; |
202 |
+ |
} |
203 |
+ |
|
204 |
+ |
static GtkWidget *table_make_combobox(GtkWidget *table, int row, int label_id, const char *default_value, const combo_desc *options) |
205 |
+ |
{ |
206 |
+ |
GList *glist = NULL; |
207 |
+ |
while (options->label_id) { |
208 |
+ |
glist = g_list_append(glist, (void *)GetString(options->label_id)); |
209 |
+ |
options++; |
210 |
+ |
} |
211 |
+ |
|
212 |
+ |
return table_make_combobox(table, row, label_id, default_value, glist); |
213 |
+ |
} |
214 |
+ |
|
215 |
+ |
static GtkWidget *table_make_file_entry(GtkWidget *table, int row, int label_id, const char *prefs_item, bool only_dirs = false) |
216 |
+ |
{ |
217 |
+ |
GtkWidget *box, *label, *entry, *button; |
218 |
+ |
|
219 |
+ |
label = gtk_label_new(GetString(label_id)); |
220 |
+ |
gtk_widget_show(label); |
221 |
+ |
gtk_table_attach(GTK_TABLE(table), label, 0, 1, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
222 |
+ |
|
223 |
+ |
const char *str = PrefsFindString(prefs_item); |
224 |
+ |
if (str == NULL) |
225 |
+ |
str = ""; |
226 |
+ |
|
227 |
+ |
box = gtk_hbox_new(FALSE, 4); |
228 |
+ |
gtk_widget_show(box); |
229 |
+ |
gtk_table_attach(GTK_TABLE(table), box, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
230 |
+ |
|
231 |
+ |
entry = gtk_entry_new(); |
232 |
+ |
gtk_entry_set_text(GTK_ENTRY(entry), str); |
233 |
+ |
gtk_widget_show(entry); |
234 |
+ |
gtk_box_pack_start(GTK_BOX(box), entry, TRUE, TRUE, 0); |
235 |
+ |
|
236 |
+ |
button = make_browse_button(entry); |
237 |
+ |
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0); |
238 |
+ |
g_object_set_data(G_OBJECT(entry), "chooser_button", button); |
239 |
+ |
return entry; |
240 |
+ |
} |
241 |
+ |
|
242 |
|
static GtkWidget *make_option_menu(GtkWidget *top, int label_id, const opt_desc *options, int active) |
243 |
|
{ |
244 |
|
GtkWidget *box, *label, *opt, *menu; |
491 |
|
* "Volumes" pane |
492 |
|
*/ |
493 |
|
|
494 |
+ |
static GtkWidget *w_enableextfs, *w_extdrives; |
495 |
|
static GtkWidget *volume_list; |
496 |
|
static int selected_volume; |
497 |
|
|
498 |
+ |
// Set sensitivity of widgets |
499 |
+ |
static void set_volumes_sensitive(void) |
500 |
+ |
{ |
501 |
+ |
const bool enable_extfs = PrefsFindBool("enableextfs"); |
502 |
+ |
gtk_widget_set_sensitive(w_extdrives, enable_extfs); |
503 |
+ |
} |
504 |
+ |
|
505 |
|
// Volume in list selected |
506 |
|
static void cl_selected(GtkWidget *list, int row, int column) |
507 |
|
{ |
523 |
|
gchar *file = (gchar *)gtk_file_selection_get_filename(GTK_FILE_SELECTION(assoc->req)); |
524 |
|
|
525 |
|
const gchar *str = gtk_entry_get_text(GTK_ENTRY(assoc->entry)); |
526 |
< |
int size = atoi(str); |
526 |
> |
size_t size = atoi(str) << 20; |
527 |
|
|
528 |
< |
char cmd[1024]; |
529 |
< |
sprintf(cmd, "dd if=/dev/zero \"of=%s\" bs=1024k count=%d", file, size); |
530 |
< |
int ret = system(cmd); |
441 |
< |
if (ret == 0) |
528 |
> |
int fd = _open(file, _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC, _S_IREAD | _S_IWRITE); |
529 |
> |
if (fd >= 0) { |
530 |
> |
if (_chsize(fd, size) == 0) |
531 |
|
gtk_clist_append(GTK_CLIST(volume_list), &file); |
532 |
+ |
_close(fd); |
533 |
+ |
} |
534 |
|
gtk_widget_destroy(GTK_WIDGET(assoc->req)); |
535 |
|
delete assoc; |
536 |
|
} |
579 |
|
static void mn_boot_any(...) {PrefsReplaceInt32("bootdriver", 0);} |
580 |
|
static void mn_boot_cdrom(...) {PrefsReplaceInt32("bootdriver", CDROMRefNum);} |
581 |
|
|
582 |
+ |
// "Enable external file system" button toggled |
583 |
+ |
static void tb_enableextfs(GtkWidget *widget) |
584 |
+ |
{ |
585 |
+ |
PrefsReplaceBool("enableextfs", GTK_TOGGLE_BUTTON(widget)->active); |
586 |
+ |
set_volumes_sensitive(); |
587 |
+ |
} |
588 |
+ |
|
589 |
|
// "No CD-ROM Driver" button toggled |
590 |
|
static void tb_nocdrom(GtkWidget *widget) |
591 |
|
{ |
592 |
|
PrefsReplaceBool("nocdrom", GTK_TOGGLE_BUTTON(widget)->active); |
593 |
|
} |
594 |
|
|
595 |
+ |
// "Enable polling" button toggled |
596 |
+ |
static void tb_pollmedia(GtkWidget *widget) |
597 |
+ |
{ |
598 |
+ |
PrefsReplaceBool("pollmedia", GTK_TOGGLE_BUTTON(widget)->active); |
599 |
+ |
} |
600 |
+ |
|
601 |
|
// Read settings from widgets and set preferences |
602 |
|
static void read_volumes_settings(void) |
603 |
|
{ |
609 |
|
gtk_clist_get_text(GTK_CLIST(volume_list), i, 0, &str); |
610 |
|
PrefsAddString("disk", str); |
611 |
|
} |
612 |
+ |
|
613 |
+ |
PrefsReplaceString("extdrives", get_file_entry_path(w_extdrives)); |
614 |
|
} |
615 |
|
|
616 |
|
// Create "Volumes" pane |
659 |
|
menu = make_option_menu(box, STR_BOOTDRIVER_CTRL, options, active); |
660 |
|
|
661 |
|
make_checkbox(box, STR_NOCDROM_CTRL, "nocdrom", GTK_SIGNAL_FUNC(tb_nocdrom)); |
662 |
+ |
|
663 |
+ |
make_checkbox(box, STR_POLLMEDIA_CTRL, "pollmedia", GTK_SIGNAL_FUNC(tb_pollmedia)); |
664 |
+ |
|
665 |
+ |
make_separator(box); |
666 |
+ |
w_enableextfs = make_checkbox(box, STR_EXTFS_ENABLE_CTRL, "enableextfs", GTK_SIGNAL_FUNC(tb_enableextfs)); |
667 |
+ |
w_extdrives = make_file_entry(box, STR_EXTFS_DRIVES_CTRL, "extdrives", true); |
668 |
+ |
|
669 |
+ |
set_volumes_sensitive(); |
670 |
|
} |
671 |
|
|
672 |
|
|
1022 |
|
// Set sensitivity of widgets |
1023 |
|
static void set_input_sensitive(void) |
1024 |
|
{ |
1025 |
< |
gtk_widget_set_sensitive(w_keycode_file, PrefsFindBool("keycodes")); |
1025 |
> |
const bool use_keycodes = PrefsFindBool("keycodes"); |
1026 |
> |
gtk_widget_set_sensitive(w_keycode_file, use_keycodes); |
1027 |
> |
gtk_widget_set_sensitive(GTK_WIDGET(g_object_get_data(G_OBJECT(w_keycode_file), "chooser_button")), use_keycodes); |
1028 |
|
gtk_widget_set_sensitive(w_mouse_wheel_lines, PrefsFindInt32("mousewheelmode") == 1); |
1029 |
|
} |
1030 |
|
|
1054 |
|
// Create "Input" pane |
1055 |
|
static void create_input_pane(GtkWidget *top) |
1056 |
|
{ |
1057 |
< |
GtkWidget *box, *hbox, *menu, *label; |
1057 |
> |
GtkWidget *box, *hbox, *menu, *label, *button; |
1058 |
|
GtkObject *adj; |
1059 |
|
|
1060 |
|
box = make_pane(top, STR_INPUT_PANE_TITLE); |
1061 |
|
|
1062 |
|
make_checkbox(box, STR_KEYCODES_CTRL, "keycodes", GTK_SIGNAL_FUNC(tb_keycodes)); |
1063 |
< |
w_keycode_file = make_file_entry(box, STR_KEYCODE_FILE_CTRL, "keycodefile"); |
1063 |
> |
|
1064 |
> |
hbox = gtk_hbox_new(FALSE, 4); |
1065 |
> |
gtk_widget_show(hbox); |
1066 |
> |
gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
1067 |
> |
|
1068 |
> |
label = gtk_label_new(GetString(STR_KEYCODES_CTRL)); |
1069 |
> |
gtk_widget_show(label); |
1070 |
> |
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1071 |
> |
|
1072 |
> |
const char *str = PrefsFindString("keycodefile"); |
1073 |
> |
if (str == NULL) |
1074 |
> |
str = ""; |
1075 |
> |
|
1076 |
> |
w_keycode_file = gtk_entry_new(); |
1077 |
> |
gtk_entry_set_text(GTK_ENTRY(w_keycode_file), str); |
1078 |
> |
gtk_widget_show(w_keycode_file); |
1079 |
> |
gtk_box_pack_start(GTK_BOX(hbox), w_keycode_file, TRUE, TRUE, 0); |
1080 |
> |
|
1081 |
> |
button = make_browse_button(w_keycode_file); |
1082 |
> |
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1083 |
> |
g_object_set_data(G_OBJECT(w_keycode_file), "chooser_button", button); |
1084 |
|
|
1085 |
|
make_separator(box); |
1086 |
|
|
1114 |
|
|
1115 |
|
|
1116 |
|
/* |
1117 |
< |
* "Ports" pane |
1117 |
> |
* "Serial" pane |
1118 |
|
*/ |
1119 |
|
|
1120 |
< |
static GtkWidget *w_seriala, *w_portfile0, *w_portfile0_browse; |
1121 |
< |
static GtkWidget *w_serialb, *w_portfile1, *w_portfile1_browse; |
1120 |
> |
static GtkWidget *w_seriala, *w_portfile0; |
1121 |
> |
static GtkWidget *w_serialb, *w_portfile1; |
1122 |
|
|
1123 |
|
// Set sensitivity of widgets |
1124 |
|
static void set_serial_sensitive(void) |
1129 |
|
str = gtk_entry_get_text(GTK_ENTRY(w_seriala)); |
1130 |
|
is_file = strcmp(str, "FILE") == 0; |
1131 |
|
gtk_widget_set_sensitive(w_portfile0, is_file); |
1132 |
< |
gtk_widget_set_sensitive(w_portfile0_browse, is_file); |
1132 |
> |
gtk_widget_set_sensitive(GTK_WIDGET(g_object_get_data(G_OBJECT(w_portfile0), "chooser_button")), is_file); |
1133 |
|
|
1134 |
|
str = gtk_entry_get_text(GTK_ENTRY(w_serialb)); |
1135 |
|
is_file = strcmp(str, "FILE") == 0; |
1136 |
|
gtk_widget_set_sensitive(w_portfile1, is_file); |
1137 |
< |
gtk_widget_set_sensitive(w_portfile1_browse, is_file); |
1137 |
> |
gtk_widget_set_sensitive(GTK_WIDGET(g_object_get_data(G_OBJECT(w_portfile1), "chooser_button")), is_file); |
1138 |
|
} |
1139 |
|
|
1140 |
|
// Read settings from widgets and set preferences |
1180 |
|
return glist; |
1181 |
|
} |
1182 |
|
|
1183 |
< |
// Create "Ports" pane |
1183 |
> |
// Create "Serial" pane |
1184 |
|
static void create_serial_pane(GtkWidget *top) |
1185 |
|
{ |
1186 |
|
GtkWidget *box, *hbox, *table, *label, *combo, *sep, *entry; |
1189 |
|
box = make_pane(top, STR_SERIAL_PANE_TITLE); |
1190 |
|
table = make_table(box, 2, 5); |
1191 |
|
|
1056 |
– |
label = gtk_label_new(GetString(STR_SERIALA_CTRL)); |
1057 |
– |
gtk_widget_show(label); |
1058 |
– |
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
1059 |
– |
|
1192 |
|
GList *glist = add_serial_names(); |
1061 |
– |
combo = gtk_combo_new(); |
1062 |
– |
gtk_widget_show(combo); |
1063 |
– |
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist); |
1193 |
|
const char *str = PrefsFindString("seriala"); |
1194 |
< |
if (str == NULL) |
1066 |
< |
str = ""; |
1067 |
< |
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str); |
1068 |
< |
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 0, 1, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
1194 |
> |
combo = table_make_combobox(table, 0, STR_SERIALA_CTRL, str, glist); |
1195 |
|
w_seriala = GTK_COMBO(combo)->entry; |
1196 |
|
gtk_signal_connect(GTK_OBJECT(w_seriala), "changed", GTK_SIGNAL_FUNC(cb_serial_port_changed), NULL); |
1197 |
|
|
1198 |
< |
label = gtk_label_new(GetString(STR_FILE_CTRL)); |
1073 |
< |
gtk_widget_show(label); |
1074 |
< |
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
1075 |
< |
|
1076 |
< |
hbox = gtk_hbox_new(FALSE, 4); |
1077 |
< |
gtk_widget_show(hbox); |
1078 |
< |
gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 1, 2, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
1079 |
< |
|
1080 |
< |
w_portfile0 = gtk_entry_new(); |
1081 |
< |
str = PrefsFindString("portfile0"); |
1082 |
< |
if (str == NULL) |
1083 |
< |
str = "C:\\B2TEMP0.OUT"; |
1084 |
< |
gtk_entry_set_text(GTK_ENTRY(w_portfile0), str); |
1085 |
< |
gtk_widget_show(w_portfile0); |
1086 |
< |
gtk_box_pack_start(GTK_BOX(hbox), w_portfile0, TRUE, TRUE, 0); |
1087 |
< |
|
1088 |
< |
w_portfile0_browse = make_browse_button(w_portfile0); |
1089 |
< |
gtk_box_pack_start(GTK_BOX(hbox), w_portfile0_browse, FALSE, FALSE, 0); |
1198 |
> |
w_portfile0 = table_make_file_entry(table, 1, STR_FILE_CTRL, "portfile0"); |
1199 |
|
|
1200 |
|
sep = gtk_hseparator_new(); |
1201 |
|
gtk_widget_show(sep); |
1202 |
|
gtk_table_attach(GTK_TABLE(table), sep, 0, 2, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
1203 |
|
|
1095 |
– |
label = gtk_label_new(GetString(STR_SERIALB_CTRL)); |
1096 |
– |
gtk_widget_show(label); |
1097 |
– |
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
1098 |
– |
|
1099 |
– |
combo = gtk_combo_new(); |
1100 |
– |
gtk_widget_show(combo); |
1101 |
– |
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist); |
1204 |
|
str = PrefsFindString("serialb"); |
1205 |
< |
if (str == NULL) |
1104 |
< |
str = ""; |
1105 |
< |
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str); |
1106 |
< |
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
1205 |
> |
combo = table_make_combobox(table, 3, STR_SERIALB_CTRL, str, glist); |
1206 |
|
w_serialb = GTK_COMBO(combo)->entry; |
1207 |
|
gtk_signal_connect(GTK_OBJECT(w_serialb), "changed", GTK_SIGNAL_FUNC(cb_serial_port_changed), NULL); |
1208 |
|
|
1209 |
< |
label = gtk_label_new(GetString(STR_FILE_CTRL)); |
1111 |
< |
gtk_widget_show(label); |
1112 |
< |
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
1113 |
< |
|
1114 |
< |
hbox = gtk_hbox_new(FALSE, 4); |
1115 |
< |
gtk_widget_show(hbox); |
1116 |
< |
gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 4, 5, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
1117 |
< |
|
1118 |
< |
w_portfile1 = gtk_entry_new(); |
1119 |
< |
str = PrefsFindString("portfile1"); |
1120 |
< |
if (str == NULL) |
1121 |
< |
str = "C:\\B2TEMP1.OUT"; |
1122 |
< |
gtk_entry_set_text(GTK_ENTRY(w_portfile1), str); |
1123 |
< |
gtk_widget_show(w_portfile1); |
1124 |
< |
gtk_box_pack_start(GTK_BOX(hbox), w_portfile1, TRUE, TRUE, 0); |
1125 |
< |
|
1126 |
< |
w_portfile1_browse = make_browse_button(w_portfile1); |
1127 |
< |
gtk_box_pack_start(GTK_BOX(hbox), w_portfile1_browse, FALSE, FALSE, 0); |
1209 |
> |
w_portfile1 = table_make_file_entry(table, 4, STR_FILE_CTRL, "portfile1"); |
1210 |
|
|
1211 |
|
set_serial_sensitive(); |
1212 |
|
} |
1284 |
|
* "Memory/Misc" pane |
1285 |
|
*/ |
1286 |
|
|
1287 |
< |
static GtkObject *w_ramsize_adj; |
1287 |
> |
static GtkWidget *w_ramsize; |
1288 |
|
static GtkWidget *w_rom_file; |
1289 |
|
|
1290 |
|
// "Ignore SEGV" button toggled |
1309 |
|
// Read settings from widgets and set preferences |
1310 |
|
static void read_memory_settings(void) |
1311 |
|
{ |
1312 |
< |
PrefsReplaceInt32("ramsize", int(GTK_ADJUSTMENT(w_ramsize_adj)->value) << 20); |
1312 |
> |
const char *str = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(w_ramsize)->entry)); |
1313 |
> |
PrefsReplaceInt32("ramsize", atoi(str) << 20); |
1314 |
|
|
1315 |
< |
const char *str = get_file_entry_path(w_rom_file); |
1315 |
> |
str = get_file_entry_path(w_rom_file); |
1316 |
|
if (str && strlen(str)) |
1317 |
|
PrefsReplaceString("rom", str); |
1318 |
|
else |
1323 |
|
// Create "Memory/Misc" pane |
1324 |
|
static void create_memory_pane(GtkWidget *top) |
1325 |
|
{ |
1326 |
< |
GtkWidget *box, *hbox, *vbox, *hbox2, *label, *scale; |
1326 |
> |
GtkWidget *box, *hbox, *table, *label, *scale, *menu; |
1327 |
|
|
1328 |
|
box = make_pane(top, STR_MEMORY_MISC_PANE_TITLE); |
1329 |
+ |
table = make_table(box, 2, 5); |
1330 |
|
|
1331 |
< |
hbox = gtk_hbox_new(FALSE, 4); |
1332 |
< |
gtk_widget_show(hbox); |
1333 |
< |
|
1334 |
< |
label = gtk_label_new(GetString(STR_RAMSIZE_SLIDER)); |
1335 |
< |
gtk_widget_show(label); |
1336 |
< |
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1337 |
< |
|
1338 |
< |
vbox = gtk_vbox_new(FALSE, 4); |
1339 |
< |
gtk_widget_show(vbox); |
1340 |
< |
|
1341 |
< |
gfloat min, max; |
1342 |
< |
min = 1; |
1343 |
< |
max = 1024; |
1344 |
< |
w_ramsize_adj = gtk_adjustment_new(min, min, max, 1, 16, 0); |
1345 |
< |
gtk_adjustment_set_value(GTK_ADJUSTMENT(w_ramsize_adj), PrefsFindInt32("ramsize") >> 20); |
1346 |
< |
|
1263 |
< |
scale = gtk_hscale_new(GTK_ADJUSTMENT(w_ramsize_adj)); |
1264 |
< |
gtk_widget_show(scale); |
1265 |
< |
gtk_scale_set_digits(GTK_SCALE(scale), 0); |
1266 |
< |
gtk_box_pack_start(GTK_BOX(vbox), scale, TRUE, TRUE, 0); |
1267 |
< |
|
1268 |
< |
hbox2 = gtk_hbox_new(FALSE, 4); |
1269 |
< |
gtk_widget_show(hbox2); |
1270 |
< |
|
1271 |
< |
char val[32]; |
1272 |
< |
sprintf(val, GetString(STR_RAMSIZE_FMT), int(min)); |
1273 |
< |
label = gtk_label_new(val); |
1274 |
< |
gtk_widget_show(label); |
1275 |
< |
gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0); |
1276 |
< |
|
1277 |
< |
sprintf(val, GetString(STR_RAMSIZE_FMT), int(max)); |
1278 |
< |
label = gtk_label_new(val); |
1279 |
< |
gtk_widget_show(label); |
1280 |
< |
gtk_box_pack_end(GTK_BOX(hbox2), label, FALSE, FALSE, 0); |
1281 |
< |
gtk_box_pack_start(GTK_BOX(vbox), hbox2, TRUE, TRUE, 0); |
1282 |
< |
gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); |
1283 |
< |
gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
1331 |
> |
static const combo_desc options[] = { |
1332 |
> |
STR_RAMSIZE_2MB_LAB, |
1333 |
> |
STR_RAMSIZE_4MB_LAB, |
1334 |
> |
STR_RAMSIZE_8MB_LAB, |
1335 |
> |
STR_RAMSIZE_16MB_LAB, |
1336 |
> |
STR_RAMSIZE_32MB_LAB, |
1337 |
> |
STR_RAMSIZE_64MB_LAB, |
1338 |
> |
STR_RAMSIZE_128MB_LAB, |
1339 |
> |
STR_RAMSIZE_256MB_LAB, |
1340 |
> |
STR_RAMSIZE_512MB_LAB, |
1341 |
> |
STR_RAMSIZE_1024MB_LAB, |
1342 |
> |
0 |
1343 |
> |
}; |
1344 |
> |
char default_ramsize[10]; |
1345 |
> |
sprintf(default_ramsize, "%d", PrefsFindInt32("ramsize") >> 20); |
1346 |
> |
w_ramsize = table_make_combobox(table, 0, STR_RAMSIZE_CTRL, default_ramsize, options); |
1347 |
|
|
1348 |
|
static const opt_desc model_options[] = { |
1349 |
|
{STR_MODELID_5_LAB, GTK_SIGNAL_FUNC(mn_modelid_5)}, |
1355 |
|
case 5: active = 0; break; |
1356 |
|
case 14: active = 1; break; |
1357 |
|
} |
1358 |
< |
make_option_menu(box, STR_MODELID_CTRL, model_options, active); |
1358 |
> |
table_make_option_menu(table, 2, STR_MODELID_CTRL, model_options, active); |
1359 |
|
|
1360 |
|
#if EMULATED_68K |
1361 |
|
static const opt_desc cpu_options[] = { |
1374 |
|
case 3: active = fpu ? 3 : 2; break; |
1375 |
|
case 4: active = 4; |
1376 |
|
} |
1377 |
< |
make_option_menu(box, STR_CPU_CTRL, cpu_options, active); |
1377 |
> |
table_make_option_menu(table, 3, STR_CPU_CTRL, cpu_options, active); |
1378 |
|
#endif |
1379 |
|
|
1380 |
< |
w_rom_file = make_file_entry(box, STR_ROM_FILE_CTRL, "rom"); |
1380 |
> |
w_rom_file = table_make_file_entry(table, 4, STR_ROM_FILE_CTRL, "rom"); |
1381 |
|
|
1382 |
|
#ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION |
1383 |
|
make_checkbox(box, STR_IGNORESEGV_CTRL, "ignoresegv", GTK_SIGNAL_FUNC(tb_ignoresegv)); |