[patch] Re: [gnome-network]clear history menu item
- From: William Jon McCann <mccannwj pha jhu edu>
- To: gnome-network-list gnome org
- Subject: [patch] Re: [gnome-network]clear history menu item
- Date: Thu, 20 Nov 2003 16:51:47 -0500
German Poo Caaman~o wrote:
El jue, 20-11-2003 a las 16:24, William Jon McCann escribió:
Hi,
I have a patch that adds a "Clear History" item to the menu. It clears
the GnomeEntry history for each of the notebook pages. This puts users
directly in control and helps with privacy issues.
My question is: where should it go in the menus? Under Edit?
I guess Edit. At least "clear" action always goes under edit. In this
case, it's a special kind of clear :-)
You got it :)
It seems to only works well with libgnomeui > 2.2. On my RH9 system
(libgnomeui 2.2) I must restart the app for the history to clear. With
newer version the history is cleared directly.
Ok to commit?
Jon
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/ChangeLog,v
retrieving revision 1.98
diff -u -r1.98 ChangeLog
--- ChangeLog 20 Nov 2003 21:12:42 -0000 1.98
+++ ChangeLog 20 Nov 2003 21:47:51 -0000
@@ -1,5 +1,9 @@
2003-11-20 William Jon McCann <mccann jhu edu>
+ * callbacks.c (on_clear_history_activate):
+ * callbacks.h:
+ * gnome-netinfo.glade: Add a Clear History menu item.
+
* main.c (main, load_info_widgets_from_xml):
* util-mii.c:
* whois.c (whois_do, whois_foreach):
Index: callbacks.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/callbacks.c,v
retrieving revision 1.28
diff -u -r1.28 callbacks.c
--- callbacks.c 20 Nov 2003 21:12:42 -0000 1.28
+++ callbacks.c 20 Nov 2003 21:47:51 -0000
@@ -270,3 +270,20 @@
(netinfo->copy_output) ((gpointer) netinfo, NULL);
}
}
+
+void
+on_clear_history_activate (GtkWidget * notebook, gpointer data)
+{
+ Netinfo *netinfo;
+
+ g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
+
+ /* Pages all share a history id for host entry except whois */
+ netinfo = g_object_get_data (G_OBJECT (notebook), "finger");
+ gnome_entry_clear_history (GNOME_ENTRY (netinfo->host));
+ gnome_entry_clear_history (GNOME_ENTRY (netinfo->user));
+
+ netinfo = g_object_get_data (G_OBJECT (notebook), "whois");
+ gnome_entry_clear_history (GNOME_ENTRY (netinfo->host));
+
+}
Index: callbacks.h
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/callbacks.h,v
retrieving revision 1.11
diff -u -r1.11 callbacks.h
--- callbacks.h 19 Nov 2003 16:19:10 -0000 1.11
+++ callbacks.h 20 Nov 2003 21:47:51 -0000
@@ -22,3 +22,5 @@
void on_about_activate (GtkWidget * parent, gpointer data);
void on_copy_activate (GtkWidget * notebook, gpointer data);
+
+void on_clear_history_activate (GtkWidget * notebook, gpointer data);
Index: gnome-netinfo.glade
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/gnome-netinfo.glade,v
retrieving revision 1.28
diff -u -r1.28 gnome-netinfo.glade
--- gnome-netinfo.glade 19 Nov 2003 16:19:10 -0000 1.28
+++ gnome-netinfo.glade 20 Nov 2003 21:47:51 -0000
@@ -61,6 +61,30 @@
<signal name="activate" handler="on_copy_activate" object="notebook" last_modification_time="Sun, 20 Jul 2003 22:11:25 GMT"/>
</widget>
</child>
+ <child>
+ <widget class="GtkImageMenuItem" id="separator1">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="m_clear_history">
+ <property name="visible">True</property>
+ <property name="label">Clear _History</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_clear_history_activate" object="notebook" last_modification_time="Thu, 20 Nov 2003 22:11:25 GMT"/>
+ <child internal-child="image">
+ <widget class="GtkImage" id="m_clear_history_pixmap">
+ <property name="visible">True</property>
+ <property name="stock">gtk-clear</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
</child>
</widget>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]