From 227fab86efce103776af0364cbfd3f1959f9d269 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 8 Jun 2000 17:12:12 +0000 Subject: Now this derives from GtkObject. It follows the same strategy as the 2000-06-08 Federico Mena Quintero * contact-editor/e-contact-editor.h (EContactEditor): Now this derives from GtkObject. It follows the same strategy as the EventEditor in the calendar. (EContactEditor): Added an is_new_card field so that we can know whether to add() or commit() the card. * contact-editor/e-contact-editor.c (e_contact_editor_get_type): Derive from GtkObject. (e_contact_editor_class_init): Likewise. (e_contact_editor_class_init): Added an "is_new_card" argument. (e_contact_editor_set_arg): Handle ARG_IS_NEW_CARD. (e_contact_editor_get_arg): Likewise. (e_contact_editor_new): Take in an is_new_arg argument and set it on the object. (e_contact_editor_init): Load the app widget into the app field of the EContactEditor structure. Create its UIHandler as well. (e_contact_editor_class_init): New "add_card", "commit_card", and "editor_closed" signals. * contact-editor/test-editor.c (main): Modified for the new API. (editor_closed_cb): Tweaked for the new API. Since this test program does not use Bonobo, it doesn't work, though. * gui/component/addressbook.c (new_contact_cb): Use the new contact editor API. (table_double_click): Ditto. * gui/minicard/e-minicard-view.c (e_minicard_view_event): Use the new contact editor API. * gui/minicard/e-minicard.c (e_minicard_event): Use the new contact editor API. svn path=/trunk/; revision=3479 --- .../gui/contact-editor/contact-editor.glade | 4010 ++++++++++---------- .../gui/contact-editor/e-contact-editor-strings.h | 12 +- addressbook/gui/contact-editor/e-contact-editor.c | 423 ++- addressbook/gui/contact-editor/e-contact-editor.h | 20 +- addressbook/gui/contact-editor/test-editor.c | 74 +- 5 files changed, 2473 insertions(+), 2066 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade index 21ad4fd265..7f11886b28 100644 --- a/addressbook/gui/contact-editor/contact-editor.glade +++ b/addressbook/gui/contact-editor/contact-editor.glade @@ -20,124 +20,100 @@ - GtkWindow - contact editor + GnomeDialog + dialog2 + 2 False - Contact Editor GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False - True + False False + False + False - GtkNotebook - notebook-contact-editor - True - True - True - GTK_POS_TOP - False - 2 - 2 - False + GtkVBox + GnomeDialog:vbox + dialog-vbox2 + False + 4 + + 4 + True + True + - GtkTable - table-contact-editor-general - 7 - 14 - 8 - False - 4 - 4 + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area2 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + - GtkEntry - entry-phone1 + GtkButton + button28 + True True - True - True - 0 - - - 7 - 8 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - + GNOME_STOCK_BUTTON_OK - GtkEntry - entry-phone2 + GtkButton + button29 + True True - True - True - 0 - - - 7 - 8 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - + GNOME_STOCK_BUTTON_APPLY - GtkEntry - entry-phone3 + GtkButton + button30 + True True - True - True - 0 - - - 7 - 8 - 2 - 3 - 0 - 0 - True - False - False - False - True - False - + GNOME_STOCK_BUTTON_CANCEL + + + + GtkTable + table2 + 2 + 2 + False + 0 + 2 + + 0 + True + True + GtkEntry - entry-phone4 + entry2 True True True 0 - 7 - 8 - 3 - 4 + 0 + 2 + 1 + 2 0 0 True @@ -150,118 +126,19 @@ - GtkText - text-address - 1 - 1 - True - True - - - 7 - 8 - 5 - 9 - 0 - 0 - True - False - False - False - True - True - - - - - GtkButton - button-fullname - True - + GtkVBox + vbox1 + False + 2 1 - 3 + 2 0 1 0 0 False - False - False - False - True - True - - - - - GtkAccelLabel - accellabel-fileas - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 1 - 3 - 3 - 4 - 0 - 0 - False - False - False - False - True - True - - - - - GtkAccelLabel - accellabel-web - - GTK_JUSTIFY_LEFT - False - 0 - 0.5 - 0 - 0 - - 1 - 3 - 8 - 9 - 0 - 0 - False - False - False - False - True - True - - - - - GtkAlignment - alignment3 - 1 - 0.5 - 0 - 1 - - 2 - 3 - 5 - 6 - 0 - 0 - False - False + True False False True @@ -270,30 +147,48 @@ GtkButton - button-email1 + button31 + 2 + True + + + 0 + False + False + + - - Placeholder - + + GtkButton + button32 + 2 + True + + + 0 + False + False + - GtkAlignment - alignment5 - 1 - 0.5 - 0 - 0 + GtkScrolledWindow + scrolledwindow1 + 200 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS - 6 - 7 - 3 - 4 + 0 + 1 + 0 + 1 0 0 - False - False + True + True False False True @@ -301,2005 +196,2136 @@ - GtkButton - button-phone4 + GtkCList + clist1 + True + 1 + 80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_NONE - Placeholder + GtkLabel + CList:title + label20 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + - - GtkAlignment - alignment7 - 1 - 0.5 - 0 - 0 - - 6 - 7 - 1 - 2 - 0 - 0 - False - False - False - False - True - True - - - - GtkButton - button-phone2 - - - Placeholder - - - + + GnomeDialog + dialog-add-phone + False + New phone type + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + False + False + False - - GtkAlignment - alignment8 - 1 - 0.5 - 0 - 0 - - 6 - 7 - 0 - 1 - 0 - 0 - False - False - False - False - True - True - + + GtkVBox + GnomeDialog:vbox + vbox2 + False + 8 + + 4 + True + True + - - GtkButton - button-phone1 + + GtkHButtonBox + GnomeDialog:action_area + hbuttonbox1 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + - - Placeholder - - + + GtkButton + button43 + True + True + True + + GNOME_STOCK_PIXMAP_ADD - GtkHSeparator - hseparator4 - - 4 - 8 - 4 - 5 - 0 - 2 - True - False - False - False - True - False - + GtkButton + button44 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + GtkFrame + frame-add-phone + 4 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + GtkAlignment - alignment6 - 1 + alignment9 + 9 + 0.5 0.5 - 0 - 0 - - 6 - 7 - 2 - 3 - 0 - 0 - False - False - False - False - True - True - + 1 + 1 - GtkButton - button-phone3 - - - Placeholder - + GtkEntry + entry-add-phone + True + True + True + True + 0 + + + + - - GtkEntry - entry-fullname - True - True - True - True - True - 0 - - - 3 - 4 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - - + + GnomeApp + contact editor + Contact Editor + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + True - - GtkEntry - entry-jobtitle - True - True - True - 0 - - - 3 - 4 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - + + GnomeDock + GnomeApp:dock + dock1 + True + + 0 + True + True + - - GtkEntry - entry-company - True - True - True - 0 - - - 3 - 4 - 2 - 3 - 0 - 0 - True - False - False - False - True - False - - + + GtkNotebook + GnomeDock:contents + notebook-contact-editor + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + + GtkTable + table-contact-editor-general + 7 + 14 + 8 + False + 4 + 4 - - GtkEntry - entry-email1 - True - True - True - 0 - - - 3 - 4 - 5 - 6 - 0 - 0 - True - False - False - False - True - False - - - - - GtkEntry - entry-web - True - True - True - 0 - - - 3 - 4 - 8 - 9 - 0 - 0 - True - False - False - False - True - False - - - - - GtkHSeparator - hseparator5 - - 0 - 4 - 4 - 5 - 0 - 2 - True - False - False - False - True - False - - - - - GtkCombo - combo-file-as - False - True - True - True - False - - - 3 - 4 - 3 - 4 - 0 - 0 - True - False - False - False - True - False - + + GtkEntry + entry-phone1 + True + True + True + 0 + + + 7 + 8 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + GtkEntry - GtkCombo:entry - entry-file-as + entry-phone2 True True True 0 + + 7 + 8 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + - - - GtkHSeparator - hseparator6 - - 0 - 4 - 7 - 8 - 0 - 2 - True - False - False - False - True - True - - - - - GtkAlignment - alignment10 - 0.5 - 0 - 1 - 1 - - 3 - 4 - 6 - 7 - 0 - 0 - True - False - True - True - True - True - + + GtkEntry + entry-phone3 + True + True + True + 0 + + + 7 + 8 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + - GtkCheckButton - checkbutton-htmlmail - - False - True + GtkEntry + entry-phone4 + True + True + True + 0 + + + 7 + 8 + 3 + 4 + 0 + 0 + True + False + False + False + True + False + - - - GtkAlignment - alignment4 - 1 - 0.5 - 0 - 0 - - 6 - 7 - 5 - 6 - 0 - 0 - False - False - False - False - True - True - + + GtkText + text-address + 1 + 1 + True + True + + + 7 + 8 + 5 + 9 + 0 + 0 + True + False + False + False + True + True + + GtkButton - button-address - - - Placeholder - + button-fullname + True + + + 1 + 3 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + - - - - GtkLabel - address-label - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - text-address - - 5 - 7 - 6 - 7 - 0 - 0 - False - False - False - False - True - True - - - - - GtkEventBox - eventbox1 - - 5 - 6 - 0 - 1 - 0 - 0 - False - False - False - False - True - True - - GtkLabel - label-phone1 - + GtkAccelLabel + accellabel-fileas + GTK_JUSTIFY_CENTER False 0 0.5 0 0 - entry-phone1 + + 1 + 3 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + - - - - GtkEventBox - eventbox2 - - 5 - 6 - 1 - 2 - 0 - 0 - False - False - False - False - True - True - - GtkLabel - label-phone2 - - GTK_JUSTIFY_CENTER + GtkAccelLabel + accellabel-web + + GTK_JUSTIFY_LEFT False 0 0.5 0 0 - entry-phone2 + + 1 + 3 + 8 + 9 + 0 + 0 + False + False + False + False + True + True + - - - - GtkEventBox - eventbox3 - - 5 - 6 - 2 - 3 - 0 - 0 - False - False - False - False - True - True - - GtkLabel - label-phone3 - - GTK_JUSTIFY_CENTER - False - 0 + GtkAlignment + alignment3 + 1 0.5 - 0 - 0 - entry-phone3 + 0 + 1 + + 2 + 3 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + + + GtkButton + button-email1 + + + Placeholder + + - - - GtkEventBox - eventbox4 - - 5 - 6 - 3 - 4 - 0 - 0 - False - False - False - False - True - True - + + GtkAlignment + alignment5 + 1 + 0.5 + 0 + 0 + + 6 + 7 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + + + GtkButton + button-phone4 + + + Placeholder + + + - GtkLabel - label-phone4 - - GTK_JUSTIFY_LEFT - False - 0 + GtkAlignment + alignment7 + 1 0.5 - 0 - 0 - entry-phone4 + 0 + 0 + + 6 + 7 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + GtkButton + button-phone2 + + + Placeholder + + - - - - GtkEventBox - eventbox5 - - 1 - 2 - 5 - 6 - 0 - 0 - False - False - False - False - True - True - - GtkLabel - label-email1 - - GTK_JUSTIFY_CENTER - False - 0 + GtkAlignment + alignment8 + 1 0.5 - 0 - 0 - entry-email1 - - + 0 + 0 + + 6 + 7 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + - - GtkEventBox - eventbox-business - - 5 - 6 - 5 - 6 - 0 - 0 - False - False - False - False - True - True - + + GtkButton + button-phone1 - - GtkLabel - label-address - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - text-address + + Placeholder + + - - - - GtkAlignment - alignment2 - 0 - 0 - 0 - 0 - - 7 - 8 - 9 - 10 - 0 - 0 - True - False - False - False - True - True - - GtkCheckButton - checkbutton-mailingaddress - - False - True + GtkHSeparator + hseparator4 + + 4 + 8 + 4 + 5 + 0 + 2 + True + False + False + False + True + False + - - - GtkHSeparator - hseparator9 - - 0 - 4 - 11 - 12 - 0 - 2 - True - False - False - False - True - True - - + + GtkAlignment + alignment6 + 1 + 0.5 + 0 + 0 + + 6 + 7 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + - - GtkHSeparator - hseparator10 - - 4 - 8 - 11 - 12 - 0 - 0 - True - False - False - False - True - True - - + + GtkButton + button-phone3 - - GtkAlignment - alignment12 - 0.5 - 0.5 - 1 - 0 - - 1 - 3 - 12 - 13 - 0 - 0 - False - False - False - False - True - True - + + Placeholder + + + - GtkButton - button-contacts + GtkEntry + entry-fullname + True True - + True + True + True + 0 + + + 3 + 4 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + - - - GtkAlignment - alignment15 - 0.5 - 0.5 - 1 - 0 - - 7 - 8 - 12 - 13 - 0 - 0 - True - False - False - False - True - True - + + GtkEntry + entry-jobtitle + True + True + True + 0 + + + 3 + 4 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + GtkEntry - entry-categories + entry-company True True True 0 + + 3 + 4 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + - - - GtkAlignment - alignment14 - 0.5 - 0.5 - 1 - 0 - - 3 - 4 - 12 - 13 - 0 - 0 - True - False - False - False - True - True - + + GtkEntry + entry-email1 + True + True + True + 0 + + + 3 + 4 + 5 + 6 + 0 + 0 + True + False + False + False + True + False + + GtkEntry - entry-contacts + entry-web True True True 0 + + 3 + 4 + 8 + 9 + 0 + 0 + True + False + False + False + True + False + - - - GtkAlignment - alignment16 - 0.5 - 0.5 - 1 - 0 - - 5 - 7 - 12 - 13 - 0 - 0 - False - False - False - False - True - True - + + GtkHSeparator + hseparator5 + + 0 + 4 + 4 + 5 + 0 + 2 + True + False + False + False + True + False + + - GtkButton - button-categories - True - + GtkCombo + combo-file-as + False + True + True + True + False + + + 3 + 4 + 3 + 4 + 0 + 0 + True + False + False + False + True + False + + + + GtkEntry + GtkCombo:entry + entry-file-as + True + True + True + 0 + + - - - GtkEventBox - eventbox7 - - 1 - 3 - 1 - 2 - 0 - 0 - False - False - False - False - True - True - + + GtkHSeparator + hseparator6 + + 0 + 4 + 7 + 8 + 0 + 2 + True + False + False + False + True + True + + - GtkLabel - label34 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-jobtitle + GtkAlignment + alignment10 + 0.5 + 0 + 1 + 1 + + 3 + 4 + 6 + 7 + 0 + 0 + True + False + True + True + True + True + + + + GtkCheckButton + checkbutton-htmlmail + + False + True + - - - Custom - custom1 - e_create_image_widget - malehead.png - - 0 - 0 - Thu, 18 May 2000 12:19:47 GMT - - 0 - 1 - 0 - 4 - 0 - 0 - False - False - False - False - True - True - - - - - Custom - custom2 - e_create_image_widget - cellphone.png - - 0 - 0 - Thu, 18 May 2000 12:20:02 GMT - - 4 - 5 - 0 - 4 - 0 - 0 - False - False - False - False - True - True - - + + GtkAlignment + alignment4 + 1 + 0.5 + 0 + 0 + + 6 + 7 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + - - Custom - custom3 - e_create_image_widget - envelope.png - - 0 - 0 - Thu, 18 May 2000 12:19:51 GMT - - 0 - 1 - 5 - 7 - 0 - 0 - False - False - False - False - True - True - - + + GtkButton + button-address - - Custom - custom4 - e_create_image_widget - house.png - - 0 - 0 - Thu, 18 May 2000 12:20:06 GMT - - 4 - 5 - 5 - 10 - 0 - 0 - False - False - False - False - True - True - - + + Placeholder + + + - - Custom - custom5 - e_create_image_widget - evolution-contacts.png - - 0 - 0 - Thu, 18 May 2000 12:19:59 GMT - - 0 - 1 - 12 - 14 + + GtkLabel + address-label + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - False - False - False - False - True - True - - + text-address + + 5 + 7 + 6 + 7 + 0 + 0 + False + False + False + False + True + True + + - - Custom - custom6 - e_create_image_widget - briefcase.png - - 0 - 0 - Thu, 18 May 2000 12:20:09 GMT - - 4 - 5 - 12 - 14 - 0 - 0 - False - False - False - False - True - True - - + + GtkEventBox + eventbox1 + + 5 + 6 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + - - Custom - custom10 - e_create_image_widget - globe.png - - 0 - 0 - Thu, 18 May 2000 12:19:56 GMT - - 0 - 1 - 8 - 10 - 0 - 0 - False - False - False - False - True - True - - + + GtkLabel + label-phone1 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + entry-phone1 + + - - GtkLabel - label35 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-company - - 1 - 3 - 2 - 3 - 0 - 0 - False - False - False - False - True - True - - - + + GtkEventBox + eventbox2 + + 5 + 6 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + - - GtkLabel - Notebook:tab - label15 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - + + GtkLabel + label-phone2 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + entry-phone2 + + - - GtkTable - table-contact-editor-details - 7 - 9 - 6 - False - 4 - 4 + + GtkEventBox + eventbox3 + + 5 + 6 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + - - GtkLabel - label21 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-department - - 1 - 2 - 0 - 1 - 0 - 0 - False - False - False - False - True - True - - + + GtkLabel + label-phone3 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + entry-phone3 + + - - GtkLabel - label22 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-office - - 1 - 2 - 1 - 2 - 0 - 0 - False - False - False - False - True - True - - + + GtkEventBox + eventbox4 + + 5 + 6 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + - - GtkLabel - label23 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-profession - - 1 - 2 - 2 - 3 - 0 - 0 - False - False - False - False - True - True - - + + GtkLabel + label-phone4 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + entry-phone4 + + - - GtkLabel - label24 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-nickname - - 1 - 2 - 4 - 5 - 0 - 0 - False - False - False - False - True - True - - + + GtkEventBox + eventbox5 + + 1 + 2 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + - - GtkLabel - label25 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-spouse - - 1 - 2 - 5 - 6 - 0 - 0 - False - False - False - False - True - True - - + + GtkLabel + label-email1 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + entry-email1 + + - - GtkLabel - label31 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 3 - 4 - 4 - 5 - 0 - 0 - False - False - False - False - True - True - - + + GtkEventBox + eventbox-business + + 5 + 6 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + - - GtkLabel - label30 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-assistant - - 3 - 4 - 1 - 2 - 0 - 0 - False - False - False - False - True - True - - + + GtkLabel + label-address + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + text-address + + - - GtkLabel - label29 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-manager - - 3 - 4 - 0 - 1 - 0 - 0 - False - False - False - False - True - True - - + + GtkAlignment + alignment2 + 0 + 0 + 0 + 0 + + 7 + 8 + 9 + 10 + 0 + 0 + True + False + False + False + True + True + - - GtkLabel - label32 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 3 - 4 - 5 - 6 - 0 - 0 - False - False - False - False - True - True - - + + GtkCheckButton + checkbutton-mailingaddress + + False + True + + - - GtkEntry - entry-spouse - True - True - True - 0 - - - 2 - 3 - 5 - 6 - 0 - 0 - True - False - False - False - True - False - - + + GtkHSeparator + hseparator9 + + 0 + 4 + 11 + 12 + 0 + 2 + True + False + False + False + True + True + + + + + GtkHSeparator + hseparator10 + + 4 + 8 + 11 + 12 + 0 + 0 + True + False + False + False + True + True + + + + + GtkAlignment + alignment12 + 0.5 + 0.5 + 1 + 0 + + 1 + 3 + 12 + 13 + 0 + 0 + False + False + False + False + True + True + + + + GtkButton + button-contacts + True + + + + + + GtkAlignment + alignment15 + 0.5 + 0.5 + 1 + 0 + + 7 + 8 + 12 + 13 + 0 + 0 + True + False + False + False + True + True + + + + GtkEntry + entry-categories + True + True + True + 0 + + + + + + GtkAlignment + alignment14 + 0.5 + 0.5 + 1 + 0 + + 3 + 4 + 12 + 13 + 0 + 0 + True + False + False + False + True + True + + + + GtkEntry + entry-contacts + True + True + True + 0 + + + + + + GtkAlignment + alignment16 + 0.5 + 0.5 + 1 + 0 + + 5 + 7 + 12 + 13 + 0 + 0 + False + False + False + False + True + True + + + + GtkButton + button-categories + True + + + + + + GtkEventBox + eventbox7 + + 1 + 3 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + GtkLabel + label34 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + entry-jobtitle + + + + + Custom + custom1 + e_create_image_widget + malehead.png + + 0 + 0 + Thu, 18 May 2000 12:19:47 GMT + + 0 + 1 + 0 + 4 + 0 + 0 + False + False + False + False + True + True + + + + + Custom + custom2 + e_create_image_widget + cellphone.png + + 0 + 0 + Thu, 18 May 2000 12:20:02 GMT + + 4 + 5 + 0 + 4 + 0 + 0 + False + False + False + False + True + True + + + + + Custom + custom3 + e_create_image_widget + envelope.png + + 0 + 0 + Thu, 18 May 2000 12:19:51 GMT + + 0 + 1 + 5 + 7 + 0 + 0 + False + False + False + False + True + True + + + + + Custom + custom4 + e_create_image_widget + house.png + + 0 + 0 + Thu, 18 May 2000 12:20:06 GMT + + 4 + 5 + 5 + 10 + 0 + 0 + False + False + False + False + True + True + + + + + Custom + custom5 + e_create_image_widget + evolution-contacts.png + + 0 + 0 + Thu, 18 May 2000 12:19:59 GMT + + 0 + 1 + 12 + 14 + 0 + 0 + False + False + False + False + True + True + + - - GtkEntry - entry-department - True - True - True - 0 - - - 2 - 3 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - - + + Custom + custom6 + e_create_image_widget + briefcase.png + + 0 + 0 + Thu, 18 May 2000 12:20:09 GMT + + 4 + 5 + 12 + 14 + 0 + 0 + False + False + False + False + True + True + + - - GtkEntry - entry-office - True - True - True - 0 - - - 2 - 3 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - + + Custom + custom10 + e_create_image_widget + globe.png + + 0 + 0 + Thu, 18 May 2000 12:19:56 GMT + + 0 + 1 + 8 + 10 + 0 + 0 + False + False + False + False + True + True + + - - GtkEntry - entry-profession - True - True - True - 0 - - - 2 - 3 - 2 - 3 + + GtkLabel + label35 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - True - False - False - False - True - False - + entry-company + + 1 + 3 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + - GtkEntry - entry-nickname - True - True - True - 0 - - - 2 - 3 - 4 - 5 - 0 - 0 - True - False - False - False - True - False - + GtkLabel + Notebook:tab + label15 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 - GnomeDateEdit - dateedit-anniversary - False - False - False - 7 - 19 - - 4 - 6 - 5 - 6 - 0 - 0 - True - False - False - False - True - False - - + GtkTable + table-contact-editor-details + 7 + 9 + 6 + False + 4 + 4 - - GnomeDateEdit - dateedit-birthday - False - False - False - 7 - 19 - - 4 - 6 - 4 - 5 + + GtkLabel + label21 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - True - False - False - False - True - False - - + entry-department + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + - - GtkEntry - entry-assistant - True - True - True - 0 - - - 4 - 6 - 1 - 2 + + GtkLabel + label22 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - True - False - False - False - True - False - - + entry-office + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + - - GtkEntry - entry-manager - True - True - True - 0 - - - 4 - 6 - 0 - 1 + + GtkLabel + label23 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - True - False - False - False - True - False - - + entry-profession + + 1 + 2 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + - - GtkHSeparator - hseparator7 - - 0 - 6 - 3 - 4 + + GtkLabel + label24 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 - 2 - False - False - False - False - True - True - - + 0 + entry-nickname + + 1 + 2 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + - - GtkLabel - label33 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 1 - 2 - 7 - 8 + + GtkLabel + label25 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - False - False - False - False - True - True - - + entry-spouse + + 1 + 2 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + - - GtkHSeparator - hseparator8 - - 0 - 6 - 6 - 7 + + GtkLabel + label31 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - True - False - False - False - True - True - - + + 3 + 4 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + - - Custom - custom7 - e_create_image_widget - briefcase.png - - 0 - 0 - Thu, 18 May 2000 12:20:13 GMT - - 0 - 1 - 0 - 2 + + GtkLabel + label30 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - False - False - False - False - True - True - - + entry-assistant + + 3 + 4 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + - - Custom - custom8 - e_create_image_widget - malehead.png - - 0 - 0 - Thu, 18 May 2000 12:20:16 GMT - - 0 - 1 - 4 - 6 + + GtkLabel + label29 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - False - False - False - False - True - True - - + entry-manager + + 3 + 4 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + - - GtkScrolledWindow - scrolledwindow2 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 1 - 6 - 8 - 9 + + GtkLabel + label32 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - True - True - False - False - True - True - + + 3 + 4 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + - GtkText - text-comments + GtkEntry + entry-spouse True True + True + 0 + + 2 + 3 + 5 + 6 + 0 + 0 + True + False + False + False + True + False + - - - - Custom - custom9 - e_create_image_widget - globe.png - - 0 - 0 - Thu, 18 May 2000 12:20:19 GMT - - 0 - 1 - 7 - 9 - 0 - 0 - False - False - False - False - True - True - - - - - - GtkLabel - Notebook:tab - label16 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - GnomeDialog - dialog2 - 2 - False - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - False - False - False - - - GtkVBox - GnomeDialog:vbox - dialog-vbox2 - False - 4 - - 4 - True - True - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area2 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button28 - True - True - GNOME_STOCK_BUTTON_OK - - - GtkButton - button29 - True - True - GNOME_STOCK_BUTTON_APPLY - + + GtkEntry + entry-department + True + True + True + 0 + + + 2 + 3 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + - - GtkButton - button30 - True - True - GNOME_STOCK_BUTTON_CANCEL - - + + GtkEntry + entry-office + True + True + True + 0 + + + 2 + 3 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + - - GtkTable - table2 - 2 - 2 - False - 0 - 2 - - 0 - True - True - + + GtkEntry + entry-profession + True + True + True + 0 + + + 2 + 3 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + - - GtkEntry - entry2 - True - True - True - 0 - - - 0 - 2 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - + + GtkEntry + entry-nickname + True + True + True + 0 + + + 2 + 3 + 4 + 5 + 0 + 0 + True + False + False + False + True + False + + - - GtkVBox - vbox1 - False - 2 - - 1 - 2 - 0 - 1 - 0 - 0 - False - True - False - False - True - True - + + GnomeDateEdit + dateedit-anniversary + False + False + False + 7 + 19 + + 4 + 6 + 5 + 6 + 0 + 0 + True + False + False + False + True + False + + - GtkButton - button31 - 2 + GnomeDateEdit + dateedit-birthday + False + False + False + 7 + 19 + + 4 + 6 + 4 + 5 + 0 + 0 + True + False + False + False + True + False + + + + + GtkEntry + entry-assistant True - + True + True + 0 + - 0 - False - False + 4 + 6 + 1 + 2 + 0 + 0 + True + False + False + False + True + False - GtkButton - button32 - 2 + GtkEntry + entry-manager True - + True + True + 0 + - 0 - False - False + 4 + 6 + 0 + 1 + 0 + 0 + True + False + False + False + True + False - - - GtkScrolledWindow - scrolledwindow1 - 200 - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 0 - 1 - 0 - 1 + + GtkHSeparator + hseparator7 + + 0 + 6 + 3 + 4 + 0 + 2 + False + False + False + False + True + True + + + + + GtkLabel + label33 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 0 0 - True - True - False - False - True - True - + + 1 + 2 + 7 + 8 + 0 + 0 + False + False + False + False + True + True + + - GtkCList - clist1 - True - 1 - 80 - GTK_SELECTION_SINGLE - True - GTK_SHADOW_NONE - - - GtkLabel - CList:title - label20 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 + GtkHSeparator + hseparator8 + + 0 + 6 + 6 + 7 0 0 - + True + False + False + False + True + True + - - - - - - GnomeDialog - dialog-add-phone - False - New phone type - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - False - False - False + + Custom + custom7 + e_create_image_widget + briefcase.png + + 0 + 0 + Thu, 18 May 2000 12:20:13 GMT + + 0 + 1 + 0 + 2 + 0 + 0 + False + False + False + False + True + True + + - - GtkVBox - GnomeDialog:vbox - vbox2 - False - 8 - - 4 - True - True - + + Custom + custom8 + e_create_image_widget + malehead.png + + 0 + 0 + Thu, 18 May 2000 12:20:16 GMT + + 0 + 1 + 4 + 6 + 0 + 0 + False + False + False + False + True + True + + - - GtkHButtonBox - GnomeDialog:action_area - hbuttonbox1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - + + GtkScrolledWindow + scrolledwindow2 + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 1 + 6 + 8 + 9 + 0 + 0 + True + True + False + False + True + True + - - GtkButton - button43 - True - True - True - - GNOME_STOCK_PIXMAP_ADD - + + GtkText + text-comments + True + True + + + - - GtkButton - button44 - True - True - GNOME_STOCK_BUTTON_CANCEL + + Custom + custom9 + e_create_image_widget + globe.png + + 0 + 0 + Thu, 18 May 2000 12:20:19 GMT + + 0 + 1 + 7 + 9 + 0 + 0 + False + False + False + False + True + True + + - - - - GtkFrame - frame-add-phone - 4 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - True - - GtkAlignment - alignment9 - 9 + GtkLabel + Notebook:tab + label16 + + GTK_JUSTIFY_CENTER + False 0.5 0.5 - 1 - 1 - - - GtkEntry - entry-add-phone - True - True - True - True - 0 - - + 0 + 0 + + + GnomeAppBar + GnomeApp:appbar + appbar1 + True + True + + 0 + True + True + + diff --git a/addressbook/gui/contact-editor/e-contact-editor-strings.h b/addressbook/gui/contact-editor/e-contact-editor-strings.h index d5f1983573..d5ac9daf24 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-strings.h +++ b/addressbook/gui/contact-editor/e-contact-editor-strings.h @@ -4,6 +4,12 @@ * DO NOT compile it as part of your application. */ +gchar *s = N_("_Add"); +gchar *s = N_("_Delete"); +gchar *s = N_("Phone Types"); +gchar *s = N_("New phone type"); +gchar *s = N_("Add"); +gchar *s = N_("New phone type"); gchar *s = N_("Contact Editor"); gchar *s = N_("_Full Name..."); gchar *s = N_("File As:"); @@ -33,9 +39,3 @@ gchar *s = N_("_Manager's Name:"); gchar *s = N_("Anni_versary:"); gchar *s = N_("No_tes:"); gchar *s = N_("Details"); -gchar *s = N_("_Add"); -gchar *s = N_("_Delete"); -gchar *s = N_("Phone Types"); -gchar *s = N_("New phone type"); -gchar *s = N_("Add"); -gchar *s = N_("New phone type"); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 5ca3fd753e..00cf952d8e 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -29,6 +29,14 @@ #include #include +/* Signal IDs */ +enum { + ADD_CARD, + COMMIT_CARD, + EDITOR_CLOSED, + LAST_SIGNAL +}; + 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); @@ -47,12 +55,15 @@ static void set_fields(EContactEditor *editor); static void set_address_field(EContactEditor *editor, int result); static void add_field_callback(GtkWidget *widget, EContactEditor *editor); -static GtkVBoxClass *parent_class = NULL; +static GtkObjectClass *parent_class = NULL; + +static guint contact_editor_signals[LAST_SIGNAL]; /* The arguments we take */ enum { ARG_0, - ARG_CARD + ARG_CARD, + ARG_IS_NEW_CARD }; enum { @@ -80,7 +91,7 @@ e_contact_editor_get_type (void) (GtkClassInitFunc) NULL, }; - contact_editor_type = gtk_type_unique (gtk_vbox_get_type (), &contact_editor_info); + contact_editor_type = gtk_type_unique (GTK_TYPE_OBJECT, &contact_editor_info); } return contact_editor_type; @@ -90,15 +101,43 @@ static void e_contact_editor_class_init (EContactEditorClass *klass) { GtkObjectClass *object_class; - GtkVBoxClass *vbox_class; object_class = (GtkObjectClass*) klass; - vbox_class = (GtkVBoxClass *) klass; - parent_class = gtk_type_class (gtk_vbox_get_type ()); + parent_class = gtk_type_class (GTK_TYPE_OBJECT); gtk_object_add_arg_type ("EContactEditor::card", GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CARD); + gtk_object_add_arg_type ("EContactEditor::is_new_card", GTK_TYPE_BOOL, + GTK_ARG_READWRITE, ARG_IS_NEW_CARD); + + contact_editor_signals[ADD_CARD] = + gtk_signal_new ("add_card", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (EContactEditorClass, add_card), + gtk_marshal_NONE__OBJECT, + GTK_TYPE_NONE, 1, + GTK_TYPE_OBJECT); + + contact_editor_signals[COMMIT_CARD] = + gtk_signal_new ("commit_card", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (EContactEditorClass, commit_card), + gtk_marshal_NONE__OBJECT, + GTK_TYPE_NONE, 1, + GTK_TYPE_OBJECT); + + contact_editor_signals[EDITOR_CLOSED] = + gtk_signal_new ("editor_closed", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (EContactEditorClass, editor_closed), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + + gtk_object_class_add_signals (object_class, contact_editor_signals, LAST_SIGNAL); object_class->set_arg = e_contact_editor_set_arg; object_class->get_arg = e_contact_editor_get_arg; @@ -463,13 +502,328 @@ categories_clicked(GtkWidget *button, EContactEditor *editor) g_free(categories); } +/* Emits the signal to request saving a card */ +static void +save_card (EContactEditor *ce) +{ + if (ce->is_new_card) + gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[ADD_CARD], + ce->card); + else + gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[COMMIT_CARD], + ce->card); + + /* FIXME: should we set the ce->is_new_card here or have the client code + * set the "is_new_card" argument on the contact editor object? + */ + + ce->is_new_card = FALSE; +} + +/* Closes the dialog box and emits the appropriate signals */ +static void +close_dialog (EContactEditor *ce) +{ + g_assert (ce->app != NULL); + + gtk_widget_destroy (ce->app); + ce->app = NULL; + + gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[EDITOR_CLOSED]); +} + +/* Menu callbacks */ + +/* File/Save callback */ +static void +file_save_cb (GtkWidget *widget, gpointer data) +{ + EContactEditor *ce; + + ce = E_CONTACT_EDITOR (data); + save_card (ce); +} + +/* File/Close callback */ +static void +file_close_cb (GtkWidget *widget, gpointer data) +{ + EContactEditor *ce; + + ce = E_CONTACT_EDITOR (data); + close_dialog (ce); +} + +/* Menu bar */ + +static GnomeUIInfo file_new_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Appointment"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Meeting Re_quest"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Mail Message"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Contact"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Task"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Task _Request"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Journal Entry"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Note"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Ch_oose Form..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo file_page_setup_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Memo Style"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Define Print _Styles..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo file_menu[] = { + GNOMEUIINFO_MENU_NEW_SUBTREE (file_new_menu), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: S_end"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_SAVE_ITEM (file_save_cb, NULL), + GNOMEUIINFO_MENU_SAVE_AS_ITEM (NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Save Attac_hments..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Delete"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Move to Folder..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Cop_y to Folder..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_SUBTREE (N_("Page Set_up"), file_page_setup_menu), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Print Pre_view"), NULL, NULL), + GNOMEUIINFO_MENU_PRINT_ITEM (NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_PROPERTIES_ITEM (NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_CLOSE_ITEM (file_close_cb, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo edit_object_menu[] = { + GNOMEUIINFO_ITEM_NONE ("FIXME: what goes here?", NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo edit_menu[] = { + GNOMEUIINFO_MENU_UNDO_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_REDO_ITEM (NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_CUT_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_COPY_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_PASTE_ITEM (NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Paste _Special..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_CLEAR_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_SELECT_ALL_ITEM (NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Mark as U_nread"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_FIND_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_FIND_AGAIN_ITEM (NULL, NULL), + GNOMEUIINFO_SUBTREE (N_("_Object"), edit_object_menu), + GNOMEUIINFO_END +}; + +static GnomeUIInfo view_previous_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Item"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Unread Item"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Fi_rst Item in Folder"), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo view_next_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Item"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Unread Item"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Last Item in Folder"), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo view_toolbars_menu[] = { + { GNOME_APP_UI_TOGGLEITEM, N_("FIXME: _Standard"), NULL, NULL, NULL, NULL, + GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL }, + { GNOME_APP_UI_TOGGLEITEM, N_("FIXME: __Formatting"), NULL, NULL, NULL, NULL, + GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL }, + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Customize..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo view_menu[] = { + GNOMEUIINFO_SUBTREE (N_("Pre_vious"), view_previous_menu), + GNOMEUIINFO_SUBTREE (N_("Ne_xt"), view_next_menu), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_SUBTREE (N_("_Toolbars"), view_toolbars_menu), + GNOMEUIINFO_END +}; + +static GnomeUIInfo insert_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _File..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: It_em..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Object..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo format_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Font..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Paragraph..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo tools_forms_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Ch_oose Form..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Desi_gn This Form"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: D_esign a Form..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Publish _Form..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Pu_blish Form As..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Script _Debugger"), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo tools_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Spelling..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_SUBTREE (N_("_Forms"), tools_forms_menu), + GNOMEUIINFO_END +}; + +static GnomeUIInfo actions_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _New Contact"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: New _Contact from Same Company"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: New _Letter to Contact"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: New _Message to Contact"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: New Meetin_g with Contact"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Plan a Meeting..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: New _Task for Contact"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: New _Journal Entry for Contact"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Flag for Follow Up..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Display Map of Address"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Open Web Page"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Forward as _vCard"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: For_ward"), NULL, NULL) +}; + +static GnomeUIInfo help_menu[] = { + GNOMEUIINFO_ITEM_NONE ("FIXME: fix Bonobo so it supports help items!", NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo main_menu[] = { + GNOMEUIINFO_MENU_FILE_TREE (file_menu), + GNOMEUIINFO_MENU_EDIT_TREE (edit_menu), + GNOMEUIINFO_MENU_VIEW_TREE (view_menu), + GNOMEUIINFO_SUBTREE (N_("_Insert"), insert_menu), + GNOMEUIINFO_SUBTREE (N_("F_ormat"), format_menu), + GNOMEUIINFO_SUBTREE (N_("_Tools"), tools_menu), + GNOMEUIINFO_SUBTREE (N_("Actio_ns"), actions_menu), + GNOMEUIINFO_MENU_HELP_TREE (help_menu), + GNOMEUIINFO_END +}; + +/* Creates the menu bar for the contact editor */ +static void +create_menu (EContactEditor *ce) +{ + BonoboUIHandlerMenuItem *list; + + bonobo_ui_handler_create_menubar (ce->uih); + + list = bonobo_ui_handler_menu_parse_uiinfo_list_with_data (main_menu, ce); + bonobo_ui_handler_menu_add_list (ce->uih, "/", list); +} + +/* Toolbar/Save and Close callback */ +static void +tb_save_and_close_cb (GtkWidget *widget, gpointer data) +{ + EContactEditor *ce; + + ce = E_CONTACT_EDITOR (data); + save_card (ce); + close_dialog (ce); +} + +/* Toolbar */ + +static GnomeUIInfo toolbar[] = { + GNOMEUIINFO_ITEM_STOCK (N_("FIXME: Save and Close"), + N_("Save the appointment and close the dialog box"), + tb_save_and_close_cb, + GNOME_STOCK_PIXMAP_SAVE), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Print..."), + N_("Print this item"), NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Insert File..."), + N_("Insert a file as an attachment"), NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Recurrence..."), + N_("Configure recurrence rules"), NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Invite Attendees..."), + N_("Invite attendees to a meeting"), NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Delete"), + N_("Delete this item"), NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Previous"), + N_("Go to the previous item"), NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Next"), + N_("Go to the next item"), NULL), + GNOMEUIINFO_ITEM_STOCK (N_("FIXME: Help"), + N_("See online help"), NULL, GNOME_STOCK_PIXMAP_HELP), + GNOMEUIINFO_END +}; + +/* Creates the toolbar for the contact editor */ +static void +create_toolbar (EContactEditor *ce) +{ + BonoboUIHandlerToolbarItem *list; + GnomeDockItem *dock_item; + GtkWidget *toolbar_child; + + bonobo_ui_handler_create_toolbar (ce->uih, "Toolbar"); + + /* Fetch the toolbar. What a pain in the ass. */ + + dock_item = gnome_app_get_dock_item_by_name (GNOME_APP (ce->app), GNOME_APP_TOOLBAR_NAME); + g_assert (dock_item != NULL); + + toolbar_child = gnome_dock_item_get_child (dock_item); + g_assert (toolbar_child != NULL && GTK_IS_TOOLBAR (toolbar_child)); + + /* Turn off labels as GtkToolbar sucks */ + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar_child), GTK_TOOLBAR_ICONS); + + list = bonobo_ui_handler_toolbar_parse_uiinfo_list_with_data (toolbar, ce); + bonobo_ui_handler_toolbar_add_list (ce->uih, "/Toolbar", list); +} + +/* Callback used when the dialog box is destroyed */ +static gint +app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) +{ + EContactEditor *ce; + + ce = E_CONTACT_EDITOR (data); + + close_dialog (ce); + return TRUE; +} + static void e_contact_editor_init (EContactEditor *e_contact_editor) { GladeXML *gui; GtkWidget *widget; - e_contact_editor->email_info = NULL; e_contact_editor->phone_info = NULL; e_contact_editor->address_info = NULL; @@ -498,15 +852,11 @@ e_contact_editor_init (EContactEditor *e_contact_editor) gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-editor.glade", NULL); e_contact_editor->gui = gui; - widget = glade_xml_get_widget(gui, "notebook-contact-editor"); - if (!widget) { - return; - } - gtk_widget_reparent(widget, - GTK_WIDGET(e_contact_editor)); + e_contact_editor->app = glade_xml_get_widget (gui, "contact editor"); - if (GTK_IS_CONTAINER(widget)) - e_container_foreach_leaf(GTK_CONTAINER(widget), (GtkCallback) add_field_callback, e_contact_editor); + e_container_foreach_leaf (GTK_CONTAINER (e_contact_editor->app), + (GtkCallback) add_field_callback, + e_contact_editor); _replace_buttons(e_contact_editor); set_entry_changed_signals(e_contact_editor); @@ -520,6 +870,24 @@ e_contact_editor_init (EContactEditor *e_contact_editor) if (widget && GTK_IS_BUTTON(widget)) gtk_signal_connect(GTK_OBJECT(widget), "clicked", categories_clicked, e_contact_editor); + + /* Build the menu and toolbar */ + + e_contact_editor->uih = bonobo_ui_handler_new (); + if (!e_contact_editor->uih) { + g_message ("e_contact_editor_init(): eeeeek, could not create the UI handler!"); + return; + } + + bonobo_ui_handler_set_app (e_contact_editor->uih, GNOME_APP (e_contact_editor->app)); + + create_menu (e_contact_editor); + create_toolbar (e_contact_editor); + + /* Connect to the deletion of the dialog */ + + gtk_signal_connect (GTK_OBJECT (e_contact_editor->app), "delete_event", + GTK_SIGNAL_FUNC (app_delete_event_cb), e_contact_editor); } void @@ -567,14 +935,20 @@ e_contact_editor_destroy (GtkObject *object) { gtk_object_unref(GTK_OBJECT(e_contact_editor->gui)); } -GtkWidget* -e_contact_editor_new (ECard *card) +EContactEditor * +e_contact_editor_new (ECard *card, gboolean is_new_card) { - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_editor_get_type ())); - gtk_object_set (GTK_OBJECT(widget), + EContactEditor *ce; + + ce = E_CONTACT_EDITOR (gtk_type_new (E_CONTACT_EDITOR_TYPE)); + + gtk_object_set (GTK_OBJECT (ce), "card", card, + "is_new_card", is_new_card, NULL); - return widget; + + gtk_widget_show (ce->app); + return ce; } static void @@ -594,6 +968,10 @@ e_contact_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) NULL); fill_in_info(editor); break; + + case ARG_IS_NEW_CARD: + editor->is_new_card = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE; + break; } } @@ -610,6 +988,11 @@ e_contact_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) extract_info(e_contact_editor); GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(e_contact_editor->card); break; + + case ARG_IS_NEW_CARD: + GTK_VALUE_BOOL (*arg) = e_contact_editor->is_new_card ? TRUE : FALSE; + break; + default: arg->type = GTK_TYPE_INVALID; break; diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h index 288cec1db0..8eae2bf1b5 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.h +++ b/addressbook/gui/contact-editor/e-contact-editor.h @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -52,13 +53,17 @@ typedef struct _EContactEditorClass EContactEditorClass; struct _EContactEditor { - GtkVBox parent; + GtkObject object; /* item specific fields */ ECard *card; ECardSimple *simple; + + /* UI handler */ + BonoboUIHandler *uih; GladeXML *gui; + GtkWidget *app; GnomeUIInfo *email_info; GnomeUIInfo *phone_info; GnomeUIInfo *address_info; @@ -77,15 +82,24 @@ struct _EContactEditor ECardSimpleAddressId address_choice; GList *arbitrary_fields; + + /* Whether we are editing a new card or an existing one */ + guint is_new_card : 1; }; struct _EContactEditorClass { - GtkVBoxClass parent_class; + GtkObjectClass parent_class; + + /* Notification signals */ + + void (* add_card) (EContactEditor *ce, ECard *card); + void (* commit_card) (EContactEditor *ce, ECard *card); + void (* editor_closed) (EContactEditor *ce); }; -GtkWidget *e_contact_editor_new(ECard *card); +EContactEditor *e_contact_editor_new (ECard *card, gboolean is_new_card); GtkType e_contact_editor_get_type (void); #ifdef __cplusplus diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c index 5b48c1a92f..80db2fe848 100644 --- a/addressbook/gui/contact-editor/test-editor.c +++ b/addressbook/gui/contact-editor/test-editor.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * test-editor.c * Copyright (C) 2000 Helix Code, Inc. * Author: Chris Lahey @@ -75,21 +75,23 @@ read_file (char *name) return g_strdup (buff); } -/* This is a horrible thing to do, but it is just a test. */ -GtkWidget *editor; - -static void destroy_callback(GtkWidget *app, gpointer data) +/* Callback used when a contact editor is closed */ +static void +editor_closed_cb (EContactEditor *ce, gpointer data) { static int count = 2; - count --; - if ( count <= 0 ) - exit(0); + + count--; + gtk_object_unref (GTK_OBJECT (ce)); + + if (count == 0) + exit (0); } #if 0 static void about_callback( GtkWidget *widget, gpointer data ) { - + const gchar *authors[] = { "Christopher James Lahey ", @@ -102,57 +104,39 @@ static void about_callback( GtkWidget *widget, gpointer data ) authors, _( "This should test the contact editor canvas item" ), NULL); - gtk_widget_show (about); + gtk_widget_show (about); } #endif int main( int argc, char *argv[] ) { char *cardstr; - GtkWidget *app; - + EContactEditor *ce; + /* bindtextdomain (PACKAGE, GNOMELOCALEDIR); textdomain (PACKAGE);*/ - + gnome_init( "Contact Editor Test", VERSION, argc, argv); - + glade_gnome_init (); - - app = gnome_app_new("Contact Editor Test", NULL); - + cardstr = NULL; if (argc == 2) cardstr = read_file (argv [1]); - + if (cardstr == NULL) cardstr = TEST_VCARD; - - editor = e_contact_editor_new(e_card_new(cardstr)); - - 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(e_card_new(cardstr)); - - 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 ); - - gtk_main(); - + + ce = e_contact_editor_new (e_card_new (cardstr), TRUE); + gtk_signal_connect (GTK_OBJECT (ce), "editor_closed", + GTK_SIGNAL_FUNC (editor_closed_cb), NULL); + + ce = e_contact_editor_new (e_card_new (cardstr), TRUE); + gtk_signal_connect (GTK_OBJECT (ce), "editor_closed", + GTK_SIGNAL_FUNC (editor_closed_cb), NULL); + + gtk_main(); + /* Not reached. */ return 0; } -- cgit v1.2.3