Raphael Manfredi wrote:
Quoting Russell Francis <[EMAIL PROTECTED]> from ml.softs.gtk-gnutella.devel:
:If this is the case, is anyone opposed to removing the version column :from the "gnutellaNet Connections" CList/TreeView? What useful :information is it providing if only version .6 clients are allowed to :connect?


Indeed. It provides none nowadays.

Raphael

If this is the case then I support removing it from the UI. Attached is a patch which does this for both the GTK1 && GTK2 interface.


Thanks,
Russ

Index: gtk-gnutella.glade
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/gtk-gnutella.glade,v
retrieving revision 1.169
diff -u -r1.169 gtk-gnutella.glade
--- gtk-gnutella.glade  13 Dec 2003 09:24:02 -0000      1.169
+++ gtk-gnutella.glade  15 Dec 2003 17:13:46 -0000
@@ -1053,28 +1053,29 @@
                    <class>GtkCList</class>
                    <name>clist_nodes</name>
                    <border_width>2</border_width>
+                   <can_focus>True</can_focus>
                    <signal>
                      <name>select_row</name>
                      <handler>on_clist_nodes_select_row</handler>
-                     <last_modification_time>Sun, 26 Mar 2000 17:33:59 
GMT</last_modification_time>
+                     <last_modification_time>Mon, 15 Dec 2003 15:34:10 
GMT</last_modification_time>
                    </signal>
                    <signal>
                      <name>unselect_row</name>
                      <handler>on_clist_nodes_unselect_row</handler>
-                     <last_modification_time>Sun, 26 Mar 2000 18:27:40 
GMT</last_modification_time>
+                     <last_modification_time>Mon, 15 Dec 2003 15:34:19 
GMT</last_modification_time>
                    </signal>
                    <signal>
                      <name>button_press_event</name>
                      <handler>on_clist_nodes_button_press_event</handler>
-                     <last_modification_time>Sat, 29 Apr 2000 18:51:37 
GMT</last_modification_time>
+                     <last_modification_time>Mon, 15 Dec 2003 15:34:48 
GMT</last_modification_time>
                    </signal>
                    <signal>
                      <name>resize_column</name>
                      <handler>on_clist_nodes_resize_column</handler>
-                     <last_modification_time>Tue, 09 May 2000 19:18:06 
GMT</last_modification_time>
+                     <last_modification_time>Mon, 15 Dec 2003 15:35:10 
GMT</last_modification_time>
                    </signal>
-                   <columns>7</columns>
-                   <column_widths>80,80,80,80,80,80,80</column_widths>
+                   <columns>6</columns>
+                   <column_widths>80,80,80,80,80,80</column_widths>
                    <selection_mode>GTK_SELECTION_EXTENDED</selection_mode>
                    <show_titles>True</show_titles>
                    <shadow_type>GTK_SHADOW_IN</shadow_type>
@@ -1110,19 +1111,6 @@
                      <child_name>CList:title</child_name>
                      <name>label_node_vendor</name>
                      <label>User-agent</label>
-                     <justify>GTK_JUSTIFY_CENTER</justify>
-                     <wrap>False</wrap>
-                     <xalign>0.5</xalign>
-                     <yalign>0.5</yalign>
-                     <xpad>0</xpad>
-                     <ypad>0</ypad>
-                   </widget>
-
-                   <widget>
-                     <class>GtkLabel</class>
-                     <child_name>CList:title</child_name>
-                     <name>label_node_proto</name>
-                     <label>Ver</label>
                      <justify>GTK_JUSTIFY_CENTER</justify>
                      <wrap>False</wrap>
                      <xalign>0.5</xalign>
Index: src/interface-glade1.c
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/interface-glade1.c,v
retrieving revision 1.85
diff -u -r1.85 interface-glade1.c
--- src/interface-glade1.c      13 Dec 2003 09:24:03 -0000      1.85
+++ src/interface-glade1.c      15 Dec 2003 17:14:09 -0000
@@ -114,7 +114,6 @@
   GtkWidget *label13;
   GtkWidget *label14;
   GtkWidget *label_node_vendor;
-  GtkWidget *label_node_proto;
   GtkWidget *label_node_connected;
   GtkWidget *label_node_uptime;
   GtkWidget *label_node_info;
@@ -1679,7 +1678,7 @@
   gtk_box_pack_start (GTK_BOX (vbox17), sw_nodes, TRUE, TRUE, 0);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw_nodes), 
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 
-  clist_nodes = gtk_clist_new (7);
+  clist_nodes = gtk_clist_new (6);
   gtk_widget_set_name (clist_nodes, "clist_nodes");
   gtk_widget_ref (clist_nodes);
   gtk_object_set_data_full (GTK_OBJECT (main_window), "clist_nodes", clist_nodes,
@@ -1687,14 +1686,12 @@
   gtk_widget_show (clist_nodes);
   gtk_container_add (GTK_CONTAINER (sw_nodes), clist_nodes);
   gtk_container_set_border_width (GTK_CONTAINER (clist_nodes), 2);
-  GTK_WIDGET_UNSET_FLAGS (clist_nodes, GTK_CAN_FOCUS);
   gtk_clist_set_column_width (GTK_CLIST (clist_nodes), 0, 80);
   gtk_clist_set_column_width (GTK_CLIST (clist_nodes), 1, 80);
   gtk_clist_set_column_width (GTK_CLIST (clist_nodes), 2, 80);
   gtk_clist_set_column_width (GTK_CLIST (clist_nodes), 3, 80);
   gtk_clist_set_column_width (GTK_CLIST (clist_nodes), 4, 80);
   gtk_clist_set_column_width (GTK_CLIST (clist_nodes), 5, 80);
-  gtk_clist_set_column_width (GTK_CLIST (clist_nodes), 6, 80);
   gtk_clist_set_selection_mode (GTK_CLIST (clist_nodes), GTK_SELECTION_EXTENDED);
   gtk_clist_column_titles_show (GTK_CLIST (clist_nodes));
 
@@ -1723,21 +1720,13 @@
   gtk_widget_show (label_node_vendor);
   gtk_clist_set_column_widget (GTK_CLIST (clist_nodes), 2, label_node_vendor);
 
-  label_node_proto = gtk_label_new (_("Ver"));
-  gtk_widget_set_name (label_node_proto, "label_node_proto");
-  gtk_widget_ref (label_node_proto);
-  gtk_object_set_data_full (GTK_OBJECT (main_window), "label_node_proto", 
label_node_proto,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (label_node_proto);
-  gtk_clist_set_column_widget (GTK_CLIST (clist_nodes), 3, label_node_proto);
-
   label_node_connected = gtk_label_new (_("Connected"));
   gtk_widget_set_name (label_node_connected, "label_node_connected");
   gtk_widget_ref (label_node_connected);
   gtk_object_set_data_full (GTK_OBJECT (main_window), "label_node_connected", 
label_node_connected,
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show (label_node_connected);
-  gtk_clist_set_column_widget (GTK_CLIST (clist_nodes), 4, label_node_connected);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_nodes), 3, label_node_connected);
 
   label_node_uptime = gtk_label_new (_("Uptime"));
   gtk_widget_set_name (label_node_uptime, "label_node_uptime");
@@ -1745,7 +1734,7 @@
   gtk_object_set_data_full (GTK_OBJECT (main_window), "label_node_uptime", 
label_node_uptime,
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show (label_node_uptime);
-  gtk_clist_set_column_widget (GTK_CLIST (clist_nodes), 5, label_node_uptime);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_nodes), 4, label_node_uptime);
 
   label_node_info = gtk_label_new (_("Info"));
   gtk_widget_set_name (label_node_info, "label_node_info");
@@ -1753,7 +1742,7 @@
   gtk_object_set_data_full (GTK_OBJECT (main_window), "label_node_info", 
label_node_info,
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show (label_node_info);
-  gtk_clist_set_column_widget (GTK_CLIST (clist_nodes), 6, label_node_info);
+  gtk_clist_set_column_widget (GTK_CLIST (clist_nodes), 5, label_node_info);
   gtk_misc_set_alignment (GTK_MISC (label_node_info), 7.45058e-09, 0.5);
 
   hbox2 = gtk_hbox_new (FALSE, 4);
@@ -12154,7 +12143,7 @@
   gtk_widget_show (label_about_title);
   gtk_box_pack_start (GTK_BOX (hbox170), label_about_title, TRUE, TRUE, 0);
 
-  label_about_rcsid = gtk_label_new (_("$Id: interface-glade1.c,v 1.85 2003/12/13 
09:24:03 nonamer Exp $"));
+  label_about_rcsid = gtk_label_new (_("$Id: gtk-gnutella.glade,v 1.169 2003/12/13 
09:24:02 nonamer Exp $"));
   gtk_widget_set_name (label_about_rcsid, "label_about_rcsid");
   gtk_widget_ref (label_about_rcsid);
   gtk_object_set_data_full (GTK_OBJECT (dlg_about), "label_about_rcsid", 
label_about_rcsid,
@@ -12221,7 +12210,7 @@
                     (GtkAttachOptions) (0), 0, 0);
   gtk_misc_set_alignment (GTK_MISC (label266), 1, 0.5);
 
-  label267 = gtk_label_new (_("Rapha�l Manfredi"));
+  label267 = gtk_label_new (_("Rapha\353l Manfredi"));
   gtk_widget_set_name (label267, "label267");
   gtk_widget_ref (label267);
   gtk_object_set_data_full (GTK_OBJECT (dlg_about), "label267", label267,
@@ -12265,7 +12254,7 @@
                     (GtkAttachOptions) (0), 0, 0);
   gtk_misc_set_alignment (GTK_MISC (label291), 1, 0.5);
 
-  label273 = gtk_label_new (_("Rapha�l Manfredi"));
+  label273 = gtk_label_new (_("Rapha\353l Manfredi"));
   gtk_widget_set_name (label273, "label273");
   gtk_widget_ref (label273);
   gtk_object_set_data_full (GTK_OBJECT (dlg_about), "label273", label273,
Index: src/nodes_gui.c
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/nodes_gui.c,v
retrieving revision 1.30
diff -u -r1.30 nodes_gui.c
--- src/nodes_gui.c     9 Aug 2003 22:16:03 -0000       1.30
+++ src/nodes_gui.c     15 Dec 2003 17:14:10 -0000
@@ -35,12 +35,23 @@
 
 RCSID("$Id: nodes_gui.c,v 1.30 2003/08/09 22:16:03 rmanfredi Exp $");
 
-static gchar gui_tmp[4096];
-
 static void nodes_gui_update_node_info(gnet_node_info_t *n);
 static void nodes_gui_update_node_flags(
        gnet_node_t n, gnet_node_flags_t *flags);
 
+/*
+ * The column numbers for the GtkCList
+ */
+enum {
+       COL_NODE_HOST,
+       COL_NODE_TYPE,
+       COL_NODE_VENDOR,
+       COL_NODE_CONNECTED,
+       COL_NODE_UPTIME,
+       COL_NODE_INFO,
+       NUM_OF_COLUMNS
+};     
+
 
 /***
  *** Callbacks
@@ -130,21 +141,18 @@
 
         node_get_status(n->node_handle, &status);
 
-        gtk_clist_set_text(clist, row, 2, n->vendor ? n->vendor : "...");
-
-        gm_snprintf(gui_tmp, sizeof(gui_tmp), "%d.%d",
-            n->proto_major, n->proto_minor);
-        gtk_clist_set_text(clist, row, 3, gui_tmp);
+        gtk_clist_set_text(clist, row, COL_NODE_VENDOR,
+                       n->vendor ? n->vendor : "...");
 
                if (status.status == GTA_NODE_CONNECTED)
-               gtk_clist_set_text(clist, row, 4, 
+               gtk_clist_set_text(clist, row, COL_NODE_CONNECTED, 
                                short_uptime(now - status.connect_date));
 
                if (status.up_date)
-           gtk_clist_set_text(clist, row, 5, 
+           gtk_clist_set_text(clist, row, COL_NODE_UPTIME, 
                        status.up_date ?  short_uptime(now - status.up_date) : "...");
 
-        gtk_clist_set_text(clist, row, 6,
+        gtk_clist_set_text(clist, row, COL_NODE_INFO,
                        nodes_gui_common_status_str(&status, now));
     } else {
         g_warning("%s: no matching row found", G_GNUC_PRETTY_FUNCTION);
@@ -163,7 +171,7 @@
 
        row = gtk_clist_find_row_from_data(clist, GUINT_TO_POINTER(n));
     if (row != -1) {
-        gtk_clist_set_text(clist, row, 1,
+        gtk_clist_set_text(clist, row, COL_NODE_TYPE,
                        nodes_gui_common_flags_str(flags));
     } else {
         g_warning("%s: no matching row found", G_GNUC_PRETTY_FUNCTION);
@@ -244,26 +252,23 @@
 {
     GtkCList *clist_nodes;
     gint row;
-       gchar *titles[7];
-       gchar proto_tmp[32];
+       gchar *titles[NUM_OF_COLUMNS];
 
     g_assert(n != NULL);
 
-       gm_snprintf(proto_tmp, sizeof(proto_tmp), "%d.%d",
-               n->proto_major, n->proto_minor);
-
-    titles[0] = ip_port_to_gchar(n->ip, n->port);
-    titles[1] = "...";
-    titles[2] = n->vendor ? n->vendor : "...";
-    titles[3] = proto_tmp;
-    titles[4] = "...";
-    titles[5] = "...";
-    titles[6] = "...";
+    titles[COL_NODE_HOST] = ip_port_to_gchar(n->ip, n->port);
+    titles[COL_NODE_TYPE] = "...";
+    titles[COL_NODE_VENDOR] = n->vendor ? n->vendor : "...";
+    titles[COL_NODE_CONNECTED] = "...";
+    titles[COL_NODE_UPTIME] = "...";
+    titles[COL_NODE_INFO] = "...";
 
-    clist_nodes = GTK_CLIST(lookup_widget(main_window, "clist_nodes"));
+    clist_nodes = GTK_CLIST(lookup_widget(main_window,
+               "clist_nodes"));
 
     row = gtk_clist_append(clist_nodes, titles);
-    gtk_clist_set_row_data(clist_nodes, row, GUINT_TO_POINTER(n->node_handle));
+    gtk_clist_set_row_data(clist_nodes, row,
+               GUINT_TO_POINTER(n->node_handle));
 }
 
 
@@ -308,15 +313,15 @@
                 */
 
                if (status.status == GTA_NODE_CONNECTED) {
-               gtk_clist_set_text(clist, row, 4, 
+               gtk_clist_set_text(clist, row, COL_NODE_CONNECTED, 
                                short_uptime(now - status.connect_date));
                
                        if (status.up_date)
-                               gtk_clist_set_text(clist, row, 5, 
+                               gtk_clist_set_text(clist, row, COL_NODE_UPTIME, 
                                        status.up_date ?
                                                short_uptime(now - status.up_date) : 
"...");
                }
-        gtk_clist_set_text(clist, row, 6,
+        gtk_clist_set_text(clist, row, COL_NODE_INFO,
                        nodes_gui_common_status_str(&status, now));
     }
     gtk_clist_thaw(clist);
Index: src/nodes_gui2.c
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/nodes_gui2.c,v
retrieving revision 1.37
diff -u -r1.37 nodes_gui2.c
--- src/nodes_gui2.c    29 Oct 2003 17:57:00 -0000      1.37
+++ src/nodes_gui2.c    15 Dec 2003 17:14:10 -0000
@@ -46,7 +46,6 @@
     COL_NODE_HOST,
     COL_NODE_TYPE,
     COL_NODE_VENDOR,
-    COL_NODE_VERSION,
     COL_NODE_CONNECTED,
     COL_NODE_UPTIME,
     COL_NODE_INFO,
@@ -152,7 +151,6 @@
 
        gtk_list_store_set(nodes_model, iter, 
                COL_NODE_VENDOR, lazy_locale_to_utf8(pretty_node_vendor(n), 0),
-               COL_NODE_VERSION, version,
                COL_NODE_INFO, nodes_gui_common_status_str(&status, now),
                (-1));
 }
@@ -203,7 +201,6 @@
         G_TYPE_STRING,   /* COL_NODE_HOST */
         G_TYPE_STRING,   /* COL_NODE_TYPE */
         G_TYPE_STRING,   /* COL_NODE_VENDOR */
-        G_TYPE_STRING,   /* COL_NODE_VERSION */
         G_TYPE_STRING,   /* COL_NODE_CONNECTED */
         G_TYPE_STRING,   /* COL_NODE_UPTIME */
         G_TYPE_STRING,   /* COL_NODE_INFO */
@@ -231,7 +228,6 @@
     add_column(tree, COL_NODE_HOST, width[COL_NODE_HOST], "Host");
     add_column(tree, COL_NODE_TYPE, width[COL_NODE_TYPE], "Flags");
     add_column(tree, COL_NODE_VENDOR, width[COL_NODE_VENDOR], "User-agent");
-    add_column(tree, COL_NODE_VERSION, width[COL_NODE_VERSION], "Ver");
     add_column(tree, COL_NODE_CONNECTED, width[COL_NODE_CONNECTED],
                "Connected");
     add_column(tree, COL_NODE_UPTIME, width[COL_NODE_UPTIME], "Uptime");
@@ -303,7 +299,6 @@
         COL_NODE_HOST,    ip_port_to_gchar(n->ip, n->port),
         COL_NODE_TYPE,    NULL,
         COL_NODE_VENDOR,  lazy_locale_to_utf8(pretty_node_vendor(n), 0),
-        COL_NODE_VERSION, proto_tmp,
         COL_NODE_CONNECTED, NULL,
         COL_NODE_UPTIME,  NULL,
         COL_NODE_INFO,    NULL,

Reply via email to