Hi,
Looks like someone added this to the GTK1 interface already. Attached
is a patch to add it to the GTK2 interface.
Note: I couldn't see what needed to be done to 'connect' it up inside
the core so it's possible this patch isn't what you're looking for.
>From what I could tell the internal connections were already done. All
I did was add the checkboxes to the gui.
The widget names are: checkbutton_gnet_monitor_servents and
checkbutton_gnet_monitor_ip as per the property names.
Emile
ps. Servants is spelled with an 'A' not an 'E'. I'm not sure if
there's some reason for the incorrect spelling.
On Sun, 2003-08-03 at 21:01, Raphael Manfredi wrote:
> If someone can use glade to add the checkboxes for the two new properties
> "node_monitor_unstable_ip" and "node_monitor_unstable_servents" in the
> two GTK frontends, I'd be grateful. Otherwise, it will be a config-file
> settings only, and I'll revert to them being FALSE by default.
? gtk-gnutella-current/.tm_project.cache
? gtk-gnutella-current/Makefile
? gtk-gnutella-current/config.cache
? gtk-gnutella-current/config.h
? gtk-gnutella-current/config.log
? gtk-gnutella-current/config.status
? gtk-gnutella-current/gtk-gnutella.spec
? gtk-gnutella-current/gtk_gnutella.prj
? gtk-gnutella-current/gtk_gnutella.prj.11633
? gtk-gnutella-current/gtk_gnutella.prj.1348
? gtk-gnutella-current/gtk_gnutella.prj.30813
? gtk-gnutella-current/gtk_gnutella.pws
? gtk-gnutella-current/stamp-h
? gtk-gnutella-current/intl/Makefile
? gtk-gnutella-current/po/Makefile
? gtk-gnutella-current/po/Makefile.in
? gtk-gnutella-current/po/POTFILES
? gtk-gnutella-current/po/es.gmo
? gtk-gnutella-current/po/fr.gmo
? gtk-gnutella-current/po/nl.gmo
? gtk-gnutella-current/src/.deps
? gtk-gnutella-current/src/Makefile
? gtk-gnutella-current/src/getdate.c
? gtk-gnutella-current/src/gtk-gnutella
Index: gtk-gnutella-current/gtk2-gnutella.glade
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/gtk2-gnutella.glade,v
retrieving revision 1.70
diff -u -r1.70 gtk2-gnutella.glade
--- gtk-gnutella-current/gtk2-gnutella.glade 2 Aug 2003 22:31:57 -0000 1.70
+++ gtk-gnutella-current/gtk2-gnutella.glade 6 Aug 2003 22:05:56 -0000
@@ -5907,7 +5907,7 @@
<widget class="GtkTable" id="table37">
<property name="border_width">2</property>
<property name="visible">True</property>
- <property name="n_rows">3</property>
+ <property name="n_rows">5</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">2</property>
@@ -6119,6 +6119,50 @@
<property name="right_attach">1</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton"
id="checkbutton_gnet_monitor_ip">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Monitor bad node
IP addresses</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">True</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_padding">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton"
id="checkbutton_gnet_monitor_servents">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Monitor and
auto-ban unstable servent types</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">True</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_padding">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
Index: gtk-gnutella-current/src/gnet_property.c
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/gnet_property.c,v
retrieving revision 1.84
diff -u -r1.84 gnet_property.c
--- gtk-gnutella-current/src/gnet_property.c 5 Aug 2003 21:32:11 -0000 1.84
+++ gtk-gnutella-current/src/gnet_property.c 6 Aug 2003 22:06:01 -0000
@@ -362,8 +362,8 @@
guint32 clock_skew_def = 0;
gboolean node_monitor_unstable_ip = TRUE;
gboolean node_monitor_unstable_ip_def = TRUE;
-gboolean node_monitor_unstable_servents = FALSE;
-gboolean node_monitor_unstable_servents_def = FALSE;
+gboolean node_monitor_unstable_servents = TRUE;
+gboolean node_monitor_unstable_servents_def = TRUE;
static prop_set_t *gnet_property = NULL;
@@ -3472,4 +3472,3 @@
return stub;
}
-
Index: gtk-gnutella-current/src/gnet_props.ag
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/gnet_props.ag,v
retrieving revision 1.75
diff -u -r1.75 gnet_props.ag
--- gtk-gnutella-current/src/gnet_props.ag 5 Aug 2003 21:32:12 -0000 1.75
+++ gtk-gnutella-current/src/gnet_props.ag 6 Aug 2003 22:06:01 -0000
@@ -1832,7 +1832,6 @@
"already keeps track of unstable IP addresses.";
type = boolean;
data = {
- default = FALSE;
+ default = TRUE;
};
};
-
Index: gtk-gnutella-current/src/interface-glade2.c
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/interface-glade2.c,v
retrieving revision 1.71
diff -u -r1.71 interface-glade2.c
--- gtk-gnutella-current/src/interface-glade2.c 2 Aug 2003 22:31:59 -0000 1.71
+++ gtk-gnutella-current/src/interface-glade2.c 6 Aug 2003 22:06:09 -0000
@@ -1433,7 +1433,7 @@
gtk_misc_set_alignment (GTK_MISC (label492), 0, 0.5);
gtk_misc_set_padding (GTK_MISC (label492), 10, 0);
gtk_widget_set_name (label493, "label493");
gtk_widget_show (label493);
gtk_box_pack_start (GTK_BOX (vbox88), label493, FALSE, FALSE, 0);
@@ -1441,7 +1441,7 @@
gtk_misc_set_alignment (GTK_MISC (label493), 0, 0.5);
gtk_misc_set_padding (GTK_MISC (label493), 10, 0);
gtk_widget_set_name (label494, "label494");
gtk_widget_show (label494);
gtk_box_pack_start (GTK_BOX (vbox88), label494, FALSE, FALSE, 0);
@@ -1547,7 +1547,7 @@
gtk_container_set_border_width (GTK_CONTAINER (button_about_close), 6);
GTK_WIDGET_SET_FLAGS (button_about_close, GTK_CAN_DEFAULT);
gtk_widget_set_name (label538, "label538");
gtk_box_pack_start (GTK_BOX (vbox67), label538, FALSE, FALSE, 0);
gtk_widget_set_sensitive (label538, FALSE);
@@ -3396,6 +3396,8 @@
GtkObject *spinbutton_config_node_rx_flowc_ratio_adj;
GtkWidget *spinbutton_config_node_rx_flowc_ratio;
GtkWidget *label573;
+ GtkWidget *checkbutton_gnet_monitor_ip;
+ GtkWidget *checkbutton_gnet_monitor_servents;
GtkWidget *label429;
GtkWidget *frame_expert_gnet_other;
GtkWidget *table51;
@@ -3831,7 +3833,7 @@
gtk_widget_show (frame_expert_gnet_quality);
gtk_box_pack_start (GTK_BOX (vbox25), frame_expert_gnet_quality, FALSE, TRUE, 0);
- table37 = gtk_table_new (3, 3, FALSE);
+ table37 = gtk_table_new (5, 3, FALSE);
gtk_widget_set_name (table37, "table37");
gtk_widget_show (table37);
gtk_container_add (GTK_CONTAINER (frame_expert_gnet_quality), table37);
@@ -3923,6 +3925,22 @@
gtk_misc_set_alignment (GTK_MISC (label573), 0, 0.5);
gtk_misc_set_padding (GTK_MISC (label573), 5, 0);
+ checkbutton_gnet_monitor_ip = gtk_check_button_new_with_mnemonic (_("Monitor bad
node IP addresses"));
+ gtk_widget_set_name (checkbutton_gnet_monitor_ip, "checkbutton_gnet_monitor_ip");
+ gtk_widget_show (checkbutton_gnet_monitor_ip);
+ gtk_table_attach (GTK_TABLE (table37), checkbutton_gnet_monitor_ip, 0, 1, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 5, 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton_gnet_monitor_ip),
TRUE);
+
+ checkbutton_gnet_monitor_servents = gtk_check_button_new_with_mnemonic (_("Monitor
and auto-ban unstable servent types"));
+ gtk_widget_set_name (checkbutton_gnet_monitor_servents,
"checkbutton_gnet_monitor_servents");
+ gtk_widget_show (checkbutton_gnet_monitor_servents);
+ gtk_table_attach (GTK_TABLE (table37), checkbutton_gnet_monitor_servents, 0, 1, 4,
5,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 5, 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(checkbutton_gnet_monitor_servents), TRUE);
+
label429 = gtk_label_new (_("Quality management"));
gtk_widget_set_name (label429, "label429");
gtk_widget_show (label429);
@@ -4051,6 +4069,8 @@
GLADE_HOOKUP_OBJECT (main_window_config_gnet_tab, label574, "label574");
GLADE_HOOKUP_OBJECT (main_window_config_gnet_tab,
spinbutton_config_node_rx_flowc_ratio, "spinbutton_config_node_rx_flowc_ratio");
GLADE_HOOKUP_OBJECT (main_window_config_gnet_tab, label573, "label573");
+ GLADE_HOOKUP_OBJECT (main_window_config_gnet_tab, checkbutton_gnet_monitor_ip,
"checkbutton_gnet_monitor_ip");
+ GLADE_HOOKUP_OBJECT (main_window_config_gnet_tab,
checkbutton_gnet_monitor_servents, "checkbutton_gnet_monitor_servents");
GLADE_HOOKUP_OBJECT (main_window_config_gnet_tab, label429, "label429");
GLADE_HOOKUP_OBJECT (main_window_config_gnet_tab, frame_expert_gnet_other,
"frame_expert_gnet_other");
GLADE_HOOKUP_OBJECT (main_window_config_gnet_tab, table51, "table51");