Re: [gnome-network][PATCH] netinfo



El lun, 15-12-2003 a las 19:55, William Jon McCann escribió:
> Hi,
> 
> This is a nice feature.  However, I think there is a slight problem with 
> the way you have implemented it.
> 
> It assumes that only one process is going at a time.  For example, try this:
> 
> Start an unlimited number of pings.  Watch cursor is visible.  Go to 
> Netstat and display routing information.  When it completes the watch 
> cursor is gone.  However, the pings are still going.
> 
> Maybe the cursor state should be set individually for each notebook 
> pages on the interface?

Yes, the cursor is set now only for each treeview. An updated patch have
been attached.

> Also, you probably don't want to modify ping.c.
> 
> Thanks,
> Jon
> 
> Carlos Garcia Campos wrote:
> > Hi all,
> > 
> > Sometimes, when you launch a ping or traceroute or any other process, it
> > seems to do nothing for a while. I propose a patch to change the cursor
> > to GDK_WATCH when a process is running.
> > 
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > Index: ChangeLog
> > ===================================================================
> > RCS file: /cvs/gnome/gnome-network/gnome-netinfo/ChangeLog,v
> > retrieving revision 1.102
> > diff -u -u -r1.102 ChangeLog
> > --- ChangeLog	5 Dec 2003 02:27:22 -0000	1.102
> > +++ ChangeLog	9 Dec 2003 13:27:54 -0000
> > @@ -1,3 +1,9 @@
> > +2003-12-09  Carlos García Campos <carlosgc gnome org>
> > +
> > +	* info.c (get_nic_information): removed invalid g_free()
> > +	* netinfo.c (toggle_state): change the cursor to GDK_WATCH when 
> > +	a process is running
> > +	  
> >  2003-12-01  Bastien Nocera  <hadess hadess net>
> >                                                                                  
> >  	* main.c: (load_whois_widgets_from_xml): we don't have a "user"
> > Index: info.c
> > ===================================================================
> > RCS file: /cvs/gnome/gnome-network/gnome-netinfo/info.c,v
> > retrieving revision 1.19
> > diff -u -u -r1.19 info.c
> > --- info.c	20 Nov 2003 21:12:42 -0000	1.19
> > +++ info.c	9 Dec 2003 13:27:55 -0000
> > @@ -306,7 +306,6 @@
> >  			break;
> >  		}
> >  	}
> > -	g_free (ifr);
> >  }
> >  
> >  static GList *
> > Index: netinfo.c
> > ===================================================================
> > RCS file: /cvs/gnome/gnome-network/gnome-netinfo/netinfo.c,v
> > retrieving revision 1.17
> > diff -u -u -r1.17 netinfo.c
> > --- netinfo.c	20 Nov 2003 21:12:43 -0000	1.17
> > +++ netinfo.c	9 Dec 2003 13:27:55 -0000
> > @@ -164,7 +164,7 @@
> >  netinfo_process_command (Netinfo * netinfo)
> >  {
> >  	g_return_if_fail (netinfo != NULL);
> > -
> > +	
> >  	netinfo_toggle_state (netinfo, INACTIVE, NULL);
> >  
> >  	netinfo_text_buffer_insert (netinfo);
> > @@ -174,7 +174,7 @@
> >  netinfo_text_buffer_insert (Netinfo * netinfo)
> >  {
> >  	gchar *dir = g_get_current_dir ();
> > -	gint child_pid, pout, perr;
> > +	gint child_pid, pout/*, perr*/;
> >  	GIOChannel *channel;
> >  	GError *err = NULL;
> >  
> > @@ -306,6 +306,8 @@
> >  netinfo_toggle_state (Netinfo * netinfo, gboolean state,
> >  		      gpointer user_data)
> >  {
> > +	GdkCursor *cursor;
> > +	
> >  	g_assert (netinfo != NULL);
> >  	g_return_if_fail (netinfo != NULL);
> >  
> > @@ -315,8 +317,14 @@
> >  	}
> >  
> >  	if (state) {
> > +		gdk_window_set_cursor ((netinfo->main_window)->window, NULL);
> >  		netinfo->child_pid = 0;
> > +	} else {
> > +		cursor = gdk_cursor_new (GDK_WATCH);
> > +		gdk_window_set_cursor ((netinfo->main_window)->window, cursor);
> > +		gdk_cursor_unref (cursor);
> >  	}
> > +	
> >  	netinfo->running = !state;
> >  
> >  	netinfo_toggle_button (netinfo);
> > Index: ping.c
> > ===================================================================
> > RCS file: /cvs/gnome/gnome-network/gnome-netinfo/ping.c,v
> > retrieving revision 1.22
> > diff -u -u -r1.22 ping.c
> > --- ping.c	20 Nov 2003 21:12:43 -0000	1.22
> > +++ ping.c	9 Dec 2003 13:27:55 -0000
> > @@ -344,7 +344,7 @@
> >  	if (count != 5 && count != 6) {
> >  
> >  	}
> > -	/*printf ("DBG: bytes: %d, ip: %s, icmp_seq: %d\n", data->bytes, data->ip, data->icmp_seq);*/
> > +
> >  	return count;
> >  }
> >  
> 
> _______________________________________________
> gnome-network-list mailing list
> gnome-network-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-network-list
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 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-network/gnome-netinfo/ChangeLog,v
retrieving revision 1.103
diff -u -u -r1.103 ChangeLog
--- ChangeLog	15 Dec 2003 19:15:23 -0000	1.103
+++ ChangeLog	15 Dec 2003 22:46:48 -0000
@@ -1,5 +1,18 @@
 2003-12-15  Carlos García Campos <carlosgc gnome org>
 
+	* netinfo.[ch] (is_ipv6_enable): added is_ipv6_enable function to know if
+	IPv6 is enabled in the system
+	* netinfo.c (toggle_state): change the cursor to GDK_WATCH when
+        a process is running
+	* netstat.[ch] (get_active_option, strip_protocol_line,
+        strip_route_line, *_tree_insert): IPv6 support
+	* netstat.[ch] (get_active_option): checks if IPv6 is enabled before use
+	inet6 protocol
+	* netstat.c (*_tree_insert): the tree_model doesn't change when
+        you toggle between protocol and route twice
+
+2003-12-15  Carlos García Campos <carlosgc gnome org>
+
 	* info.c (info_get_nic_information): removed invalid g_free()
 
 2003-12-01  Bastien Nocera  <hadess hadess net>
Index: netinfo.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/netinfo.c,v
retrieving revision 1.17
diff -u -u -r1.17 netinfo.c
--- netinfo.c	20 Nov 2003 21:12:43 -0000	1.17
+++ netinfo.c	15 Dec 2003 22:46:48 -0000
@@ -164,7 +176,7 @@
 netinfo_process_command (Netinfo * netinfo)
 {
 	g_return_if_fail (netinfo != NULL);
-
+	
 	netinfo_toggle_state (netinfo, INACTIVE, NULL);
 
 	netinfo_text_buffer_insert (netinfo);
@@ -174,7 +186,7 @@
 netinfo_text_buffer_insert (Netinfo * netinfo)
 {
 	gchar *dir = g_get_current_dir ();
-	gint child_pid, pout, perr;
+	gint child_pid, pout/*, perr*/;
 	GIOChannel *channel;
 	GError *err = NULL;
 
@@ -306,6 +318,8 @@
 netinfo_toggle_state (Netinfo * netinfo, gboolean state,
 		      gpointer user_data)
 {
+	GdkCursor *cursor;
+	
 	g_assert (netinfo != NULL);
 	g_return_if_fail (netinfo != NULL);
 
@@ -315,8 +329,14 @@
 	}
 
 	if (state) {
+		gdk_window_set_cursor ((netinfo->output)->window, NULL);
 		netinfo->child_pid = 0;
+	} else {
+		cursor = gdk_cursor_new (GDK_WATCH);
+		gdk_window_set_cursor ((netinfo->output)->window, cursor);
+		gdk_cursor_destroy (cursor);
 	}
+	
 	netinfo->running = !state;
 
 	netinfo_toggle_button (netinfo);

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]