aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2001-02-06 05:23:28 +0800
committerChris Lahey <clahey@src.gnome.org>2001-02-06 05:23:28 +0800
commit6240b1cdde1fe0f00f1ffce9295c6e9b2adcc817 (patch)
tree63b39d850bab3ac7d4b1bc2ad2fa6a4704f1c33b /addressbook
parentfdb765da597c1929ffc8d5275e74b78f5624fe60 (diff)
downloadgsoc2013-evolution-6240b1cdde1fe0f00f1ffce9295c6e9b2adcc817.tar
gsoc2013-evolution-6240b1cdde1fe0f00f1ffce9295c6e9b2adcc817.tar.gz
gsoc2013-evolution-6240b1cdde1fe0f00f1ffce9295c6e9b2adcc817.tar.bz2
gsoc2013-evolution-6240b1cdde1fe0f00f1ffce9295c6e9b2adcc817.tar.lz
gsoc2013-evolution-6240b1cdde1fe0f00f1ffce9295c6e9b2adcc817.tar.xz
gsoc2013-evolution-6240b1cdde1fe0f00f1ffce9295c6e9b2adcc817.tar.zst
gsoc2013-evolution-6240b1cdde1fe0f00f1ffce9295c6e9b2adcc817.zip
Added gal-view-factory-minicard.c, gal-view-factory-minicard.h,
2001-02-05 Christopher James Lahey <clahey@helixcode.com> * gui/widgets/Makefile.am (libeminicard_a_SOURCES): Added gal-view-factory-minicard.c, gal-view-factory-minicard.h, gal-view-minicard.c, and gal-view-minicard.h. * gui/widgets/gal-view-factory-minicard.c, gui/widgets/gal-view-factory-minicard.h, gui/widgets/gal-view-minicard.c, and gui/widgets/gal-view-minicard.h: New classes for minicard view type. * gui/widgets/e-addressbook-view.c: Deploy gal-view stuff properly. svn path=/trunk/; revision=7987
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog13
-rw-r--r--addressbook/gui/widgets/Makefile.am6
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c23
-rw-r--r--addressbook/gui/widgets/gal-view-factory-minicard.c119
-rw-r--r--addressbook/gui/widgets/gal-view-factory-minicard.h35
-rw-r--r--addressbook/gui/widgets/gal-view-minicard.c154
-rw-r--r--addressbook/gui/widgets/gal-view-minicard.h38
7 files changed, 380 insertions, 8 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 57b6c6be5a..9999ef6d31 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,18 @@
2001-02-05 Christopher James Lahey <clahey@helixcode.com>
+ * gui/widgets/Makefile.am (libeminicard_a_SOURCES): Added
+ gal-view-factory-minicard.c, gal-view-factory-minicard.h,
+ gal-view-minicard.c, and gal-view-minicard.h.
+
+ * gui/widgets/gal-view-factory-minicard.c,
+ gui/widgets/gal-view-factory-minicard.h,
+ gui/widgets/gal-view-minicard.c, and
+ gui/widgets/gal-view-minicard.h: New classes for minicard view
+ type.
+
+ * gui/widgets/e-addressbook-view.c: Deploy gal-view stuff
+ properly.
+
* backend/ebook/e-card.c (e_card_get_vcard): Make the Note field
be quoted printable.
diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am
index 1d8fe2df52..9b5166eaf0 100644
--- a/addressbook/gui/widgets/Makefile.am
+++ b/addressbook/gui/widgets/Makefile.am
@@ -31,7 +31,11 @@ libeminicard_a_SOURCES = \
e-minicard-widget.c \
e-minicard-widget.h \
e-minicard.c \
- e-minicard.h
+ e-minicard.h \
+ gal-view-factory-minicard.c \
+ gal-view-factory-minicard.h \
+ gal-view-minicard.c \
+ gal-view-minicard.h
noinst_PROGRAMS = \
minicard-widget-test \
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index cde705427a..9a322a8cbf 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -30,7 +30,12 @@
#include <gal/widgets/e-scroll-frame.h>
#include <gal/widgets/e-popup-menu.h>
#include "widgets/menus/gal-view-menus.h"
+
#include <gal/menus/gal-view-factory-etable.h>
+#include <gal/menus/gal-view-etable.h>
+
+#include "gal-view-factory-minicard.h"
+#include "gal-view-minicard.h"
#include "e-addressbook-model.h"
@@ -787,7 +792,13 @@ display_view(GalViewCollection *collection,
GalView *view,
gpointer data)
{
- g_print ("title: %s\n", gal_view_get_title(view));
+ EAddressbookView *address_view = data;
+ if (GAL_IS_VIEW_ETABLE(view)) {
+ change_view_type (address_view, E_ADDRESSBOOK_VIEW_TABLE);
+ e_table_set_state_object(e_table_scrolled_get_table(E_TABLE_SCROLLED(address_view->widget)), GAL_VIEW_ETABLE(view)->state);
+ } else if (GAL_IS_VIEW_MINICARD(view)) {
+ change_view_type (address_view, E_ADDRESSBOOK_VIEW_MINICARD);
+ }
}
void
@@ -812,18 +823,16 @@ e_addressbook_view_setup_menus (EAddressbookView *view,
gal_view_collection_add_factory(collection, factory);
gtk_object_sink(GTK_OBJECT(factory));
- gal_view_collection_load(collection);
-
-#if 0
- factory = e_minicard_view_factory_new();
+ factory = gal_view_factory_minicard_new();
gal_view_collection_add_factory(collection, factory);
gtk_object_sink(GTK_OBJECT(factory));
-#endif
+
+ gal_view_collection_load(collection);
views = gal_view_menus_new(collection);
gal_view_menus_apply(views, uic, NULL); /* This function probably needs to sink the views object. */
gtk_signal_connect(GTK_OBJECT(collection), "display_view",
- display_view, NULL);
+ display_view, view);
/* gtk_object_sink(GTK_OBJECT(views)); */
gtk_object_sink(GTK_OBJECT(collection));
diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.c b/addressbook/gui/widgets/gal-view-factory-minicard.c
new file mode 100644
index 0000000000..1d10b71f78
--- /dev/null
+++ b/addressbook/gui/widgets/gal-view-factory-minicard.c
@@ -0,0 +1,119 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * gal-view-factory-minicard.c: A View Factory
+ *
+ * Authors:
+ * Chris Lahey <clahey@ximian.com>
+ *
+ * (C) 2000, 2001 Ximian, Inc.
+ */
+#include <config.h>
+#include "gal-view-factory-minicard.h"
+#include "gal-view-minicard.h"
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-i18n.h>
+
+#define GVFE_CLASS(e) ((GalViewFactoryMinicardClass *)((GtkObject *)e)->klass)
+
+#define PARENT_TYPE gal_view_factory_get_type ()
+
+static GalViewFactoryClass *gal_view_factory_minicard_parent_class;
+
+static const char *
+gal_view_factory_minicard_get_title (GalViewFactory *factory)
+{
+ return _("Card View");
+}
+
+static GalView *
+gal_view_factory_minicard_new_view (GalViewFactory *factory,
+ const char *name)
+{
+ return gal_view_minicard_new(name);
+}
+
+static const char *
+gal_view_factory_minicard_get_type_code (GalViewFactory *factory)
+{
+ return "minicard";
+}
+
+static void
+gal_view_factory_minicard_destroy (GtkObject *object)
+{
+#if 0
+ GalViewFactoryMinicard *factory = GAL_VIEW_FACTORY_MINICARD(object);
+#endif
+}
+
+static void
+gal_view_factory_minicard_class_init (GtkObjectClass *object_class)
+{
+ GalViewFactoryClass *view_factory_class = GAL_VIEW_FACTORY_CLASS(object_class);
+ gal_view_factory_minicard_parent_class = gtk_type_class (PARENT_TYPE);
+
+ view_factory_class->get_title = gal_view_factory_minicard_get_title;
+ view_factory_class->new_view = gal_view_factory_minicard_new_view;
+ view_factory_class->get_type_code = gal_view_factory_minicard_get_type_code;
+
+ object_class->destroy = gal_view_factory_minicard_destroy;
+}
+
+static void
+gal_view_factory_minicard_init (GalViewFactoryMinicard *factory)
+{
+}
+
+/**
+ * gal_view_minicard_new
+ *
+ * A new GalViewFactory for creating Minicard views. Create one of
+ * these and pass it to GalViewCollection for use.
+ *
+ * Returns: The new GalViewFactoryMinicard.
+ */
+GalViewFactory *
+gal_view_factory_minicard_new (void)
+{
+ return gal_view_factory_minicard_construct (gtk_type_new (gal_view_factory_minicard_get_type ()));
+}
+
+/**
+ * gal_view_minicard_construct
+ * @factory: The factory to construct
+ *
+ * constructs the GalViewFactoryMinicard. To be used by subclasses and
+ * language bindings.
+ *
+ * Returns: The GalViewFactoryMinicard.
+ */
+GalViewFactory *
+gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory)
+{
+ return GAL_VIEW_FACTORY(factory);
+}
+
+GtkType
+gal_view_factory_minicard_get_type (void)
+{
+ static guint type = 0;
+
+ if (!type)
+ {
+ GtkTypeInfo info =
+ {
+ "GalViewFactoryMinicard",
+ sizeof (GalViewFactoryMinicard),
+ sizeof (GalViewFactoryMinicardClass),
+ (GtkClassInitFunc) gal_view_factory_minicard_class_init,
+ (GtkObjectInitFunc) gal_view_factory_minicard_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ type = gtk_type_unique (PARENT_TYPE, &info);
+ }
+
+ return type;
+}
diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.h b/addressbook/gui/widgets/gal-view-factory-minicard.h
new file mode 100644
index 0000000000..3816fdba46
--- /dev/null
+++ b/addressbook/gui/widgets/gal-view-factory-minicard.h
@@ -0,0 +1,35 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * gal-view-factory-minicard.c: A View Factory
+ *
+ * Authors:
+ * Chris Lahey <clahey@ximian.com>
+ *
+ * (C) 2000, 2001 Ximian, Inc.
+ */
+#ifndef _GAL_VIEW_FACTORY_MINICARD_H_
+#define _GAL_VIEW_FACTORY_MINICARD_H_
+
+#include <gtk/gtkobject.h>
+#include <gal/menus/gal-view-factory.h>
+
+#define GAL_VIEW_FACTORY_MINICARD_TYPE (gal_view_factory_minicard_get_type ())
+#define GAL_VIEW_FACTORY_MINICARD(o) (GTK_CHECK_CAST ((o), GAL_VIEW_FACTORY_MINICARD_TYPE, GalViewFactoryMinicard))
+#define GAL_VIEW_FACTORY_MINICARD_CLASS(k) (GTK_CHECK_CLASS_CAST((k), GAL_VIEW_FACTORY_MINICARD_TYPE, GalViewFactoryMinicardClass))
+#define GAL_IS_VIEW_FACTORY_MINICARD(o) (GTK_CHECK_TYPE ((o), GAL_VIEW_FACTORY_MINICARD_TYPE))
+#define GAL_IS_VIEW_FACTORY_MINICARD_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GAL_VIEW_FACTORY_MINICARD_TYPE))
+
+typedef struct {
+ GalViewFactory base;
+} GalViewFactoryMinicard;
+
+typedef struct {
+ GalViewFactoryClass parent_class;
+} GalViewFactoryMinicardClass;
+
+/* Standard functions */
+GtkType gal_view_factory_minicard_get_type (void);
+GalViewFactory *gal_view_factory_minicard_new (void);
+GalViewFactory *gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory);
+
+#endif /* _GAL_VIEW_FACTORY_MINICARD_H_ */
diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c
new file mode 100644
index 0000000000..4cfa71f470
--- /dev/null
+++ b/addressbook/gui/widgets/gal-view-minicard.c
@@ -0,0 +1,154 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * gal-view-minicard.c: An Minicard View
+ *
+ * Authors:
+ * Chris Lahey <clahey@ximian.com>
+ *
+ * (C) 2000, 2001 Ximian, Inc.
+ */
+#include <config.h>
+#include "gal-view-minicard.h"
+
+#define PARENT_TYPE gal_view_get_type ()
+
+static GalViewClass *gal_view_minicard_parent_class;
+
+static void
+gal_view_minicard_edit (GalView *view)
+{
+ /* GalViewMinicard *minicard_view = GAL_VIEW_MINICARD(view); */
+}
+
+static void
+gal_view_minicard_load (GalView *view,
+ const char *filename)
+{
+}
+
+static void
+gal_view_minicard_save (GalView *view,
+ const char *filename)
+{
+}
+
+static const char *
+gal_view_minicard_get_title (GalView *view)
+{
+ return GAL_VIEW_MINICARD(view)->title;
+}
+
+static void
+gal_view_minicard_set_title (GalView *view,
+ const char *title)
+{
+ g_free(GAL_VIEW_MINICARD(view)->title);
+ GAL_VIEW_MINICARD(view)->title = g_strdup(title);
+}
+
+static const char *
+gal_view_minicard_get_type_code (GalView *view)
+{
+ return "minicard";
+}
+
+static GalView *
+gal_view_minicard_clone (GalView *view)
+{
+ GalViewMinicard *gve, *new;
+
+ gve = GAL_VIEW_MINICARD(view);
+
+ new = gtk_type_new (gal_view_minicard_get_type ());
+ new->title = g_strdup (gve->title);
+
+ return GAL_VIEW(new);
+}
+
+static void
+gal_view_minicard_destroy (GtkObject *object)
+{
+ GalViewMinicard *view = GAL_VIEW_MINICARD(object);
+ g_free(view->title);
+}
+
+static void
+gal_view_minicard_class_init (GtkObjectClass *object_class)
+{
+ GalViewClass *gal_view_class = GAL_VIEW_CLASS(object_class);
+ gal_view_minicard_parent_class = gtk_type_class (PARENT_TYPE);
+
+ gal_view_class->edit = gal_view_minicard_edit ;
+ gal_view_class->load = gal_view_minicard_load ;
+ gal_view_class->save = gal_view_minicard_save ;
+ gal_view_class->get_title = gal_view_minicard_get_title ;
+ gal_view_class->set_title = gal_view_minicard_set_title ;
+ gal_view_class->get_type_code = gal_view_minicard_get_type_code;
+ gal_view_class->clone = gal_view_minicard_clone ;
+
+ object_class->destroy = gal_view_minicard_destroy ;
+}
+
+static void
+gal_view_minicard_init (GalViewMinicard *gve)
+{
+ gve->title = NULL;
+}
+
+/**
+ * gal_view_minicard_new
+ * @title: The name of the new view.
+ *
+ * Returns a new GalViewMinicard. This is primarily for use by
+ * GalViewFactoryMinicard.
+ *
+ * Returns: The new GalViewMinicard.
+ */
+GalView *
+gal_view_minicard_new (const gchar *title)
+{
+ return gal_view_minicard_construct (gtk_type_new (gal_view_minicard_get_type ()), title);
+}
+
+/**
+ * gal_view_minicard_construct
+ * @view: The view to construct.
+ * @title: The name of the new view.
+ *
+ * constructs the GalViewMinicard. To be used by subclasses and
+ * language bindings.
+ *
+ * Returns: The GalViewMinicard.
+ */
+GalView *
+gal_view_minicard_construct (GalViewMinicard *view,
+ const gchar *title)
+{
+ view->title = g_strdup(title);
+ return GAL_VIEW(view);
+}
+
+GtkType
+gal_view_minicard_get_type (void)
+{
+ static guint type = 0;
+
+ if (!type)
+ {
+ GtkTypeInfo info =
+ {
+ "GalViewMinicard",
+ sizeof (GalViewMinicard),
+ sizeof (GalViewMinicardClass),
+ (GtkClassInitFunc) gal_view_minicard_class_init,
+ (GtkObjectInitFunc) gal_view_minicard_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ type = gtk_type_unique (PARENT_TYPE, &info);
+ }
+
+ return type;
+}
diff --git a/addressbook/gui/widgets/gal-view-minicard.h b/addressbook/gui/widgets/gal-view-minicard.h
new file mode 100644
index 0000000000..fef98141f3
--- /dev/null
+++ b/addressbook/gui/widgets/gal-view-minicard.h
@@ -0,0 +1,38 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * gal-view-minicard.h: An Minicard View
+ *
+ * Authors:
+ * Chris Lahey <clahey@ximian.com>
+ *
+ * (C) 2000, 2001 Ximian, Inc.
+ */
+#ifndef _GAL_VIEW_MINICARD_H_
+#define _GAL_VIEW_MINICARD_H_
+
+#include <gtk/gtkobject.h>
+#include <gal/menus/gal-view.h>
+
+#define GAL_VIEW_MINICARD_TYPE (gal_view_minicard_get_type ())
+#define GAL_VIEW_MINICARD(o) (GTK_CHECK_CAST ((o), GAL_VIEW_MINICARD_TYPE, GalViewMinicard))
+#define GAL_VIEW_MINICARD_CLASS(k) (GTK_CHECK_CLASS_CAST((k), GAL_VIEW_MINICARD_TYPE, GalViewMinicardClass))
+#define GAL_IS_VIEW_MINICARD(o) (GTK_CHECK_TYPE ((o), GAL_VIEW_MINICARD_TYPE))
+#define GAL_IS_VIEW_MINICARD_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GAL_VIEW_MINICARD_TYPE))
+
+typedef struct {
+ GalView base;
+
+ char *title;
+} GalViewMinicard;
+
+typedef struct {
+ GalViewClass parent_class;
+} GalViewMinicardClass;
+
+/* Standard functions */
+GtkType gal_view_minicard_get_type (void);
+GalView *gal_view_minicard_new (const gchar *title);
+GalView *gal_view_minicard_construct (GalViewMinicard *view,
+ const gchar *title);
+
+#endif /* _GAL_VIEW_MINICARD_H_ */