aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/select-names/e-select-names-manager.c
diff options
context:
space:
mode:
authorIain Holmes <iain@helixcode.com>2000-10-18 19:01:22 +0800
committerIain Holmes <iain@src.gnome.org>2000-10-18 19:01:22 +0800
commitba84ef43e5f8b5209b75c734b42acd407c1cfbc7 (patch)
tree89f442d9bb42e128b127209b8714b48958d720ff /addressbook/gui/component/select-names/e-select-names-manager.c
parent80dbb750f559f058ef656b012c24b031f0881126 (diff)
downloadgsoc2013-evolution-ba84ef43e5f8b5209b75c734b42acd407c1cfbc7.tar.gz
gsoc2013-evolution-ba84ef43e5f8b5209b75c734b42acd407c1cfbc7.tar.zst
gsoc2013-evolution-ba84ef43e5f8b5209b75c734b42acd407c1cfbc7.zip
Change the initial dialog visibility to FALSE so the contact editor
2000-10-17 Iain Holmes <iain@helixcode.com> * contact-editor/contact-editor.glade: Change the initial dialog visibility to FALSE so the contact editor doesn't flash when it appears. 2000-10-16 Iain Holmes <iain@helixcode.com> * gui/component/select-names/e-select-names-manager.c (e_select_names_manager_activate_dialog): Only allow one dialog per manager. svn path=/trunk/; revision=5986
Diffstat (limited to 'addressbook/gui/component/select-names/e-select-names-manager.c')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.c41
1 files changed, 11 insertions, 30 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c
index c4c7440270..55c5ae1608 100644
--- a/addressbook/gui/component/select-names/e-select-names-manager.c
+++ b/addressbook/gui/component/select-names/e-select-names-manager.c
@@ -114,7 +114,6 @@ e_select_names_manager_destroy (GtkObject *object)
manager = E_SELECT_NAMES_MANAGER (object);
- g_hash_table_destroy (manager->id_to_names);
gtk_object_unref(GTK_OBJECT(manager->sections));
gtk_object_unref(GTK_OBJECT(manager->entries));
}
@@ -209,7 +208,6 @@ entry_free(void *ent, void *data)
static void
e_select_names_manager_init (ESelectNamesManager *manager)
{
- manager->id_to_names = g_hash_table_new (g_str_hash, g_str_equal);
manager->sections = e_list_new(section_copy, section_free, manager);
manager->entries = e_list_new(entry_copy, entry_free, manager);
}
@@ -318,48 +316,31 @@ e_select_names_clicked(ESelectNames *dialog, gint button, ESelectNamesManager *m
gnome_dialog_close(GNOME_DIALOG(dialog));
}
-static void
-remove_id_from_table (GtkWidget *names,
- ESelectNamesManager *manager)
-{
- char *id;
-
- id = gtk_object_get_data (GTK_OBJECT (names), "section-id");
- g_hash_table_remove (manager->id_to_names, id);
- g_free (id);
-}
-
void e_select_names_manager_activate_dialog (ESelectNamesManager *manager,
const char *id)
{
- ESelectNames *names;
EIterator *iterator;
- names = g_hash_table_lookup (manager->id_to_names, id);
-
- if (names) {
- g_assert (GTK_WIDGET_REALIZED (GTK_WIDGET (names)));
- gdk_window_show (GTK_WIDGET (names)->window);
- gdk_window_raise (GTK_WIDGET (names)->window);
+ if (manager->names) {
+ g_assert (GTK_WIDGET_REALIZED (GTK_WIDGET (manager->names)));
+ gdk_window_show (GTK_WIDGET (manager->names)->window);
+ gdk_window_raise (GTK_WIDGET (manager->names)->window);
} else {
- char *id_dup;
- names = E_SELECT_NAMES (e_select_names_new ());
+ manager->names = E_SELECT_NAMES (e_select_names_new ());
iterator = e_list_get_iterator(manager->sections);
for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
const ESelectNamesManagerSection *section = e_iterator_get(iterator);
ESelectNamesModel *newmodel = e_select_names_model_duplicate(section->model);
- e_select_names_add_section(names, section->id, section->title, newmodel);
+ e_select_names_add_section(manager->names, section->id, section->title, newmodel);
gtk_object_unref(GTK_OBJECT(newmodel));
}
- gtk_signal_connect(GTK_OBJECT(names), "clicked",
+ gtk_signal_connect(GTK_OBJECT(manager->names), "clicked",
GTK_SIGNAL_FUNC(e_select_names_clicked), manager);
- id_dup = g_strdup (id);
- gtk_object_set_data(GTK_OBJECT(names), "section-id", id_dup);
- g_hash_table_insert (manager->id_to_names, id_dup, names);
- gtk_signal_connect(GTK_OBJECT(names), "destroy",
- GTK_SIGNAL_FUNC(remove_id_from_table), manager);
- gtk_widget_show(GTK_WIDGET(names));
+ gtk_signal_connect(GTK_OBJECT(manager->names), "destroy",
+ GTK_SIGNAL_FUNC(gtk_widget_destroyed),
+ &manager->names);
+ gtk_widget_show(GTK_WIDGET(manager->names));
}
}