aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/select-names/e-select-names-manager.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-07-08 00:14:27 +0800
committerChris Lahey <clahey@src.gnome.org>2000-07-08 00:14:27 +0800
commit661cc2d0ef7f97a064543032b088d5092c36b4cb (patch)
treedd22ad7aca692e439e66c55ce56968bff64fa8c9 /addressbook/gui/component/select-names/e-select-names-manager.c
parenta4a1a93648db15b869ee67a19b7aad1873b5f9c7 (diff)
downloadgsoc2013-evolution-661cc2d0ef7f97a064543032b088d5092c36b4cb.tar
gsoc2013-evolution-661cc2d0ef7f97a064543032b088d5092c36b4cb.tar.gz
gsoc2013-evolution-661cc2d0ef7f97a064543032b088d5092c36b4cb.tar.bz2
gsoc2013-evolution-661cc2d0ef7f97a064543032b088d5092c36b4cb.tar.lz
gsoc2013-evolution-661cc2d0ef7f97a064543032b088d5092c36b4cb.tar.xz
gsoc2013-evolution-661cc2d0ef7f97a064543032b088d5092c36b4cb.tar.zst
gsoc2013-evolution-661cc2d0ef7f97a064543032b088d5092c36b4cb.zip
Since ELDAPServer->port is a char *, allocate a string with the number 389
2000-07-07 Christopher James Lahey <clahey@helixcode.com> * gui/component/addressbook.c (new_server_cb): Since ELDAPServer->port is a char *, allocate a string with the number 389 contained. * gui/component/addressbook.c: Make the select names test test the new code instead of the old way of getting to an ESelectNames dialog. * gui/component/select-names/e-select-names-manager.c: Coded storing the model for each section, creating an entry and returning it, and for activating the dialog. Wrote a bit of the get_cards code, but not all of it. * gui/component/select-names/e-select-names-model.c, gui/component/select-names/e-select-names-model.h: Coded all of the code needed to make ESelectNamesTextModel work (it doesn't yet, but all the code should be there.) Removed E_SELECT_NAMES_MODEL_DATA_TYPE_SEPARATION_MATERIAL. * gui/component/select-names/e-select-names-table-model.c, gui/component/select-names/e-select-names-text-model.c: Changed these to compensate for removal of E_SELECT_NAMES_MODEL_DATA_TYPE_SEPARATION_MATERIAL. * gui/component/select-names/e-select-names-table-model.h, gui/component/select-names/e-select-names-text-model.h: Fixed some silly typos. * gui/component/select-names/e-select-names.c, gui/component/select-names/e-select-names.h: Added a parameter to add_section that lets you specify the source ESelectNamesModel. svn path=/trunk/; revision=3948
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.c25
1 files changed, 24 insertions, 1 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 ac59787932..2eea09f985 100644
--- a/addressbook/gui/component/select-names/e-select-names-manager.c
+++ b/addressbook/gui/component/select-names/e-select-names-manager.c
@@ -15,6 +15,7 @@
#include "e-select-names-manager.h"
#include "e-select-names-model.h"
#include "e-select-names-text-model.h"
+#include "e-select-names.h"
#include "widgets/e-text/e-entry.h"
/* Object argument IDs */
@@ -154,6 +155,9 @@ section_copy(const void *sec, void *data)
newsec = g_new(ESelectNamesManagerSection, 1);
newsec->id = g_strdup(section->id);
newsec->title = g_strdup(section->title);
+ newsec->model = section->model;
+ if (newsec->model)
+ gtk_object_ref(GTK_OBJECT(newsec->model));
return newsec;
}
@@ -163,6 +167,8 @@ section_free(void *sec, void *data)
ESelectNamesManagerSection *section = sec;
g_free(section->id);
g_free(section->title);
+ if (section->model)
+ gtk_object_unref(GTK_OBJECT(section->model));
g_free(section);
}
@@ -184,6 +190,7 @@ void e_select_names_manager_add_section (
section = g_new(ESelectNamesManagerSection, 1);
section->id = g_strdup(id);
section->title = g_strdup(title);
+ section->model = e_select_names_model_new();
e_list_append(manager->sections, section);
section_free(section, manager);
}
@@ -195,7 +202,7 @@ GtkWidget *e_select_names_manager_create_entry (
ETextModel *model;
EIterator *iterator;
iterator = e_list_get_iterator(manager->sections);
- for (; e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
+ for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
const ESelectNamesManagerSection *section = e_iterator_get(iterator);
if (!strcmp(section->id, id)) {
entry = GTK_WIDGET(e_entry_new());
@@ -212,11 +219,27 @@ GtkWidget *e_select_names_manager_create_entry (
void e_select_names_manager_activate_dialog (ESelectNamesManager *manager,
char *id)
{
+ ESelectNames *names = E_SELECT_NAMES(e_select_names_new());
+ EIterator *iterator;
+ 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);
+ e_select_names_add_section(names, section->id, section->title, section->model);
+ }
+ gtk_widget_show(GTK_WIDGET(names));
}
/* Of type ECard */
EList *e_select_names_manager_get_cards (ESelectNamesManager *manager,
char *id)
{
+ EIterator *iterator;
+ 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);
+ if (!strcmp(section->id, id)) {
+
+ }
+ }
return NULL;
}