97
static void add_menu_item(GtkWidget *menu, int label_id, GtkSignalFunc func)
121
static void add_menu_item(GtkWidget *menu, const char *label, GtkSignalFunc func, gpointer data = NULL)
99
GtkWidget *item = gtk_menu_item_new_with_label(GetString(label_id));
123
GtkWidget *item = gtk_menu_item_new_with_label(label);
100
124
gtk_widget_show(item);
101
gtk_signal_connect(GTK_OBJECT(item), "activate", func, NULL);
125
gtk_signal_connect(GTK_OBJECT(item), "activate", func, data);
102
126
gtk_menu_append(GTK_MENU(menu), item);
129
static void add_menu_item(GtkWidget *menu, int label_id, GtkSignalFunc func)
131
add_menu_item(menu, GetString(label_id), func, NULL);
105
134
static GtkWidget *make_pane(GtkWidget *notebook, int title_id)
107
136
GtkWidget *frame, *label, *box;
189
static GtkWidget *table_make_option_menu(GtkWidget *table, int row, int label_id, const opt_desc *options, int active)
191
GtkWidget *label, *opt, *menu;
193
label = gtk_label_new(GetString(label_id));
194
gtk_widget_show(label);
195
gtk_table_attach(GTK_TABLE(table), label, 0, 1, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
197
opt = gtk_option_menu_new();
198
gtk_widget_show(opt);
199
menu = gtk_menu_new();
201
while (options->label_id) {
202
add_menu_item(menu, options->label_id, options->func);
205
gtk_menu_set_active(GTK_MENU(menu), active);
207
gtk_option_menu_set_menu(GTK_OPTION_MENU(opt), menu);
208
gtk_table_attach(GTK_TABLE(table), opt, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
212
static GtkWidget *table_make_combobox(GtkWidget *table, int row, int label_id, const char *default_value, GList *glist)
214
GtkWidget *label, *combo;
217
label = gtk_label_new(GetString(label_id));
218
gtk_widget_show(label);
219
gtk_table_attach(GTK_TABLE(table), label, 0, 1, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
221
combo = gtk_combo_new();
222
gtk_widget_show(combo);
223
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist);
225
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), default_value);
226
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
231
static GtkWidget *table_make_combobox(GtkWidget *table, int row, int label_id, const char *default_value, const combo_desc *options)
234
while (options->label_id) {
235
glist = g_list_append(glist, (void *)GetString(options->label_id));
239
return table_make_combobox(table, row, label_id, default_value, glist);
242
static GtkWidget *table_make_file_entry(GtkWidget *table, int row, int label_id, const char *prefs_item, bool only_dirs = false)
244
GtkWidget *box, *label, *entry, *button;
246
label = gtk_label_new(GetString(label_id));
247
gtk_widget_show(label);
248
gtk_table_attach(GTK_TABLE(table), label, 0, 1, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
250
const char *str = PrefsFindString(prefs_item);
254
box = gtk_hbox_new(FALSE, 4);
255
gtk_widget_show(box);
256
gtk_table_attach(GTK_TABLE(table), box, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
258
entry = gtk_entry_new();
259
gtk_entry_set_text(GTK_ENTRY(entry), str);
260
gtk_widget_show(entry);
261
gtk_box_pack_start(GTK_BOX(box), entry, TRUE, TRUE, 0);
263
button = make_browse_button(entry);
264
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
265
g_object_set_data(G_OBJECT(entry), "chooser_button", button);
160
269
static GtkWidget *make_option_menu(GtkWidget *top, int label_id, const opt_desc *options, int active)
162
271
GtkWidget *box, *label, *opt, *menu;
234
342
label = gtk_label_new(GetString(label_id));
235
343
gtk_widget_show(label);
236
344
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
239
while (options->label_id) {
240
glist = g_list_append(glist, (void *)GetString(options->label_id));
244
346
combo = gtk_combo_new();
245
347
gtk_widget_show(combo);
246
348
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist);
248
sprintf(str, "%d", PrefsFindInt32(prefs_item));
249
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str);
350
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), default_value);
250
351
gtk_box_pack_start(GTK_BOX(box), combo, TRUE, TRUE, 0);
356
static GtkWidget *make_combobox(GtkWidget *top, int label_id, const char *default_value, const combo_desc *options)
359
while (options->label_id) {
360
glist = g_list_append(glist, (void *)GetString(options->label_id));
364
return make_combobox(top, label_id, default_value, glist);
257
369
* Show preferences editor
341
457
// Menu item descriptions
342
458
static GtkItemFactoryEntry menu_items[] = {
343
459
{(gchar *)GetString(STR_PREFS_MENU_FILE_GTK), NULL, NULL, 0, "<Branch>"},
344
{(gchar *)GetString(STR_PREFS_ITEM_START_GTK), NULL, GTK_SIGNAL_FUNC(cb_start), 0, NULL},
460
{(gchar *)GetString(STR_PREFS_ITEM_START_GTK), "<control>S", GTK_SIGNAL_FUNC(cb_start), 0, NULL},
345
461
{(gchar *)GetString(STR_PREFS_ITEM_ZAP_PRAM_GTK), NULL, GTK_SIGNAL_FUNC(cb_zap_pram), 0, NULL},
346
462
{(gchar *)GetString(STR_PREFS_ITEM_SEPL_GTK), NULL, NULL, 0, "<Separator>"},
347
463
{(gchar *)GetString(STR_PREFS_ITEM_QUIT_GTK), "<control>Q", GTK_SIGNAL_FUNC(cb_quit), 0, NULL},
348
464
{(gchar *)GetString(STR_HELP_MENU_GTK), NULL, NULL, 0, "<LastBranch>"},
349
{(gchar *)GetString(STR_HELP_ITEM_ABOUT_GTK), NULL, GTK_SIGNAL_FUNC(cb_about), 0, NULL}
465
{(gchar *)GetString(STR_HELP_ITEM_ABOUT_GTK), "<control>H", GTK_SIGNAL_FUNC(cb_about), 0, NULL}
468
void PrefsMigrate(void)
471
const char *ether = PrefsFindString("ether");
472
if (ether && ether[0] == '{') {
473
PrefsReplaceString("etherguid", ether);
474
PrefsReplaceString("ether", "b2ether");
476
if (PrefsFindBool("routerenabled")) {
477
PrefsRemoveItem("etherguid");
478
PrefsReplaceString("ether", "router");
352
482
bool PrefsEditor(void)
488
629
static void mn_boot_any(...) {PrefsReplaceInt32("bootdriver", 0);}
489
630
static void mn_boot_cdrom(...) {PrefsReplaceInt32("bootdriver", CDROMRefNum);}
632
// "Enable external file system" button toggled
633
static void tb_enableextfs(GtkWidget *widget)
635
PrefsReplaceBool("enableextfs", GTK_TOGGLE_BUTTON(widget)->active);
636
set_volumes_sensitive();
491
639
// "No CD-ROM Driver" button toggled
492
640
static void tb_nocdrom(GtkWidget *widget)
494
642
PrefsReplaceBool("nocdrom", GTK_TOGGLE_BUTTON(widget)->active);
643
set_volumes_sensitive();
646
// Add names of CD-ROM devices
647
static GList *add_cdrom_names(void)
651
char rootdir[4] = "X:\\";
652
for (char letter = 'C'; letter <= 'Z'; letter++) {
654
if (GetDriveType(rootdir) == DRIVE_CDROM)
655
glist = g_list_append(glist, strdup(rootdir));
661
// "Enable polling" button toggled
662
static void tb_pollmedia(GtkWidget *widget)
664
PrefsReplaceBool("pollmedia", GTK_TOGGLE_BUTTON(widget)->active);
497
667
// Read settings from widgets and set preferences
938
1181
// Create "Input" pane
939
1182
static void create_input_pane(GtkWidget *top)
941
GtkWidget *box, *hbox, *menu, *label;
1184
GtkWidget *box, *hbox, *menu, *label, *button;
944
1187
box = make_pane(top, STR_INPUT_PANE_TITLE);
946
1189
make_checkbox(box, STR_KEYCODES_CTRL, "keycodes", GTK_SIGNAL_FUNC(tb_keycodes));
947
w_keycode_file = make_file_entry(box, STR_KEYCODE_FILE_CTRL, "keycodefile");
1191
hbox = gtk_hbox_new(FALSE, 4);
1192
gtk_widget_show(hbox);
1193
gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
1195
label = gtk_label_new(GetString(STR_KEYCODES_CTRL));
1196
gtk_widget_show(label);
1197
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
1199
const char *str = PrefsFindString("keycodefile");
1203
w_keycode_file = gtk_entry_new();
1204
gtk_entry_set_text(GTK_ENTRY(w_keycode_file), str);
1205
gtk_widget_show(w_keycode_file);
1206
gtk_box_pack_start(GTK_BOX(hbox), w_keycode_file, TRUE, TRUE, 0);
1208
button = make_browse_button(w_keycode_file);
1209
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1210
g_object_set_data(G_OBJECT(w_keycode_file), "chooser_button", button);
949
1212
make_separator(box);
1053
1315
box = make_pane(top, STR_SERIAL_PANE_TITLE);
1054
1316
table = make_table(box, 2, 5);
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);
1060
1318
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);
1064
1319
const char *str = PrefsFindString("seriala");
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);
1320
combo = table_make_combobox(table, 0, STR_SERIALA_CTRL, str, glist);
1069
1321
w_seriala = GTK_COMBO(combo)->entry;
1070
1322
gtk_signal_connect(GTK_OBJECT(w_seriala), "changed", GTK_SIGNAL_FUNC(cb_serial_port_changed), NULL);
1072
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);
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);
1080
w_portfile0 = gtk_entry_new();
1081
str = PrefsFindString("portfile0");
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);
1088
w_portfile0_browse = make_browse_button(w_portfile0);
1089
gtk_box_pack_start(GTK_BOX(hbox), w_portfile0_browse, FALSE, FALSE, 0);
1324
w_portfile0 = table_make_file_entry(table, 1, STR_FILE_CTRL, "portfile0");
1091
1326
sep = gtk_hseparator_new();
1092
1327
gtk_widget_show(sep);
1093
1328
gtk_table_attach(GTK_TABLE(table), sep, 0, 2, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
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);
1099
combo = gtk_combo_new();
1100
gtk_widget_show(combo);
1101
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist);
1102
1330
str = PrefsFindString("serialb");
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);
1331
combo = table_make_combobox(table, 3, STR_SERIALB_CTRL, str, glist);
1107
1332
w_serialb = GTK_COMBO(combo)->entry;
1108
1333
gtk_signal_connect(GTK_OBJECT(w_serialb), "changed", GTK_SIGNAL_FUNC(cb_serial_port_changed), NULL);
1110
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);
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);
1118
w_portfile1 = gtk_entry_new();
1119
str = PrefsFindString("portfile1");
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);
1126
w_portfile1_browse = make_browse_button(w_portfile1);
1127
gtk_box_pack_start(GTK_BOX(hbox), w_portfile1_browse, FALSE, FALSE, 0);
1335
w_portfile1 = table_make_file_entry(table, 4, STR_FILE_CTRL, "portfile1");
1129
1337
set_serial_sensitive();
1134
1342
* "Ethernet" pane
1137
static GtkWidget *w_ether, *w_udp_port;
1345
static GtkWidget *w_ftp_port_list, *w_tcp_port_list;
1139
1347
// Set sensitivity of widgets
1140
1348
static void set_ethernet_sensitive(void)
1350
const char *str = PrefsFindString("ether");
1352
bool is_router = str && strcmp(str, "router") == 0;
1353
gtk_widget_set_sensitive(w_ftp_port_list, is_router);
1354
gtk_widget_set_sensitive(w_tcp_port_list, is_router);
1144
1357
// Read settings from widgets and set preferences
1145
1358
static void read_ethernet_settings(void)
1147
const char *str = gtk_entry_get_text(GTK_ENTRY(w_ether));
1148
if (str && strlen(str))
1149
PrefsReplaceString("ether", str);
1151
PrefsRemoveItem("ether");
1154
// Add names of ethernet interfaces
1155
static GList *add_ether_names(void)
1157
GList *glist = NULL;
1159
// TODO: Get list of all Ethernet interfaces
1161
static char s_slirp[] = "slirp";
1162
glist = g_list_append(glist, s_slirp);
1166
g_list_sort(glist, gl_str_cmp);
1169
glist = g_list_append(glist, (void *)GetString(STR_NONE_LAB));
1360
const char *str = PrefsFindString("ether");
1362
bool is_router = str && strcmp(str, "router") == 0;
1364
str = gtk_entry_get_text(GTK_ENTRY(w_ftp_port_list));
1365
PrefsReplaceString("ftp_port_list", str);
1366
str = gtk_entry_get_text(GTK_ENTRY(w_tcp_port_list));
1367
PrefsReplaceString("tcp_port", str);
1371
// Ethernet emulation type changed in menulist
1372
static void cb_ether_changed(...)
1374
set_ethernet_sensitive();
1377
// Ethernet option "None" selected
1378
static void mn_ether_none(void)
1380
PrefsRemoveItem("ether");
1381
PrefsRemoveItem("etherguid");
1384
// Ethernet option "Basilisk II Router" selected
1385
static void mn_ether_router(void)
1387
PrefsReplaceString("ether", "router");
1388
PrefsRemoveItem("etherguid");
1391
// Ethernet option "Basilisk II Slirp" selected
1392
static void mn_ether_slirp(void)
1394
PrefsReplaceString("ether", "slirp");
1395
PrefsRemoveItem("etherguid");
1398
// Ethernet option for Basilisk II driver selected
1399
static void mn_ether_b2ether(GtkWidget *, const char *guid)
1401
PrefsReplaceString("ether", "b2ether");
1402
PrefsReplaceString("etherguid", guid);
1405
// Ethernet option for Basilisk II driver selected
1406
static void mn_ether_tap(GtkWidget *, const char *guid)
1408
PrefsReplaceString("ether", "tap");
1409
PrefsReplaceString("etherguid", guid);
1412
// Create ethernet interfaces menu
1413
static int create_ether_menu(GtkWidget *menu)
1417
const char *ether = PrefsFindString("ether");
1418
const char *etherguid = PrefsFindString("etherguid");
1421
add_menu_item(menu, STR_NONE_LAB, (GtkSignalFunc)mn_ether_none);
1426
// Basilisk II Router
1427
add_menu_item(menu, "Basilisk II Router", (GtkSignalFunc)mn_ether_router);
1428
if (ether && strcmp(ether, "router") == 0)
1432
// Basilisk II Slirp
1433
add_menu_item(menu, "Basilisk II Slirp", (GtkSignalFunc)mn_ether_slirp);
1434
if (ether && strcmp(ether, "slirp") == 0)
1438
// Basilisk II Ethernet Adapter
1439
PacketOpenAdapter("", 0);
1444
if (PacketGetAdapterNames(NULL, names, &sz) == ERROR_SUCCESS) {
1447
const char DEVICE_HEADER[] = "\\Device\\B2ether_";
1448
if (strnicmp(p, DEVICE_HEADER, sizeof(DEVICE_HEADER) - 1) == 0) {
1449
LPADAPTER fd = PacketOpenAdapter(p + sizeof(DEVICE_HEADER) - 1, 0);
1452
sprintf(guid, "%s", p + sizeof(DEVICE_HEADER) - 1);
1453
const char *name = ether_guid_to_name(guid);
1454
if (name && (name = g_locale_to_utf8(name, -1, NULL, NULL, NULL))) {
1455
add_menu_item(menu, name, (GtkSignalFunc)mn_ether_b2ether, strdup(guid));
1456
if (etherguid && strcmp(guid, etherguid) == 0 &&
1457
ether && strcmp(ether, "b2ether") == 0)
1461
PacketCloseAdapter(fd);
1468
PacketCloseAdapter(NULL);
1471
const char *tap_devices;
1472
if ((tap_devices = ether_tap_devices()) != NULL) {
1473
const char *guid = tap_devices;
1475
const char *name = ether_guid_to_name(guid);
1476
if (name && (name = g_locale_to_utf8(name, -1, NULL, NULL, NULL))) {
1477
add_menu_item(menu, name, (GtkSignalFunc)mn_ether_tap, strdup(guid));
1478
if (etherguid && strcmp(guid, etherguid) == 0 &&
1479
ether && strcmp(ether, "tap") == 0)
1483
guid += strlen(guid) + 1;
1485
free((char *)tap_devices);
1174
1491
// Create "Ethernet" pane
1175
1492
static void create_ethernet_pane(GtkWidget *top)
1177
GtkWidget *box, *hbox, *table, *label, *combo, *sep, *entry;
1494
GtkWidget *box, *hbox, *table, *label, *sep, *entry, *opt, *menu, *item;
1179
1496
box = make_pane(top, STR_NETWORK_PANE_TITLE);
1180
1497
table = make_table(box, 2, 5);
1183
1500
gtk_widget_show(label);
1184
1501
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
1186
GList *glist = add_ether_names();
1187
combo = gtk_combo_new();
1188
gtk_widget_show(combo);
1189
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist);
1190
const char *str = PrefsFindString("ether");
1193
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str);
1194
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 0, 1, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
1195
w_ether = GTK_COMBO(combo)->entry;
1503
opt = gtk_option_menu_new();
1504
gtk_widget_show(opt);
1505
menu = gtk_menu_new();
1506
int active = create_ether_menu(menu);
1508
gtk_menu_set_active(GTK_MENU(menu), active);
1509
gtk_option_menu_set_menu(GTK_OPTION_MENU(opt), menu);
1510
gtk_table_attach(GTK_TABLE(table), opt, 1, 2, 0, 1, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
1511
gtk_signal_connect(GTK_OBJECT(opt), "changed", GTK_SIGNAL_FUNC(cb_ether_changed), NULL);
1513
sep = gtk_hseparator_new();
1514
gtk_widget_show(sep);
1515
gtk_table_attach(GTK_TABLE(table), sep, 0, 2, 1, 2, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
1517
label = gtk_label_new(GetString(STR_ETHER_FTP_PORT_LIST_CTRL));
1518
gtk_widget_show(label);
1519
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
1521
entry = gtk_entry_new();
1522
const char *str = PrefsFindString("ftp_port_list");
1525
gtk_entry_set_text(GTK_ENTRY(entry), str);
1526
gtk_widget_show(entry);
1527
gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
1528
w_ftp_port_list = entry;
1530
label = gtk_label_new(GetString(STR_ETHER_TCP_PORT_LIST_CTRL));
1531
gtk_widget_show(label);
1532
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
1534
entry = gtk_entry_new();
1535
str = PrefsFindString("tcp_port");
1538
gtk_entry_set_text(GTK_ENTRY(entry), str);
1539
gtk_widget_show(entry);
1540
gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
1541
w_tcp_port_list = entry;
1197
1543
set_ethernet_sensitive();
1240
1593
// Create "Memory/Misc" pane
1241
1594
static void create_memory_pane(GtkWidget *top)
1243
GtkWidget *box, *hbox, *vbox, *hbox2, *label, *scale;
1596
GtkWidget *box, *hbox, *table, *label, *scale, *menu;
1245
1598
box = make_pane(top, STR_MEMORY_MISC_PANE_TITLE);
1247
hbox = gtk_hbox_new(FALSE, 4);
1248
gtk_widget_show(hbox);
1250
label = gtk_label_new(GetString(STR_RAMSIZE_SLIDER));
1251
gtk_widget_show(label);
1252
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
1254
vbox = gtk_vbox_new(FALSE, 4);
1255
gtk_widget_show(vbox);
1260
w_ramsize_adj = gtk_adjustment_new(min, min, max, 1, 16, 0);
1261
gtk_adjustment_set_value(GTK_ADJUSTMENT(w_ramsize_adj), PrefsFindInt32("ramsize") >> 20);
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);
1268
hbox2 = gtk_hbox_new(FALSE, 4);
1269
gtk_widget_show(hbox2);
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);
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);
1599
table = make_table(box, 2, 5);
1601
static const combo_desc options[] = {
1603
STR_RAMSIZE_2MB_LAB,
1605
STR_RAMSIZE_4MB_LAB,
1606
STR_RAMSIZE_8MB_LAB,
1607
STR_RAMSIZE_16MB_LAB,
1608
STR_RAMSIZE_32MB_LAB,
1609
STR_RAMSIZE_64MB_LAB,
1610
STR_RAMSIZE_128MB_LAB,
1611
STR_RAMSIZE_256MB_LAB,
1612
STR_RAMSIZE_512MB_LAB,
1613
STR_RAMSIZE_1024MB_LAB,
1616
char default_ramsize[16];
1617
sprintf(default_ramsize, "%d", PrefsFindInt32("ramsize") >> 20);
1618
w_ramsize = table_make_combobox(table, 0, STR_RAMSIZE_CTRL, default_ramsize, options);
1285
1621
static const opt_desc model_options[] = {
1286
1622
{STR_MODELID_5_LAB, GTK_SIGNAL_FUNC(mn_modelid_5)},
1287
1623
{STR_MODELID_14_LAB, GTK_SIGNAL_FUNC(mn_modelid_14)},