1 |
|
/* |
2 |
|
* prefs_editor_gtk.cpp - Preferences editor, Unix implementation using GTK+ |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2001 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2002 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 |
227 |
|
{ |
228 |
|
GtkWidget *dialog, *label, *button; |
229 |
|
|
230 |
< |
char str[256]; |
231 |
< |
sprintf(str, GetString(STR_ABOUT_TEXT1), VERSION_MAJOR, VERSION_MINOR); |
232 |
< |
strncat(str, "\n", 255); |
233 |
< |
strncat(str, GetString(STR_ABOUT_TEXT2), 255); |
230 |
> |
char str[512]; |
231 |
> |
sprintf(str, |
232 |
> |
"Basilisk II\nVersion %d.%d\n\n" |
233 |
> |
"Copyright (C) 1997-2001 Christian Bauer et al.\n" |
234 |
> |
"E-mail: Christian.Bauer@uni-mainz.de\n" |
235 |
> |
"http://www.uni-mainz.de/~bauec002/B2Main.html\n\n" |
236 |
> |
"Basilisk II comes with ABSOLUTELY NO\n" |
237 |
> |
"WARRANTY. This is free software, and\n" |
238 |
> |
"you are welcome to redistribute it\n" |
239 |
> |
"under the terms of the GNU General\n" |
240 |
> |
"Public License.\n", |
241 |
> |
VERSION_MAJOR, VERSION_MINOR |
242 |
> |
); |
243 |
|
|
244 |
|
dialog = gtk_dialog_new(); |
236 |
– |
gtk_widget_set_usize(GTK_WIDGET(dialog), strlen(GetString(STR_ABOUT_TEXT2)) + 200, 120); |
245 |
|
gtk_window_set_title(GTK_WINDOW(dialog), GetString(STR_ABOUT_TITLE)); |
246 |
|
gtk_container_border_width(GTK_CONTAINER(dialog), 5); |
247 |
|
gtk_widget_set_uposition(GTK_WIDGET(dialog), 100, 150); |
853 |
|
* "Serial/Network" pane |
854 |
|
*/ |
855 |
|
|
856 |
< |
static GtkWidget *w_seriala, *w_serialb, *w_ether; |
856 |
> |
static GtkWidget *w_seriala, *w_serialb, *w_ether, *w_udp_port; |
857 |
> |
|
858 |
> |
// Set sensitivity of widgets |
859 |
> |
static void set_serial_sensitive(void) |
860 |
> |
{ |
861 |
> |
#if SUPPORTS_UDP_TUNNEL |
862 |
> |
gtk_widget_set_sensitive(w_ether, !PrefsFindBool("udptunnel")); |
863 |
> |
gtk_widget_set_sensitive(w_udp_port, PrefsFindBool("udptunnel")); |
864 |
> |
#endif |
865 |
> |
} |
866 |
> |
|
867 |
> |
// "Tunnel AppleTalk over IP" button toggled |
868 |
> |
static void tb_udptunnel(GtkWidget *widget) |
869 |
> |
{ |
870 |
> |
PrefsReplaceBool("udptunnel", GTK_TOGGLE_BUTTON(widget)->active); |
871 |
> |
set_serial_sensitive(); |
872 |
> |
} |
873 |
|
|
874 |
|
// Read settings from widgets and set preferences |
875 |
|
static void read_serial_settings(void) |
887 |
|
PrefsReplaceString("ether", str); |
888 |
|
else |
889 |
|
PrefsRemoveItem("ether"); |
890 |
+ |
|
891 |
+ |
#if SUPPORTS_UDP_TUNNEL |
892 |
+ |
PrefsReplaceInt32("udpport", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w_udp_port))); |
893 |
+ |
#endif |
894 |
|
} |
895 |
|
|
896 |
|
// Add names of serial devices |
974 |
|
// Create "Serial/Network" pane |
975 |
|
static void create_serial_pane(GtkWidget *top) |
976 |
|
{ |
977 |
< |
GtkWidget *box, *table, *label, *combo, *sep; |
978 |
< |
GList *glist = add_serial_names(); |
977 |
> |
GtkWidget *box, *hbox, *table, *label, *combo, *sep; |
978 |
> |
GtkObject *adj; |
979 |
|
|
980 |
|
box = make_pane(top, STR_SERIAL_NETWORK_PANE_TITLE); |
981 |
|
table = make_table(box, 2, 4); |
984 |
|
gtk_widget_show(label); |
985 |
|
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4); |
986 |
|
|
987 |
+ |
GList *glist = add_serial_names(); |
988 |
|
combo = gtk_combo_new(); |
989 |
|
gtk_widget_show(combo); |
990 |
|
gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist); |
1027 |
|
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str); |
1028 |
|
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4); |
1029 |
|
w_ether = GTK_COMBO(combo)->entry; |
1030 |
+ |
|
1031 |
+ |
#if SUPPORTS_UDP_TUNNEL |
1032 |
+ |
make_checkbox(box, STR_UDPTUNNEL_CTRL, "udptunnel", GTK_SIGNAL_FUNC(tb_udptunnel)); |
1033 |
+ |
|
1034 |
+ |
hbox = gtk_hbox_new(FALSE, 4); |
1035 |
+ |
gtk_widget_show(hbox); |
1036 |
+ |
gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
1037 |
+ |
|
1038 |
+ |
label = gtk_label_new(GetString(STR_UDPPORT_CTRL)); |
1039 |
+ |
gtk_widget_show(label); |
1040 |
+ |
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1041 |
+ |
|
1042 |
+ |
adj = gtk_adjustment_new(PrefsFindInt32("udpport"), 1, 65535, 1, 5, 0); |
1043 |
+ |
w_udp_port = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 0.0, 0); |
1044 |
+ |
gtk_widget_show(w_udp_port); |
1045 |
+ |
gtk_box_pack_start(GTK_BOX(hbox), w_udp_port, FALSE, FALSE, 0); |
1046 |
+ |
#endif |
1047 |
+ |
|
1048 |
+ |
set_serial_sensitive(); |
1049 |
|
} |
1050 |
|
|
1051 |
|
|
1083 |
|
// Create "Memory/Misc" pane |
1084 |
|
static void create_memory_pane(GtkWidget *top) |
1085 |
|
{ |
1086 |
< |
GtkWidget *box, *hbox, *vbox, *hbox2, *label, *scale, *menu; |
1086 |
> |
GtkWidget *box, *hbox, *vbox, *hbox2, *label, *scale; |
1087 |
|
|
1088 |
|
box = make_pane(top, STR_MEMORY_MISC_PANE_TITLE); |
1089 |
|
|