aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-04-24 10:51:45 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-04-24 10:51:45 +0800
commit038d1a932ce339985c91b05c2be35d512f7cef71 (patch)
tree83a183c4f1b31ec9bbbc1e0421753946f7617236 /addressbook
parente37b58efec96ce102e8c354a979a2b37d28249c7 (diff)
downloadgsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.tar.gz
gsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.tar.zst
gsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.zip
Removed attempts to use Radek's evil <DATA> hacks, which were just causing
2001-04-23 Jon Trowbridge <trow@ximian.com> * e-html-utils.c (e_text_to_html_full): Removed attempts to use Radek's evil <DATA> hacks, which were just causing me (and GtkHTML) grief. 2001-04-23 Jon Trowbridge <trow@ximian.com> * gui/component/e-address-popup.c: Lots of code has been simplified here. (e_address_popup_factory_new_control): Rather than directly pop our control up in a window (via the e_address_popup_popup function, which is now gone), just return the widget and let the caller do the popping. This works better, since it means we don't have to work around the vagaries of bonobo focus & event handling. (e_address_popup_set_name): Refresh when both name & email have been set, rather than checking a stupid counter. (e_address_popup_set_email): Ditto. 2001-04-23 Jon Trowbridge <trow@ximian.com> * mail-display.c (html_button_press_event): Check for mailto: links, and pop up our mail address menu when we find one. (make_popup_window): The main piece of code (ignoring a zillion little callbacks) to pop up our windows with reasonable semantics for having them close automatically. (mail_text_write): Enable converting addresses to mailto links in message bodies. * mail-format.c (write_address): Simplify code, removing Radek's <DATA> hacks. Write out addresses as mailto: links. svn path=/trunk/; revision=9534
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog13
-rw-r--r--addressbook/gui/component/e-address-popup.c119
-rw-r--r--addressbook/gui/component/e-address-popup.h1
3 files changed, 32 insertions, 101 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index f5b7730140..9b6ae63628 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,16 @@
+2001-04-23 Jon Trowbridge <trow@ximian.com>
+
+ * gui/component/e-address-popup.c: Lots of code has been
+ simplified here.
+ (e_address_popup_factory_new_control): Rather than directly pop
+ our control up in a window (via the e_address_popup_popup
+ function, which is now gone), just return the widget and let the
+ caller do the popping. This works better, since it means we don't
+ have to work around the vagaries of bonobo focus & event handling.
+ (e_address_popup_set_name): Refresh when both name & email have
+ been set, rather than checking a stupid counter.
+ (e_address_popup_set_email): Ditto.
+
2001-04-22 Christopher James Lahey <clahey@ximian.com>
* gui/component/addressbook-storage.c
diff --git a/addressbook/gui/component/e-address-popup.c b/addressbook/gui/component/e-address-popup.c
index 7aebeacf21..134ce1241b 100644
--- a/addressbook/gui/component/e-address-popup.c
+++ b/addressbook/gui/component/e-address-popup.c
@@ -31,6 +31,7 @@
#include <bonobo/bonobo-property-bag.h>
#include <bonobo/bonobo-generic-factory.h>
#include <gal/widgets/e-popup-menu.h>
+#include <gal/widgets/e-unicode.h>
#include <addressbook/backend/ebook/e-book.h>
#include <addressbook/backend/ebook/e-book-util.h>
#include <addressbook/contact-editor/e-contact-editor.h>
@@ -41,11 +42,6 @@ static GtkObjectClass *parent_class;
static EBook *common_book = NULL; /* still sort of lame */
static void e_address_popup_destroy (GtkObject *);
-static void e_address_popup_realize (GtkWidget *);
-static gint e_address_popup_button_press_event (GtkWidget *, GdkEventButton *ev);
-static gint e_address_popup_enter_notify_event (GtkWidget *, GdkEventCrossing *ev);
-static gint e_address_popup_leave_notify_event (GtkWidget *, GdkEventCrossing *ev);
-
static void e_address_popup_query (EAddressPopup *);
@@ -53,16 +49,10 @@ static void
e_address_popup_class_init (EAddressPopupClass *klass)
{
GtkObjectClass *object_class = (GtkObjectClass *) klass;
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
parent_class = GTK_OBJECT_CLASS (gtk_type_class (gtk_event_box_get_type ()));
object_class->destroy = e_address_popup_destroy;
-
- widget_class->realize = e_address_popup_realize;
- widget_class->button_press_event = e_address_popup_button_press_event;
- widget_class->enter_notify_event = e_address_popup_enter_notify_event;
- widget_class->leave_notify_event = e_address_popup_leave_notify_event;
}
static void
@@ -89,57 +79,6 @@ e_address_popup_destroy (GtkObject *obj)
GTK_OBJECT_CLASS (parent_class)->destroy (obj);
}
-static void
-e_address_popup_realize (GtkWidget *w)
-{
- EAddressPopup *pop = E_ADDRESS_POPUP (w);
-
- if (GTK_WIDGET_CLASS (parent_class)->realize)
- GTK_WIDGET_CLASS (parent_class)->realize (w);
-
- /* Start the death count. */
- pop->leave_timeout_tag = gtk_timeout_add (10000, (GtkFunction) gtk_widget_destroy, pop);
-}
-
-static gint
-e_address_popup_button_press_event (GtkWidget *w, GdkEventButton *ev)
-{
- gtk_widget_destroy (w);
- return FALSE;
-}
-
-static gint
-e_address_popup_enter_notify_event (GtkWidget *w, GdkEventCrossing *ev)
-{
- EAddressPopup *pop = E_ADDRESS_POPUP (w);
-
- if (pop->leave_timeout_tag) {
- gtk_timeout_remove (pop->leave_timeout_tag);
- pop->leave_timeout_tag = 0;
- }
-
- return FALSE;
-}
-
-static gint
-e_address_popup_leave_notify_event (GtkWidget *w, GdkEventCrossing *ev)
-{
- EAddressPopup *pop = E_ADDRESS_POPUP (w);
- const gint slack=5;
- gint x, y;
-
- /* Manually check our "leave" events to avoid weird erroneous leaves
- that seem related to bonobo... */
- gdk_window_get_pointer (w->window, &x, &y, NULL);
- if (slack <= x && x < w->allocation.width-slack && slack <= y && y < w->allocation.height-slack)
- return FALSE;
-
- if (pop->leave_timeout_tag == 0)
- pop->leave_timeout_tag = gtk_timeout_add (1000, (GtkFunction) gtk_widget_destroy, pop);
-
- return FALSE;
-}
-
GtkType
e_address_popup_get_type (void)
{
@@ -199,9 +138,7 @@ e_address_popup_set_name (EAddressPopup *pop, const gchar *name)
pop->name = g_strdup (name);
g_strstrip (pop->name);
- ++pop->set_count;
-
- if (pop->set_count >= 2)
+ if (pop->name && pop->email)
e_address_popup_refresh_names (pop);
}
@@ -214,9 +151,7 @@ e_address_popup_set_email (EAddressPopup *pop, const gchar *email)
pop->email = g_strdup (email);
g_strstrip (pop->email);
- ++pop->set_count;
-
- if (pop->set_count >= 2)
+ if (pop->name && pop->email)
e_address_popup_refresh_names (pop);
}
@@ -278,36 +213,6 @@ e_address_popup_new (void)
return GTK_WIDGET (pop);
}
-static GtkWidget *
-e_address_popup_popup (EAddressPopup *pop)
-{
- GtkWidget *win, *fr;
- gint x, y;
-
- win = gtk_window_new (GTK_WINDOW_POPUP);
- fr = gtk_frame_new (NULL);
- gtk_container_add (GTK_CONTAINER (win), fr);
- gtk_container_add (GTK_CONTAINER (fr), GTK_WIDGET (pop));
-
- gtk_window_set_policy (GTK_WINDOW (win), FALSE, FALSE, FALSE);
-
- gdk_window_get_pointer (NULL, &x, &y, NULL);
- x = MAX (x-10, 0);
- y = MAX (y-10, 0);
- gtk_widget_set_uposition (win, x, y);
-
- gtk_signal_connect_object (GTK_OBJECT (pop),
- "destroy",
- GTK_SIGNAL_FUNC(gtk_widget_destroy),
- GTK_OBJECT (win));
-
- gtk_widget_show (GTK_WIDGET (pop));
- gtk_widget_show (fr);
- gtk_widget_show (win);
-
- return win;
-}
-
static void
found_fields_cb (EBook *book, EBookStatus status, EList *writable_fields, gpointer closure)
{
@@ -351,7 +256,15 @@ e_address_popup_cardify (EAddressPopup *pop, ECard *card)
static void
add_contacts_cb (EAddressPopup *pop)
{
- e_contact_quick_add (pop->name, pop->email, NULL, NULL);
+ if (pop->email && *pop->email) {
+
+ if (pop->name && *pop->name)
+ e_contact_quick_add (pop->name, pop->email, NULL, NULL);
+ else
+ e_contact_quick_add_free_form (pop->email, NULL, NULL);
+
+ }
+
gtk_widget_destroy (GTK_WIDGET (pop));
}
@@ -486,7 +399,13 @@ e_address_popup_factory_new_control (void)
GtkWidget *w;
w = e_address_popup_new ();
- control = bonobo_control_new (e_address_popup_popup (E_ADDRESS_POPUP (w)));
+ control = bonobo_control_new (w);
+ gtk_widget_show (w);
+
+ gtk_signal_connect_object (GTK_OBJECT (w),
+ "destroy",
+ GTK_SIGNAL_FUNC (bonobo_object_unref),
+ GTK_OBJECT (control));
bag = bonobo_property_bag_new (NULL, set_prop, w);
bonobo_property_bag_add (bag, "name", PROPERTY_NAME,
diff --git a/addressbook/gui/component/e-address-popup.h b/addressbook/gui/component/e-address-popup.h
index cac060fb4a..1ecfc773c7 100644
--- a/addressbook/gui/component/e-address-popup.h
+++ b/addressbook/gui/component/e-address-popup.h
@@ -49,7 +49,6 @@ struct _EAddressPopup {
guint leave_timeout_tag;
gboolean grabbed;
- gint set_count;
gchar *name;
gchar *email;
/horde3-hermes: EOL in April 2012antoine2014-08-201-2/+0 * Remove net/rsmb, MOVED entry was already added on 2014-08-13antoine2014-08-201-1/+0 * New port: sysutils/sas2ircupi2014-08-191-0/+1 * LEGAL: add entry for databases/linux-oracle-instantclient-sqlplusrene2014-07-231-0/+1 * LEGAL: add entry for databases/linux-oracle-instantclient-basicrene2014-07-231-0/+1 * - Update to latest upstream release 1.7.1riggs2014-07-171-1/+0 * Add LEGAL entry for net-p2p/btsynclwhsu2014-06-301-0/+1 * - Correct gmsh-occ entry.stephen2014-06-221-1/+1 * - Add cad/gmsh and cad/gmsh-occ ports.stephen2014-06-221-0/+2 * - Update LEGAL for some perforce portsantoine2014-06-141-0/+5 * LEGAL: Add stardict-longmaneadler2014-06-121-0/+1 * Use the wordings of RESTRICTED.jkim2014-06-121-3/+3 * Belatedly add LEGAL entries for java/jdk*-doc.jkim2014-06-121-0/+3 * - Update to 8.07.14 (and make fetchable again)antoine2014-06-011-1/+1 * Fix LEGAL/LICENSE* for multimedia/vtkmpeg2encode.riggs2014-06-011-1/+0 * LEGAL: fix multiple portseadler2014-05-261-1/+1 * Very minor update to /usr/ports/LEGAL to resolve discrepancy with make -VLEGAL.cs2014-05-191-1/+1 * LEGAL: update for stuffiteadler2014-05-171-1/+1 * LEGAL: fix multiple portseadler2014-05-171-2/+2 * LEGAL: fix multiple portseadler2014-05-171-5/+5 * Sync text of LEGAL and RESTRICTED for x11-fonts/sharefonts.olgeni2014-05-111-1/+1 * Remove expired ports:rene2014-05-111-2/+0 * Sync text of LEGAL and RESTRICTED for x11-fonts/freefonts.olgeni2014-05-111-1/+1 * Remove entry for sysutils/condor, it is no longer requires registration/manua...ak2014-05-071-1/+0 * Remove expired ports:rene2014-05-041-1/+0 * Remove expired ports:rene2014-04-111-2/+0 * Removed Long ago EOLed portbapt2014-04-101-1/+0 * Add Elasticsearch Marvel management plugin.tj2014-04-041-0/+1 * - Remove RESTRICTED.bdrewery2014-04-031-2/+2 * Remove expired ports:rene2014-04-021-4/+0 * The Oracle Java 8 JDK/JRE for Linux.jkim2014-04-011-0/+2 * Drop maintainership and fix LEGAL.ale2014-03-311-1/+1 * Remove expired port:rene2014-03-311-1/+0 * Remove expired ports:rene2014-03-251-1/+0 * libamr(n|w)briggs2014-03-151-2/+2 * - Update RESTRICTED comment for graphics/libecwj2amdmi32014-03-151-1/+1 * multimedia/linux-huludesktop: remove dead porteadler2014-03-151-1/+0 * Remove expired ports:rene2014-03-141-1/+0 * . support STAGE;bsam2014-03-131-1/+1 * Update LEGAL for thundercacheeadler2014-03-131-1/+1 * - Fix devel/raknet's distname within LEGAL filemartymac2014-03-121-1/+1 * LEGAL: fix yed legal texteadler2014-03-121-1/+1 * net/dgd-lpmud: fix LEGAL restrictionseadler2014-03-121-1/+1 * Remove expired ports:rene2014-03-101-2/+0 * LEGAL: fix kzip legal texteadler2014-03-101-1/+1 * LEGAL: fix lang/xds* portseadler2014-03-101-2/+2 * - Make case sensitive to match the output of "make -VLEGAL"tota2014-03-081-1/+1 * Remove expired ports with no active website:rene2014-03-081-1/+0 * - update LEGAL to match NO_CDROM in news/nntpcacheleeym2014-03-081-1/+1 * Mark RESTRICTED, according to EULA in the distfile, distribution is not allowedantoine2014-03-071-0/+1 * LEGAL: fix directoryeadler2014-03-031-1/+1 * Make LEGAL text match ports' RESTRICTED text in their Makefilesfeld2014-03-031-2/+2 * Fix text for www/dansguardiangarga2014-03-031-1/+1 * Fix the reason for french/homard.thierry2014-03-031-1/+1 * Sync legal with port and .src copyright.cy2014-03-031-2/+2 * Sync (and improve) the NO_PACKAGE and IGNORE statements and the entrygerald2014-03-031-1/+1 * LEGAL: make text match porteadler2014-02-231-12/+12 * Remove expired port:nemysis2014-02-191-1/+0 * Cosmetic fixes, update the pkg-descr WWWfeld2014-02-181-0/+1 * emulators/fmsx:rene2014-01-311-1/+1 * - Update to 6.8.0tota2014-01-191-1/+1 * - Fix build on recent FreeBSD (10, 11)martymac2014-01-131-0/+1 * Welcome net-mgmt/unifi2 to the treefeld2014-01-041-0/+1 * Add CONFLICTS for incoming net-mgmt/unifi2feld2014-01-041-1/+1 * Remove entry for mplayer, it is no longer restrictedarved2014-01-031-1/+0 * sync with make -VLEGALnetchild2013-12-241-1/+1 * Remove expired ports:rene2013-12-221-2/+0 * multiple: sync legaleadler2013-12-131-4/+4 * Update distname for games/flightgear-mb339-panmartymac2013-12-121-1/+1 * math/emc2: modernize porteadler2013-12-121-1/+1 * multiple: sync LEGAL and 'make -VLEGAL'eadler2013-12-121-2/+2 * multiple: sync LEGAL and 'make -VLEGAL'eadler2013-12-121-3/+3 * LEGAL: sync LEGAL texteadler2013-12-121-1/+1 * - update LEGALdinoex2013-12-121-4/+3 * - Sync legal texts for my portsmva2013-12-121-7/+15 * LEGAL, chinese/moettf: sync LEGAL texteadler2013-12-121-1/+1 * LEGAL, sysutils/arcconf: canconicalize LEGAL texteadler2013-12-121-1/+1 * LEGAL: remove security/pgpdumpeadler2013-12-121-1/+0 * - Capitalize multimedia/vdr-plugin-markad RESTRICTED.nox2013-12-121-0/+1 * Fix typo.ehaupt2013-12-121-1/+1 * - Update f-prot entry to match the output of "make -VLEGAL"tdb2013-12-111-1/+1 * LEGAL: split emulators/fuse-roms into twoeadler2013-12-111-1/+2 * - Make 'make -VLEGAL' match the entry in LEGAL andrene2013-12-111-1/+1 * LEGAL: add games/kye to LEGALeadler2013-12-111-0/+1 * LEGAL: remove security/pam_authsrveadler2013-12-111-1/+0 * Preparing for new port net-mgmt/unififeld2013-11-261-0/+1 * Remove expired ports:rene2013-11-151-1/+0 * Add Opus-22.rom for emulators/fuse-romsrene2013-11-131-1/+1 * This port installs some extra ZX spectrum ROM images which have beenrene2013-11-131-0/+1 * No public distfiles available anymore, pkgname conflict with sysutils/trackerbapt2013-10-021-1/+0 * Remove expired ports:rene2013-08-281-2/+0 * Add new port print/hplip-plugin:makc2013-07-141-0/+1 * Remove net/urtwn-firmware-kmod, integrated to head/ as of r253139.gjb2013-07-131-1/+0 * Remove expired port:rene2013-07-071-1/+0 * Change comment for uzap. Distributing the source is OK (has beenjoerg2013-06-181-1/+1 * - Add new port: net/urtwn-firmware-kmod:gjb2013-06-081-0/+1 * Restore the LEGAL statement about ventrilo-serverbapt2013-06-061-0/+1 * fwtk has gonebapt2013-06-051-1/+0 * Remove expired ports:rene2013-06-031-1/+0 * - Finish removal of support for Linux 2.4 in bsd.linux-apps.mk andrene2013-05-301-1/+0 * I copied the text from the wrong open makefile :-\eadler2013-05-181-1/+1 * Add a new port with legal issues.eadler2013-05-181-0/+1 * qjail license resolved in r316638bdrewery2013-04-291-1/+0 * Add entry to LEGAL as RESTRICTED status was added in r314731eadler2013-03-281-0/+1 * No approval process was required in my testing.eadler2013-03-251-1/+0 * No approval process was required in my testing.eadler2013-03-251-1/+0 * The file 'COPYING' in the distfile seems to indicate that the line in LEGAL i...eadler2013-03-251-1/+1 * a license was added in r300998. Since there is now the option for AGPL no re...eadler2013-03-251-1/+0 * - A port which is restricted should must not hide this facteadler2013-03-251-1/+1 * Removed in r169678eadler2013-03-221-1/+0 * Remove as port is under the GPL (r255853)eadler2013-03-211-1/+0 * The only reference to the files being restricted is Makefile.icons.eadler2013-03-211-1/+0 * Expand globs. This makes some future work a lot easier.eadler2013-03-211-6/+16 * Add a few missing entrieseadler2013-03-211-0/+2 * - Remove fsharppgj2013-03-211-1/+0 * Removed entry from port Makefile in r267037.eadler2013-03-211-1/+0 * Removed entry from port Makefile in r46360.eadler2013-03-211-1/+0 * Remove non-existent WWWeadler2013-03-191-1/+0 * tkman is licensed under the "Artistic License"eadler2013-03-191-1/+0 * Per r301175 xteddy is GPL so remove entry from LEGALeadler2013-03-191-1/+0 * Removeeadler2013-03-191-1/+0 * french/gibi: IGNORE for more than 6 monthseadler2013-03-191-1/+0 * Per r306610eadler2013-03-181-1/+0 * According to r242466 the port is now GPL so remove this entry from LEGALeadler2013-03-181-1/+0 * This software is under the BSD license:eadler2013-03-181-1/+0 * This software is under the GPLeadler2013-03-181-1/+0 * Per r172016eadler2013-03-181-1/+0 * According to r142824 the port is now BSD so remove this entry from LEGALeadler2013-03-181-1/+0 * Sort by distname. This was kind of done before but clearly got out of wack.eadler2013-03-181-64/+64 * This port seems to be legally distributed based on the COPYING fileeadler2013-03-181-1/+0 * audio/faad:eadler2013-03-181-1/+0 * Remove dns/h2n: legally questionable and obsolete.eadler2013-03-181-1/+0 * According to r160671 the port is not restricted any longereadler2013-03-181-1/+0 * According to r123287 the port is now GPLed so remove this entry from LEGALeadler2013-03-181-1/+0 * add an additional missing porteadler2013-03-181-0/+1 * acroread8 is also legally restrictedeadler2013-03-181-0/+1 * According to r206652 the port is now GPLed so remove this entry from LEGALeadler2013-03-181-1/+0 * According to r249857 the port is now GPLed so remove this entry from LEGALeadler2013-03-181-2/+0 * IDEA was no longer covered by any patents conservatively in 2012.eadler2013-03-171-1/+0 * x11-fonts appears not to exist.eadler2013-03-171-2/+0 * Make LEGAL machine parsableeadler2013-03-171-378/+168 * Remove expired, unmaintained ports:rene2013-03-141-4/+0 * 2013-03-13 misc/gopod: does not work with modern iPods anymorebapt2013-03-131-2/+0 * Remove expired, unmaintained ports:rene2013-03-061-4/+0 * Add entry for science/fvcommakc2013-02-211-0/+1 * 2012-05-10 databases/hypertable: BROKEN for more than 6 monthbapt2013-01-061-1/+0 * 2013-01-04 ports-mgmt/portmanager: Does not support modern ports features suc...bapt2013-01-061-1/+0 * Decommissioning java 1.5 (EOLed since October 2009):bapt2012-12-111-14/+0 * 2012-11-27 java/jmp: Java 1.5 is EOLedbapt2012-11-281-3/+0 * 2012-11-27 devel/p5-SPOPS: Depend on the expired p5-Class-Fieldsbapt2012-11-281-1/+0 * 2012-11-09 x11-fonts/tolkien-ttf: Does not fetch: there are no more public di...bapt2012-11-111-3/+0 * It seems that the file dgguspat.zip is the one which was legally restricted, buteadler2012-10-291-1/+0 * Remove now useless legal notice about gogobapt2012-10-261-1/+0 * 2012-10-20 chinese/wangttf: No more public distfilesbapt2012-10-261-2/+0 * 2012-10-20 games/yace: No more public distfilesbapt2012-10-261-1/+0 * 2012-10-20 lang/ironpython: No more public distfilesbapt2012-10-261-2/+0 * Remove ports which no longer exist.eadler2012-10-221-11/+2 * Add new port games/speakinghangmanjhale2012-09-221-0/+1