aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.c11
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c5
-rw-r--r--addressbook/gui/widgets/e-minicard.c25
-rw-r--r--addressbook/gui/widgets/e-minicard.h2
4 files changed, 33 insertions, 10 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c
index 0660bbd13a..36909ca433 100644
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c
@@ -159,7 +159,16 @@ addressbook_is_cell_editable (ETableModel *etc, int col, int row)
{
EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etc);
EAddressbookTableAdapterPrivate *priv = adapter->priv;
- return e_addressbook_model_editable(priv->model) && col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING;
+ ECard *card = e_addressbook_model_card_at (priv->model, row);
+
+ if (!e_addressbook_model_editable(priv->model))
+ return FALSE;
+ else if (e_card_evolution_list (card))
+ /* we only allow editing of the name and file as for
+ lists */
+ return col == E_CARD_SIMPLE_FIELD_FULL_NAME || col == E_CARD_SIMPLE_FIELD_FILE_AS;
+ else
+ return col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING;
}
static void
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index e871836017..436632e77f 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -481,7 +481,10 @@ table_double_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, E
g_assert (E_IS_BOOK (book));
- e_addressbook_show_contact_editor (book, card, FALSE, view->editable);
+ if (e_card_evolution_list (card))
+ e_addressbook_show_contact_list_editor (book, card, FALSE, view->editable);
+ else
+ e_addressbook_show_contact_editor (book, card, FALSE, view->editable);
}
}
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 23fa560f2f..6c06952c6e 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -438,10 +438,10 @@ card_modified_cb (EBook* book, EBookStatus status, gpointer user_data)
/* Callback used when the contact editor is closed */
static void
-editor_closed_cb (EContactEditor *ce, gpointer data)
+editor_closed_cb (GtkObject *editor, gpointer data)
{
EMinicard *minicard = data;
- gtk_object_unref (GTK_OBJECT (ce));
+ gtk_object_unref (GTK_OBJECT (editor));
minicard->editor = NULL;
}
@@ -528,7 +528,10 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
case GDK_2BUTTON_PRESS:
if (event->button.button == 1 && E_IS_MINICARD_VIEW(item->parent)) {
if (e_minicard->editor) {
- e_contact_editor_raise(e_minicard->editor);
+ if (e_card_evolution_list (e_minicard->card))
+ e_contact_list_editor_raise (E_CONTACT_LIST_EDITOR(e_minicard->editor));
+ else
+ e_contact_editor_raise(E_CONTACT_EDITOR(e_minicard->editor));
} else {
EBook *book = NULL;
if (E_IS_MINICARD_VIEW(item->parent)) {
@@ -538,11 +541,19 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
}
if (book != NULL) {
- e_minicard->editor = e_addressbook_show_contact_editor (book, e_minicard->card,
- FALSE, e_minicard->editable);
- gtk_object_ref (GTK_OBJECT (e_minicard->editor));
+ if (e_card_evolution_list (e_minicard->card)) {
+ EContactListEditor *editor = e_addressbook_show_contact_list_editor (book, e_minicard->card,
+ FALSE, e_minicard->editable);
+ e_minicard->editor = GTK_OBJECT (editor);
+ }
+ else {
+ EContactEditor *editor = e_addressbook_show_contact_editor (book, e_minicard->card,
+ FALSE, e_minicard->editable);
+ e_minicard->editor = GTK_OBJECT (editor);
+ }
+ gtk_object_ref (e_minicard->editor);
- gtk_signal_connect (GTK_OBJECT (e_minicard->editor), "editor_closed",
+ gtk_signal_connect (e_minicard->editor, "editor_closed",
GTK_SIGNAL_FUNC (editor_closed_cb), e_minicard);
}
diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h
index ae54ad63ec..6b4ce35013 100644
--- a/addressbook/gui/widgets/e-minicard.h
+++ b/addressbook/gui/widgets/e-minicard.h
@@ -70,7 +70,7 @@ struct _EMinicard
GnomeCanvasItem *header_rect;
GnomeCanvasItem *header_text;
- EContactEditor *editor;
+ GtkObject *editor;
GList *fields; /* Of type EMinicardField */
guint needs_remodeling : 1;