From 07af9adcd6731f65e158d8807e85a19dab7bb736 Mon Sep 17 00:00:00 2001 From: Chris Lahey Date: Fri, 21 Jan 2000 00:35:45 +0000 Subject: Changed some line spacing. * widgets/e-text-event-processor-types.h: Changed some line spacing. * widgets/test-reflow.c: Connected to the resize signal of the reflow. * widgets/e-minicard.c: Made width argument set function only update if width is different. * widgets/e-reflow.h, widgets/e-reflow.c: Added draggable column dividers. * addressbook/contact-editor/test-editor.c: Open two dialogs for more interesting testing. * addressbook/contact-editor/e-contact-editor.h, addressbook/contact-editor/e-contact-editor.c: Modified to use glade. Added menus to change which phone/address/email entries to view. Added images to the dialog. * addressbook/contact-editor/e-contact-editor-strings.h, addressbook/contact-editor/contact-editor.glade: Glade files for the contact editor dialog. * addressbook/contact-editor/Makefile.am: Added images and added glade stuff. * addressbook/contact-editor/arrow.png, addressbook/contact-editor/briefcase.png, addressbook/contact-editor/netfreebusy.png, addressbook/contact-editor/netmeeting.png: Image files for the contact editor dialog. svn path=/trunk/; revision=1599 --- addressbook/contact-editor/Makefile.am | 17 +- addressbook/contact-editor/arrow.png | Bin 0 -> 122 bytes addressbook/contact-editor/briefcase.png | Bin 0 -> 390 bytes addressbook/contact-editor/contact-editor.glade | 2198 ++++++++++++++++++++ .../contact-editor/e-contact-editor-strings.h | 48 + addressbook/contact-editor/e-contact-editor.c | 676 +++--- addressbook/contact-editor/e-contact-editor.h | 16 +- addressbook/contact-editor/netfreebusy.png | Bin 0 -> 755 bytes addressbook/contact-editor/netmeeting.png | Bin 0 -> 803 bytes addressbook/contact-editor/test-editor.c | 22 +- 10 files changed, 2697 insertions(+), 280 deletions(-) create mode 100644 addressbook/contact-editor/arrow.png create mode 100644 addressbook/contact-editor/briefcase.png create mode 100644 addressbook/contact-editor/contact-editor.glade create mode 100644 addressbook/contact-editor/e-contact-editor-strings.h create mode 100644 addressbook/contact-editor/netfreebusy.png create mode 100644 addressbook/contact-editor/netmeeting.png (limited to 'addressbook/contact-editor') diff --git a/addressbook/contact-editor/Makefile.am b/addressbook/contact-editor/Makefile.am index 0286af7c49..4892d51bbb 100644 --- a/addressbook/contact-editor/Makefile.am +++ b/addressbook/contact-editor/Makefile.am @@ -1,4 +1,13 @@ +images = email.png head.png phone.png snailmail.png web.png arrow.png briefcase.png netmeeting.png netfreebusy.png + +EXTRA_DIST = $(images) +pkgdata_DATA = $(images) + +CPPFLAGS = \ + -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ + -DDATADIR=\""$(datadir)"\" + INCLUDES = \ $(GNOME_INCLUDEDIR) @@ -17,4 +26,10 @@ contact_editor_test_SOURCES = \ contact_editor_test_LDADD = \ $(EXTRA_GNOME_LIBS) \ - libecontacteditor.a + libecontacteditor.a + +gladedir = $(datadir)/evolution/glade + +glade_DATA = \ + contact-editor.glade + diff --git a/addressbook/contact-editor/arrow.png b/addressbook/contact-editor/arrow.png new file mode 100644 index 0000000000..b7f782c1e5 Binary files /dev/null and b/addressbook/contact-editor/arrow.png differ diff --git a/addressbook/contact-editor/briefcase.png b/addressbook/contact-editor/briefcase.png new file mode 100644 index 0000000000..dd59b8fd39 Binary files /dev/null and b/addressbook/contact-editor/briefcase.png differ diff --git a/addressbook/contact-editor/contact-editor.glade b/addressbook/contact-editor/contact-editor.glade new file mode 100644 index 0000000000..87251a6f6f --- /dev/null +++ b/addressbook/contact-editor/contact-editor.glade @@ -0,0 +1,2198 @@ + + + + + Contact-editor + contact-editor + + src + pixmaps + C + True + True + True + False + False + False + False + interface.c + interface.h + callbacks.c + callbacks.h + support.c + support.h + True + e-contact-editor-strings.h + + + + GtkWindow + contact editor + False + Contact Editor + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + + + GtkNotebook + notebook-contact-editor + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + 5 + + + GtkTable + table-contact-editor-general + 7 + 12 + 8 + False + 4 + 4 + + + GtkEntry + entry-phone1 + + 7 + 8 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry-phone2 + + 7 + 8 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry-phone3 + + 7 + 8 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry-phone4 + + 7 + 8 + 3 + 4 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry-fullname + + 3 + 4 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry-web + + 3 + 4 + 8 + 9 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkLabel + label-phone3 + + 5 + 6 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label-phone2 + + 5 + 6 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label-phone1 + + 5 + 6 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label-phone4 + + 5 + 6 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + + + GtkText + text-address + + 7 + 8 + 5 + 9 + 0 + 0 + True + False + False + False + True + True + + 1 + 1 + True + True + + + + + GtkLabel + label-email1 + + 1 + 2 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkButton + button-fullname + + 1 + 3 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + True + + + + + GtkAccelLabel + accellabel-jobtitle + + 1 + 3 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkAccelLabel + accellabel-company + + 1 + 3 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkAccelLabel + accellabel-fileas + + 1 + 3 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkAccelLabel + accellabel-web + + 1 + 3 + 8 + 9 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + + + GtkHBox + hbox5 + + 0 + 8 + 10 + 11 + 0 + 0 + True + True + False + False + True + True + + False + 0 + + + GtkText + text-comments + + 0 + True + True + + True + True + + + + + GtkVScrollbar + vscrollbar-comments + + 0 + False + False + + GTK_UPDATE_CONTINUOUS + 0 + 0 + 0 + 0 + 0 + 0 + + + + + GtkHBox + hbox3 + + 0 + 8 + 11 + 12 + 0 + 0 + True + False + False + False + True + True + + False + 6 + + + GtkButton + button-contacts + + 0 + False + False + + True + + + + + GtkEntry + entry-contacts + + 0 + True + True + + True + True + True + 0 + + + + + GtkButton + button-categories + + 0 + False + False + + True + + + + + GtkEntry + entry-categories + + 0 + False + False + + True + True + True + 0 + + + + + + GtkAlignment + alignment2 + + 7 + 8 + 9 + 10 + 0 + 0 + True + False + False + False + True + True + + 0 + 0 + 0 + 0 + + + GtkCheckButton + checkbutton-mailingaddress + True + + False + True + + + + + GtkButton + button-address + + 5 + 7 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + True + + + + + GtkEntry + entry-jobtitle + + 3 + 4 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry-company + + 3 + 4 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkCombo + combo-fileas + + 3 + 4 + 3 + 4 + 0 + 0 + True + False + False + False + True + False + + True + True + True + False + + + + + GtkHBox + hbox4 + + 3 + 4 + 5 + 6 + 0 + 0 + True + False + False + False + True + False + + False + 4 + + + GtkEntry + entry-email1 + + 0 + True + True + + True + True + True + 0 + + + + + GtkButton + button23 + + 0 + False + False + + + + Placeholder + + + + + + GtkAlignment + alignment3 + + 2 + 3 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + 1 + 0.5 + 0 + 1 + + + GtkButton + button-email1 + True + + + Placeholder + + + + + + GtkAlignment + alignment4 + + 6 + 7 + 6 + 7 + 0 + 0 + False + False + False + False + True + True + + 1 + 0.5 + 0 + 1 + + + GtkButton + button-address1 + True + + + Placeholder + + + + + + GtkAlignment + alignment5 + + 6 + 7 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + 1 + 0.5 + 0 + 0 + + + GtkButton + button-phone4 + True + + + Placeholder + + + + + + GtkAlignment + alignment7 + + 6 + 7 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + 1 + 0.5 + 0 + 0 + + + GtkButton + button-phone2 + True + + + Placeholder + + + + + + GtkAlignment + alignment8 + + 6 + 7 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + 1 + 0.5 + 0 + 0 + + + GtkButton + button-phone1 + True + + + Placeholder + + + + + + GtkLabel + label-address1 + + 5 + 6 + 6 + 7 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkHSeparator + hseparator6 + + 0 + 4 + 7 + 8 + 0 + 2 + True + False + False + False + True + True + + + + + GtkHSeparator + hseparator4 + + 4 + 8 + 4 + 5 + 0 + 2 + True + False + False + False + True + False + + + + + GtkHSeparator + hseparator5 + + 0 + 4 + 4 + 5 + 0 + 2 + True + False + False + False + True + False + + + + + GtkAlignment + alignment6 + + 6 + 7 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + 1 + 0.5 + 0 + 0 + + + GtkButton + button-phone3 + True + + + Placeholder + + + + + + + GtkLabel + Notebook:tab + label15 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkTable + table-contact-editor-details + 7 + 12 + 6 + False + 4 + 4 + + + GtkLabel + label21 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label22 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label23 + + 1 + 2 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label24 + + 1 + 2 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label25 + + 1 + 2 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label26 + + 1 + 2 + 7 + 8 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label27 + + 1 + 2 + 8 + 9 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label28 + + 1 + 2 + 10 + 11 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label31 + + 3 + 4 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label30 + + 3 + 4 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label29 + + 3 + 4 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + label32 + + 3 + 4 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkEntry + entry4 + + 2 + 3 + 5 + 6 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry5 + + 2 + 3 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry6 + + 2 + 3 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry7 + + 2 + 3 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry8 + + 2 + 3 + 4 + 5 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry9 + + 2 + 6 + 7 + 8 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry10 + + 2 + 5 + 8 + 9 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry11 + + 2 + 6 + 10 + 11 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GnomeDateEdit + dateedit2 + + 4 + 6 + 5 + 6 + 0 + 0 + True + False + False + False + True + False + + False + False + False + 7 + 19 + + + + GnomeDateEdit + dateedit1 + + 4 + 6 + 4 + 5 + 0 + 0 + True + False + False + False + True + False + + False + False + False + 7 + 19 + + + + GtkEntry + entry13 + + 4 + 6 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkEntry + entry12 + + 4 + 6 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkButton + button-callnow + + 5 + 6 + 8 + 9 + 0 + 0 + False + False + False + False + True + True + + True + + + + + GtkHBox + hbox7 + + 0 + 6 + 9 + 10 + 0 + 0 + True + False + False + False + True + True + + False + 6 + + + GtkLabel + label33 + + 0 + False + False + + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 2 + + + + GtkHSeparator + hseparator8 + + 0 + True + True + + + + + + GtkHBox + hbox8 + + 0 + 6 + 6 + 7 + 0 + 0 + True + False + False + False + True + True + + False + 6 + + + GtkLabel + label34 + + 0 + False + False + + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 2 + + + + GtkHSeparator + hseparator9 + + 0 + True + True + + + + + + GtkHSeparator + hseparator7 + + 0 + 6 + 3 + 4 + 0 + 2 + False + False + False + False + True + True + + + + + + GtkLabel + Notebook:tab + label16 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkText + text3 + True + False + + + + + GtkLabel + Notebook:tab + label17 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkText + text2 + True + False + + + + + GtkLabel + Notebook:tab + label18 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkText + text4 + True + False + + + + + GtkLabel + Notebook:tab + label19 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GnomeDialog + dialog2 + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox2 + + 4 + True + True + + False + 8 + + + GtkTable + table2 + + 0 + True + True + + 2 + 2 + False + 0 + 0 + + + GtkEntry + entry2 + + 0 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + True + True + True + 0 + + + + + GtkVBox + vbox1 + + 1 + 2 + 0 + 1 + 0 + 0 + False + True + False + False + True + True + + False + 0 + + + GtkButton + button31 + + 0 + False + False + + True + + + + + GtkButton + button32 + + 0 + False + False + + True + + + + + + GtkScrolledWindow + scrolledwindow1 + + 0 + 1 + 0 + 1 + 0 + 0 + True + True + False + False + True + True + + 200 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkCList + clist1 + True + 1 + 80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_NONE + + + GtkLabel + CList:title + label20 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area2 + + 0 + False + True + GTK_PACK_END + + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + + GtkButton + button28 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button29 + True + True + GNOME_STOCK_BUTTON_APPLY + + + + GtkButton + button30 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + + + GnomeDialog + dialog-add-phone + False + New phone type + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + vbox2 + + 4 + True + True + + False + 8 + + + GtkFrame + frame-add-phone + 4 + + 0 + True + True + + + 0 + GTK_SHADOW_ETCHED_IN + + + GtkAlignment + alignment9 + 9 + 0.5 + 0.5 + 1 + 1 + + + GtkEntry + entry-add-phone + True + True + True + 0 + + + + + + + GtkHButtonBox + GnomeDialog:action_area + hbuttonbox1 + + 0 + False + True + GTK_PACK_END + + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + + GtkButton + button43 + True + True + + GNOME_STOCK_PIXMAP_ADD + + + + GtkButton + button44 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + + diff --git a/addressbook/contact-editor/e-contact-editor-strings.h b/addressbook/contact-editor/e-contact-editor-strings.h new file mode 100644 index 0000000000..131dd6fdf4 --- /dev/null +++ b/addressbook/contact-editor/e-contact-editor-strings.h @@ -0,0 +1,48 @@ +/* + * Translatable strings file generated by Glade. + * Add this file to your project's POTFILES.in. + * DO NOT compile it as part of your application. + */ + +gchar *s = N_("Contact Editor"); +gchar *s = N_("Business Fax"); +gchar *s = N_("Home"); +gchar *s = N_("Business"); +gchar *s = N_("Mobile"); +gchar *s = N_("Email"); +gchar *s = N_("\tFull Name..."); +gchar *s = N_("Job Title:"); +gchar *s = N_("Company:"); +gchar *s = N_("File As:"); +gchar *s = N_("Web page address:"); +gchar *s = N_("Contacts..."); +gchar *s = N_("Categories..."); +gchar *s = N_("This is the mailing address"); +gchar *s = N_("A_ddress..."); +gchar *s = N_("Business"); +gchar *s = N_("General"); +gchar *s = N_("Department:"); +gchar *s = N_("Office:"); +gchar *s = N_("Profession:"); +gchar *s = N_("Nickname:"); +gchar *s = N_("Spouse's name:"); +gchar *s = N_("Directory Server:"); +gchar *s = N_("Email alias:"); +gchar *s = N_("Address:"); +gchar *s = N_("Birthday:"); +gchar *s = N_("Assistant's name:"); +gchar *s = N_("Manager's name:"); +gchar *s = N_("Anniversary:"); +gchar *s = N_("Call Now"); +gchar *s = N_("Internet Free-Busy"); +gchar *s = N_("Online NetMeeting settings"); +gchar *s = N_("Details"); +gchar *s = N_("Activities"); +gchar *s = N_("Certificates"); +gchar *s = N_("All Fields"); +gchar *s = N_("Add"); +gchar *s = N_("Delete"); +gchar *s = N_("Phone Types"); +gchar *s = N_("New phone type"); +gchar *s = N_("New phone type"); +gchar *s = N_("Add"); diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c index 73b48a7eb8..6a6c6d982e 100644 --- a/addressbook/contact-editor/e-contact-editor.c +++ b/addressbook/contact-editor/e-contact-editor.c @@ -26,8 +26,14 @@ static void e_contact_editor_init (EContactEditor *card); static void e_contact_editor_class_init (EContactEditorClass *klass); static void e_contact_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); static void e_contact_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); +static void e_contact_editor_destroy (GtkObject *object); -static GtkNotebookClass *parent_class = NULL; +static GtkWidget *e_contact_editor_build_dialog(EContactEditor *editor, gchar *entry_id, gchar *label_id, gchar *title, GList **list, GnomeUIInfo **info); +static void _email_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor); +static void _phone_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor); +static void _address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor); + +static GtkVBoxClass *parent_class = NULL; #if 0 enum { @@ -44,6 +50,12 @@ enum { ARG_CARD }; +enum { + DYNAMIC_LIST_EMAIL, + DYNAMIC_LIST_PHONE, + DYNAMIC_LIST_ADDRESS +}; + GtkType e_contact_editor_get_type (void) { @@ -63,7 +75,7 @@ e_contact_editor_get_type (void) (GtkClassInitFunc) NULL, }; - contact_editor_type = gtk_type_unique (gtk_notebook_get_type (), &contact_editor_info); + contact_editor_type = gtk_type_unique (gtk_vbox_get_type (), &contact_editor_info); } return contact_editor_type; @@ -73,12 +85,12 @@ static void e_contact_editor_class_init (EContactEditorClass *klass) { GtkObjectClass *object_class; - GtkNotebookClass *notebook_class; + GtkVBoxClass *vbox_class; object_class = (GtkObjectClass*) klass; - notebook_class = (GtkNotebookClass *) klass; + vbox_class = (GtkVBoxClass *) klass; - parent_class = gtk_type_class (gtk_notebook_get_type ()); + parent_class = gtk_type_class (gtk_vbox_get_type ()); #if 0 e_contact_editor_signals[E_CONTACT_EDITOR_RESIZE] = @@ -98,300 +110,140 @@ e_contact_editor_class_init (EContactEditorClass *klass) object_class->set_arg = e_contact_editor_set_arg; object_class->get_arg = e_contact_editor_get_arg; + object_class->destroy = e_contact_editor_destroy; } -static GtkWidget * -_create_page_general_name(EContactEditor *e_contact_editor) -{ - GtkWidget *table; - GtkWidget *alignment; - table = gtk_table_new(3, 4, FALSE); - alignment = gtk_alignment_new(0, 0, 0, 0); - gtk_container_add(GTK_CONTAINER(alignment), - gnome_pixmap_new_from_file("head.png")); - gtk_table_attach(GTK_TABLE(table), - alignment, - 0, 1, 0, 4, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Full Name:")), - 1, 2, 0, 1, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Job Title:")), - 1, 2, 1, 2, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Company:")), - 1, 2, 2, 3, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("File as:")), - 1, 2, 3, 4, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_entry_new(), - 2, 3, 0, 1, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_entry_new(), - 2, 3, 1, 2, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_entry_new(), - 2, 3, 2, 3, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_combo_new(), - 2, 3, 3, 4, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - return table; -} - -static GtkWidget * -_create_page_general_phone(EContactEditor *e_contact_editor) -{ - GtkWidget *table; - GtkWidget *alignment; - table = gtk_table_new(3, 4, FALSE); - alignment = gtk_alignment_new(0,0,0,0); - gtk_container_add(GTK_CONTAINER(alignment), - gnome_pixmap_new_from_file("phone.png")); - - gtk_table_attach(GTK_TABLE(table), - alignment, - 0, 1, 0, 4, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Home:")), - 1, 2, 0, 1, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Car:")), - 1, 2, 1, 2, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Mobile:")), - 1, 2, 2, 3, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Business Fax:")), - 1, 2, 3, 4, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_entry_new(), - 2, 3, 0, 1, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_entry_new(), - 2, 3, 1, 2, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_entry_new(), - 2, 3, 2, 3, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_entry_new(), - 2, 3, 3, 4, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - return table; -} - -static GtkWidget * -_create_page_general_email(EContactEditor *e_contact_editor) -{ - GtkWidget *table; - GtkWidget *alignment; - table = gtk_table_new(3, 1, FALSE); - alignment = gtk_alignment_new(0,0,0,0); - gtk_container_add(GTK_CONTAINER(alignment), - gnome_pixmap_new_from_file("email.png")); - - gtk_table_attach(GTK_TABLE(table), - alignment, - 0, 1, 0, 1, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Email:")), - 1, 2, 0, 1, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_entry_new(), - 2, 3, 0, 1, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - return table; -} - -static GtkWidget * -_create_page_general_web(EContactEditor *e_contact_editor) +static void +_add_image(GtkTable *table, gchar *image, int left, int right, int top, int bottom) { - GtkWidget *table; - GtkWidget *alignment; - table = gtk_table_new(3, 1, FALSE); - alignment = gtk_alignment_new(0,0,0,0); - gtk_container_add(GTK_CONTAINER(alignment), - gnome_pixmap_new_from_file("web.png")); - - gtk_table_attach(GTK_TABLE(table), - alignment, - 0, 1, 0, 1, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Web page address:")), - 1, 2, 0, 1, - 0, 0, + gtk_table_attach(table, + gtk_widget_new(gtk_alignment_get_type(), + "child", gnome_pixmap_new_from_file(image), + "xalign", (double) 0, + "yalign", (double) 0, + "xscale", (double) 0, + "yscale", (double) 0, + NULL), + left, right, top, bottom, + GTK_FILL, GTK_FILL, 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_entry_new(), - 2, 3, 0, 1, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - return table; } -static GtkWidget * -_create_page_general_snailmail(EContactEditor *e_contact_editor) +static void +_add_images(GtkTable *table) { - GtkWidget *table; - GtkWidget *alignment; - GtkWidget *text; - table = gtk_table_new(3, 3, FALSE); - alignment = gtk_alignment_new(0,0,0,0); - gtk_container_add(GTK_CONTAINER(alignment), - gnome_pixmap_new_from_file("snailmail.png")); - - gtk_table_attach(GTK_TABLE(table), - alignment, - 0, 1, 0, 1, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Address:")), - 1, 2, 0, 1, - 0, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_label_new(_("Business:")), - 1, 2, 1, 2, - 0, 0, - 0, 0); - text = gtk_text_new(NULL, NULL); - gtk_object_set(GTK_OBJECT(text), - "editable", TRUE, - NULL); - gtk_table_attach(GTK_TABLE(table), - text, - 2, 3, 0, 2, - GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - gtk_check_button_new_with_label(_("This is the mailing address")), - 2, 3, 2, 3, - 0, 0, - 0, 0); - return table; + _add_image(table, DATADIR "/evolution/head.png", 0, 1, 0, 4); + _add_image(table, DATADIR "/evolution/phone.png", 4, 5, 0, 4); + _add_image(table, DATADIR "/evolution/email.png", 0, 1, 5, 7); + _add_image(table, DATADIR "/evolution/web.png", 0, 1, 8, 10); + _add_image(table, DATADIR "/evolution/snailmail.png", 4, 5, 5, 10); } -static GtkWidget * -_create_page_general_comments(EContactEditor *e_contact_editor) +static void +_add_details_images(GtkTable *table) { - GtkWidget *text; - text = gtk_text_new(NULL, NULL); - gtk_object_set (GTK_OBJECT(text), - "editable", TRUE, - NULL); - return text; + _add_image(table, DATADIR "/evolution/briefcase.png", 0, 1, 0, 2); + _add_image(table, DATADIR "/evolution/head.png", 0, 1, 4, 6); + _add_image(table, DATADIR "/evolution/netmeeting.png", 0, 1, 7, 9); + _add_image(table, DATADIR "/evolution/netfreebusy.png", 0, 1, 10, 12); } -static GtkWidget * -_create_page_general_extras(EContactEditor *e_contact_editor) +static void +_replace_button(EContactEditor *editor, gchar *button_xml, gchar *image, GtkSignalFunc func) { - return gtk_entry_new(); + GladeXML *gui = editor->gui; + GtkWidget *button = glade_xml_get_widget(gui, button_xml); + gchar *image_temp; + image_temp = g_strdup_printf("%s%s", DATADIR "/evolution/", image); + gtk_container_add(GTK_CONTAINER(button), + gnome_pixmap_new_from_file(image_temp)); + g_free(image_temp); + gtk_signal_connect(GTK_OBJECT(button), "button_press_event", func, editor); + } -static GtkWidget * -_create_page_general( EContactEditor *e_contact_editor ) +static void +_replace_buttons(EContactEditor *editor) { - GtkWidget *table; - table = gtk_table_new(2, 5, FALSE); - gtk_table_attach(GTK_TABLE(table), - _create_page_general_name(e_contact_editor), - 0, 1, - 0, 1, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - _create_page_general_phone(e_contact_editor), - 1, 2, - 0, 1, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - _create_page_general_email(e_contact_editor), - 0, 1, - 1, 2, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - _create_page_general_web(e_contact_editor), - 0, 1, - 2, 3, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - _create_page_general_snailmail(e_contact_editor), - 1, 2, - 1, 3, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - _create_page_general_comments(e_contact_editor), - 0, 2, - 3, 4, - GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, - 0, 0); - gtk_table_attach(GTK_TABLE(table), - _create_page_general_extras(e_contact_editor), - 0, 2, - 4, 5, - GTK_FILL | GTK_EXPAND, 0, - 0, 0); - return table; + _replace_button(editor, "button-phone1", "arrow.png", _phone_arrow_pressed); + _replace_button(editor, "button-phone2", "arrow.png", _phone_arrow_pressed); + _replace_button(editor, "button-phone3", "arrow.png", _phone_arrow_pressed); + _replace_button(editor, "button-phone4", "arrow.png", _phone_arrow_pressed); + _replace_button(editor, "button-address1", "arrow.png", _address_arrow_pressed); + _replace_button(editor, "button-email1", "arrow.png", _email_arrow_pressed); } static void e_contact_editor_init (EContactEditor *e_contact_editor) { - GtkNotebook *notebook = GTK_NOTEBOOK (e_contact_editor); + GladeXML *gui; + GtkAdjustment *adjustment; /* e_contact_editor->card = NULL;*/ - e_contact_editor->fields = NULL; + gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-editor.glade", NULL); + e_contact_editor->gui = gui; + gtk_widget_reparent(glade_xml_get_widget(gui, "notebook-contact-editor"), + GTK_WIDGET(e_contact_editor)); + + _add_images(GTK_TABLE(glade_xml_get_widget(gui, "table-contact-editor-general"))); + _add_details_images(GTK_TABLE(glade_xml_get_widget(gui, "table-contact-editor-details"))); + _replace_buttons(e_contact_editor); + + gtk_object_get(GTK_OBJECT(glade_xml_get_widget(gui, "text-comments")), + "vadjustment", &adjustment, + NULL); + gtk_range_set_adjustment(GTK_RANGE(glade_xml_get_widget(gui, "vscrollbar-comments")), + adjustment); + + e_contact_editor->email_info = NULL; + e_contact_editor->phone_info = NULL; + e_contact_editor->address_info = NULL; + e_contact_editor->email_popup = NULL; + e_contact_editor->phone_popup = NULL; + e_contact_editor->address_popup = NULL; + e_contact_editor->email_list = NULL; + e_contact_editor->phone_list = NULL; + e_contact_editor->address_list = NULL; +} + +void +e_contact_editor_destroy (GtkObject *object) { + EContactEditor *e_contact_editor = E_CONTACT_EDITOR(object); + + if (e_contact_editor->email_list) { + g_list_foreach(e_contact_editor->email_list, (GFunc) g_free, NULL); + g_list_free(e_contact_editor->email_list); + } + if (e_contact_editor->email_info) { + g_free(e_contact_editor->email_info); + } + if (e_contact_editor->email_popup) { + gtk_widget_unref(e_contact_editor->email_popup); + } + + if (e_contact_editor->phone_list) { + g_list_foreach(e_contact_editor->phone_list, (GFunc) g_free, NULL); + g_list_free(e_contact_editor->phone_list); + } + if (e_contact_editor->phone_info) { + g_free(e_contact_editor->phone_info); + } + if (e_contact_editor->phone_popup) { + gtk_widget_unref(e_contact_editor->phone_popup); + } + + if (e_contact_editor->address_list) { + g_list_foreach(e_contact_editor->address_list, (GFunc) g_free, NULL); + g_list_free(e_contact_editor->address_list); + } + if (e_contact_editor->address_info) { + g_free(e_contact_editor->address_info); + } + if (e_contact_editor->address_popup) { + gtk_widget_unref(e_contact_editor->address_popup); + } - gtk_notebook_append_page (notebook, - _create_page_general(e_contact_editor), - gtk_label_new(_("General"))); + gtk_object_unref(GTK_OBJECT(e_contact_editor->gui)); } GtkWidget* @@ -436,3 +288,277 @@ e_contact_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) break; } } + +static void +_popup_position(GtkMenu *menu, + gint *x, + gint *y, + gpointer data) +{ + GtkWidget *button = GTK_WIDGET(data); + int mh, mw; + gdk_window_get_origin (button->window, x, y); + *x += button->allocation.width; + *y += button->allocation.height; + + mh = GTK_WIDGET(menu)->allocation.height; + mw = GTK_WIDGET(menu)->allocation.width; + + *x -= mw; + if (*x < 0) + *x = 0; + + if (*y < 0) + *y = 0; + + if ((*x + mw) > gdk_screen_width ()) + *x = gdk_screen_width () - mw; + + if ((*y + mh) > gdk_screen_height ()) + *y = gdk_screen_height () - mh; +} + +static void +_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor, GtkWidget *popup, GList **list, GnomeUIInfo **info, gchar *label, gchar *entry, gchar *dialog_title) +{ + gint menu_item; + gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "button_press_event"); + gtk_widget_realize(popup); + menu_item = gnome_popup_menu_do_popup_modal(popup, _popup_position, widget, button, editor); + if ( menu_item != -1 ) { + if (menu_item == g_list_length (*list)) { + e_contact_editor_build_dialog(editor, entry, label, dialog_title, list, info); + } else { + gtk_object_set(GTK_OBJECT(glade_xml_get_widget(editor->gui, label)), + "label", g_list_nth_data(*list, menu_item), + NULL); + } + } +} + +static void +e_contact_editor_build_ui_info(GList *list, GnomeUIInfo **infop) +{ + GnomeUIInfo *info; + GnomeUIInfo singleton = { GNOME_APP_UI_ITEM, NULL, NULL, NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, 0, 0, 0, NULL }; + GnomeUIInfo end = GNOMEUIINFO_END; + int length; + int i; + + info = *infop; + + if ( info ) + g_free(info); + length = g_list_length( list ); + info = g_new(GnomeUIInfo, length + 2); + for (i = 0; i < length; i++) { + info[i] = singleton; + info[i].label = _(list->data); + list = list->next; + } + info[i] = singleton; + info[i].label = N_("Other..."); + i++; + info[i] = end; + + *infop = info; +} + +static void +_dialog_clicked(GtkWidget *dialog, gint button, EContactEditor *editor) +{ + GtkWidget *label = gtk_object_get_data(GTK_OBJECT(dialog), + "e_contact_editor_label"); + GtkWidget *entry = gtk_object_get_data(GTK_OBJECT(dialog), + "e_contact_editor_entry"); + GtkWidget *dialog_entry = gtk_object_get_data(GTK_OBJECT(dialog), + "e_contact_editor_dialog_entry"); + GList **list = gtk_object_get_data(GTK_OBJECT(dialog), + "e_contact_editor_list"); + GList **info = gtk_object_get_data(GTK_OBJECT(dialog), + "e_contact_editor_info"); + switch (button) { + case 0: + gtk_object_set(GTK_OBJECT(label), + "label", gtk_entry_get_text(GTK_ENTRY(dialog_entry)), + NULL); + *list = g_list_append(*list, g_strdup(gtk_entry_get_text(GTK_ENTRY(dialog_entry)))); + g_free(*info); + *info = NULL; + break; + } + gnome_dialog_close(GNOME_DIALOG(dialog)); +} + +static void +_dialog_destroy(EContactEditor *editor, GtkWidget *dialog) +{ + gnome_dialog_close(GNOME_DIALOG(dialog)); +} + +static GtkWidget * +e_contact_editor_build_dialog(EContactEditor *editor, gchar *entry_id, gchar *label_id, gchar *title, GList **list, GnomeUIInfo **info) +{ + GtkWidget *dialog_entry = gtk_entry_new(); + GtkWidget *entry = glade_xml_get_widget(editor->gui, entry_id); + GtkWidget *label = glade_xml_get_widget(editor->gui, label_id); + + GtkWidget *dialog = gnome_dialog_new(title, + NULL); + + gtk_container_add(GTK_CONTAINER(GNOME_DIALOG(dialog)->vbox), + gtk_widget_new (gtk_frame_get_type(), + "border_width", 4, + "label", title, + "child", gtk_widget_new(gtk_alignment_get_type(), + "child", dialog_entry, + "xalign", .5, + "yalign", .5, + "xscale", 1.0, + "yscale", 1.0, + "border_width", 9, + NULL), + NULL)); + + gnome_dialog_append_button_with_pixmap(GNOME_DIALOG(dialog), + "Add", + GNOME_STOCK_PIXMAP_ADD); + gnome_dialog_append_button(GNOME_DIALOG(dialog), GNOME_STOCK_BUTTON_CANCEL); + gnome_dialog_set_default(GNOME_DIALOG(dialog), 0); + + gtk_signal_connect(GTK_OBJECT(dialog), "clicked", + _dialog_clicked, editor); + gtk_signal_connect_while_alive(GTK_OBJECT(editor), "destroy", + _dialog_destroy, GTK_OBJECT(dialog), GTK_OBJECT(dialog)); + + gtk_object_set_data(GTK_OBJECT(dialog), + "e_contact_editor_entry", entry); + gtk_object_set_data(GTK_OBJECT(dialog), + "e_contact_editor_label", label); + gtk_object_set_data(GTK_OBJECT(dialog), + "e_contact_editor_dialog_entry", dialog_entry); + gtk_object_set_data(GTK_OBJECT(dialog), + "e_contact_editor_list", list); + gtk_object_set_data(GTK_OBJECT(dialog), + "e_contact_editor_info", info); + + gtk_widget_show_all(dialog); + return dialog; +} + +static void +_phone_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor) +{ + int which; + int i; + gchar *label; + gchar *entry; + if ( widget == glade_xml_get_widget(editor->gui, "button-phone1") ) { + which = 1; + } else if ( widget == glade_xml_get_widget(editor->gui, "button-phone2") ) { + which = 2; + } else if ( widget == glade_xml_get_widget(editor->gui, "button-phone3") ) { + which = 3; + } else if ( widget == glade_xml_get_widget(editor->gui, "button-phone4") ) { + which = 4; + } else + return; + + label = g_strdup_printf("label-phone%d", which); + entry = g_strdup_printf("entry-phone%d", which); + + if (editor->phone_list == NULL) { + static char *info[] = { + N_("Assistant"), + N_("Business"), + N_("Business 2"), + N_("Business Fax"), + N_("Callback"), + N_("Car"), + N_("Company"), + N_("Home"), + N_("Home 2"), + N_("Home Fax"), + N_("ISDN"), + N_("Mobile"), + N_("Other"), + N_("Other Fax"), + N_("Pager"), + N_("Primary"), + N_("Radio"), + N_("Telex"), + N_("TTY/TDD") + }; + + for (i = 0; i < sizeof(info) / sizeof(info[0]); i++) { + editor->phone_list = g_list_append(editor->phone_list, g_strdup(info[i])); + } + } + if (editor->phone_info == NULL) { + e_contact_editor_build_ui_info(editor->phone_list, &editor->phone_info); + + if ( editor->phone_popup ) + gtk_widget_unref(editor->phone_popup); + + editor->phone_popup = gnome_popup_menu_new(editor->phone_info); + } + + _arrow_pressed (widget, button, editor, editor->phone_popup, &editor->phone_list, &editor->phone_info, label, entry, "Add new phone number type"); + + g_free(label); + g_free(entry); +} + +static void +_email_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor) +{ + int i; + if (editor->email_list == NULL) { + static char *info[] = { + N_("Email"), + N_("Email 2"), + N_("Email 3") + }; + + for (i = 0; i < sizeof(info) / sizeof(info[0]); i++) { + editor->email_list = g_list_append(editor->email_list, g_strdup(info[i])); + } + } + if (editor->email_info == NULL) { + e_contact_editor_build_ui_info(editor->email_list, &editor->email_info); + + if ( editor->email_popup ) + gtk_widget_unref(editor->email_popup); + + editor->email_popup = gnome_popup_menu_new(editor->email_info); + } + + _arrow_pressed (widget, button, editor, editor->email_popup, &editor->email_list, &editor->email_info, "label-email1", "entry-email1", "Add new Email type"); +} + +static void +_address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor) +{ + int i; + if (editor->address_list == NULL) { + static char *info[] = { + N_("Business"), + N_("Home"), + N_("Other") + }; + + for (i = 0; i < sizeof(info) / sizeof(info[0]); i++) { + editor->address_list = g_list_append(editor->address_list, g_strdup(info[i])); + } + } + if (editor->address_info == NULL) { + e_contact_editor_build_ui_info(editor->address_list, &editor->address_info); + + if ( editor->address_popup ) + gtk_widget_unref(editor->address_popup); + + editor->address_popup = gnome_popup_menu_new(editor->address_info); + } + + _arrow_pressed (widget, button, editor, editor->address_popup, &editor->address_list, &editor->address_info, "label-address1", "entry-address1", "Add new Address type"); +} diff --git a/addressbook/contact-editor/e-contact-editor.h b/addressbook/contact-editor/e-contact-editor.h index 45f3ae5597..7b914967ee 100644 --- a/addressbook/contact-editor/e-contact-editor.h +++ b/addressbook/contact-editor/e-contact-editor.h @@ -22,6 +22,7 @@ #define __E_CONTACT_EDITOR_H__ #include +#include #ifdef __cplusplus extern "C" { @@ -49,17 +50,26 @@ typedef struct _EContactEditorClass EContactEditorClass; struct _EContactEditor { - GtkNotebook parent; + GtkVBox parent; /* item specific fields */ /* ECard *card; */ - GList *fields; /* Of type GnomeCanvasItem. */ + GladeXML *gui; + GnomeUIInfo *email_info; + GnomeUIInfo *phone_info; + GnomeUIInfo *address_info; + GtkWidget *email_popup; + GtkWidget *phone_popup; + GtkWidget *address_popup; + GList *email_list; + GList *phone_list; + GList *address_list; }; struct _EContactEditorClass { - GtkNotebookClass parent_class; + GtkVBoxClass parent_class; }; diff --git a/addressbook/contact-editor/netfreebusy.png b/addressbook/contact-editor/netfreebusy.png new file mode 100644 index 0000000000..09ec8a2a5c Binary files /dev/null and b/addressbook/contact-editor/netfreebusy.png differ diff --git a/addressbook/contact-editor/netmeeting.png b/addressbook/contact-editor/netmeeting.png new file mode 100644 index 0000000000..4cb90c121e Binary files /dev/null and b/addressbook/contact-editor/netmeeting.png differ diff --git a/addressbook/contact-editor/test-editor.c b/addressbook/contact-editor/test-editor.c index 737c3028c4..49ed7e48bf 100644 --- a/addressbook/contact-editor/test-editor.c +++ b/addressbook/contact-editor/test-editor.c @@ -23,6 +23,7 @@ #include "config.h" #include +#include #include "e-contact-editor.h" /* This is a horrible thing to do, but it is just a test. */ @@ -30,7 +31,10 @@ GtkWidget *editor; static void destroy_callback(GtkWidget *app, gpointer data) { - exit(0); + static int count = 2; + count --; + if ( count <= 0 ) + exit(0); } static void about_callback( GtkWidget *widget, gpointer data ) @@ -59,6 +63,22 @@ int main( int argc, char *argv[] ) textdomain (PACKAGE);*/ gnome_init( "Contact Editor Test", VERSION, argc, argv); + + glade_gnome_init (); + + app = gnome_app_new("Contact Editor Test", NULL); + + editor = e_contact_editor_new(NULL); + + gnome_app_set_contents( GNOME_APP( app ), editor ); + + /* Connect the signals */ + gtk_signal_connect( GTK_OBJECT( app ), "destroy", + GTK_SIGNAL_FUNC( destroy_callback ), + ( gpointer ) app ); + + gtk_widget_show_all( app ); + app = gnome_app_new("Contact Editor Test", NULL); editor = e_contact_editor_new(NULL); -- cgit v1.2.3