From 5ff5cd81532edda57a0793273fee0cdadef07dd9 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 4 Jan 2001 21:56:16 +0000 Subject: Remove non-existent file 2001-01-04 JP Rosevear * POTFILES.in: Remove non-existent file 2001-01-04 JP Rosevear * conduit/Makefile.am: Fix hard coded library names that were accidentally committed (i'm looking at you miggie) * contact-editor/e-contact-editor.c (categories_clicked): Reflect renaming. * contact-editor/e-contact-editor-categories.[hc]: These are living in gal now svn path=/trunk/; revision=7261 --- addressbook/ChangeLog | 11 + addressbook/conduit/Makefile.am | 13 +- addressbook/contact-editor/Makefile.am | 4 - addressbook/contact-editor/categories-strings.h | 9 - addressbook/contact-editor/categories.glade | 190 --------- .../contact-editor/e-contact-editor-categories.c | 452 --------------------- .../contact-editor/e-contact-editor-categories.h | 81 ---- addressbook/contact-editor/e-contact-editor.c | 3 +- addressbook/gui/contact-editor/Makefile.am | 4 - .../gui/contact-editor/categories-strings.h | 9 - addressbook/gui/contact-editor/categories.glade | 190 --------- .../contact-editor/e-contact-editor-categories.c | 452 --------------------- .../contact-editor/e-contact-editor-categories.h | 81 ---- addressbook/gui/contact-editor/e-contact-editor.c | 3 +- 14 files changed, 24 insertions(+), 1478 deletions(-) delete mode 100644 addressbook/contact-editor/categories-strings.h delete mode 100644 addressbook/contact-editor/categories.glade delete mode 100644 addressbook/contact-editor/e-contact-editor-categories.c delete mode 100644 addressbook/contact-editor/e-contact-editor-categories.h delete mode 100644 addressbook/gui/contact-editor/categories-strings.h delete mode 100644 addressbook/gui/contact-editor/categories.glade delete mode 100644 addressbook/gui/contact-editor/e-contact-editor-categories.c delete mode 100644 addressbook/gui/contact-editor/e-contact-editor-categories.h (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index ccfd805b97..1138adf072 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,14 @@ +2001-01-04 JP Rosevear + + * conduit/Makefile.am: Fix hard coded library names that were + accidentally committed (i'm looking at you miggie) + + * contact-editor/e-contact-editor.c (categories_clicked): Reflect + renaming. + + * contact-editor/e-contact-editor-categories.[hc]: These are + living in gal now + 2001-01-04 JP Rosevear * backend/pas/pas-backend-file.c (pas_backend_file_book_view_free): diff --git a/addressbook/conduit/Makefile.am b/addressbook/conduit/Makefile.am index ab8a972b5b..f17f060aef 100644 --- a/addressbook/conduit/Makefile.am +++ b/addressbook/conduit/Makefile.am @@ -12,8 +12,17 @@ bin_PROGRAMS = e-address-conduit-control-applet e_address_conduit_control_applet_SOURCES = address-conduit-control-applet.c -e_address_conduit_control_applet_LDFLAGS = \ - -rdynamic -L/usr/lib -L/usr/X11R6/lib -lcapplet -lgnorba -lgpilotd -lgpilotdcm -lgpilotdconduit -lgnomevfs -lgthread -lpthread -lbonobo -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgnome -lgnomesupport -lesd -laudiofile -ldb1 -lgdk_pixbuf -ltiff -ljpeg -lpng -lgtk -lgdk -lgmodule -ldl -lXi -lXext -lX11 -loaf -lORBitCosNaming -lORBit -lIIOP -lORBitutil -lglib -lnsl -lm -lxml -lz -lpisock +e_address_conduit_control_applet_LDADD = \ + $(CAPPLET_LIBS) \ + $(GNOME_LIBDIR) \ + $(GNOME_PILOT_LIBS) \ + $(PISOCK_LIBDIR) $(PISOCK_LIBS) \ + $(GNOME_CAPPLET_LIBS) \ + $(BONOBO_VFS_GNOME_LIBS) \ + $(GNOME_XML_LIB) \ + $(GNOMEUI_LIBS) \ + $(INTLLIBS) + # Address Conduit e_address_conduitsdir=$(libdir)/gnome-pilot/conduits diff --git a/addressbook/contact-editor/Makefile.am b/addressbook/contact-editor/Makefile.am index 1016d38301..fb200df78f 100644 --- a/addressbook/contact-editor/Makefile.am +++ b/addressbook/contact-editor/Makefile.am @@ -17,8 +17,6 @@ noinst_LIBRARIES = \ libecontacteditor_a_SOURCES = \ e-contact-editor-address.c \ e-contact-editor-address.h \ - e-contact-editor-categories.c \ - e-contact-editor-categories.h \ e-contact-editor-fullname.c \ e-contact-editor-fullname.h \ e-contact-editor.c \ @@ -56,7 +54,6 @@ glade_DATA = \ contact-editor.glade \ fulladdr.glade \ fullname.glade \ - categories.glade \ e-contact-editor-confirm-delete.glade EXTRA_DIST = $(evolution_DATA) \ @@ -64,5 +61,4 @@ EXTRA_DIST = $(evolution_DATA) \ e-contact-editor-strings.h \ fulladdr.glade.h \ fullname-strings.h \ - categories-strings.h \ e-contact-editor-confirm-delete.glade.h diff --git a/addressbook/contact-editor/categories-strings.h b/addressbook/contact-editor/categories-strings.h deleted file mode 100644 index 813018a00e..0000000000 --- a/addressbook/contact-editor/categories-strings.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Translatable strings file generated by Glade. - * Add this file to your project's POTFILES.in. - * DO NOT compile it as part of your application. - */ - -gchar *s = N_("categories"); -gchar *s = N_("Item(s) belong to these categories:"); -gchar *s = N_("Available Categories:"); diff --git a/addressbook/contact-editor/categories.glade b/addressbook/contact-editor/categories.glade deleted file mode 100644 index bf78008940..0000000000 --- a/addressbook/contact-editor/categories.glade +++ /dev/null @@ -1,190 +0,0 @@ - - - - - categories - categories - - src - pixmaps - C - True - False - False - False - False - False - False - interface.c - interface.h - callbacks.c - callbacks.h - support.c - support.h - True - categories-strings.h - - - - GnomeDialog - categories - True - False - categories - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - False - False - - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - True - False - 8 - - 4 - True - True - - - - GtkTable - table-categories - True - 4 - 1 - False - 0 - 0 - - 0 - True - True - - - - GtkAccelLabel - accellabel1 - True - - GTK_JUSTIFY_LEFT - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - True - - - - - GtkAccelLabel - accellabel2 - True - - GTK_JUSTIFY_LEFT - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - True - - - - - GtkEntry - entry-categories - True - True - True - True - 0 - - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - True - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button1 - True - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - button3 - True - True - True - GNOME_STOCK_BUTTON_CANCEL - - - - - - diff --git a/addressbook/contact-editor/e-contact-editor-categories.c b/addressbook/contact-editor/e-contact-editor-categories.c deleted file mode 100644 index 045f128b48..0000000000 --- a/addressbook/contact-editor/e-contact-editor-categories.c +++ /dev/null @@ -1,452 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-contact-editor-categories.c - * Copyright (C) 2000 Helix Code, Inc. - * Author: Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include -#include -#include - -static void e_contact_editor_categories_init (EContactEditorCategories *card); -static void e_contact_editor_categories_class_init (EContactEditorCategoriesClass *klass); -static void e_contact_editor_categories_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_contact_editor_categories_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_contact_editor_categories_destroy (GtkObject *object); -static int e_contact_editor_categories_col_count (ETableModel *etc, gpointer data); -static int e_contact_editor_categories_row_count (ETableModel *etc, gpointer data); -static void *e_contact_editor_categories_value_at (ETableModel *etc, int col, int row, gpointer data); -static void e_contact_editor_categories_set_value_at (ETableModel *etc, int col, int row, const void *val, gpointer data); -static gboolean e_contact_editor_categories_is_cell_editable (ETableModel *etc, int col, int row, gpointer data); -static void *e_contact_editor_categories_duplicate_value (ETableModel *etc, int col, const void *value, gpointer data); -static void e_contact_editor_categories_free_value (ETableModel *etc, int col, void *value, gpointer data); -static void *e_contact_editor_categories_initialize_value (ETableModel *etc, int col, gpointer data); -static gboolean e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const void *value, gpointer data); -static char * e_contact_editor_categories_value_to_string (ETableModel *etc, int col, const void *value, gpointer data); - -static GnomeDialogClass *parent_class = NULL; - -/* The arguments we take */ -enum { - ARG_0, - ARG_CATEGORIES -}; - -GtkType -e_contact_editor_categories_get_type (void) -{ - static GtkType contact_editor_categories_type = 0; - - if (!contact_editor_categories_type) - { - static const GtkTypeInfo contact_editor_categories_info = - { - "EContactEditorCategories", - sizeof (EContactEditorCategories), - sizeof (EContactEditorCategoriesClass), - (GtkClassInitFunc) e_contact_editor_categories_class_init, - (GtkObjectInitFunc) e_contact_editor_categories_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - contact_editor_categories_type = gtk_type_unique (gnome_dialog_get_type (), &contact_editor_categories_info); - } - - return contact_editor_categories_type; -} - -static void -e_contact_editor_categories_class_init (EContactEditorCategoriesClass *klass) -{ - GtkObjectClass *object_class; - GnomeDialogClass *dialog_class; - - object_class = (GtkObjectClass*) klass; - dialog_class = (GnomeDialogClass *) klass; - - parent_class = gtk_type_class (gnome_dialog_get_type ()); - - gtk_object_add_arg_type ("EContactEditorCategories::categories", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_CATEGORIES); - - object_class->set_arg = e_contact_editor_categories_set_arg; - object_class->get_arg = e_contact_editor_categories_get_arg; - object_class->destroy = e_contact_editor_categories_destroy; -} - -gchar *builtin_categories[] = { - "Business", - "Competition", - "Favorites", - "Gifts", - "Goals/Objectives", - "Holiday", - "Holiday Cards", - "Hot Contacts", - "Ideas", - "International", - "Key Customer", - "Miscellaneous", - "Personal", - "Phone Calls", - "Status", - "Strategies", - "Suppliers", - "Time & Expenses", - "VIP", - "Waiting", -}; - -#define BUILTIN_CATEGORY_COUNT (sizeof(builtin_categories) / sizeof(builtin_categories[0])) - -static void -add_list_unique(EContactEditorCategories *categories, char *string) -{ - int k; - char *temp = e_strdup_strip(string); - char **list = categories->category_list; - - if (!*temp) { - g_free(temp); - return; - } - for (k = 0; k < categories->list_length; k++) { - if (!strcmp(list[k], temp)) { - categories->selected_list[k] = TRUE; - break; - } - } - if (k == categories->list_length) { - categories->selected_list[categories->list_length] = TRUE; - list[categories->list_length++] = temp; - } else { - g_free(temp); - } -} - -static void -do_parse_categories(EContactEditorCategories *categories) -{ - char *str = categories->categories; - int length = strlen(str); - char *copy = g_new(char, length + 1); - int i, j; - char **list; - int count = 1; - - e_table_model_pre_change(categories->model); - - for (i = 0; i < categories->list_length; i++) - g_free(categories->category_list[i]); - g_free(categories->category_list); - g_free(categories->selected_list); - - for (i = 0; str[i]; i++) { - switch (str[i]) { - case '\\': - i++; - if (!str[i]) - i--; - break; - case ',': - count ++; - break; - } - } - list = g_new(char *, count + 1 + BUILTIN_CATEGORY_COUNT); - categories->category_list = list; - - categories->selected_list = g_new(gboolean, count + 1 + BUILTIN_CATEGORY_COUNT); - - for (count = 0; count < BUILTIN_CATEGORY_COUNT; count++) { - list[count] = g_strdup(builtin_categories[count]); - categories->selected_list[count] = 0; - } - - categories->list_length = count; - - for (i = 0, j = 0; str[i]; i++, j++) { - switch (str[i]) { - case '\\': - i++; - if (str[i]) { - copy[j] = str[i]; - } else - i--; - break; - case ',': - copy[j] = 0; - add_list_unique(categories, copy); - j = -1; - break; - default: - copy[j] = str[i]; - break; - } - } - copy[j] = 0; - add_list_unique(categories, copy); - g_free(copy); - e_table_model_changed(categories->model); -} - -static void -e_contact_editor_categories_entry_change (GtkWidget *entry, - EContactEditorCategories *categories) -{ - g_free(categories->categories); - categories->categories = e_utf8_gtk_entry_get_text(GTK_ENTRY(entry)); - do_parse_categories(categories); -} - -#define INITIAL_SPEC "\ - \ - \ - \ - \ - \ - \ - \ -" - -static void -e_contact_editor_categories_init (EContactEditorCategories *categories) -{ - GladeXML *gui; - GtkWidget *table; - GtkWidget *e_table; - - categories->list_length = 0; - categories->category_list = NULL; - categories->selected_list = NULL; - categories->categories = NULL; - - gnome_dialog_append_button ( GNOME_DIALOG(categories), - GNOME_STOCK_BUTTON_OK); - - gnome_dialog_append_button ( GNOME_DIALOG(categories), - GNOME_STOCK_BUTTON_CANCEL); - - gtk_window_set_policy(GTK_WINDOW(categories), FALSE, TRUE, FALSE); - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/categories.glade", NULL); - categories->gui = gui; - - table = glade_xml_get_widget(gui, "table-categories"); - gtk_widget_ref(table); - gtk_container_remove(GTK_CONTAINER(table->parent), table); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (categories)->vbox), table, TRUE, TRUE, 0); - gtk_widget_unref(table); - - categories->entry = glade_xml_get_widget(gui, "entry-categories"); - - gtk_signal_connect(GTK_OBJECT(categories->entry), "changed", - GTK_SIGNAL_FUNC(e_contact_editor_categories_entry_change), categories); - - categories->model = e_table_simple_new(e_contact_editor_categories_col_count, - e_contact_editor_categories_row_count, - e_contact_editor_categories_value_at, - e_contact_editor_categories_set_value_at, - e_contact_editor_categories_is_cell_editable, - e_contact_editor_categories_duplicate_value, - e_contact_editor_categories_free_value, - e_contact_editor_categories_initialize_value, - e_contact_editor_categories_value_is_empty, - e_contact_editor_categories_value_to_string, - categories); - - e_table = e_table_scrolled_new (categories->model, NULL, INITIAL_SPEC, NULL); - - gtk_object_sink(GTK_OBJECT(categories->model)); - - gtk_widget_show(e_table); - - gtk_table_attach_defaults(GTK_TABLE(table), - e_table, - 0, 1, - 3, 4); -} - -void -e_contact_editor_categories_destroy (GtkObject *object) -{ - EContactEditorCategories *categories = E_CONTACT_EDITOR_CATEGORIES(object); - int i; - - if (categories->gui) - gtk_object_unref(GTK_OBJECT(categories->gui)); - - g_free(categories->categories); - for (i = 0; i < categories->list_length; i++) - g_free(categories->category_list[i]); - g_free(categories->category_list); - g_free(categories->selected_list); -} - -GtkWidget* -e_contact_editor_categories_new (char *categories) -{ - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_editor_categories_get_type ())); - gtk_object_set (GTK_OBJECT(widget), - "categories", categories, - NULL); - return widget; -} - -static void -e_contact_editor_categories_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) -{ - EContactEditorCategories *e_contact_editor_categories; - - e_contact_editor_categories = E_CONTACT_EDITOR_CATEGORIES (o); - - switch (arg_id){ - case ARG_CATEGORIES: - e_utf8_gtk_entry_set_text(GTK_ENTRY(e_contact_editor_categories->entry), GTK_VALUE_STRING (*arg)); - break; - } -} - -static void -e_contact_editor_categories_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - EContactEditorCategories *e_contact_editor_categories; - - e_contact_editor_categories = E_CONTACT_EDITOR_CATEGORIES (object); - - switch (arg_id) { - case ARG_CATEGORIES: - GTK_VALUE_STRING (*arg) = g_strdup(e_contact_editor_categories->categories); - break; - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -/* This function returns the number of columns in our ETableModel. */ -static int -e_contact_editor_categories_col_count (ETableModel *etc, gpointer data) -{ - return 2; -} - -/* This function returns the number of rows in our ETableModel. */ -static int -e_contact_editor_categories_row_count (ETableModel *etc, gpointer data) -{ - EContactEditorCategories *categories = E_CONTACT_EDITOR_CATEGORIES(data); - return categories->list_length; -} - -/* This function returns the value at a particular point in our ETableModel. */ -static void * -e_contact_editor_categories_value_at (ETableModel *etc, int col, int row, gpointer data) -{ - EContactEditorCategories *categories = E_CONTACT_EDITOR_CATEGORIES(data); - if (col == 0) - return (void *) categories->selected_list[row]; - else - return categories->category_list[row]; -} - -/* This function sets the value at a particular point in our ETableModel. */ -static void -e_contact_editor_categories_set_value_at (ETableModel *etc, int col, int row, const void *val, gpointer data) -{ - EContactEditorCategories *categories = E_CONTACT_EDITOR_CATEGORIES(data); - if ( col == 0 ) { - char **strs; - int i, j; - char *string; - categories->selected_list[row] = (gboolean) val; - strs = g_new(char *, categories->list_length + 1); - for (i = 0, j = 0; i < categories->list_length; i++) { - if (categories->selected_list[i]) - strs[j++] = categories->category_list[i]; - } - strs[j] = 0; - string = g_strjoinv(", ", strs); - e_utf8_gtk_entry_set_text(GTK_ENTRY(categories->entry), string); - g_free(string); - g_free(strs); - } - if ( col == 1 ) - return; -} - -/* This function returns whether a particular cell is editable. */ -static gboolean -e_contact_editor_categories_is_cell_editable (ETableModel *etc, int col, int row, gpointer data) -{ - return col == 0; -} - -/* This function duplicates the value passed to it. */ -static void * -e_contact_editor_categories_duplicate_value (ETableModel *etc, int col, const void *value, gpointer data) -{ - if (col == 0) - return (void *)value; - else - return g_strdup(value); -} - -/* This function frees the value passed to it. */ -static void -e_contact_editor_categories_free_value (ETableModel *etc, int col, void *value, gpointer data) -{ - if (col == 0) - return; - else - g_free(value); -} - -static void * -e_contact_editor_categories_initialize_value (ETableModel *etc, int col, gpointer data) -{ - if (col == 0) - return NULL; - else - return g_strdup(""); -} - -static gboolean -e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const void *value, gpointer data) -{ - if (col == 0) - return value == NULL; - else - return !(value && *(char *)value); -} - -static char * -e_contact_editor_categories_value_to_string (ETableModel *etc, int col, const void *value, gpointer data) -{ - if (col == 0) - return g_strdup_printf("%d", (int) value); - else - return g_strdup(value); -} diff --git a/addressbook/contact-editor/e-contact-editor-categories.h b/addressbook/contact-editor/e-contact-editor-categories.h deleted file mode 100644 index 04b3c686ed..0000000000 --- a/addressbook/contact-editor/e-contact-editor-categories.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* e-contact-editor-categories.h - * Copyright (C) 2000 Helix Code, Inc. - * Author: Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ -#ifndef __E_CONTACT_EDITOR_CATEGORIES_H__ -#define __E_CONTACT_EDITOR_CATEGORIES_H__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -/* EContactEditorCategories - A dialog displaying information about a contact. - * - * The following arguments are available: - * - * name type read/write description - * -------------------------------------------------------------------------------- - */ - -#define E_CONTACT_EDITOR_CATEGORIES_TYPE (e_contact_editor_categories_get_type ()) -#define E_CONTACT_EDITOR_CATEGORIES(obj) (GTK_CHECK_CAST ((obj), E_CONTACT_EDITOR_CATEGORIES_TYPE, EContactEditorCategories)) -#define E_CONTACT_EDITOR_CATEGORIES_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CONTACT_EDITOR_CATEGORIES_TYPE, EContactEditorCategoriesClass)) -#define E_IS_CONTACT_EDITOR_CATEGORIES(obj) (GTK_CHECK_TYPE ((obj), E_CONTACT_EDITOR_CATEGORIES_TYPE)) -#define E_IS_CONTACT_EDITOR_CATEGORIES_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CONTACT_EDITOR_CATEGORIES_TYPE)) - - -typedef struct _EContactEditorCategories EContactEditorCategories; -typedef struct _EContactEditorCategoriesClass EContactEditorCategoriesClass; - -struct _EContactEditorCategories -{ - GnomeDialog parent; - - /* item specific fields */ - char *categories; - GtkWidget *entry; - ETableModel *model; - - int list_length; - char **category_list; - gboolean *selected_list; - - GladeXML *gui; -}; - -struct _EContactEditorCategoriesClass -{ - GnomeDialogClass parent_class; -}; - - -GtkWidget *e_contact_editor_categories_new(char *categories); -GtkType e_contact_editor_categories_get_type (void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* __E_CONTACT_EDITOR_CATEGORIES_H__ */ diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c index ee362dc2d1..0ebe11a513 100644 --- a/addressbook/contact-editor/e-contact-editor.c +++ b/addressbook/contact-editor/e-contact-editor.c @@ -25,7 +25,6 @@ #include "e-contact-editor.h" #include #include -#include #include #include #include "e-util/e-gui-utils.h" @@ -570,7 +569,7 @@ categories_clicked(GtkWidget *button, EContactEditor *editor) gtk_object_get(GTK_OBJECT(editor->card), "categories", &categories, NULL); - dialog = GNOME_DIALOG(e_contact_editor_categories_new(categories)); + dialog = GNOME_DIALOG(e_categories_new(categories)); gtk_widget_show(GTK_WIDGET(dialog)); result = gnome_dialog_run (dialog); g_free (categories); diff --git a/addressbook/gui/contact-editor/Makefile.am b/addressbook/gui/contact-editor/Makefile.am index 1016d38301..fb200df78f 100644 --- a/addressbook/gui/contact-editor/Makefile.am +++ b/addressbook/gui/contact-editor/Makefile.am @@ -17,8 +17,6 @@ noinst_LIBRARIES = \ libecontacteditor_a_SOURCES = \ e-contact-editor-address.c \ e-contact-editor-address.h \ - e-contact-editor-categories.c \ - e-contact-editor-categories.h \ e-contact-editor-fullname.c \ e-contact-editor-fullname.h \ e-contact-editor.c \ @@ -56,7 +54,6 @@ glade_DATA = \ contact-editor.glade \ fulladdr.glade \ fullname.glade \ - categories.glade \ e-contact-editor-confirm-delete.glade EXTRA_DIST = $(evolution_DATA) \ @@ -64,5 +61,4 @@ EXTRA_DIST = $(evolution_DATA) \ e-contact-editor-strings.h \ fulladdr.glade.h \ fullname-strings.h \ - categories-strings.h \ e-contact-editor-confirm-delete.glade.h diff --git a/addressbook/gui/contact-editor/categories-strings.h b/addressbook/gui/contact-editor/categories-strings.h deleted file mode 100644 index 813018a00e..0000000000 --- a/addressbook/gui/contact-editor/categories-strings.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Translatable strings file generated by Glade. - * Add this file to your project's POTFILES.in. - * DO NOT compile it as part of your application. - */ - -gchar *s = N_("categories"); -gchar *s = N_("Item(s) belong to these categories:"); -gchar *s = N_("Available Categories:"); diff --git a/addressbook/gui/contact-editor/categories.glade b/addressbook/gui/contact-editor/categories.glade deleted file mode 100644 index bf78008940..0000000000 --- a/addressbook/gui/contact-editor/categories.glade +++ /dev/null @@ -1,190 +0,0 @@ - - - - - categories - categories - - src - pixmaps - C - True - False - False - False - False - False - False - interface.c - interface.h - callbacks.c - callbacks.h - support.c - support.h - True - categories-strings.h - - - - GnomeDialog - categories - True - False - categories - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - False - False - - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - True - False - 8 - - 4 - True - True - - - - GtkTable - table-categories - True - 4 - 1 - False - 0 - 0 - - 0 - True - True - - - - GtkAccelLabel - accellabel1 - True - - GTK_JUSTIFY_LEFT - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - True - - - - - GtkAccelLabel - accellabel2 - True - - GTK_JUSTIFY_LEFT - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - True - - - - - GtkEntry - entry-categories - True - True - True - True - 0 - - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - True - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button1 - True - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - button3 - True - True - True - GNOME_STOCK_BUTTON_CANCEL - - - - - - diff --git a/addressbook/gui/contact-editor/e-contact-editor-categories.c b/addressbook/gui/contact-editor/e-contact-editor-categories.c deleted file mode 100644 index 045f128b48..0000000000 --- a/addressbook/gui/contact-editor/e-contact-editor-categories.c +++ /dev/null @@ -1,452 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-contact-editor-categories.c - * Copyright (C) 2000 Helix Code, Inc. - * Author: Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include -#include -#include - -static void e_contact_editor_categories_init (EContactEditorCategories *card); -static void e_contact_editor_categories_class_init (EContactEditorCategoriesClass *klass); -static void e_contact_editor_categories_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_contact_editor_categories_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_contact_editor_categories_destroy (GtkObject *object); -static int e_contact_editor_categories_col_count (ETableModel *etc, gpointer data); -static int e_contact_editor_categories_row_count (ETableModel *etc, gpointer data); -static void *e_contact_editor_categories_value_at (ETableModel *etc, int col, int row, gpointer data); -static void e_contact_editor_categories_set_value_at (ETableModel *etc, int col, int row, const void *val, gpointer data); -static gboolean e_contact_editor_categories_is_cell_editable (ETableModel *etc, int col, int row, gpointer data); -static void *e_contact_editor_categories_duplicate_value (ETableModel *etc, int col, const void *value, gpointer data); -static void e_contact_editor_categories_free_value (ETableModel *etc, int col, void *value, gpointer data); -static void *e_contact_editor_categories_initialize_value (ETableModel *etc, int col, gpointer data); -static gboolean e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const void *value, gpointer data); -static char * e_contact_editor_categories_value_to_string (ETableModel *etc, int col, const void *value, gpointer data); - -static GnomeDialogClass *parent_class = NULL; - -/* The arguments we take */ -enum { - ARG_0, - ARG_CATEGORIES -}; - -GtkType -e_contact_editor_categories_get_type (void) -{ - static GtkType contact_editor_categories_type = 0; - - if (!contact_editor_categories_type) - { - static const GtkTypeInfo contact_editor_categories_info = - { - "EContactEditorCategories", - sizeof (EContactEditorCategories), - sizeof (EContactEditorCategoriesClass), - (GtkClassInitFunc) e_contact_editor_categories_class_init, - (GtkObjectInitFunc) e_contact_editor_categories_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - contact_editor_categories_type = gtk_type_unique (gnome_dialog_get_type (), &contact_editor_categories_info); - } - - return contact_editor_categories_type; -} - -static void -e_contact_editor_categories_class_init (EContactEditorCategoriesClass *klass) -{ - GtkObjectClass *object_class; - GnomeDialogClass *dialog_class; - - object_class = (GtkObjectClass*) klass; - dialog_class = (GnomeDialogClass *) klass; - - parent_class = gtk_type_class (gnome_dialog_get_type ()); - - gtk_object_add_arg_type ("EContactEditorCategories::categories", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_CATEGORIES); - - object_class->set_arg = e_contact_editor_categories_set_arg; - object_class->get_arg = e_contact_editor_categories_get_arg; - object_class->destroy = e_contact_editor_categories_destroy; -} - -gchar *builtin_categories[] = { - "Business", - "Competition", - "Favorites", - "Gifts", - "Goals/Objectives", - "Holiday", - "Holiday Cards", - "Hot Contacts", - "Ideas", - "International", - "Key Customer", - "Miscellaneous", - "Personal", - "Phone Calls", - "Status", - "Strategies", - "Suppliers", - "Time & Expenses", - "VIP", - "Waiting", -}; - -#define BUILTIN_CATEGORY_COUNT (sizeof(builtin_categories) / sizeof(builtin_categories[0])) - -static void -add_list_unique(EContactEditorCategories *categories, char *string) -{ - int k; - char *temp = e_strdup_strip(string); - char **list = categories->category_list; - - if (!*temp) { - g_free(temp); - return; - } - for (k = 0; k < categories->list_length; k++) { - if (!strcmp(list[k], temp)) { - categories->selected_list[k] = TRUE; - break; - } - } - if (k == categories->list_length) { - categories->selected_list[categories->list_length] = TRUE; - list[categories->list_length++] = temp; - } else { - g_free(temp); - } -} - -static void -do_parse_categories(EContactEditorCategories *categories) -{ - char *str = categories->categories; - int length = strlen(str); - char *copy = g_new(char, length + 1); - int i, j; - char **list; - int count = 1; - - e_table_model_pre_change(categories->model); - - for (i = 0; i < categories->list_length; i++) - g_free(categories->category_list[i]); - g_free(categories->category_list); - g_free(categories->selected_list); - - for (i = 0; str[i]; i++) { - switch (str[i]) { - case '\\': - i++; - if (!str[i]) - i--; - break; - case ',': - count ++; - break; - } - } - list = g_new(char *, count + 1 + BUILTIN_CATEGORY_COUNT); - categories->category_list = list; - - categories->selected_list = g_new(gboolean, count + 1 + BUILTIN_CATEGORY_COUNT); - - for (count = 0; count < BUILTIN_CATEGORY_COUNT; count++) { - list[count] = g_strdup(builtin_categories[count]); - categories->selected_list[count] = 0; - } - - categories->list_length = count; - - for (i = 0, j = 0; str[i]; i++, j++) { - switch (str[i]) { - case '\\': - i++; - if (str[i]) { - copy[j] = str[i]; - } else - i--; - break; - case ',': - copy[j] = 0; - add_list_unique(categories, copy); - j = -1; - break; - default: - copy[j] = str[i]; - break; - } - } - copy[j] = 0; - add_list_unique(categories, copy); - g_free(copy); - e_table_model_changed(categories->model); -} - -static void -e_contact_editor_categories_entry_change (GtkWidget *entry, - EContactEditorCategories *categories) -{ - g_free(categories->categories); - categories->categories = e_utf8_gtk_entry_get_text(GTK_ENTRY(entry)); - do_parse_categories(categories); -} - -#define INITIAL_SPEC "\ - \ - \ - \ - \ - \ - \ - \ -" - -static void -e_contact_editor_categories_init (EContactEditorCategories *categories) -{ - GladeXML *gui; - GtkWidget *table; - GtkWidget *e_table; - - categories->list_length = 0; - categories->category_list = NULL; - categories->selected_list = NULL; - categories->categories = NULL; - - gnome_dialog_append_button ( GNOME_DIALOG(categories), - GNOME_STOCK_BUTTON_OK); - - gnome_dialog_append_button ( GNOME_DIALOG(categories), - GNOME_STOCK_BUTTON_CANCEL); - - gtk_window_set_policy(GTK_WINDOW(categories), FALSE, TRUE, FALSE); - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/categories.glade", NULL); - categories->gui = gui; - - table = glade_xml_get_widget(gui, "table-categories"); - gtk_widget_ref(table); - gtk_container_remove(GTK_CONTAINER(table->parent), table); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (categories)->vbox), table, TRUE, TRUE, 0); - gtk_widget_unref(table); - - categories->entry = glade_xml_get_widget(gui, "entry-categories"); - - gtk_signal_connect(GTK_OBJECT(categories->entry), "changed", - GTK_SIGNAL_FUNC(e_contact_editor_categories_entry_change), categories); - - categories->model = e_table_simple_new(e_contact_editor_categories_col_count, - e_contact_editor_categories_row_count, - e_contact_editor_categories_value_at, - e_contact_editor_categories_set_value_at, - e_contact_editor_categories_is_cell_editable, - e_contact_editor_categories_duplicate_value, - e_contact_editor_categories_free_value, - e_contact_editor_categories_initialize_value, - e_contact_editor_categories_value_is_empty, - e_contact_editor_categories_value_to_string, - categories); - - e_table = e_table_scrolled_new (categories->model, NULL, INITIAL_SPEC, NULL); - - gtk_object_sink(GTK_OBJECT(categories->model)); - - gtk_widget_show(e_table); - - gtk_table_attach_defaults(GTK_TABLE(table), - e_table, - 0, 1, - 3, 4); -} - -void -e_contact_editor_categories_destroy (GtkObject *object) -{ - EContactEditorCategories *categories = E_CONTACT_EDITOR_CATEGORIES(object); - int i; - - if (categories->gui) - gtk_object_unref(GTK_OBJECT(categories->gui)); - - g_free(categories->categories); - for (i = 0; i < categories->list_length; i++) - g_free(categories->category_list[i]); - g_free(categories->category_list); - g_free(categories->selected_list); -} - -GtkWidget* -e_contact_editor_categories_new (char *categories) -{ - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_editor_categories_get_type ())); - gtk_object_set (GTK_OBJECT(widget), - "categories", categories, - NULL); - return widget; -} - -static void -e_contact_editor_categories_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) -{ - EContactEditorCategories *e_contact_editor_categories; - - e_contact_editor_categories = E_CONTACT_EDITOR_CATEGORIES (o); - - switch (arg_id){ - case ARG_CATEGORIES: - e_utf8_gtk_entry_set_text(GTK_ENTRY(e_contact_editor_categories->entry), GTK_VALUE_STRING (*arg)); - break; - } -} - -static void -e_contact_editor_categories_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - EContactEditorCategories *e_contact_editor_categories; - - e_contact_editor_categories = E_CONTACT_EDITOR_CATEGORIES (object); - - switch (arg_id) { - case ARG_CATEGORIES: - GTK_VALUE_STRING (*arg) = g_strdup(e_contact_editor_categories->categories); - break; - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -/* This function returns the number of columns in our ETableModel. */ -static int -e_contact_editor_categories_col_count (ETableModel *etc, gpointer data) -{ - return 2; -} - -/* This function returns the number of rows in our ETableModel. */ -static int -e_contact_editor_categories_row_count (ETableModel *etc, gpointer data) -{ - EContactEditorCategories *categories = E_CONTACT_EDITOR_CATEGORIES(data); - return categories->list_length; -} - -/* This function returns the value at a particular point in our ETableModel. */ -static void * -e_contact_editor_categories_value_at (ETableModel *etc, int col, int row, gpointer data) -{ - EContactEditorCategories *categories = E_CONTACT_EDITOR_CATEGORIES(data); - if (col == 0) - return (void *) categories->selected_list[row]; - else - return categories->category_list[row]; -} - -/* This function sets the value at a particular point in our ETableModel. */ -static void -e_contact_editor_categories_set_value_at (ETableModel *etc, int col, int row, const void *val, gpointer data) -{ - EContactEditorCategories *categories = E_CONTACT_EDITOR_CATEGORIES(data); - if ( col == 0 ) { - char **strs; - int i, j; - char *string; - categories->selected_list[row] = (gboolean) val; - strs = g_new(char *, categories->list_length + 1); - for (i = 0, j = 0; i < categories->list_length; i++) { - if (categories->selected_list[i]) - strs[j++] = categories->category_list[i]; - } - strs[j] = 0; - string = g_strjoinv(", ", strs); - e_utf8_gtk_entry_set_text(GTK_ENTRY(categories->entry), string); - g_free(string); - g_free(strs); - } - if ( col == 1 ) - return; -} - -/* This function returns whether a particular cell is editable. */ -static gboolean -e_contact_editor_categories_is_cell_editable (ETableModel *etc, int col, int row, gpointer data) -{ - return col == 0; -} - -/* This function duplicates the value passed to it. */ -static void * -e_contact_editor_categories_duplicate_value (ETableModel *etc, int col, const void *value, gpointer data) -{ - if (col == 0) - return (void *)value; - else - return g_strdup(value); -} - -/* This function frees the value passed to it. */ -static void -e_contact_editor_categories_free_value (ETableModel *etc, int col, void *value, gpointer data) -{ - if (col == 0) - return; - else - g_free(value); -} - -static void * -e_contact_editor_categories_initialize_value (ETableModel *etc, int col, gpointer data) -{ - if (col == 0) - return NULL; - else - return g_strdup(""); -} - -static gboolean -e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const void *value, gpointer data) -{ - if (col == 0) - return value == NULL; - else - return !(value && *(char *)value); -} - -static char * -e_contact_editor_categories_value_to_string (ETableModel *etc, int col, const void *value, gpointer data) -{ - if (col == 0) - return g_strdup_printf("%d", (int) value); - else - return g_strdup(value); -} diff --git a/addressbook/gui/contact-editor/e-contact-editor-categories.h b/addressbook/gui/contact-editor/e-contact-editor-categories.h deleted file mode 100644 index 04b3c686ed..0000000000 --- a/addressbook/gui/contact-editor/e-contact-editor-categories.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* e-contact-editor-categories.h - * Copyright (C) 2000 Helix Code, Inc. - * Author: Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ -#ifndef __E_CONTACT_EDITOR_CATEGORIES_H__ -#define __E_CONTACT_EDITOR_CATEGORIES_H__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -/* EContactEditorCategories - A dialog displaying information about a contact. - * - * The following arguments are available: - * - * name type read/write description - * -------------------------------------------------------------------------------- - */ - -#define E_CONTACT_EDITOR_CATEGORIES_TYPE (e_contact_editor_categories_get_type ()) -#define E_CONTACT_EDITOR_CATEGORIES(obj) (GTK_CHECK_CAST ((obj), E_CONTACT_EDITOR_CATEGORIES_TYPE, EContactEditorCategories)) -#define E_CONTACT_EDITOR_CATEGORIES_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CONTACT_EDITOR_CATEGORIES_TYPE, EContactEditorCategoriesClass)) -#define E_IS_CONTACT_EDITOR_CATEGORIES(obj) (GTK_CHECK_TYPE ((obj), E_CONTACT_EDITOR_CATEGORIES_TYPE)) -#define E_IS_CONTACT_EDITOR_CATEGORIES_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CONTACT_EDITOR_CATEGORIES_TYPE)) - - -typedef struct _EContactEditorCategories EContactEditorCategories; -typedef struct _EContactEditorCategoriesClass EContactEditorCategoriesClass; - -struct _EContactEditorCategories -{ - GnomeDialog parent; - - /* item specific fields */ - char *categories; - GtkWidget *entry; - ETableModel *model; - - int list_length; - char **category_list; - gboolean *selected_list; - - GladeXML *gui; -}; - -struct _EContactEditorCategoriesClass -{ - GnomeDialogClass parent_class; -}; - - -GtkWidget *e_contact_editor_categories_new(char *categories); -GtkType e_contact_editor_categories_get_type (void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* __E_CONTACT_EDITOR_CATEGORIES_H__ */ diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index ee362dc2d1..0ebe11a513 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -25,7 +25,6 @@ #include "e-contact-editor.h" #include #include -#include #include #include #include "e-util/e-gui-utils.h" @@ -570,7 +569,7 @@ categories_clicked(GtkWidget *button, EContactEditor *editor) gtk_object_get(GTK_OBJECT(editor->card), "categories", &categories, NULL); - dialog = GNOME_DIALOG(e_contact_editor_categories_new(categories)); + dialog = GNOME_DIALOG(e_categories_new(categories)); gtk_widget_show(GTK_WIDGET(dialog)); result = gnome_dialog_run (dialog); g_free (categories); -- cgit v1.2.3