diff options
author | Dan Winship <danw@src.gnome.org> | 2003-04-11 22:15:40 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2003-04-11 22:15:40 +0800 |
commit | 730d7da9eb2cc54d9302754887f06f9c996efed7 (patch) | |
tree | 7fd4fd433571533a65e93b01b9a217b32fa5d0d8 /calendar/gui | |
parent | fff54e119823ba14123eb8273ec9a724eb81500a (diff) | |
download | gsoc2013-evolution-730d7da9eb2cc54d9302754887f06f9c996efed7.tar gsoc2013-evolution-730d7da9eb2cc54d9302754887f06f9c996efed7.tar.gz gsoc2013-evolution-730d7da9eb2cc54d9302754887f06f9c996efed7.tar.bz2 gsoc2013-evolution-730d7da9eb2cc54d9302754887f06f9c996efed7.tar.lz gsoc2013-evolution-730d7da9eb2cc54d9302754887f06f9c996efed7.tar.xz gsoc2013-evolution-730d7da9eb2cc54d9302754887f06f9c996efed7.tar.zst gsoc2013-evolution-730d7da9eb2cc54d9302754887f06f9c996efed7.zip |
Remove the "Contacts" button and entry from here too. Supposed to have
* gui/dialogs/task-page.glade: Remove the "Contacts" button and
entry from here too. Supposed to have been part of #35926
* gui/dialogs/task-page.c: Remove all code pertaining to the
contacts button
* gui/dialogs/comp-editor-util.c:
* gui/dialogs/comp-editor-util.h: Likewise
* gui/dialogs/Makefile.am (IDL_GENERATED, etc): Remove
select-names stuff, which is no longe rused.
svn path=/trunk/; revision=20816
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/.cvsignore | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/Makefile.am | 14 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-util.c | 254 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-util.h | 15 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 95 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.glade | 42 |
6 files changed, 0 insertions, 424 deletions
diff --git a/calendar/gui/dialogs/.cvsignore b/calendar/gui/dialogs/.cvsignore index 64968755b7..ba36b62d3e 100644 --- a/calendar/gui/dialogs/.cvsignore +++ b/calendar/gui/dialogs/.cvsignore @@ -2,7 +2,3 @@ .pure Makefile Makefile.in -Evolution-Addressbook-SelectNames.h -Evolution-Addressbook-SelectNames-stubs.c -Evolution-Addressbook-SelectNames-skels.c -Evolution-Addressbook-SelectNames-common.c diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am index 53ea88a9dc..f61640ab67 100644 --- a/calendar/gui/dialogs/Makefile.am +++ b/calendar/gui/dialogs/Makefile.am @@ -1,16 +1,3 @@ -IDLS = $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl - -IDL_GENERATED_H = \ - Evolution-Addressbook-SelectNames.h -IDL_GENERATED = $(IDL_GENERATED_H) - -$(IDL_GENERATED_H): $(IDLS) - $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \ - --nostubs --noskels --nocommon \ - $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl - -BUILT_SOURCES = $(IDL_GENERATED) - INCLUDES = \ -DG_LOG_DOMAIN=\"calendar-gui\" \ -I$(top_srcdir) \ @@ -33,7 +20,6 @@ INCLUDES = \ noinst_LTLIBRARIES = libcal-dialogs.la libcal_dialogs_la_SOURCES = \ - $(IDL_GENERATED) \ alarm-options.c \ alarm-options.h \ alarm-page.c \ diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index 2df5f94fa7..09b78201c5 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -268,260 +268,6 @@ comp_editor_get_current_time (GtkObject *object, gpointer data) -/* - * These are utility functions to handle the SelectNames control we use - * for the contacts field, and its related dialog. - */ - -#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames" - -GNOME_Evolution_Addressbook_SelectNames -comp_editor_create_contacts_component (void) -{ - GNOME_Evolution_Addressbook_SelectNames corba_select_names; - CORBA_Environment ev; - - CORBA_exception_init (&ev); - corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, - NULL, &ev); - - /* OAF seems to be broken -- it can return a CORBA_OBJECT_NIL without - raising an exception in `ev'. Is this true with BonoboActivation? */ - if (ev._major != CORBA_NO_EXCEPTION - || corba_select_names == CORBA_OBJECT_NIL) { - g_warning ("Cannot activate -- %s", SELECT_NAMES_OAFID); - CORBA_exception_free (&ev); - return CORBA_OBJECT_NIL; - } - - CORBA_exception_free (&ev); - - return corba_select_names; -} - - -GtkWidget * -comp_editor_create_contacts_control (GNOME_Evolution_Addressbook_SelectNames corba_select_names) -{ - Bonobo_Control corba_control; - GtkWidget *control_widget; - CORBA_Environment ev; - char *name = _("Contacts"); - - CORBA_exception_init (&ev); - - GNOME_Evolution_Addressbook_SelectNames_addSection ( - corba_select_names, name, name, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - return NULL; - } - - corba_control = - GNOME_Evolution_Addressbook_SelectNames_getEntryBySection ( - corba_select_names, name, &ev); - - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - control_widget = bonobo_widget_new_control_from_objref ( - corba_control, CORBA_OBJECT_NIL); - - gtk_widget_show (control_widget); - - return control_widget; -} - - -void -comp_editor_connect_contacts_changed (GtkWidget *contacts_entry, - BonoboListenerCallbackFn changed_cb, - gpointer changed_cb_data) -{ - BonoboControlFrame *cf; - Bonobo_PropertyBag pb = CORBA_OBJECT_NIL; - - cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (contacts_entry)); - pb = bonobo_control_frame_get_control_property_bag (cf, NULL); - - bonobo_event_source_client_add_listener ( - pb, changed_cb, - "Bonobo/Property:change:entry_changed", - NULL, changed_cb_data); -} - - -void -comp_editor_show_contacts_dialog (GNOME_Evolution_Addressbook_SelectNames corba_select_names) -{ - CORBA_Environment ev; - - CORBA_exception_init (&ev); - GNOME_Evolution_Addressbook_SelectNames_activateDialog ( - corba_select_names, _("Contacts"), &ev); - CORBA_exception_free (&ev); -} - - -/* A simple 'name <email>' parser. Input should be UTF8. - FIXME: Should probably use camel functions or something. */ -static void -parse_contact_string (const char *value, char **name, char **email) -{ - char *lbracket, *rbracket, *name_end, *tmp_name, *tmp_email; - - if (!value) { - *name = g_strdup (""); - *email = g_strdup (""); - return; - } - - lbracket = g_utf8_strchr (value, g_utf8_strlen (value, 0), '<'); - rbracket = g_utf8_strchr (value, g_utf8_strlen (value, 0), '>'); - - if (!lbracket || !rbracket || rbracket < lbracket) { - *name = g_strdup (value); - *email = g_strdup (""); - return; - } - - name_end = g_utf8_prev_char (lbracket); - while (name_end > value && g_unichar_isspace (g_utf8_get_char (name_end))) - name_end = g_utf8_prev_char (name_end); - - tmp_name = g_malloc (name_end - value + 2); - strncpy (tmp_name, value, name_end - value + 1); - tmp_name[name_end - value + 1] = '\0'; - *name = tmp_name; - - tmp_email = g_malloc (rbracket - lbracket); - strncpy (tmp_email, lbracket + 1, rbracket - lbracket - 1); - tmp_email[rbracket - lbracket - 1] = '\0'; - *email = tmp_email; - -#if 0 - g_print ("Parsed: %s\n Name:'%s'\nEmail:'%s'\n", - value, *name, *email); -#endif -} - - -void -comp_editor_contacts_to_widget (GtkWidget *contacts_entry, - CalComponent *comp) -{ - GPtrArray *dest_array; - EDestination *dest; - GSList *contact_list, *elem; - char *contacts_string; - int i; - - cal_component_get_contact_list (comp, &contact_list); - if (!contact_list) - return; - - dest_array = g_ptr_array_new (); - for (elem = contact_list; elem; elem = elem->next) { - CalComponentText *t = elem->data; - char *name, *email; - - parse_contact_string (t->value, &name, &email); - - dest = e_destination_new (); - e_destination_set_name (dest, name); - e_destination_set_email (dest, email); - g_ptr_array_add (dest_array, dest); - g_free (name); - g_free (email); - } - cal_component_free_text_list (contact_list); - - /* we need destv to be NULL terminated */ - g_ptr_array_add (dest_array, NULL); - - contacts_string = e_destination_exportv ((EDestination**) dest_array->pdata); -#if 0 - g_print ("Destinations: %s\n", contacts_string ? contacts_string : ""); -#endif - - bonobo_widget_set_property (BONOBO_WIDGET (contacts_entry), - "destinations", TC_CORBA_string, contacts_string, NULL); - - g_free (contacts_string); - - /* We free all dest_array except the last NULL we added. */ - for (i = 0; i < dest_array->len - 1; i++) { - dest = g_ptr_array_index (dest_array, i); - g_object_unref((dest)); - } - g_ptr_array_free (dest_array, TRUE); -} - - -void -comp_editor_contacts_to_component (GtkWidget *contacts_entry, - CalComponent *comp) -{ - EDestination **contact_destv; - GSList *contact_list = NULL, *elem; - char *contacts_string = NULL; - CalComponentText *t; - const char *name, *email; - int i; - - bonobo_widget_get_property (BONOBO_WIDGET (contacts_entry), - "destinations", TC_CORBA_string, &contacts_string, NULL); -#if 0 - g_print ("Contacts string: %s\n", contacts_string ? contacts_string : ""); -#endif - - contact_destv = e_destination_importv (contacts_string); - g_free (contacts_string); - - if (contact_destv) { - for (i = 0; contact_destv[i] != NULL; i++) { - name = e_destination_get_name (contact_destv[i]); - email = e_destination_get_email (contact_destv[i]); - - t = g_new0 (CalComponentText, 1); - t->altrep = NULL; - - /* If both name and email are given, use the standard - '"name" <email>' form, otherwise use just the name - or the email address. - FIXME: I'm not sure this is correct syntax etc. */ - if (name && name[0] && email && email[0]) - t->value = g_strdup_printf ("\"%s\" <%s>", - name, email); - else if (name && name[0]) - t->value = g_strdup_printf ("\"%s\"", - name); - else - t->value = g_strdup_printf ("<%s>", - email); - - contact_list = g_slist_prepend (contact_list, t); - - g_object_unref((contact_destv[i])); - } - } - g_free (contact_destv); - - contact_list = g_slist_reverse (contact_list); - cal_component_set_contact_list (comp, contact_list); - - for (elem = contact_list; elem; elem = elem->next) { - t = elem->data; - g_free ((char*)t->value); - g_free (t); - } - g_slist_free (contact_list); -} - /** * comp_editor_strip_categories: * @categories: A string of category names entered by the user. diff --git a/calendar/gui/dialogs/comp-editor-util.h b/calendar/gui/dialogs/comp-editor-util.h index d024de8be0..04bbe23cf4 100644 --- a/calendar/gui/dialogs/comp-editor-util.h +++ b/calendar/gui/dialogs/comp-editor-util.h @@ -22,9 +22,6 @@ #define _COMP_EDITOR_UTIL_H_ #include <gtk/gtkwidget.h> -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-event-source.h> -#include "Evolution-Addressbook-SelectNames.h" #include "comp-editor-page.h" void comp_editor_dates (CompEditorPageDates *date, CalComponent *comp); @@ -38,18 +35,6 @@ GtkWidget *comp_editor_new_date_edit (gboolean show_date, gboolean show_time, struct tm comp_editor_get_current_time (GtkObject *object, gpointer data); -GNOME_Evolution_Addressbook_SelectNames comp_editor_create_contacts_component (void); -GtkWidget * comp_editor_create_contacts_control (GNOME_Evolution_Addressbook_SelectNames corba_select_names); -void comp_editor_connect_contacts_changed (GtkWidget *contacts_entry, - BonoboListenerCallbackFn changed_cb, - gpointer changed_cb_data); -void comp_editor_show_contacts_dialog (GNOME_Evolution_Addressbook_SelectNames corba_select_names); - -void comp_editor_contacts_to_widget (GtkWidget *contacts_entry, - CalComponent *comp); -void comp_editor_contacts_to_component (GtkWidget *contacts_entry, - CalComponent *comp); - char *comp_editor_strip_categories (const char *categories); #endif diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 7f25514364..c83473ef07 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -66,18 +66,10 @@ struct _TaskPagePrivate { GtkWidget *classification_private; GtkWidget *classification_confidential; - GtkWidget *contacts_btn; - GtkWidget *contacts_box; - GtkWidget *categories_btn; GtkWidget *categories; gboolean updating; - - /* The Corba component for selecting contacts, and the entry field - which we place in the dialog. */ - GNOME_Evolution_Addressbook_SelectNames corba_select_names; - GtkWidget *contacts_entry; }; static const int classification_map[] = { @@ -159,15 +151,10 @@ task_page_init (TaskPage *tpage) priv->classification_public = NULL; priv->classification_private = NULL; priv->classification_confidential = NULL; - priv->contacts_btn = NULL; - priv->contacts_box = NULL; priv->categories_btn = NULL; priv->categories = NULL; priv->updating = FALSE; - - priv->corba_select_names = CORBA_OBJECT_NIL; - priv->contacts_entry = NULL; } /* Destroy handler for the task page */ @@ -183,14 +170,6 @@ task_page_finalize (GObject *object) tpage = TASK_PAGE (object); priv = tpage->priv; - if (priv->corba_select_names != CORBA_OBJECT_NIL) { - CORBA_Environment ev; - - CORBA_exception_init (&ev); - bonobo_object_release_unref (priv->corba_select_names, &ev); - CORBA_exception_free (&ev); - } - if (priv->main) gtk_widget_unref (priv->main); @@ -265,23 +244,6 @@ classification_get (GtkWidget *widget) return e_dialog_radio_get (widget, classification_map); } -static void -contacts_changed_cb (BonoboListener *listener, - const char *event_name, - const CORBA_any *arg, - CORBA_Environment *ev, - gpointer data) -{ - TaskPage *tpage; - TaskPagePrivate *priv; - - tpage = TASK_PAGE (data); - priv = tpage->priv; - - if (!priv->updating) - comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tpage)); -} - /* fill_widgets handler for the task page */ static void task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) @@ -444,18 +406,6 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) e_dialog_editable_set (priv->categories, categories); - /* Contacts */ - comp_editor_contacts_to_widget (priv->contacts_entry, comp); - - /* We connect the contacts changed signal here, as we have to be a bit - more careful with it due to the use or Corba. The priv->updating - flag won't work as we won't get the changed event immediately. - FIXME: Unfortunately this doesn't work either. We never get the - changed event now. */ - comp_editor_connect_contacts_changed (priv->contacts_entry, - contacts_changed_cb, tpage); - - priv->updating = FALSE; } @@ -593,9 +543,6 @@ task_page_fill_component (CompEditorPage *page, CalComponent *comp) if (str) g_free (str); - /* Contacts */ - comp_editor_contacts_to_component (priv->contacts_entry, comp); - return TRUE; } @@ -671,9 +618,6 @@ get_widgets (TaskPage *tpage) priv->classification_private = GW ("classification-private"); priv->classification_confidential = GW ("classification-confidential"); - priv->contacts_btn = GW ("contacts-button"); - priv->contacts_box = GW ("contacts-box"); - priv->categories_btn = GW ("categories-button"); priv->categories = GW ("categories"); @@ -688,8 +632,6 @@ get_widgets (TaskPage *tpage) && priv->classification_private && priv->classification_confidential && priv->description - && priv->contacts_btn - && priv->contacts_box && priv->categories_btn && priv->categories); } @@ -786,27 +728,6 @@ date_changed_cb (EDateEdit *dedit, gpointer data) &dates); } -/* Callback used when the contacts button is clicked; we must bring up the - * contact list dialog. - */ -static void -contacts_clicked_cb (GtkWidget *button, gpointer data) -{ - TaskPage *tpage; - TaskPagePrivate *priv; - - tpage = TASK_PAGE (data); - priv = tpage->priv; - - comp_editor_show_contacts_dialog (priv->corba_select_names); - - /* FIXME: Currently we aren't getting the changed event from the - SelectNames component correctly, so we aren't saving the event - if just the contacts are changed. To work around that, we assume - that if the contacts button is clicked it is changed. */ - comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tpage)); -} - /* Callback used when the categories button is clicked; we must bring up the * category list dialog. */ @@ -901,27 +822,11 @@ init_widgets (TaskPage *tpage) g_signal_connect((priv->categories), "changed", G_CALLBACK (field_changed_cb), tpage); - /* Contacts button */ - g_signal_connect((priv->contacts_btn), "clicked", - G_CALLBACK (contacts_clicked_cb), tpage); - /* Categories button */ g_signal_connect((priv->categories_btn), "clicked", G_CALLBACK (categories_clicked_cb), tpage); - /* Create the contacts entry, a corba control from the address book. */ - priv->corba_select_names = comp_editor_create_contacts_component (); - if (priv->corba_select_names == CORBA_OBJECT_NIL) - return FALSE; - - priv->contacts_entry = comp_editor_create_contacts_control (priv->corba_select_names); - if (priv->contacts_entry == NULL) - return FALSE; - - gtk_container_add (GTK_CONTAINER (priv->contacts_box), - priv->contacts_entry); - /* Set the default timezone, so the timezone entry may be hidden. */ location = calendar_config_get_timezone (); zone = icaltimezone_get_builtin_timezone (location); diff --git a/calendar/gui/dialogs/task-page.glade b/calendar/gui/dialogs/task-page.glade index 1587f35f3d..2bf8736666 100644 --- a/calendar/gui/dialogs/task-page.glade +++ b/calendar/gui/dialogs/task-page.glade @@ -401,48 +401,6 @@ <property name="visible">yes</property> <child> - <widget class="GtkButton" id="contacts-button"> - <property name="can_focus">yes</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="visible">yes</property> - - <child> - <widget class="GtkLabel" id="label16"> - <property name="label" translatable="yes">_Contacts...</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">no</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">4</property> - <property name="ypad">0</property> - <property name="visible">yes</property> - <property name="use_underline">yes</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">no</property> - <property name="fill">no</property> - </packing> - </child> - - <child> - <widget class="GtkEventBox" id="contacts-box"> - <property name="visible">yes</property> - - <child> - <placeholder /> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">yes</property> - <property name="fill">yes</property> - </packing> - </child> - - <child> <widget class="GtkButton" id="categories-button"> <property name="can_focus">yes</property> <property name="relief">GTK_RELIEF_NORMAL</property> |