aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog20
-rw-r--r--addressbook/gui/component/select-names/e-select-names-section.etspec2
-rw-r--r--addressbook/gui/component/select-names/e-select-names.c78
-rw-r--r--addressbook/gui/component/select-names/e-select-names.h5
4 files changed, 44 insertions, 61 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 1d820c224e..6e92275a49 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,23 @@
+2003-03-18 Chris Toshok <toshok@ximian.com>
+
+ * gui/component/select-names/e-select-names-section.etspec: use
+ alternating-row-colors="false"
+
+ * gui/component/select-names/e-select-names.h: nuke prototypes for
+ e_select_names_get_source/section.
+
+ * gui/component/select-names/e-select-names.c (set_book): remove
+ the signal disconnect from here.
+ (addressbook_model_set_uri): same.
+ (e_select_names_init): connect to the search_result signal on the
+ addressbook model.
+ (e_select_names_child_free): disconnect the changed_id signal.
+ (e_select_names_add_section): set the underline column so the
+ recipient tables look like they did when they were EEntry.
+ (e_select_names_add_section): store off the changed_id.
+ (e_select_names_get_section): nuke.
+ (e_select_names_get_source): nuke.
+
2003-03-18 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c (addrconduit_load_configuration): kill
diff --git a/addressbook/gui/component/select-names/e-select-names-section.etspec b/addressbook/gui/component/select-names/e-select-names-section.etspec
index ba3f68f4b4..9d7b038892 100644
--- a/addressbook/gui/component/select-names/e-select-names-section.etspec
+++ b/addressbook/gui/component/select-names/e-select-names-section.etspec
@@ -1,4 +1,4 @@
-<ETableSpecification no-headers="true" cursor-mode="line">
+<ETableSpecification no-headers="true" cursor-mode="line" alternating-row-colors="false">
<ETableColumn model_col= "0" _title="Name" expansion="1.0" minimum_width="20" resizable="true" cell="string" compare="collate" search="string"/>
<ETableState>
<column source="0"/>
diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c
index 9be940ce8f..00f4004945 100644
--- a/addressbook/gui/component/select-names/e-select-names.c
+++ b/addressbook/gui/component/select-names/e-select-names.c
@@ -72,6 +72,7 @@ typedef struct {
GtkWidget *label;
GtkWidget *button;
GtkWidget *recipient_table;
+ gulong changed_id;
} ESelectNamesChild;
GType
@@ -122,11 +123,6 @@ search_result (EAddressbookModel *model, EBookViewStatus status, ESelectNames *e
static void
set_book(EBook *book, EBookStatus status, ESelectNames *esn)
{
- if (esn->search_id) {
- g_signal_handler_disconnect(esn->model, esn->search_id);
- esn->search_id = 0;
- }
-
g_object_set(esn->model,
"book", book,
NULL);
@@ -156,12 +152,6 @@ addressbook_model_set_uri(ESelectNames *e_select_names, EAddressbookModel *model
book = e_book_new();
- if (e_select_names->search_id)
- g_signal_handler_disconnect(model, e_select_names->search_id);
- e_select_names->search_id = g_signal_connect (model,
- "search_result", G_CALLBACK (search_result),
- e_select_names);
-
g_object_ref(e_select_names);
g_object_ref(model);
addressbook_load_uri(book, book_uri, (EBookCallback) set_book, e_select_names);
@@ -532,6 +522,10 @@ e_select_names_init (ESelectNames *e_select_names)
g_object_weak_ref (G_OBJECT (e_select_names->status_message), clear_widget, &e_select_names->status_message);
}
+ e_select_names->search_id = g_signal_connect (e_select_names->model,
+ "search_result", G_CALLBACK (search_result),
+ e_select_names);
+
e_select_names->categories = glade_xml_get_widget (gui, "custom-categories");
if (e_select_names->categories && !E_IS_CATEGORIES_MASTER_LIST_OPTION_MENU (e_select_names->categories))
e_select_names->categories = NULL;
@@ -595,10 +589,8 @@ e_select_names_init (ESelectNames *e_select_names)
static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names)
{
- g_signal_handlers_disconnect_matched (child->source,
- (GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA),
- 0, 0, NULL,
- G_CALLBACK (sync_table_and_models), e_select_names);
+ g_signal_handler_disconnect(child->source, child->changed_id);
+
g_free(child->title);
g_object_unref(child->table_model);
g_object_unref(child->source);
@@ -717,6 +709,8 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
GtkTable *table;
char *label_text;
ETable *etable;
+ ETableExtras *extras;
+ ECell *string_cell;
GtkWidget *sw;
@@ -767,10 +761,19 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
etable = e_table_scrolled_get_table (e_select_names->table);
gtk_widget_set_sensitive (button, e_table_selected_count (etable) > 0);
+ extras = e_table_extras_new ();
+ string_cell = e_table_extras_get_cell (extras, "string");
+
+ g_object_set (string_cell,
+ "underline_column", 2,
+ NULL);
+
sw = e_table_scrolled_new_from_spec_file (E_TABLE_MODEL (child->table_model),
- NULL,
+ extras,
EVOLUTION_ETSPECDIR "/e-select-names-section.etspec",
NULL);
+ g_object_unref (extras);
+
child->recipient_table = GTK_WIDGET (e_table_scrolled_get_table (E_TABLE_SCROLLED (sw)));
g_signal_connect (child->recipient_table,
@@ -785,10 +788,10 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
g_signal_connect(child->recipient_table, "double_click",
G_CALLBACK(remove_address), child);
- g_signal_connect (child->source,
- "changed",
- G_CALLBACK (sync_table_and_models),
- e_select_names);
+ child->changed_id = g_signal_connect (child->source,
+ "changed",
+ G_CALLBACK (sync_table_and_models),
+ e_select_names);
gtk_widget_show_all (sw);
@@ -817,41 +820,6 @@ card_free(void *value, void *closure)
g_object_unref((gpointer)value);
}
-EList *
-e_select_names_get_section(ESelectNames *e_select_names, char *id)
-{
- ESelectNamesChild *child;
- int i;
- int rows;
- EList *list;
-
- child = g_hash_table_lookup(e_select_names->children, id);
- if (!child)
- return NULL;
- rows = e_select_names_model_count (child->source);
-
- list = e_list_new(card_copy, card_free, NULL);
- for (i = 0; i < rows; i++) {
- ECard *card = e_select_names_model_get_card (child->source, i);
- e_list_append(list, card);
- g_object_unref(card);
- }
- return list;
-}
-
-ESelectNamesModel *
-e_select_names_get_source(ESelectNames *e_select_names,
- char *id)
-{
- ESelectNamesChild *child = g_hash_table_lookup(e_select_names->children, id);
- if (child) {
- if (child->source)
- g_object_ref(child->source);
- return child->source;
- } else
- return NULL;
-}
-
void
e_select_names_set_default (ESelectNames *e_select_names,
const char *id)
diff --git a/addressbook/gui/component/select-names/e-select-names.h b/addressbook/gui/component/select-names/e-select-names.h
index ccf4eebd5f..609aa00f01 100644
--- a/addressbook/gui/component/select-names/e-select-names.h
+++ b/addressbook/gui/component/select-names/e-select-names.h
@@ -92,13 +92,8 @@ void e_select_names_add_section (ESelectNames *e_select_names,
char *name,
char *id,
ESelectNamesModel *source);
-ESelectNamesModel *e_select_names_get_source (ESelectNames *e_select_names,
- char *id);
void e_select_names_set_default (ESelectNames *e_select_names,
const char *id);
-/* Returns a ref counted list of addresses. */
-EList *e_select_names_get_section (ESelectNames *e_select_names,
- char *id);
#ifdef __cplusplus
}