aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-06-29 11:53:11 +0800
committerChris Toshok <toshok@src.gnome.org>2001-06-29 11:53:11 +0800
commit51da89cf510f7fcbe80eecfb6c98beb0ccb4ff9c (patch)
tree458e7cb2a72d5251ad454bd3b2ca17d4bbc24d79 /addressbook
parent9d83b98a54a420207ed3770bf0d2283d5c7dcd19 (diff)
downloadgsoc2013-evolution-51da89cf510f7fcbe80eecfb6c98beb0ccb4ff9c.tar
gsoc2013-evolution-51da89cf510f7fcbe80eecfb6c98beb0ccb4ff9c.tar.gz
gsoc2013-evolution-51da89cf510f7fcbe80eecfb6c98beb0ccb4ff9c.tar.bz2
gsoc2013-evolution-51da89cf510f7fcbe80eecfb6c98beb0ccb4ff9c.tar.lz
gsoc2013-evolution-51da89cf510f7fcbe80eecfb6c98beb0ccb4ff9c.tar.xz
gsoc2013-evolution-51da89cf510f7fcbe80eecfb6c98beb0ccb4ff9c.tar.zst
gsoc2013-evolution-51da89cf510f7fcbe80eecfb6c98beb0ccb4ff9c.zip
remove ancient e-table include, and add include for contact-editor so we
2001-06-28 Chris Toshok <toshok@ximian.com> * gui/contact-list-editor/Makefile.am (INCLUDES): remove ancient e-table include, and add include for contact-editor so we can reuse the confirm_delete dialog. * gui/contact-list-editor/e-contact-list-editor.h (struct _EContactListEditor): remove prototype for e_contact_list_editor_close, since the function no longer exists. * gui/contact-list-editor/e-contact-list-editor.c (list_deleted_cb): new function, emit our "list_deleted" signal. (delete_cb): new function, called from the Delete toolbar item. (e_contact_list_editor_raise): flesh out function. (extract_info): "evolution_list" => "list". (fill_in_info): same. svn path=/trunk/; revision=10587
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog17
-rw-r--r--addressbook/gui/contact-list-editor/Makefile.am2
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c50
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.h1
4 files changed, 52 insertions, 18 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 5ca176dff7..a3739aecdb 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,22 @@
2001-06-28 Chris Toshok <toshok@ximian.com>
+ * gui/contact-list-editor/Makefile.am (INCLUDES): remove ancient
+ e-table include, and add include for contact-editor so we can
+ reuse the confirm_delete dialog.
+
+ * gui/contact-list-editor/e-contact-list-editor.h (struct
+ _EContactListEditor): remove prototype for
+ e_contact_list_editor_close, since the function no longer exists.
+
+ * gui/contact-list-editor/e-contact-list-editor.c
+ (list_deleted_cb): new function, emit our "list_deleted" signal.
+ (delete_cb): new function, called from the Delete toolbar item.
+ (e_contact_list_editor_raise): flesh out function.
+ (extract_info): "evolution_list" => "list".
+ (fill_in_info): same.
+
+2001-06-28 Chris Toshok <toshok@ximian.com>
+
* backend/ebook/e-card.c (e_card_get_vobject): add support for
X-EVOLUTION-LIST and X-EVOLUTION-LIST-SHOW-ADDRESSES.
(parse_list): new function, parse the boolean X-EVOLUTION-LIST.
diff --git a/addressbook/gui/contact-list-editor/Makefile.am b/addressbook/gui/contact-list-editor/Makefile.am
index 5e6229a833..fb16b8e6e7 100644
--- a/addressbook/gui/contact-list-editor/Makefile.am
+++ b/addressbook/gui/contact-list-editor/Makefile.am
@@ -5,7 +5,7 @@ INCLUDES = \
-I$(top_srcdir)/addressbook/ \
-I$(top_srcdir)/addressbook/backend \
-I$(top_srcdir)/addressbook/gui/merging \
- -I$(top_srcdir)/widgets/e-table \
+ -I$(top_srcdir)/addressbook/gui/contact-editor \
-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DEVOLUTION_DATADIR=\""$(datadir)"\" \
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index cd2710f022..bff82c2f2b 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -25,6 +25,7 @@
#include <gal/e-table/e-table-scrolled.h>
#include <gal/widgets/e-unicode.h>
+#include "e-contact-editor.h"
#include "e-contact-list-editor.h"
#include "e-contact-list-model.h"
@@ -350,7 +351,6 @@ save_card (EContactListEditor *cle, gboolean should_close)
}
}
-/* File/Close callback */
static void
file_close_cb (GtkWidget *widget, gpointer data)
{
@@ -374,15 +374,41 @@ tb_save_and_close_cb (GtkWidget *widget, gpointer data)
save_card (cle, TRUE);
}
+static void
+list_deleted_cb (EBook *book, EBookStatus status, EContactListEditor *cle)
+{
+ gtk_signal_emit (GTK_OBJECT (cle), contact_list_editor_signals[LIST_DELETED],
+ status, cle->card);
+}
+
+static void
+delete_cb (GtkWidget *widget, gpointer data)
+{
+ EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
+ ECard *card = cle->card;
+
+ gtk_object_ref(GTK_OBJECT(card));
+
+ if (e_contact_editor_confirm_delete(GTK_WINDOW(cle->app))) {
+
+ extract_info (cle);
+
+ if (!cle->is_new_list)
+ e_book_remove_card (cle->book, card, GTK_SIGNAL_FUNC(list_deleted_cb), cle);
+ }
+
+ gtk_object_unref(GTK_OBJECT(card));
+}
+
static
BonoboUIVerb verbs [] = {
BONOBO_UI_UNSAFE_VERB ("ContactListEditorSave", file_save_cb),
BONOBO_UI_UNSAFE_VERB ("ContactListEditorSaveClose", tb_save_and_close_cb),
+ BONOBO_UI_UNSAFE_VERB ("ContactListEditorDelete", delete_cb),
#if 0
BONOBO_UI_UNSAFE_VERB ("ContactEditorSaveAs", file_save_as_cb),
BONOBO_UI_UNSAFE_VERB ("ContactEditorSendAs", file_send_as_cb),
BONOBO_UI_UNSAFE_VERB ("ContactEditorSendTo", file_send_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorDelete", delete_cb),
#endif
BONOBO_UI_UNSAFE_VERB ("ContactListEditorClose", file_close_cb),
BONOBO_UI_VERB_END
@@ -440,6 +466,7 @@ e_contact_list_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
editor->card = e_card_duplicate(E_CARD(GTK_VALUE_OBJECT (*arg)));
fill_in_info(editor);
editor->changed = FALSE;
+ command_state_changed (editor);
break;
case ARG_IS_NEW_LIST: {
@@ -506,13 +533,9 @@ e_contact_list_editor_show (EContactListEditor *editor)
}
void
-e_contact_list_editor_close (EContactListEditor *editor)
-{
-}
-
-void
e_contact_list_editor_raise (EContactListEditor *editor)
{
+ gdk_window_raise (GTK_WIDGET (editor->app)->window);
}
#define SPEC "<ETableSpecification no-headers=\"true\" cursor-mode=\"line\" selection-mode=\"single\"> \
@@ -732,8 +755,8 @@ extract_info(EContactListEditor *editor)
gtk_object_set (GTK_OBJECT(card),
- "evolution_list", GINT_TO_POINTER (TRUE),
- "evolution_list_show_addresses",
+ "list", GINT_TO_POINTER (TRUE),
+ "list_show_addresses",
GINT_TO_POINTER (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton))),
NULL);
@@ -762,15 +785,10 @@ fill_in_info(EContactListEditor *editor)
gtk_object_get (GTK_OBJECT (editor->card),
"file_as", &file_as,
"email", &email_list,
- "evolution_list", &is_evolution_list,
- "evolution_list_show_addresses", &show_addresses,
+ "list", &is_evolution_list,
+ "list_show_addresses", &show_addresses,
NULL);
- if (!editor->is_new_list && !is_evolution_list) {
- g_warning ("Attempting to edit non-list card in the list editor.\n");
- return;
- }
-
gtk_editable_delete_text (GTK_EDITABLE (editor->list_name_entry), 0, -1);
if (file_as) {
int position = 0;
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.h b/addressbook/gui/contact-list-editor/e-contact-list-editor.h
index 4aba6668f8..6c67fc6468 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.h
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.h
@@ -96,7 +96,6 @@ EContactListEditor *e_contact_list_editor_new (EBook *book,
gboolean editable);
GtkType e_contact_list_editor_get_type (void);
void e_contact_list_editor_show (EContactListEditor *editor);
-void e_contact_list_editor_close (EContactListEditor *editor);
void e_contact_list_editor_raise (EContactListEditor *editor);
gboolean e_contact_list_editor_confirm_delete (GtkWindow *parent);