ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/prefs_editor_gtk.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/prefs_editor_gtk.cpp (file contents):
Revision 1.17 by cebix, 2001-07-11T19:26:14Z vs.
Revision 1.18 by cebix, 2001-07-12T19:48:27Z

# Line 853 | Line 853 | static void create_input_pane(GtkWidget
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)
# Line 871 | Line 887 | 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
# Line 954 | Line 974 | static GList *add_ether_names(void)
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);
# Line 964 | Line 984 | static void create_serial_pane(GtkWidget
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);
# Line 1006 | Line 1027 | static void create_serial_pane(GtkWidget
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines