aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog16
-rw-r--r--addressbook/gui/component/Makefile.am5
-rw-r--r--addressbook/gui/component/addressbook.c20
-rw-r--r--addressbook/gui/component/e-addressbook-model.c12
-rw-r--r--addressbook/gui/component/e-select-names.c11
-rw-r--r--addressbook/gui/component/select-names.glade1
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c12
7 files changed, 62 insertions, 15 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index ba40dac9f6..4dc536ccf1 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,19 @@
+2000-06-11 Christopher James Lahey <clahey@helixcode.com>
+
+ * gui/component/Makefile.am: Added glade files.
+
+ * gui/component/addressbook.c: Added a test of the Select Names
+ functionality.
+
+ * gui/component/e-addressbook-model.c: Made this class_init
+ function a bit cleaner.
+
+ * gui/component/e-select-names.c: Tested this and fixed some
+ obvious errors.
+
+ * gui/component/select-names.glade: The main window shouldn't be
+ visible by default.
+
2000-06-11 Ettore Perazzoli <ettore@helixcode.com>
* contact-editor/Makefile.am (contact_editor_test_LDADD): Link
diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am
index c5cc80afb7..56dedae772 100644
--- a/addressbook/gui/component/Makefile.am
+++ b/addressbook/gui/component/Makefile.am
@@ -74,13 +74,14 @@ gnorba_DATA = addressbook.gnorba
endif
gladedir = $(datadir)/evolution/glade
-glade_DATA = ldap-server-dialog.glade ldap-server-dialog.glade.h alphabet.glade
+glade_DATA = ldap-server-dialog.glade ldap-server-dialog.glade.h alphabet.glade select-names.glade
EXTRA_DIST = \
$(glade_DATA) \
addressbook.gnorba \
addressbook.oafinfo \
- alphabet.glade.h
+ alphabet.glade.h \
+ select-names.glade.h
if ENABLE_PURIFY
PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 805a11f574..1bce1010e3 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -26,6 +26,7 @@
#include <e-cell-text.h>
#include <e-addressbook-model.h>
+#include <e-select-names.h>
#include "e-contact-editor.h"
#include "e-contact-save-as.h"
#include "e-ldap-server-dialog.h"
@@ -76,6 +77,7 @@ control_deactivate (BonoboControl *control, BonoboUIHandler *uih)
{
/* how to remove a menu item */
bonobo_ui_handler_menu_remove (uih, "/File/Print");
+ bonobo_ui_handler_menu_remove (uih, "/File/TestSelectNames");
bonobo_ui_handler_menu_remove (uih, "/View/<sep>");
bonobo_ui_handler_menu_remove (uih, "/View/Toggle View");
bonobo_ui_handler_menu_remove (uih, "/Actions/New Contact");
@@ -407,6 +409,17 @@ print_cb (BonoboUIHandler *uih, void *user_data, const char *path)
}
}
+static void
+test_select_names_cb (BonoboUIHandler *uih, void *user_data, const char *path)
+{
+ ESelectNames *names = E_SELECT_NAMES(e_select_names_new());
+
+ e_select_names_add_section(names, _("To"), "to");
+ e_select_names_add_section(names, _("From"), "from");
+ e_select_names_add_section(names, _("Cc"), "cc");
+ gtk_widget_show(GTK_WIDGET(names));
+}
+
static GnomeUIInfo gnome_toolbar [] = {
GNOMEUIINFO_ITEM_STOCK (N_("New"), N_("Create a new contact"), new_contact_cb, GNOME_STOCK_PIXMAP_NEW),
@@ -486,6 +499,13 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih,
0, 0, print_cb,
(gpointer) view);
+ bonobo_ui_handler_menu_new_item (uih, "/File/TestSelectNames",
+ N_("Test Select Names"),
+ NULL, -1,
+ BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
+ 0, 0, test_select_names_cb,
+ (gpointer) view);
+
bonobo_ui_handler_menu_new_item (uih, "/View/Toggle View",
N_("As _Table"),
NULL, -1,
diff --git a/addressbook/gui/component/e-addressbook-model.c b/addressbook/gui/component/e-addressbook-model.c
index 5d71757b60..5699ad0c00 100644
--- a/addressbook/gui/component/e-addressbook-model.c
+++ b/addressbook/gui/component/e-addressbook-model.c
@@ -15,6 +15,8 @@
#include <gnome.h>
#define PARENT_TYPE e_table_model_get_type()
+ETableModelClass *parent_class;
+
/*
* EAddressbookModel callbacks
* These are the callbacks that define the behavior of our custom model.
@@ -197,15 +199,17 @@ e_addressbook_model_class_init (GtkObjectClass *object_class)
{
ETableModelClass *model_class = (ETableModelClass *) object_class;
+ parent_class = gtk_type_class (PARENT_TYPE);
+
+ object_class->destroy = addressbook_destroy;
+ object_class->set_arg = e_addressbook_model_set_arg;
+ object_class->get_arg = e_addressbook_model_get_arg;
+
gtk_object_add_arg_type ("EAddressbookModel::book", GTK_TYPE_OBJECT,
GTK_ARG_READWRITE, ARG_BOOK);
gtk_object_add_arg_type ("EAddressbookModel::query", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_QUERY);
- object_class->destroy = addressbook_destroy;
- object_class->set_arg = e_addressbook_model_set_arg;
- object_class->get_arg = e_addressbook_model_get_arg;
-
model_class->column_count = addressbook_col_count;
model_class->row_count = addressbook_row_count;
model_class->value_at = addressbook_value_at;
diff --git a/addressbook/gui/component/e-select-names.c b/addressbook/gui/component/e-select-names.c
index 2f2d2abec2..b92c842844 100644
--- a/addressbook/gui/component/e-select-names.c
+++ b/addressbook/gui/component/e-select-names.c
@@ -36,6 +36,7 @@ static void e_select_names_get_arg (GtkObject *object, GtkArg *arg, guint arg_id
static void e_select_names_destroy (GtkObject *object);
static GnomeDialogClass *parent_class = NULL;
+#define PARENT_TYPE gnome_dialog_get_type()
/* The arguments we take */
enum {
@@ -68,7 +69,7 @@ e_select_names_get_type (void)
(GtkClassInitFunc) NULL,
};
- type = gtk_type_unique (gtk_vbox_get_type (), &info);
+ type = gtk_type_unique (PARENT_TYPE, &info);
}
return type;
@@ -81,11 +82,11 @@ e_select_names_class_init (ESelectNamesClass *klass)
object_class = (GtkObjectClass*) klass;
- parent_class = gtk_type_class (gnome_dialog_get_type ());
+ parent_class = gtk_type_class (PARENT_TYPE);
- gtk_object_add_arg_type ("EAddressbookModel::book", GTK_TYPE_OBJECT,
+ gtk_object_add_arg_type ("ESelectNames::book", GTK_TYPE_OBJECT,
GTK_ARG_READWRITE, ARG_BOOK);
- gtk_object_add_arg_type ("EAddressbookModel::query", GTK_TYPE_STRING,
+ gtk_object_add_arg_type ("ESelectNames::query", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_QUERY);
object_class->set_arg = e_select_names_set_arg;
@@ -261,7 +262,7 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id)
return;
}
- table = GTK_TABLE(glade_xml_get_widget (e_select_names->gui, "recipient-table"));
+ table = GTK_TABLE(glade_xml_get_widget (e_select_names->gui, "table-recipients"));
child = g_new(ESelectNamesChild, 1);
diff --git a/addressbook/gui/component/select-names.glade b/addressbook/gui/component/select-names.glade
index 6165eb0b0a..46da911228 100644
--- a/addressbook/gui/component/select-names.glade
+++ b/addressbook/gui/component/select-names.glade
@@ -20,6 +20,7 @@
<widget>
<class>GnomeDialog</class>
<name>dialog-top</name>
+ <visible>False</visible>
<title>Select Names</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 5d71757b60..5699ad0c00 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -15,6 +15,8 @@
#include <gnome.h>
#define PARENT_TYPE e_table_model_get_type()
+ETableModelClass *parent_class;
+
/*
* EAddressbookModel callbacks
* These are the callbacks that define the behavior of our custom model.
@@ -197,15 +199,17 @@ e_addressbook_model_class_init (GtkObjectClass *object_class)
{
ETableModelClass *model_class = (ETableModelClass *) object_class;
+ parent_class = gtk_type_class (PARENT_TYPE);
+
+ object_class->destroy = addressbook_destroy;
+ object_class->set_arg = e_addressbook_model_set_arg;
+ object_class->get_arg = e_addressbook_model_get_arg;
+
gtk_object_add_arg_type ("EAddressbookModel::book", GTK_TYPE_OBJECT,
GTK_ARG_READWRITE, ARG_BOOK);
gtk_object_add_arg_type ("EAddressbookModel::query", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_QUERY);
- object_class->destroy = addressbook_destroy;
- object_class->set_arg = e_addressbook_model_set_arg;
- object_class->get_arg = e_addressbook_model_get_arg;
-
model_class->column_count = addressbook_col_count;
model_class->row_count = addressbook_row_count;
model_class->value_at = addressbook_value_at;