[gnome-network] [PATH] Tooltips and statusbar messages in Nettool



Hi all, 

attached is a patch that adds tooltips and status bar messages in gnome-
nettool.  

Ok to commit?

Greetings,
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Carlos Garcia Campos a.k.a. KaL
   elkalmail yahoo es
   carlosgc gnome org
 Grupo Linups
   Usuarios de SL/Linux de la UPSAM
 http://www.linups.org
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=             
PGP key: http://pgp.rediris.es:11371/pks/lookup?op=get&search=0x523E6462
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-nettool/ChangeLog,v
retrieving revision 1.34
diff -u -u -r1.34 ChangeLog
--- ChangeLog	14 Jun 2004 10:08:35 -0000	1.34
+++ ChangeLog	23 Jun 2004 19:55:18 -0000
@@ -1,3 +1,16 @@
+2004-06-23  Carlos Garc�Campos <carlosgc gnome org>
+
+	* src/callbacks.c (on_page_switch), src/finger.c (finger_do),
+	src/lookup.c (lookup_do), src/netstat.c (get_active_option),
+	src/nettool.[ch] (toggle_state), src/ping.c (ping_do), src/scan.c
+	(scan_do), src/traceroute.c (traceroute_do), src/whois.c (whois_do):
+	added status_bar messages
+
+	* src/main.c (load_*_widgets_from_xml): added tooltips
+
+	* src/gnome-nettool.glade: "Send unlimited requests" renamed as
+	"Unlimited requests"
+
 2004-06-14  Fernando Herrera  <fherrera onirica com>
 
 	* src/info.c: (info_get_nic_information), (info_get_interfaces):
Index: src/callbacks.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/callbacks.c,v
retrieving revision 1.9
diff -u -u -r1.9 callbacks.c
--- src/callbacks.c	10 Jun 2004 23:10:28 -0000	1.9
+++ src/callbacks.c	23 Jun 2004 19:55:19 -0000
@@ -452,10 +452,17 @@
 	if (!netinfo)
 		return;
 
-	if (netinfo->running)
+	if (netinfo->running) {
 		netinfo_progress_indicator_start (netinfo);
-	else
+		if (netinfo->stbar_text) {
+			gtk_statusbar_pop (GTK_STATUSBAR (netinfo->status_bar), 0);
+			gtk_statusbar_push (GTK_STATUSBAR (netinfo->status_bar),
+					    0, netinfo->stbar_text);
+		}
+	} else {
 		netinfo_progress_indicator_stop (netinfo);
+		gtk_statusbar_pop (GTK_STATUSBAR (netinfo->status_bar), 0);
+	}
 
 	title = g_strdup_printf ("Network Tools - %s",
 				 gtk_label_get_text (GTK_LABEL (netinfo->page_label)));
Index: src/finger.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/finger.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 finger.c
--- src/finger.c	23 Jan 2004 15:48:43 -0000	1.1.1.1
+++ src/finger.c	23 Jun 2004 19:55:19 -0000
@@ -53,6 +53,12 @@
 	host = netinfo_get_host (netinfo);
 	user = netinfo_get_user (netinfo);
 
+	if (netinfo->stbar_text)
+		g_free (netinfo->stbar_text);
+	netinfo->stbar_text = g_strdup_printf (_("Getting information of %s on %s"),
+					       g_ascii_strcasecmp (user, "") != 0 ? user : "all users",
+					       g_ascii_strcasecmp (host, "") != 0 ? host : "localhost");
+
 	buffer =
 		gtk_text_view_get_buffer (GTK_TEXT_VIEW (netinfo->output));
 
Index: src/gnome-nettool.glade
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/gnome-nettool.glade,v
retrieving revision 1.11
diff -u -u -r1.11 gnome-nettool.glade
--- src/gnome-nettool.glade	10 Jun 2004 23:10:28 -0000	1.11
+++ src/gnome-nettool.glade	23 Jun 2004 19:55:19 -0000
@@ -1477,7 +1477,7 @@
 			    <widget class="GtkRadioButton" id="ping_unlimited">
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
-			      <property name="label" translatable="yes">Send unlimited requests</property>
+			      <property name="label" translatable="yes">Unlimited requests</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
 			      <property name="focus_on_click">True</property>
@@ -3562,7 +3562,7 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkStatusbar" id="statusbar1">
+	    <widget class="GtkStatusbar" id="statusbar">
 	      <property name="visible">True</property>
 	      <property name="has_resize_grip">True</property>
 	    </widget>
Index: src/lookup.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/lookup.c,v
retrieving revision 1.3
diff -u -u -r1.3 lookup.c
--- src/lookup.c	8 Jun 2004 17:38:16 -0000	1.3
+++ src/lookup.c	23 Jun 2004 19:55:20 -0000
@@ -74,6 +74,10 @@
 
 	host = netinfo_get_host (netinfo);
 
+	if (netinfo->stbar_text)
+		g_free (netinfo->stbar_text);
+	netinfo->stbar_text = g_strdup_printf (_("Lookup %s"), host);
+
 	if (netinfo_validate_host (netinfo) == FALSE) {
 		netinfo_stop_process_command (netinfo);
 		return;
Index: src/main.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/main.c,v
retrieving revision 1.9
diff -u -u -r1.9 main.c
--- src/main.c	10 Jun 2004 23:10:28 -0000	1.9
+++ src/main.c	23 Jun 2004 19:55:20 -0000
@@ -260,6 +260,7 @@
 	GtkEntry  *entry_host;
 	GtkTreeModel *model;
 	GtkEntryCompletion *completion;
+	GtkTooltips *tips;
 
 	g_return_val_if_fail (xml != NULL, NULL);
 
@@ -288,6 +289,9 @@
 	pinger->packets_received = glade_xml_get_widget (xml, "ping_packets_received");
 	pinger->packets_loss = glade_xml_get_widget (xml, "ping_packets_loss");
 
+	pinger->status_bar = glade_xml_get_widget (xml, "statusbar");
+	pinger->stbar_text = NULL;
+
 	vbox_ping = glade_xml_get_widget (xml, "vbox_ping");
 	
 	pinger->button_callback = G_CALLBACK (on_ping_activate);
@@ -301,6 +305,11 @@
 	/*gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (pinger->host), 0);*/
 
 	entry_host = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (pinger->host)));
+	tips = gtk_tooltips_new ();
+	gtk_tooltips_set_tip (tips, GTK_WIDGET (entry_host),
+			      _("Enter the network address to ping.\n"
+				"For example: www.domain.com or 192.168.2.1"),
+			      NULL);
 	
 	completion = gtk_entry_completion_new ();
 	gtk_entry_set_completion (entry_host, completion);
@@ -332,6 +341,7 @@
 	GtkEntry  *entry_host;
 	GtkTreeModel *model;
 	GtkEntryCompletion *completion;
+	GtkTooltips *tips;
 
 	g_return_val_if_fail (xml != NULL, NULL);
 
@@ -353,6 +363,9 @@
 	tracer->routing = NULL;
 	tracer->protocol = NULL;
 	tracer->multicast = NULL;
+
+	tracer->status_bar = glade_xml_get_widget (xml, "statusbar");
+	tracer->stbar_text = NULL;
 	
 	vbox_traceroute = glade_xml_get_widget (xml, "vbox_traceroute");
 
@@ -367,6 +380,11 @@
 	/*gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (tracer->host), 0);*/
 
 	entry_host = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (tracer->host)));
+	tips = gtk_tooltips_new ();
+	gtk_tooltips_set_tip (tips, GTK_WIDGET (entry_host),
+			      _("Enter the network address to trace a route to.\n"
+				"For example: www.domain.com or 192.168.2.1"),
+			      NULL);
 
 	completion = gtk_entry_completion_new ();
 	gtk_entry_set_completion (entry_host, completion);
@@ -415,6 +433,9 @@
 	netstat->sensitive = NULL;
 	netstat->label_run = _("Netstat");
 	netstat->label_stop = NULL;
+
+	netstat->status_bar = glade_xml_get_widget (xml, "statusbar");
+	netstat->stbar_text = NULL;
 	
 	vbox_netstat = glade_xml_get_widget (xml, "vbox_netstat");
 	
@@ -520,6 +541,9 @@
 	info->list_ip_addr = glade_xml_get_widget (xml, "info_list_ip_addr");
 	info->configure_button = glade_xml_get_widget (xml, "info_configure_button");
 
+	info->status_bar = glade_xml_get_widget (xml, "statusbar");
+	info->stbar_text = NULL;
+
 	info->network_tool_path = util_find_program_in_path (GST_NETWORK_TOOL, NULL);
 
 	model = GTK_TREE_MODEL (gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_STRING,
@@ -573,6 +597,7 @@
 	GtkEntry  *entry_host;
 	GtkTreeModel *model;
 	GtkEntryCompletion *completion;
+	GtkTooltips *tips;
 
 	g_return_val_if_fail (xml != NULL, NULL);
 
@@ -594,6 +619,9 @@
 	scan->sensitive = NULL;
 	scan->label_run = _("Scan");
 	scan->label_stop = NULL;
+
+	scan->status_bar = glade_xml_get_widget (xml, "statusbar");
+	scan->stbar_text = NULL;
 	
 	scan->button_callback = G_CALLBACK (on_scan_activate);
 	scan->copy_output = NETINFO_COPY_FUNC (scan_copy_to_clipboard);
@@ -606,6 +634,11 @@
 	/*gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (scan->host), 0);*/
 
 	entry_host = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (scan->host)));
+	tips = gtk_tooltips_new ();
+	gtk_tooltips_set_tip (tips, GTK_WIDGET (entry_host),
+			      _("Enter the network address to scan for open ports.\n"
+				"For example: www.domain.com or 192.168.2.1"),
+			      NULL);
 
 	completion = gtk_entry_completion_new ();
 	gtk_entry_set_completion (entry_host, completion);
@@ -681,6 +714,7 @@
 	GtkEntry  *entry_host;
 	GtkTreeModel *model;
 	GtkEntryCompletion *completion;
+	GtkTooltips *tips;
 
 	g_return_val_if_fail (xml != NULL, NULL);
 
@@ -703,6 +737,9 @@
 	lookup->routing = NULL;
 	lookup->protocol = NULL;
 	lookup->multicast = NULL;
+
+	lookup->status_bar = glade_xml_get_widget (xml, "statusbar");
+	lookup->stbar_text = NULL;
 	
 	vbox_lookup = glade_xml_get_widget (xml, "vbox_lookup");
 
@@ -719,6 +756,11 @@
 	/*gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (lookup->host), 0);*/
 
 	entry_host = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (lookup->host)));
+	tips = gtk_tooltips_new ();
+	gtk_tooltips_set_tip (tips, GTK_WIDGET (entry_host),
+			      _("Enter the network address to lookup.\n"
+				"For example: www.domain.com or 192.168.2.1"),
+			      NULL);
 
 	completion = gtk_entry_completion_new ();
 	gtk_entry_set_completion (entry_host, completion);
@@ -751,6 +793,7 @@
 	GtkEntry  *entry_host;
 	GtkTreeModel *model;
 	GtkEntryCompletion *completion;
+	GtkTooltips *tips;
 
 	g_return_val_if_fail (xml != NULL, NULL);
 
@@ -774,6 +817,9 @@
 	finger->routing = NULL;
 	finger->protocol = NULL;
 	finger->multicast = NULL;
+
+	finger->status_bar = glade_xml_get_widget (xml, "statusbar");
+	finger->stbar_text = NULL;
 	
 	vbox_finger = glade_xml_get_widget (xml, "vbox_finger");
 
@@ -793,6 +839,10 @@
 	/*gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (finger->user), 0);*/
 
 	entry_host = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (finger->user)));
+	tips = gtk_tooltips_new ();
+	gtk_tooltips_set_tip (tips, GTK_WIDGET (entry_host),
+			      _("Enter the user to finger."),
+			      NULL);
 
 	completion = gtk_entry_completion_new ();
 	gtk_entry_set_completion (entry_host, completion);
@@ -816,6 +866,11 @@
 	/*gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (finger->host), 0);*/
 
 	entry_host = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (finger->host)));
+	tips = gtk_tooltips_new ();
+	gtk_tooltips_set_tip (tips, GTK_WIDGET (entry_host),
+			      _("Enter the network address to finger that user.\n"
+				"For example: www.domain.com or 192.168.2.1"),
+			      NULL);
 
 	completion = gtk_entry_completion_new ();
 	gtk_entry_set_completion (entry_host, completion);
@@ -848,6 +903,7 @@
 	GtkEntry  *entry_host;
 	GtkTreeModel *model;
 	GtkEntryCompletion *completion;
+	GtkTooltips *tips;
 	PangoFontDescription *font_desc;
 	
 
@@ -872,6 +928,9 @@
 	whois->protocol = NULL;
 	whois->multicast = NULL;
 
+	whois->status_bar = glade_xml_get_widget (xml, "statusbar");
+	whois->stbar_text = NULL;
+
 	vbox_whois = glade_xml_get_widget (xml, "vbox_whois");
 
 	font_desc = pango_font_description_new ();
@@ -890,6 +949,11 @@
 	/*gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (whois->host), 0);*/
 	
 	entry_host = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (whois->host)));
+	tips = gtk_tooltips_new ();
+	gtk_tooltips_set_tip (tips, GTK_WIDGET (entry_host),
+			      _("Enter a domain address to lookup its whois information.\n"
+				"For example: www.domain.com or 192.168.2.1"),
+			      NULL);
 	
 	completion = gtk_entry_completion_new ();
 	gtk_entry_set_completion (entry_host, completion);
Index: src/netstat.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/netstat.c,v
retrieving revision 1.3
diff -u -u -r1.3 netstat.c
--- src/netstat.c	7 Jun 2004 01:14:42 -0000	1.3
+++ src/netstat.c	23 Jun 2004 19:55:20 -0000
@@ -114,6 +114,10 @@
 		} else {
 			option = g_strdup ("-rn -A inet");
 		}
+
+		if (netinfo->stbar_text)
+			g_free (netinfo->stbar_text);
+		netinfo->stbar_text = g_strdup (_("Getting routing table"));
 	}
 	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (netinfo->protocol))) {
 		/* Only works for Solaris */
@@ -125,11 +129,19 @@
 		} else {
 			option = g_strdup ("-A inet -ln");
 		}
+
+		if (netinfo->stbar_text)
+			g_free (netinfo->stbar_text);
+		netinfo->stbar_text = g_strdup (_("Getting active Internet connections"));
 #endif
 	}
 	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (netinfo->multicast))) {
 		/* It works for Solaris and Linux */
 		option = g_strdup ("-g");
+
+		if (netinfo->stbar_text)
+			g_free (netinfo->stbar_text);
+		netinfo->stbar_text = g_strdup (_("Getting group memberships"));
 	}
 	return option;
 }
Index: src/nettool.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/nettool.c,v
retrieving revision 1.6
diff -u -u -r1.6 nettool.c
--- src/nettool.c	9 Jun 2004 18:06:19 -0000	1.6
+++ src/nettool.c	23 Jun 2004 19:55:21 -0000
@@ -425,6 +425,8 @@
 		netinfo_progress_indicator_stop (netinfo);
 		gdk_window_set_cursor ((netinfo->output)->window, NULL);
 		netinfo->child_pid = 0;
+		
+		gtk_statusbar_pop (GTK_STATUSBAR (netinfo->status_bar), 0);
 	} else {
 		pango_font_description_set_weight (font_desc,
 						   PANGO_WEIGHT_BOLD);
@@ -435,6 +437,12 @@
 			gtk_widget_realize (GTK_WIDGET (netinfo->output));
 		gdk_window_set_cursor ((netinfo->output)->window, cursor);
 		gdk_cursor_destroy (cursor);
+
+		if (netinfo->stbar_text) {
+			gtk_statusbar_pop (GTK_STATUSBAR (netinfo->status_bar), 0);
+			gtk_statusbar_push (GTK_STATUSBAR (netinfo->status_bar),
+					    0, netinfo->stbar_text);
+		}
 	}
 
 	gtk_widget_modify_font (netinfo->page_label, font_desc);
Index: src/nettool.h
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/nettool.h,v
retrieving revision 1.6
diff -u -u -r1.6 nettool.h
--- src/nettool.h	10 Jun 2004 23:10:28 -0000	1.6
+++ src/nettool.h	23 Jun 2004 19:55:21 -0000
@@ -39,6 +39,8 @@
 struct _Netinfo {
 	GtkWidget *main_window;
 	GtkWidget *progress_bar;
+	GtkWidget *status_bar;
+	gchar     *stbar_text;
 	GtkWidget *page_label;
 	GtkWidget *user;
 	GtkWidget *host;
Index: src/ping.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/ping.c,v
retrieving revision 1.3
diff -u -u -r1.3 ping.c
--- src/ping.c	8 Jun 2004 17:38:16 -0000	1.3
+++ src/ping.c	23 Jun 2004 19:55:21 -0000
@@ -68,6 +68,10 @@
 	count = netinfo_get_count (netinfo);
 	host = netinfo_get_host (netinfo);
 
+	if (netinfo->stbar_text)
+		g_free (netinfo->stbar_text);
+	netinfo->stbar_text = g_strdup_printf (_("Sending ping requests to %s"), host);
+	
 	rttmin = rttavg = rttmax = packets_loss = 0.0;
 	packets_transmitted = packets_received = 0;
 
@@ -344,9 +348,8 @@
 			&(data)->ttl, data->srtt, data->unit);
 #endif
 	if (count != 5 && count != 6) {
-
 	}
-	/*printf ("DBG: bytes: %d, ip: %s, icmp_seq: %d\n", data->bytes, data->ip, data->icmp_seq);*/
+
 	return count;
 }
 
Index: src/scan.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/scan.c,v
retrieving revision 1.2
diff -u -u -r1.2 scan.c
--- src/scan.c	7 Jun 2004 01:14:42 -0000	1.2
+++ src/scan.c	23 Jun 2004 19:55:21 -0000
@@ -75,6 +75,10 @@
 
 	host = netinfo_get_host (netinfo);
 
+	if (netinfo->stbar_text)
+		g_free (netinfo->stbar_text);
+	netinfo->stbar_text = g_strdup_printf (_("Scanning %s for open ports"), host);
+
 	/* Clear the current output */
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (netinfo->output));
 	if (GTK_IS_LIST_STORE (model)) {
Index: src/traceroute.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/traceroute.c,v
retrieving revision 1.3
diff -u -u -r1.3 traceroute.c
--- src/traceroute.c	8 Jun 2004 17:38:16 -0000	1.3
+++ src/traceroute.c	23 Jun 2004 19:55:21 -0000
@@ -53,6 +53,10 @@
 
 	host = netinfo_get_host (netinfo);
 
+	if (netinfo->stbar_text)
+		g_free (netinfo->stbar_text);
+	netinfo->stbar_text = g_strdup_printf (_("Tracing route to %s"), host);
+
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (netinfo->output));
 	if (GTK_IS_LIST_STORE (model)) {
 		gtk_list_store_clear (GTK_LIST_STORE (model));
Index: src/whois.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/whois.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 whois.c
--- src/whois.c	23 Jan 2004 15:48:47 -0000	1.1.1.1
+++ src/whois.c	23 Jun 2004 19:55:21 -0000
@@ -51,6 +51,10 @@
 
 	host = netinfo_get_host (netinfo);
 
+	if (netinfo->stbar_text)
+		g_free (netinfo->stbar_text);
+	netinfo->stbar_text = g_strdup_printf (_("Getting the whois information of %s"), host);
+
 	host_is_set = (strcmp (host, "") != 0);
 	if (! host_is_set)
 		return;

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]