[evolution-patches] remove contacts button from task editor (35926)
- From: Dan Winship <danw ximian com>
- To: evolution-patches ximian com
- Subject: [evolution-patches] remove contacts button from task editor (35926)
- Date: 10 Apr 2003 13:27:40 -0400
Anna confirms that this was intended to part of 35926 (removing the
contacts button from the meeting editor).
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1723
diff -u -r1.1723 ChangeLog
--- ChangeLog 10 Apr 2003 14:38:22 -0000 1.1723
+++ ChangeLog 10 Apr 2003 17:23:37 -0000
@@ -1,3 +1,17 @@
+2003-04-10 Dan Winship <danw ximian com>
+
+ * 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.
+
2003-04-10 Rodrigo Moya <rodrigo ximian com>
* cal-util/cal-util.h: added #define's for static capabilities.
Index: gui/dialogs/.cvsignore
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/.cvsignore,v
retrieving revision 1.5
diff -u -r1.5 .cvsignore
--- gui/dialogs/.cvsignore 4 Mar 2003 19:53:59 -0000 1.5
+++ gui/dialogs/.cvsignore 10 Apr 2003 17:23:37 -0000
@@ -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
Index: gui/dialogs/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/Makefile.am,v
retrieving revision 1.44
diff -u -r1.44 Makefile.am
--- gui/dialogs/Makefile.am 4 Mar 2003 19:52:34 -0000 1.44
+++ gui/dialogs/Makefile.am 10 Apr 2003 17:23:37 -0000
@@ -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 @@
noinst_LTLIBRARIES = libcal-dialogs.la
libcal_dialogs_la_SOURCES = \
- $(IDL_GENERATED) \
alarm-options.c \
alarm-options.h \
alarm-page.c \
Index: gui/dialogs/comp-editor-util.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor-util.c,v
retrieving revision 1.27
diff -u -r1.27 comp-editor-util.c
--- gui/dialogs/comp-editor-util.c 18 Mar 2003 01:46:25 -0000 1.27
+++ gui/dialogs/comp-editor-util.c 10 Apr 2003 17:23:37 -0000
@@ -268,260 +268,6 @@
-/*
- * 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.
Index: gui/dialogs/comp-editor-util.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor-util.h,v
retrieving revision 1.13
diff -u -r1.13 comp-editor-util.h
--- gui/dialogs/comp-editor-util.h 6 Nov 2002 21:51:44 -0000 1.13
+++ gui/dialogs/comp-editor-util.h 10 Apr 2003 17:23:37 -0000
@@ -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);
@@ -37,18 +34,6 @@
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);
Index: gui/dialogs/task-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-page.c,v
retrieving revision 1.41
diff -u -r1.41 task-page.c
--- gui/dialogs/task-page.c 3 Mar 2003 22:28:59 -0000 1.41
+++ gui/dialogs/task-page.c 10 Apr 2003 17:23:37 -0000
@@ -66,18 +66,10 @@
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 @@
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 @@
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->xml) {
g_object_unref((priv->xml));
priv->xml = NULL;
@@ -262,23 +241,6 @@
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)
@@ -441,18 +403,6 @@
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;
}
@@ -590,9 +540,6 @@
if (str)
g_free (str);
- /* Contacts */
- comp_editor_contacts_to_component (priv->contacts_entry, comp);
-
return TRUE;
}
@@ -668,9 +615,6 @@
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");
@@ -685,8 +629,6 @@
&& priv->classification_private
&& priv->classification_confidential
&& priv->description
- && priv->contacts_btn
- && priv->contacts_box
&& priv->categories_btn
&& priv->categories);
}
@@ -783,27 +725,6 @@
&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.
*/
@@ -898,26 +819,10 @@
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 ();
Index: gui/dialogs/task-page.glade
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-page.glade,v
retrieving revision 1.19
diff -u -r1.19 task-page.glade
--- gui/dialogs/task-page.glade 6 Nov 2002 21:51:45 -0000 1.19
+++ gui/dialogs/task-page.glade 10 Apr 2003 17:23:37 -0000
@@ -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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]