aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Loper <mloper@src.gnome.org>2000-04-10 02:33:50 +0800
committerMatthew Loper <mloper@src.gnome.org>2000-04-10 02:33:50 +0800
commit99612fe24cfc0dcb5bc8f020fe759ccb3cfc1416 (patch)
tree1d9cbc180c215df2f66f0786f8c1180415934128
parent01bf08bdbc72d2183d40aa88b503b07bea8fff11 (diff)
downloadgsoc2013-evolution-99612fe24cfc0dcb5bc8f020fe759ccb3cfc1416.tar.gz
gsoc2013-evolution-99612fe24cfc0dcb5bc8f020fe759ccb3cfc1416.tar.zst
gsoc2013-evolution-99612fe24cfc0dcb5bc8f020fe759ccb3cfc1416.zip
+ * addressbook/Makefile.am: Compile contact-editor, _then_ gui,
+ since the gui now depends on the contact editor (shouldn't the + contact-editor directory be moved into 'gui'?). + + * addressbook/gui/component/addressbook.c (card_added_cb): New + function. Gets called when a card is successfully added via the + contact-editor. + (new_contact_cb): New function. Gets called when a user clicks the + "new contact" button on the toolbar, and creates a contact-editor + to edit a new contact entry. + (control_activate): Call gnome_app_fill_toolbar_with_data() + instead of gnome_app_fill_toolbar(), so that our toolbar can find + the right book to add a new card to. + (addressbook_factory): On an "activate" signal, send the book up + to control_activate_cb. + + * addressbook/gui/component/addressbook-factory.c (init_bonobo): + Call glade_gnome_init(), so that our contact-editor (which + requires glade) doesn't barf. + + * addressbook/gui/component/Makefile.am: added the contact-editor + to our libraries and include files. + + * addressbook/contact-editor/e-contact-editor.c + (e_contact_editor_new): Set "card" gtk property to the passed-in + card property. svn path=/trunk/; revision=2351
-rw-r--r--ChangeLog27
-rw-r--r--addressbook/Makefile.am2
-rw-r--r--addressbook/contact-editor/e-contact-editor.c2
-rw-r--r--addressbook/gui/component/Makefile.am2
-rw-r--r--addressbook/gui/component/addressbook-factory.c4
-rw-r--r--addressbook/gui/component/addressbook.c102
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c2
7 files changed, 120 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index e59b8189ed..3e600723fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,32 @@
2000-04-09 Matt Loper <matt@helixcode.com>
+ * addressbook/Makefile.am: Compile contact-editor, _then_ gui,
+ since the gui now depends on the contact editor (shouldn't the
+ contact-editor directory be moved into 'gui'?).
+
+ * addressbook/gui/component/addressbook.c (card_added_cb): New
+ function. Gets called when a card is successfully added via the
+ contact-editor.
+ (new_contact_cb): New function. Gets called when a user clicks the
+ "new contact" button on the toolbar, and creates a contact-editor
+ to edit a new contact entry.
+ (control_activate): Call gnome_app_fill_toolbar_with_data()
+ instead of gnome_app_fill_toolbar(), so that our toolbar can find
+ the right book to add a new card to.
+ (addressbook_factory): On an "activate" signal, send the book up
+ to control_activate_cb.
+
+ * addressbook/gui/component/addressbook-factory.c (init_bonobo):
+ Call glade_gnome_init(), so that our contact-editor (which
+ requires glade) doesn't barf.
+
+ * addressbook/gui/component/Makefile.am: added the contact-editor
+ to our libraries and include files.
+
+ * addressbook/contact-editor/e-contact-editor.c
+ (e_contact_editor_new): Set "card" gtk property to the passed-in
+ card property.
+
* addressbook/gui/component/addressbook.c (addressbook_factory):
Added gtk_widget_push/pop_colormap/visual, which I assume is
necessary for canvas use.
diff --git a/addressbook/Makefile.am b/addressbook/Makefile.am
index b5d6387af6..22f0922618 100644
--- a/addressbook/Makefile.am
+++ b/addressbook/Makefile.am
@@ -1,2 +1,2 @@
SUBDIRS = \
- backend gui contact-editor printing
+ backend contact-editor gui printing
diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c
index 9277eef1fd..81916847f7 100644
--- a/addressbook/contact-editor/e-contact-editor.c
+++ b/addressbook/contact-editor/e-contact-editor.c
@@ -254,6 +254,8 @@ e_contact_editor_new (ECard *card)
gtk_object_set (GTK_OBJECT(widget),
"card", card,
NULL);
+
+ E_CONTACT_EDITOR (widget)->card = card;
return widget;
}
diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am
index f5269071c4..486cc9d528 100644
--- a/addressbook/gui/component/Makefile.am
+++ b/addressbook/gui/component/Makefile.am
@@ -5,6 +5,7 @@ INCLUDES = \
-I$(top_srcdir)/e-util \
-I$(top_srcdir) \
-I$(top_srcdir)/addressbook/gui/minicard \
+ -I$(top_srcdir)/addressbook/contact-editor \
-I$(top_srcdir)/addressbook/backend/ebook \
$(BONOBO_HTML_GNOME_CFLAGS) \
-DEVOLUTION_VERSION=\""$(VERSION)"\" \
@@ -28,6 +29,7 @@ evolution_addressbook_LDADD = \
$(top_builddir)/widgets/e-text/libetext.a \
$(top_builddir)/e-util/libeutil.la \
$(top_builddir)/addressbook/backend/ebook/libebook.la \
+ $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \
$(top_builddir)/libversit/libversit.la
evolution_addressbook_LDFLAGS = `gnome-config --libs gdk_pixbuf`
diff --git a/addressbook/gui/component/addressbook-factory.c b/addressbook/gui/component/addressbook-factory.c
index cf59177f84..83257b1189 100644
--- a/addressbook/gui/component/addressbook-factory.c
+++ b/addressbook/gui/component/addressbook-factory.c
@@ -12,7 +12,7 @@
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo.h>
-
+#include <glade/glade.h>
#include "addressbook.h"
CORBA_Environment ev;
@@ -30,6 +30,8 @@ init_bonobo (int argc, char **argv)
if (bonobo_init (orb, NULL, NULL) == FALSE)
g_error (_("Could not initialize Bonobo"));
+
+ glade_gnome_init ();
}
int
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 28422e4194..1ac90fcf28 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -1,20 +1,12 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * folder-browser-factory.c: A Bonobo Control factory for Folder Browsers
+ * addressbook.c:
*
* Author:
- * Miguel de Icaza (miguel@helixcode.com)
+ * Chris Lahey (clahey@helixcode.com)
*
* (C) 2000 Helix Code, Inc.
*/
-/*
- * bonobo-clock-control.c
- *
- * Copyright 1999, Helix Code, Inc.
- *
- * Author:
- * Nat Friedman (nat@nat.org)
- */
#include <config.h>
#include <gnome.h>
@@ -26,6 +18,7 @@
#include "e-book.h"
#include "e-canvas.h"
#include "e-minicard-view.h"
+#include "e-contact-editor.h"
static void
control_deactivate (BonoboControl *control, BonoboUIHandler *uih)
@@ -42,9 +35,81 @@ do_nothing_cb (BonoboUIHandler *uih, void *user_data, const char *path)
{
printf ("Yow! I am called back!\n");
}
+
+
+#define BLANK_VCARD \
+"BEGIN:VCARD
+" \
+"FN:
+" \
+"N:
+" \
+"BDAY:
+" \
+"TEL;WORK:
+" \
+"TEL;CELL:
+" \
+"EMAIL;INTERNET:
+" \
+"EMAIL;INTERNET:
+" \
+"ADR;WORK;POSTAL:
+" \
+"ADR;HOME;POSTAL;INTL:
+" \
+"END:VCARD
+" \
+"
+"
+
+
+static void
+card_added_cb (EBook* book, EBookStatus status, const char *id,
+ gpointer user_data)
+{
+ g_print ("%s: %s(): a card was added\n", __FILE__, __FUNCTION__);
+}
+
+
+static void
+new_contact_cb (BonoboUIHandler *uih, EBook *book, const char *path)
+{
+ gint result;
+ GtkWidget* contact_editor =
+ e_contact_editor_new(e_card_new(BLANK_VCARD));
+
+ GtkWidget* dlg = gnome_dialog_new ("Contact Editor", "Save", "Cancel", NULL);
+
+ g_assert (E_IS_BOOK (book));
+
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dlg)->vbox),
+ contact_editor, TRUE, TRUE, 0);
+
+ gtk_widget_show_all (dlg);
+
+ gnome_dialog_close_hides (GNOME_DIALOG (dlg), TRUE);
+ result = gnome_dialog_run_and_close (GNOME_DIALOG (dlg));
+
+
+ /* If the user clicks "okay"...*/
+ if (result == 0) {
+ g_assert (contact_editor);
+ g_assert (GTK_IS_OBJECT (contact_editor));
+
+ /* Add the card in the contact editor to our ebook */
+ e_book_add_card (
+ book,
+ E_CONTACT_EDITOR(contact_editor)->card,
+ card_added_cb,
+ NULL);
+ }
+
+}
+
static GnomeUIInfo gnome_toolbar [] = {
- GNOMEUIINFO_ITEM_STOCK (N_("New"), N_("Create a new contact"), do_nothing_cb, GNOME_STOCK_PIXMAP_NEW),
+ GNOMEUIINFO_ITEM_STOCK (N_("New"), N_("Create a new contact"), new_contact_cb, GNOME_STOCK_PIXMAP_NEW),
GNOMEUIINFO_SEPARATOR,
@@ -57,9 +122,8 @@ static GnomeUIInfo gnome_toolbar [] = {
-
static void
-control_activate (BonoboControl *control, BonoboUIHandler *uih)
+control_activate (BonoboControl *control, BonoboUIHandler *uih, EBook *book)
{
Bonobo_UIHandler remote_uih;
GtkWidget *toolbar;
@@ -77,9 +141,9 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih)
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL,
GTK_TOOLBAR_BOTH);
- gnome_app_fill_toolbar (GTK_TOOLBAR (toolbar),
- gnome_toolbar,
- NULL);
+ gnome_app_fill_toolbar_with_data (GTK_TOOLBAR (toolbar),
+ gnome_toolbar,
+ NULL, book);
gtk_widget_show_all (toolbar);
@@ -96,7 +160,7 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih)
static void
control_activate_cb (BonoboControl *control,
gboolean activate,
- gpointer user_data)
+ EBook* book)
{
BonoboUIHandler *uih;
@@ -104,7 +168,7 @@ control_activate_cb (BonoboControl *control,
g_assert (uih);
if (activate)
- control_activate (control, uih);
+ control_activate (control, uih, book);
else
control_deactivate (control, uih);
}
@@ -261,7 +325,7 @@ addressbook_factory (BonoboGenericFactory *Factory, void *closure)
control = bonobo_control_new(vbox);
gtk_signal_connect (GTK_OBJECT (control), "activate",
- control_activate_cb, NULL);
+ control_activate_cb, book);
gtk_widget_pop_visual ();
gtk_widget_pop_colormap ();
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 9277eef1fd..81916847f7 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -254,6 +254,8 @@ e_contact_editor_new (ECard *card)
gtk_object_set (GTK_OBJECT(widget),
"card", card,
NULL);
+
+ E_CONTACT_EDITOR (widget)->card = card;
return widget;
}
class='deletions'>-156/+468 * Update to 0.6 after my long absencekeichii2002-03-042-2/+2 * Add leocad 0.73, a CAD program that uses bricks similar to thosepetef2002-03-038-0/+106 * Respect CXX/CXXFLAGS.petef2002-03-011-0/+7 * Initial import of ngspice_reworkkevlo2002-02-0910-0/+289 * add slffea 1.25ijliao2002-02-096-0/+72 * add gnucap 0.30ijliao2002-02-076-0/+50 * Fix build on -currentkris2002-01-261-0/+12 * update to 0.23.sf2002-01-234-13/+47 * Update to 6.0.4lioux2002-01-215-97/+10 * Add message explaining that after installation the user have to run the programsobomax2001-12-294-8/+24 * Fix texti2html's path.kuriyama2001-12-271-1/+1 * Add linux-eagle , an easy to use, yet powerful tool for designingsobomax2001-12-2711-0/+1407 * Fix building docs due to missing dependenciesdwcjr2001-12-241-1/+3 * add qmlsijliao2001-12-106-0/+26 * Add missing dependency: geda-symbolslioux2001-12-032-0/+2 * Update MAINTAINER's email address: anders@codefactory.se -> anders@hack.orgpetef2001-11-301-2/+2 * Fix manpage packaging.petef2001-11-251-2/+1 * Style police: WWW tags should either end in a file/script or TRAILING /; Fix ...lioux2001-11-211-1/+1 * Style police: WWW tags should either end in a file/script or TRAILING /; Fix ...lioux2001-11-217-7/+7 * Remove a redundant trailing period and a space.knu2001-10-211-1/+1 * Update to version 2.3.3.b16kevlo2001-10-202-3/+5 * add pdnmeshijliao2001-10-157-0/+80 * Applied patch for maintainer's update.mita2001-10-093-427/+395 * o Update to 2.3.3.b15lioux2001-10-069-135/+91 * Fix the docs installation.joerg2001-10-042-3/+18 * Remove jseger and torstenb from maintainership of their ports, theydwcjr2001-09-181-1/+1 * Replace the ghostscript6 dependencies with ghostscript-gnu.knu2001-09-121-1/+1 * fix DISTNAME.sf2001-09-021-0/+1 * update to 2.3.3 beta rev.9.sf2001-08-314-80/+58 * - add NOPORTDOCS support to pkg-plistpetef2001-08-302-6/+6 * Fix a pthread compilation problem on -stable.petef2001-08-261-1/+2 * Remove giffunip@asme.org as the maintainer: he no longer has the abilitykris2001-08-241-1/+1 * Add missing LIB_DEPENDSlioux2001-08-011-2/+3 * Add NOPORTDOCS supportlioux2001-07-281-197/+197 * Add NOPORTDOCS supportlioux2001-07-151-7/+7 * Return to ports.obrien2001-07-101-1/+1 * PORTDOC Policedwcjr2001-07-081-21/+21 * Fix plist to use %%PORTDOCS%%.dannyboy2001-07-052-83/+83 * Update to version 2.3.3kevlo2001-07-035-22/+24 * Remove duplicate words where appropriate.dd2001-06-252-2/+2 * upgrade to 3.1.0ijliao2001-06-173-15/+7 * Update to version 2.3kevlo2001-06-124-12/+14 * Use proper POSIX syntax for `chown'.obrien2001-06-011-8/+8 * pass maintainership to keichiiijliao2001-05-191-1/+1 * Various patches (mainly shared library revision changes) for thoseade2001-05-052-4/+2 * Don't hardcode CC and CFLAGS to -O3kris2001-04-301-19/+41 * Update to version 1.4.7lioux2001-04-116-4/+14 * Upgrade to 20010304. and change MAINTAINER to bruno.schwander@technologist.comvanilla2001-04-078-534/+17 * gEDA electronic schematic capture toolsvanilla2001-04-0724-0/+600 * gEDA electronic schematic capture toolsvanilla2001-04-072-0/+32 * geda-symbols is the basic component of geda package.vanilla2001-04-075-0/+892 * geda-symbols is the basic component of geda package.vanilla2001-04-071-0/+1 * libgeda is a a base library common to all the gEDA toolsvanilla2001-04-079-0/+231 * Overhaul QT/KDE support:will2001-04-032-2/+2 * add vipecijliao2001-04-037-0/+115 * -pthread --> ${PTHREAD_LIBS}sobomax2001-03-301-1/+1 * distfile re-rolled (rev177 to rev178, according to Manifest).sf2001-03-181-1/+1 * Fix dependencies to tcl/tk 8.3kevlo2001-03-151-2/+2 * Use '-O0' when compiling on the Alpha to avoid internal compiler errors.steve2001-03-112-2/+14 * Fix and sort plistkris2001-03-111-72/+76 * update to 2.2.2.sf2001-03-093-15/+15 * Add oregano, schematic capture and simulation of electrical circuits.knu2001-03-076-0/+91 * Default hardcopy prints to Postscript format instead of plot(5) which wejoerg2001-03-061-0/+11 * Update to version 1.4.6kevlo2001-02-286-524/+676 * forgot bison dependenceijliao2001-02-221-0/+1 * Make the share files' installation permission safe.lioux2001-02-212-7/+16 * Update to version 2.2.1kevlo2001-02-1422-228/+109 * typo clean up police: \s -> \tlioux2001-02-142-2/+2 * Update to 9.4 and update homepagejeh2001-02-133-5/+5 * Update to version 6.5.1 and homepagejeh2001-02-133-30/+16 * add iverilog, a Verilog simulation and synthesis toolijliao2001-02-136-0/+60 * SCEPTRE (System for Circuit Evaluation and Prediction of Transientgrog2001-02-119-0/+117 * Remove inactive MAINTAINER <swallace>, who hasn't committed in over 3 years.will2001-01-272-2/+2 * Massive style enforcement - use ^I instead of spaces for variables identation.sobomax2001-01-173-4/+3 * Use the correct path in the $(TAR) commandalex2001-01-131-1/+1 * fix X manpage error with XFree86-4sf2001-01-101-0/+11 * Update to version 2.2.0kevlo2000-12-235-33/+18 * Upgrade to 0.28.tg2000-12-157-48/+39 * Update to version 2.1b9kevlo2000-12-022-2/+2 * Update to version 1.6ekevlo2000-11-183-266/+311 * Add missing @dirrm.kevlo2000-11-172-0/+2 * Update to version 2.1b8kevlo2000-11-132-2/+2 * Better handling for the imake dependency when XFREE86_VERSION != 3. Thesteve2000-11-091-3/+8 * Change motif to a normal dependency. REQUIRES_MOTIF is now calledasami2000-11-082-6/+4 * Uphold ${MOTIFLIB}lioux2000-11-021-11/+17 * - Prevent possible buffer overflowkevlo2000-10-294-24/+47 * Update to version 2.1b7kevlo2000-10-283-3/+4 * Update to 2.1b6ade2000-10-184-9/+19 * Update to 1.4.4ade2000-10-1418-568/+764 * Rename ${FILESDIR}/patch-prefix to ${FILESDIR}/template-patch-prefixasami2000-10-081-1/+1 * Implement USE_GTK, part 1.reg2000-10-051-4/+2 * Maintainer is now a committer, update email accordinglylioux2000-10-031-1/+1 * Try to unbreak this on -current.reg2000-10-013-252/+292 * Support CC/CFLAGS/PREFIX/X11BASE/MAKE properlyade2000-09-1728-262/+939 * Install libs with 0644 perms, not 0664.jedgar2000-09-141-2/+19 * Update to 2.1b3kevlo2000-09-096-22/+36 * Use ${XAWVER} for Xaw3d's shlib version number in LIB_DEPENDS so these portsasami2000-09-061-1/+1 * Add imake:${PORTSDIR}/devel/imake-4 to BUILD_DEPENDS -- these portsasami2000-08-111-1/+2 * Support X11BASE properlykevlo2000-08-071-2/+2 * Update for new shlib revision from guile 1.4ade2000-08-041-1/+1 * (1) Add new variable, XFREE86_VERSION, to specify which version ofasami2000-08-031-1/+1 * Activate Electric.sada2000-07-301-0/+1 * New port - Electric is a sophisticated electrical CAD system that can handlesada2000-07-307-0/+152 * Update MD5 (numerous updates without a version change)jedgar2000-07-131-1/+1 * Add bin/loom.asami2000-07-051-0/+1 * Unleash all of these ports upon the people. I no longer have any interestwill2000-06-222-2/+2 * Update to 1.4.1.will2000-06-208-18/+14 * Rename INSTALLS_SHLIBS to INSTALLS_SHLIB. (There was a typo in theasami2000-06-171-1/+1 * Final round of the INSTALLS_SHLIBS=yes conversion. Few remaining ports withsobomax2000-06-162-2/+1 * Teach MASTER_SITES about new MASTER_SITE_SOURCEFORGE.sobomax2000-06-141-1/+2 * Add gmac.1 and tkgate.1asami2000-06-081-0/+1 * Add fsleeper.1.asami2000-06-071-1/+1 * Update to version 3.05.steve2000-05-295-40/+24 * Incorporate some changes from NetBSD, Linux, and the Macquarie University.steve2000-05-2910-4/+382 * Mostly docs changes with the addition of some selection filter code thatsteve2000-05-281-1/+1 * Upgrade to 1.4.0.tg2000-05-178-450/+566 * Use MASTER_SITE's that actually still carry the distfile :-)jseger2000-05-151-1/+2 * Add PISCES, a two-dimensional device simulator which includesade2000-05-0324-0/+1077 * Mark BROKEN: compiler errorkris2000-04-302-0/+4 * Update MD5 checksum and remove invalid MASTER_SITES.will2000-04-222-3/+2 * Upgrade to 0.26.tg2000-04-184-6/+6