diff options
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 15 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-card-simple.h | 3 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-component.c | 4 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-model.c | 10 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view.c | 16 |
5 files changed, 34 insertions, 14 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 7ea6bcd9d1..2c89098e49 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,18 @@ +2001-04-11 Christopher James Lahey <clahey@ximian.com> + + * backend/ebook/e-card-simple.h: Added + E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING. + + * gui/component/addressbook-component.c (accepted_dnd_types): + Fixed a warning here. + + * gui/widgets/e-addressbook-model.c: Modified this to have more + columns, but not let them be edited if they're not a simple + string. + + * gui/widgets/e-minicard-view.c (e_minicard_view_init): Fixed a + warning and a memory leak here. + 2001-04-10 Gediminas Paulauskas <menesis@delfi.lt> * backend/ebook/evolution-gnomecard-importer.c: added missing #include. diff --git a/addressbook/backend/ebook/e-card-simple.h b/addressbook/backend/ebook/e-card-simple.h index 66d8e87db4..608e7488df 100644 --- a/addressbook/backend/ebook/e-card-simple.h +++ b/addressbook/backend/ebook/e-card-simple.h @@ -13,8 +13,8 @@ #define __E_CARD_SIMPLE_H__ #include <time.h> +#include <gtk/gtk.h> #include <stdio.h> -#include <gtk/gtkobject.h> #include <addressbook/backend/ebook/e-card.h> #include <addressbook/backend/ebook/e-card-types.h> #include <e-util/e-list.h> @@ -116,6 +116,7 @@ enum _ECardSimpleField { E_CARD_SIMPLE_FIELD_SPOUSE, E_CARD_SIMPLE_FIELD_NOTE, E_CARD_SIMPLE_FIELD_FBURL, + E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING = E_CARD_SIMPLE_FIELD_FBURL, E_CARD_SIMPLE_FIELD_ANNIVERSARY, E_CARD_SIMPLE_FIELD_BIRTH_DATE, E_CARD_SIMPLE_FIELD_MAILER, diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index 69815d9e83..250d13dc36 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -48,14 +48,14 @@ addressbook_component_get_shell_client (void) static BonoboGenericFactory *factory = NULL; -static const char *accepted_dnd_types[] = { +static char *accepted_dnd_types[] = { "text/x-vcard", NULL }; static const EvolutionShellComponentFolderType folder_types[] = { { "contacts", "evolution-contacts.png", accepted_dnd_types }, - { NULL, NULL } + { NULL, NULL, NULL, NULL } }; diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index abd97c8464..c20161259f 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -8,11 +8,11 @@ */ #include <config.h> -#include <gtk/gtksignal.h> +#include "e-addressbook-model.h" #include <gnome-xml/tree.h> #include <gnome-xml/parser.h> #include <gnome-xml/xmlmemory.h> -#include "e-addressbook-model.h" +#include <gnome.h> #define PARENT_TYPE e_table_model_get_type() ETableModelClass *parent_class; @@ -37,7 +37,7 @@ enum { LAST_SIGNAL }; -#define COLS (E_CARD_SIMPLE_FIELD_LAST - 5) +#define COLS (E_CARD_SIMPLE_FIELD_LAST) static guint e_addressbook_model_signals [LAST_SIGNAL] = {0, }; @@ -142,7 +142,7 @@ addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val) static gboolean addressbook_is_cell_editable (ETableModel *etc, int col, int row) { - return E_ADDRESSBOOK_MODEL(etc)->editable; + return E_ADDRESSBOOK_MODEL(etc)->editable && col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING; } static void @@ -156,7 +156,7 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) card = e_card_new(""); simple = e_card_simple_new(card); - for (col = 0; col < COLS; col++) { + for (col = 0; col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING; col++) { const void *val = e_table_model_value_at(source, col, row); e_card_simple_set(simple, col, diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index caa7c729d4..972bbd1c9c 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -25,6 +25,7 @@ #include <gtk/gtkselection.h> #include <gtk/gtkdnd.h> #include <gal/widgets/e-canvas.h> +#include <gal/widgets/e-unicode.h> #include <libgnome/gnome-i18n.h> #include "e-minicard-view.h" @@ -144,6 +145,7 @@ selection_changed (ESelectionModel *selection, EMinicardView *view) static void e_minicard_view_init (EMinicardView *view) { + char *empty_message; view->book = NULL; view->query = g_strdup("(contains \"x-evolution-any-field\" \"\")"); view->editable = FALSE; @@ -160,12 +162,14 @@ e_minicard_view_init (EMinicardView *view) gtk_signal_connect(GTK_OBJECT(view->selection), "selection_changed", GTK_SIGNAL_FUNC(selection_changed), view); - - gtk_object_set(GTK_OBJECT(view), - "empty_message", - e_utf8_from_locale_string(_("\n\nThere are no items to show in this view\n\n" - "Double-click here to create a new Contact.")), - NULL); + + empty_message = e_utf8_from_locale_string(_("\n\nThere are no items to show in this view\n\n" + "Double-click here to create a new Contact.")); + gtk_object_set (GTK_OBJECT(view), + "empty_message", + empty_message, + NULL); + g_free (empty_message); E_REFLOW_SORTED(view)->compare_func = (GCompareFunc) e_minicard_compare; E_REFLOW_SORTED(view)->string_func = (EReflowStringFunc) e_minicard_get_card_id; |