aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-07-01 08:41:13 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-07-01 08:41:13 +0800
commitfe0499e1d95e45291b655f1d068430014b5971db (patch)
tree7eb421b701f33b5a82bfd07a286240fa58789766 /mail/mail-callbacks.c
parent0d23a1ac2a2dfcc05e6540becf471c42aaa68313 (diff)
downloadgsoc2013-evolution-fe0499e1d95e45291b655f1d068430014b5971db.tar.gz
gsoc2013-evolution-fe0499e1d95e45291b655f1d068430014b5971db.tar.zst
gsoc2013-evolution-fe0499e1d95e45291b655f1d068430014b5971db.zip
Changed to return the created window. (find_socket): Added. Copied from
2001-06-30 Jon Trowbridge <trow@ximian.com> * mail-display.c (make_popup_window): Changed to return the created window. (find_socket): Added. Copied from e-shell-view.c. The fact that I'm copying this bit of code all over isn't cool. (html_button_press_event): Properly destroy the popup window when the widget inside the control is destroyed. * mail-callbacks.c (addrbook_sender): Added. Implements the "Add sender to addressbook" right-click. (Bug #3645) (find_socket): Added. Copied from e-shell-view.c. * folder-browser.c: Added "Add sender to addressbook" to context_menu[]. * mail-display.c: (handle_embedded_address_object): Removed. (on_object_requested): Removed handling for embedded address objects. (Which was obsolete crap.) svn path=/trunk/; revision=10643
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 62103fb43d..a4d1647515 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -38,6 +38,8 @@
#include <libgnome/gnome-paper.h>
#include <libgnomeprint/gnome-print-master.h>
#include <libgnomeprint/gnome-print-master-preview.h>
+#include <bonobo/bonobo-widget.h>
+#include <bonobo/bonobo-socket.h>
#include <gal/e-table/e-table.h>
#include <gal/widgets/e-gui-utils.h>
#include <filter/filter-editor.h>
@@ -996,6 +998,70 @@ copy_msg (GtkWidget *widget, gpointer user_data)
transfer_msg (widget, user_data, FALSE);
}
+/* Copied from e-shell-view.c */
+static GtkWidget *
+find_socket (GtkContainer *container)
+{
+ GList *children, *tmp;
+
+ children = gtk_container_children (container);
+ while (children) {
+ if (BONOBO_IS_SOCKET (children->data))
+ return children->data;
+ else if (GTK_IS_CONTAINER (children->data)) {
+ GtkWidget *socket = find_socket (children->data);
+ if (socket)
+ return socket;
+ }
+ tmp = children->next;
+ g_list_free_1 (children);
+ children = tmp;
+ }
+ return NULL;
+}
+
+void
+addrbook_sender (GtkWidget *widget, gpointer user_data)
+{
+ FolderBrowser *fb = FOLDER_BROWSER (user_data);
+ CamelMimeMessage *msg = NULL;
+ const CamelInternetAddress *addr;
+ gchar *addr_str;
+ GtkWidget *win;
+ GtkWidget *control;
+ GtkWidget *socket;
+
+ if (fb && fb->mail_display)
+ msg = fb->mail_display->current_message;
+
+ if (msg == NULL)
+ return;
+
+ addr = camel_mime_message_get_from (msg);
+ if (addr == NULL)
+ return;
+
+ addr_str = camel_address_format (CAMEL_ADDRESS (addr));
+
+ win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title (GTK_WINDOW (win), _("Sender"));
+
+ control = bonobo_widget_new_control ("OAFIID:GNOME_Evolution_Addressbook_AddressPopup",
+ CORBA_OBJECT_NIL);
+ bonobo_widget_set_property (BONOBO_WIDGET (control),
+ "email", addr_str,
+ NULL);
+
+ socket = find_socket (GTK_CONTAINER (control));
+ gtk_signal_connect_object (GTK_OBJECT (socket),
+ "destroy",
+ GTK_SIGNAL_FUNC (gtk_widget_destroy),
+ GTK_OBJECT (win));
+
+ gtk_container_add (GTK_CONTAINER (win), control);
+ gtk_widget_show_all (win);
+}
+
void
apply_filters (GtkWidget *widget, gpointer user_data)
{