evolution r36446 - in branches/kill-bonobo: . addressbook/gui/component addressbook/gui/widgets calendar calendar/gui calendar/gui/dialogs calendar/modules doc/reference/shell/tmpl shell ui
- From: mbarnes svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r36446 - in branches/kill-bonobo: . addressbook/gui/component addressbook/gui/widgets calendar calendar/gui calendar/gui/dialogs calendar/modules doc/reference/shell/tmpl shell ui
- Date: Wed, 24 Sep 2008 22:53:31 +0000 (UTC)
Author: mbarnes
Date: Wed Sep 24 22:53:30 2008
New Revision: 36446
URL: http://svn.gnome.org/viewvc/evolution?rev=36446&view=rev
Log:
Saving progress.
Experimenting with directory layout.
Added:
branches/kill-bonobo/addressbook/gui/component/e-book-shell-content.c
branches/kill-bonobo/addressbook/gui/component/e-book-shell-content.h
branches/kill-bonobo/calendar/gui/e-memo-preview.c (contents, props changed)
- copied, changed from r36307, /branches/kill-bonobo/calendar/gui/e-cal-component-memo-preview.c
branches/kill-bonobo/calendar/gui/e-memo-preview.h (contents, props changed)
- copied, changed from r36307, /branches/kill-bonobo/calendar/gui/e-cal-component-memo-preview.h
branches/kill-bonobo/calendar/modules/
branches/kill-bonobo/calendar/modules/e-cal-shell-module.c (props changed)
- copied unchanged from r36311, /branches/kill-bonobo/calendar/gui/e-cal-shell-module.c
branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.c (props changed)
- copied unchanged from r36317, /branches/kill-bonobo/calendar/gui/e-cal-shell-sidebar.c
branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.h (props changed)
- copied unchanged from r36317, /branches/kill-bonobo/calendar/gui/e-cal-shell-sidebar.h
branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.c (props changed)
- copied unchanged from r36304, /branches/kill-bonobo/calendar/gui/e-cal-shell-view-actions.c
branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.h (props changed)
- copied unchanged from r36304, /branches/kill-bonobo/calendar/gui/e-cal-shell-view-actions.h
branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c (contents, props changed)
- copied, changed from r36311, /branches/kill-bonobo/calendar/gui/e-cal-shell-view-private.c
branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.h (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-cal-shell-view-private.h
branches/kill-bonobo/calendar/modules/e-cal-shell-view.c (contents, props changed)
- copied, changed from r36359, /branches/kill-bonobo/calendar/gui/e-cal-shell-view.c
branches/kill-bonobo/calendar/modules/e-cal-shell-view.h (props changed)
- copied unchanged from r36359, /branches/kill-bonobo/calendar/gui/e-cal-shell-view.h
branches/kill-bonobo/calendar/modules/e-memo-shell-content.c (contents, props changed)
branches/kill-bonobo/calendar/modules/e-memo-shell-content.h (contents, props changed)
branches/kill-bonobo/calendar/modules/e-memo-shell-module.c (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-module.c
branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-sidebar.c
branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.h (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-sidebar.h
branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-view-actions.c
branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.h (props changed)
- copied unchanged from r36304, /branches/kill-bonobo/calendar/gui/e-memo-shell-view-actions.h
branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-view-private.c
branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.h (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-view-private.h
branches/kill-bonobo/calendar/modules/e-memo-shell-view.c (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-view.c
branches/kill-bonobo/calendar/modules/e-memo-shell-view.h (contents, props changed)
- copied, changed from r36311, /branches/kill-bonobo/calendar/gui/e-memo-shell-view.h
branches/kill-bonobo/calendar/modules/e-task-shell-content.c (contents, props changed)
branches/kill-bonobo/calendar/modules/e-task-shell-content.h (contents, props changed)
branches/kill-bonobo/calendar/modules/e-task-shell-module.c (contents, props changed)
- copied, changed from r36311, /branches/kill-bonobo/calendar/gui/e-task-shell-module.c
branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-task-shell-sidebar.c
branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.h (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-task-shell-sidebar.h
branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c (contents, props changed)
- copied, changed from r36304, /branches/kill-bonobo/calendar/gui/e-task-shell-view-actions.c
branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.h (props changed)
- copied unchanged from r36304, /branches/kill-bonobo/calendar/gui/e-task-shell-view-actions.h
branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c (contents, props changed)
- copied, changed from r36311, /branches/kill-bonobo/calendar/gui/e-task-shell-view-private.c
branches/kill-bonobo/calendar/modules/e-task-shell-view-private.h (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-task-shell-view-private.h
branches/kill-bonobo/calendar/modules/e-task-shell-view.c (contents, props changed)
- copied, changed from r36317, /branches/kill-bonobo/calendar/gui/e-task-shell-view.c
branches/kill-bonobo/calendar/modules/e-task-shell-view.h (contents, props changed)
- copied, changed from r36311, /branches/kill-bonobo/calendar/gui/e-task-shell-view.h
Removed:
branches/kill-bonobo/calendar/gui/e-cal-component-memo-preview.c
branches/kill-bonobo/calendar/gui/e-cal-component-memo-preview.h
branches/kill-bonobo/calendar/gui/e-cal-shell-module.c
branches/kill-bonobo/calendar/gui/e-cal-shell-sidebar.c
branches/kill-bonobo/calendar/gui/e-cal-shell-sidebar.h
branches/kill-bonobo/calendar/gui/e-cal-shell-view-actions.c
branches/kill-bonobo/calendar/gui/e-cal-shell-view-actions.h
branches/kill-bonobo/calendar/gui/e-cal-shell-view-private.c
branches/kill-bonobo/calendar/gui/e-cal-shell-view-private.h
branches/kill-bonobo/calendar/gui/e-cal-shell-view.c
branches/kill-bonobo/calendar/gui/e-cal-shell-view.h
branches/kill-bonobo/calendar/gui/e-memo-shell-module.c
branches/kill-bonobo/calendar/gui/e-memo-shell-sidebar.c
branches/kill-bonobo/calendar/gui/e-memo-shell-sidebar.h
branches/kill-bonobo/calendar/gui/e-memo-shell-view-actions.c
branches/kill-bonobo/calendar/gui/e-memo-shell-view-actions.h
branches/kill-bonobo/calendar/gui/e-memo-shell-view-private.c
branches/kill-bonobo/calendar/gui/e-memo-shell-view-private.h
branches/kill-bonobo/calendar/gui/e-memo-shell-view.c
branches/kill-bonobo/calendar/gui/e-memo-shell-view.h
branches/kill-bonobo/calendar/gui/e-task-shell-module.c
branches/kill-bonobo/calendar/gui/e-task-shell-sidebar.c
branches/kill-bonobo/calendar/gui/e-task-shell-sidebar.h
branches/kill-bonobo/calendar/gui/e-task-shell-view-actions.c
branches/kill-bonobo/calendar/gui/e-task-shell-view-actions.h
branches/kill-bonobo/calendar/gui/e-task-shell-view-private.c
branches/kill-bonobo/calendar/gui/e-task-shell-view-private.h
branches/kill-bonobo/calendar/gui/e-task-shell-view.c
branches/kill-bonobo/calendar/gui/e-task-shell-view.h
Modified:
branches/kill-bonobo/Makefile.am
branches/kill-bonobo/addressbook/gui/component/Makefile.am
branches/kill-bonobo/addressbook/gui/component/e-book-shell-sidebar.c
branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c
branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.c
branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.h
branches/kill-bonobo/addressbook/gui/component/e-book-shell-view.c
branches/kill-bonobo/addressbook/gui/widgets/e-addressbook-view.c
branches/kill-bonobo/calendar/Makefile.am
branches/kill-bonobo/calendar/gui/Makefile.am
branches/kill-bonobo/calendar/gui/calendar-component.c
branches/kill-bonobo/calendar/gui/comp-editor-factory.c
branches/kill-bonobo/calendar/gui/dialogs/comp-editor.c
branches/kill-bonobo/calendar/gui/dialogs/comp-editor.h
branches/kill-bonobo/calendar/gui/e-cal-model.c
branches/kill-bonobo/calendar/gui/e-calendar-selector.c
branches/kill-bonobo/calendar/gui/e-calendar-table-config.c
branches/kill-bonobo/calendar/gui/e-calendar-table-config.h
branches/kill-bonobo/calendar/gui/e-calendar-table.c
branches/kill-bonobo/calendar/gui/e-calendar-table.h
branches/kill-bonobo/calendar/gui/e-calendar-view.c
branches/kill-bonobo/calendar/gui/e-meeting-time-sel.c
branches/kill-bonobo/calendar/gui/e-memo-table.c
branches/kill-bonobo/calendar/gui/e-memo-table.h
branches/kill-bonobo/calendar/gui/e-memos.c
branches/kill-bonobo/calendar/gui/e-select-names-renderer.c
branches/kill-bonobo/calendar/gui/e-tasks.c
branches/kill-bonobo/calendar/gui/gnome-cal.c
branches/kill-bonobo/calendar/gui/main.c
branches/kill-bonobo/calendar/gui/memos-component.c
branches/kill-bonobo/calendar/gui/tasks-component.c
branches/kill-bonobo/calendar/gui/tasks-control.c
branches/kill-bonobo/configure.in
branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-window.sgml
branches/kill-bonobo/doc/reference/shell/tmpl/eshell-unused.sgml
branches/kill-bonobo/shell/e-shell-content.c
branches/kill-bonobo/shell/e-shell-content.h
branches/kill-bonobo/shell/e-shell-module.h
branches/kill-bonobo/shell/e-shell-sidebar.c
branches/kill-bonobo/shell/e-shell-sidebar.h
branches/kill-bonobo/shell/e-shell-taskbar.h
branches/kill-bonobo/shell/e-shell-view.c
branches/kill-bonobo/shell/e-shell-view.h
branches/kill-bonobo/shell/e-shell-window-actions.c
branches/kill-bonobo/shell/e-shell-window-private.c
branches/kill-bonobo/shell/e-shell-window.c
branches/kill-bonobo/shell/e-shell-window.h
branches/kill-bonobo/shell/e-shell.h
branches/kill-bonobo/ui/evolution-calendars.ui
branches/kill-bonobo/ui/evolution-memos.ui
branches/kill-bonobo/ui/evolution-tasks.ui
Modified: branches/kill-bonobo/Makefile.am
==============================================================================
--- branches/kill-bonobo/Makefile.am (original)
+++ branches/kill-bonobo/Makefile.am Wed Sep 24 22:53:30 2008
@@ -64,6 +64,7 @@
shell \
$(SMIME_DIR) \
addressbook \
+ calendar \
art \
doc \
ui \
Modified: branches/kill-bonobo/addressbook/gui/component/Makefile.am
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/Makefile.am (original)
+++ branches/kill-bonobo/addressbook/gui/component/Makefile.am Wed Sep 24 22:53:30 2008
@@ -34,6 +34,8 @@
autocompletion-config.h \
addressbook.c \
addressbook.h \
+ e-book-shell-content.c \
+ e-book-shell-content.h \
e-book-shell-module.c \
e-book-shell-sidebar.c \
e-book-shell-sidebar.h \
Added: branches/kill-bonobo/addressbook/gui/component/e-book-shell-content.c
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-content.c Wed Sep 24 22:53:30 2008
@@ -0,0 +1,435 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-book-shell-content.c
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "e-book-shell-content.h"
+
+#include <glib/gi18n.h>
+#include <e-util/gconf-bridge.h>
+
+#define E_BOOK_SHELL_CONTENT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_BOOK_SHELL_CONTENT, EBookShellContentPrivate))
+
+struct _EBookShellContentPrivate {
+ GtkWidget *paned;
+ GtkWidget *notebook;
+ GtkWidget *preview;
+};
+
+enum {
+ PROP_0,
+ PROP_CURRENT_VIEW,
+ PROP_PREVIEW_CONTACT,
+ PROP_PREVIEW_VISIBLE
+};
+
+static gpointer parent_class;
+
+static void
+book_shell_content_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_CURRENT_VIEW:
+ e_book_shell_content_set_current_view (
+ E_BOOK_SHELL_CONTENT (object),
+ g_value_get_object (value));
+ return;
+
+ case PROP_PREVIEW_CONTACT:
+ e_book_shell_content_set_preview_contact (
+ E_BOOK_SHELL_CONTENT (object),
+ g_value_get_object (value));
+ return;
+
+ case PROP_PREVIEW_VISIBLE:
+ e_book_shell_content_set_preview_visible (
+ E_BOOK_SHELL_CONTENT (object),
+ g_value_get_boolean (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+book_shell_content_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_CURRENT_VIEW:
+ g_value_set_object (
+ value, e_book_shell_content_get_current_view (
+ E_BOOK_SHELL_CONTENT (object)));
+ return;
+
+ case PROP_PREVIEW_CONTACT:
+ g_value_set_object (
+ value, e_book_shell_content_get_preview_contact (
+ E_BOOK_SHELL_CONTENT (object)));
+ return;
+
+ case PROP_PREVIEW_VISIBLE:
+ g_value_set_boolean (
+ value, e_book_shell_content_get_preview_visible (
+ E_BOOK_SHELL_CONTENT (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+book_shell_content_dispose (GObject *object)
+{
+ EBookShellContentPrivate *priv;
+
+ priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (object);
+
+ if (priv->paned != NULL) {
+ g_object_unref (priv->paned);
+ priv->paned = NULL;
+ }
+
+ if (priv->notebook != NULL) {
+ g_object_unref (priv->notebook);
+ priv->notebook = NULL;
+ }
+
+ if (priv->preview != NULL) {
+ g_object_unref (priv->preview);
+ priv->preview = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+book_shell_content_constructed (GObject *object)
+{
+ EBookShellContentPrivate *priv;
+ GConfBridge *bridge;
+ GtkWidget *container;
+ GtkWidget *widget;
+ const gchar *key;
+
+ priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (object);
+
+ /* Chain up to parent's constructed() method. */
+ G_OBJECT_CLASS (parent_class)->constructed (object);
+
+ container = GTK_WIDGET (object);
+
+ widget = gtk_vpaned_new ();
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ priv->paned = g_object_ref (widget);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ widget = gtk_notebook_new ();
+ gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
+ gtk_notebook_set_show_border (GTK_NOTEBOOK (widget), FALSE);
+ gtk_paned_add1 (GTK_PANED (container), widget);
+ priv->notebook = g_object_ref (widget);
+ gtk_widget_show (widget);
+
+ widget = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (
+ GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
+ gtk_paned_add2 (GTK_PANED (container), widget);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ widget = eab_contact_display_new ();
+ eab_contact_display_set_mode (
+ EAB_CONTACT_DISPLAY (widget),
+ EAB_CONTACT_DISPLAY_RENDER_NORMAL);
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ priv->preview = g_object_ref (widget);
+ gtk_widget_show (widget);
+
+ /* Bind GObject properties to GConf keys. */
+
+ bridge = gconf_bridge_get ();
+
+ object = G_OBJECT (priv->paned);
+ key = "/apps/evolution/addressbook/display/vpane_position";
+ gconf_bridge_bind_property_delayed (bridge, key, object, "position");
+}
+
+static void
+book_shell_content_class_init (EBookShellContentClass *class)
+{
+ GObjectClass *object_class;
+
+ parent_class = g_type_class_peek_parent (class);
+ g_type_class_add_private (class, sizeof (EBookShellContentPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = book_shell_content_set_property;
+ object_class->get_property = book_shell_content_get_property;
+ object_class->dispose = book_shell_content_dispose;
+ object_class->constructed = book_shell_content_constructed;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_CURRENT_VIEW,
+ g_param_spec_object (
+ "current-view",
+ _("Current View"),
+ _("The currently selected address book view"),
+ E_TYPE_ADDRESSBOOK_VIEW,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_PREVIEW_CONTACT,
+ g_param_spec_object (
+ "preview-contact",
+ _("Previewed Contact"),
+ _("The contact being shown in the preview pane"),
+ E_TYPE_CONTACT,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_PREVIEW_VISIBLE,
+ g_param_spec_boolean (
+ "preview-visible",
+ _("Preview is Visible"),
+ _("Whether the preview pane is visible"),
+ TRUE,
+ G_PARAM_READWRITE));
+}
+
+static void
+book_shell_content_init (EBookShellContent *book_shell_content)
+{
+ book_shell_content->priv =
+ E_BOOK_SHELL_CONTENT_GET_PRIVATE (book_shell_content);
+
+ /* Postpone widget construction until we have a shell view. */
+}
+
+GType
+e_book_shell_content_get_type (void)
+{
+ static GType type = 0;
+
+ if (G_UNLIKELY (type == 0)) {
+ static const GTypeInfo type_info = {
+ sizeof (EBookShellContentClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) book_shell_content_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class_data */
+ sizeof (EBookShellContent),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) book_shell_content_init,
+ NULL /* value_table */
+ };
+
+ type = g_type_register_static (
+ E_TYPE_SHELL_CONTENT, "EBookShellContent",
+ &type_info, 0);
+ }
+
+ return type;
+}
+
+GtkWidget *
+e_book_shell_content_new (EShellView *shell_view)
+{
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
+
+ return g_object_new (
+ E_TYPE_BOOK_SHELL_CONTENT,
+ "shell-view", shell_view, NULL);
+}
+
+void
+e_book_shell_content_insert_view (EBookShellContent *book_shell_content,
+ EAddressbookView *addressbook_view)
+{
+ GtkNotebook *notebook;
+ GtkWidget *child;
+
+ g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content));
+ g_return_if_fail (E_IS_ADDRESSBOOK_VIEW (addressbook_view));
+
+ notebook = GTK_NOTEBOOK (book_shell_content->priv->notebook);
+ child = GTK_WIDGET (addressbook_view);
+ gtk_notebook_append_page (notebook, child, NULL);
+}
+
+void
+e_book_shell_content_remove_view (EBookShellContent *book_shell_content,
+ EAddressbookView *addressbook_view)
+{
+ GtkNotebook *notebook;
+ GtkWidget *child;
+ gint page_num;
+
+ g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content));
+ g_return_if_fail (E_IS_ADDRESSBOOK_VIEW (addressbook_view));
+
+ notebook = GTK_NOTEBOOK (book_shell_content->priv->notebook);
+ child = GTK_WIDGET (addressbook_view);
+ page_num = gtk_notebook_page_num (notebook, child);
+ g_return_if_fail (page_num >= 0);
+
+ gtk_notebook_remove_page (notebook, page_num);
+}
+
+EAddressbookView *
+e_book_shell_content_get_current_view (EBookShellContent *book_shell_content)
+{
+ GtkNotebook *notebook;
+ GtkWidget *widget;
+ gint page_num;
+
+ g_return_val_if_fail (
+ E_IS_BOOK_SHELL_CONTENT (book_shell_content), NULL);
+
+ notebook = GTK_NOTEBOOK (book_shell_content->priv->notebook);
+ page_num = gtk_notebook_get_current_page (notebook);
+ widget = gtk_notebook_get_nth_page (notebook, page_num);
+ g_return_val_if_fail (widget != NULL, NULL);
+
+ return E_ADDRESSBOOK_VIEW (widget);
+}
+
+void
+e_book_shell_content_set_current_view (EBookShellContent *book_shell_content,
+ EAddressbookView *addressbook_view)
+{
+ GtkNotebook *notebook;
+ GtkWidget *child;
+ gint page_num;
+
+ g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content));
+ g_return_if_fail (E_IS_ADDRESSBOOK_VIEW (addressbook_view));
+
+ notebook = GTK_NOTEBOOK (book_shell_content->priv->notebook);
+ child = GTK_WIDGET (addressbook_view);
+ page_num = gtk_notebook_page_num (notebook, child);
+ g_return_if_fail (page_num >= 0);
+
+ gtk_notebook_set_current_page (notebook, page_num);
+ g_object_notify (G_OBJECT (book_shell_content), "current-view");
+}
+
+EContact *
+e_book_shell_content_get_preview_contact (EBookShellContent *book_shell_content)
+{
+ EABContactDisplay *display;
+
+ g_return_val_if_fail (
+ E_IS_BOOK_SHELL_CONTENT (book_shell_content), NULL);
+
+ display = EAB_CONTACT_DISPLAY (book_shell_content->priv->preview);
+
+ return eab_contact_display_get_contact (display);
+}
+
+void
+e_book_shell_content_set_preview_contact (EBookShellContent *book_shell_content,
+ EContact *preview_contact)
+{
+ EABContactDisplay *display;
+
+ g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content));
+
+ display = EAB_CONTACT_DISPLAY (book_shell_content->priv->preview);
+
+ eab_contact_display_set_contact (display, preview_contact);
+ g_object_notify (G_OBJECT (book_shell_content), "preview-contact");
+}
+
+gboolean
+e_book_shell_content_get_preview_visible (EBookShellContent *book_shell_content)
+{
+ GtkPaned *paned;
+ GtkWidget *child;
+
+ g_return_val_if_fail (
+ E_IS_BOOK_SHELL_CONTENT (book_shell_content), FALSE);
+
+ paned = GTK_PANED (book_shell_content->priv->paned);
+ child = gtk_paned_get_child2 (paned);
+
+ return GTK_WIDGET_VISIBLE (child);
+}
+
+void
+e_book_shell_content_set_preview_visible (EBookShellContent *book_shell_content,
+ gboolean preview_visible)
+{
+ GtkPaned *paned;
+ GtkWidget *child;
+
+ g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content));
+
+ paned = GTK_PANED (book_shell_content->priv->paned);
+ child = gtk_paned_get_child2 (paned);
+
+ if (preview_visible)
+ gtk_widget_show (child);
+ else
+ gtk_widget_hide (child);
+
+ g_object_notify (G_OBJECT (book_shell_content), "preview-visible");
+}
+
+void
+e_book_shell_content_clipboard_copy (EBookShellContent *book_shell_content)
+{
+ EAddressbookView *addressbook_view;
+ GtkHTML *html;
+ gchar *selection;
+
+ g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content));
+
+ html = GTK_HTML (book_shell_content->priv->preview);
+ addressbook_view =
+ e_book_shell_content_get_current_view (book_shell_content);
+ g_return_if_fail (addressbook_view != NULL);
+
+ if (!GTK_WIDGET_HAS_FOCUS (html)) {
+ e_addressbook_view_copy (addressbook_view);
+ return;
+ }
+
+ selection = gtk_html_get_selection_html (html, NULL);
+ if (selection != NULL)
+ gtk_html_copy (html);
+ g_free (selection);
+}
Added: branches/kill-bonobo/addressbook/gui/component/e-book-shell-content.h
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-content.h Wed Sep 24 22:53:30 2008
@@ -0,0 +1,92 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-book-shell-content.h
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef E_BOOK_SHELL_CONTENT_H
+#define E_BOOK_SHELL_CONTENT_H
+
+#include <libebook/e-contact.h>
+
+#include <e-shell-content.h>
+#include <e-shell-view.h>
+
+#include <e-addressbook-view.h>
+
+/* Standard GObject macros */
+#define E_TYPE_BOOK_SHELL_CONTENT \
+ (e_book_shell_content_get_type ())
+#define E_BOOK_SHELL_CONTENT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_BOOK_SHELL_CONTENT, EBookShellContent))
+#define E_BOOK_SHELL_CONTENT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_BOOK_SHELL_CONTENT, EBookShellContentClass))
+#define E_IS_BOOK_SHELL_CONTENT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_BOOK_SHELL_CONTENT))
+#define E_IS_BOOK_SHELL_CONTENT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_BOOK_SHELL_CONTENT))
+#define E_BOOK_SHELL_CONTENT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_BOOK_SHELL_CONTENT, EBookShellContentClass))
+
+G_BEGIN_DECLS
+
+typedef struct _EBookShellContent EBookShellContent;
+typedef struct _EBookShellContentClass EBookShellContentClass;
+typedef struct _EBookShellContentPrivate EBookShellContentPrivate;
+
+struct _EBookShellContent {
+ EShellContent parent;
+ EBookShellContentPrivate *priv;
+};
+
+struct _EBookShellContentClass {
+ EShellContentClass parent_class;
+};
+
+GType e_book_shell_content_get_type (void);
+GtkWidget * e_book_shell_content_new (EShellView *shell_view);
+void e_book_shell_content_insert_view(EBookShellContent *book_shell_content,
+ EAddressbookView *addressbook_view);
+void e_book_shell_content_remove_view(EBookShellContent *book_shell_content,
+ EAddressbookView *addressbook_view);
+EAddressbookView *
+ e_book_shell_content_get_current_view
+ (EBookShellContent *book_shell_content);
+void e_book_shell_content_set_current_view
+ (EBookShellContent *book_shell_content,
+ EAddressbookView *addressbook_view);
+EContact * e_book_shell_content_get_preview_contact
+ (EBookShellContent *book_shell_content);
+void e_book_shell_content_set_preview_contact
+ (EBookShellContent *book_shell_content,
+ EContact *preview_contact);
+gboolean e_book_shell_content_get_preview_visible
+ (EBookShellContent *book_shell_content);
+void e_book_shell_content_set_preview_visible
+ (EBookShellContent *book_shell_content,
+ gboolean preview_visible);
+void e_book_shell_content_clipboard_copy
+ (EBookShellContent *book_shell_content);
+
+G_END_DECLS
+
+#endif /* E_BOOK_SHELL_CONTENT_H */
Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-sidebar.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-sidebar.c (original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-sidebar.c Wed Sep 24 22:53:30 2008
@@ -86,6 +86,9 @@
priv = E_BOOK_SHELL_SIDEBAR_GET_PRIVATE (object);
+ /* Chain up to parent's constructed() method. */
+ G_OBJECT_CLASS (parent_class)->constructed (object);
+
shell_sidebar = E_SHELL_SIDEBAR (object);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
book_shell_view = E_BOOK_SHELL_VIEW (shell_view);
Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c (original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c Wed Sep 24 22:53:30 2008
@@ -30,10 +30,13 @@
action_address_book_copy_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_copy_to_folder (view, TRUE);
}
@@ -55,7 +58,7 @@
shell_view = E_SHELL_VIEW (book_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
- book_shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+ book_shell_sidebar = book_shell_view->priv->book_shell_sidebar;
selector = e_book_shell_sidebar_get_selector (book_shell_sidebar);
source = e_source_selector_peek_primary_selection (selector);
g_return_if_fail (source != NULL);
@@ -99,10 +102,13 @@
action_address_book_move_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_move_to_folder (view, TRUE);
}
@@ -135,7 +141,7 @@
shell_view = E_SHELL_VIEW (book_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
- book_shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+ book_shell_sidebar = book_shell_view->priv->book_shell_sidebar;
selector = e_book_shell_sidebar_get_selector (book_shell_sidebar);
source = e_source_selector_peek_primary_selection (selector);
g_return_if_fail (source != NULL);
@@ -169,10 +175,13 @@
action_address_book_save_as_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_save_as (view, TRUE);
}
@@ -180,10 +189,13 @@
action_address_book_stop_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_stop (view);
}
@@ -191,33 +203,23 @@
action_contact_clipboard_copy_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
- EAddressbookView *view;
- GtkWidget *preview;
- gchar *selection;
-
- preview = book_shell_view->priv->preview;
- view = e_book_shell_view_get_current_view (book_shell_view);
- g_return_if_fail (view != NULL);
-
- if (!GTK_WIDGET_HAS_FOCUS (preview)) {
- e_addressbook_view_copy (view);
- return;
- }
+ EBookShellContent *book_shell_content;
- selection = gtk_html_get_selection_html (GTK_HTML (preview), NULL);
- if (selection != NULL)
- gtk_html_copy (GTK_HTML (preview));
- g_free (selection);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ e_book_shell_content_clipboard_copy (book_shell_content);
}
static void
action_contact_clipboard_cut_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_cut (view);
}
@@ -225,10 +227,13 @@
action_contact_clipboard_paste_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_paste (view);
}
@@ -236,10 +241,13 @@
action_contact_copy_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_copy_to_folder (view, FALSE);
}
@@ -247,10 +255,13 @@
action_contact_delete_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_delete_selection (view, TRUE);
}
@@ -258,10 +269,13 @@
action_contact_forward_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_send (view);
}
@@ -269,10 +283,13 @@
action_contact_move_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_move_to_folder (view, FALSE);
}
@@ -280,12 +297,14 @@
action_contact_new_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
EAddressbookModel *model;
EContact *contact;
EBook *book;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
model = e_addressbook_view_get_model (view);
@@ -301,12 +320,14 @@
action_contact_new_list_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
EAddressbookModel *model;
EContact *contact;
EBook *book;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
model = e_addressbook_view_get_model (view);
@@ -322,10 +343,13 @@
action_contact_open_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_view (view);
}
@@ -333,25 +357,26 @@
action_contact_preview_cb (GtkToggleAction *action,
EBookShellView *book_shell_view)
{
- GtkWidget *child;
- GtkWidget *paned;
+ EBookShellContent *book_shell_content;
gboolean visible;
- paned = book_shell_view->priv->paned;
- child = gtk_paned_get_child2 (GTK_PANED (paned));
+ book_shell_content = book_shell_view->priv->book_shell_content;
visible = gtk_toggle_action_get_active (action);
- g_object_set (child, "visible", visible, NULL);
+ e_book_shell_content_set_preview_visible (book_shell_content, visible);
}
static void
action_contact_print_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
GtkPrintOperationAction print_action;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG;
e_addressbook_view_print (view, print_action);
}
@@ -360,11 +385,14 @@
action_contact_print_preview_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
GtkPrintOperationAction print_action;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW;
e_addressbook_view_print (view, print_action);
}
@@ -373,10 +401,13 @@
action_contact_save_as_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_save_as (view, FALSE);
}
@@ -384,10 +415,13 @@
action_contact_select_all_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_select_all (view);
}
@@ -395,10 +429,13 @@
action_contact_send_message_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
g_return_if_fail (view != NULL);
+
e_addressbook_view_send_to (view);
}
@@ -406,6 +443,7 @@
action_gal_save_custom_view_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EShellView *shell_view;
EAddressbookView *address_view;
GalViewInstance *view_instance;
@@ -414,7 +452,8 @@
if (!e_shell_view_is_active (shell_view))
return;
- address_view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ address_view = e_book_shell_content_get_current_view (book_shell_content);
view_instance = e_addressbook_view_get_view_instance (address_view);
gal_view_instance_save_as (view_instance);
}
@@ -423,13 +462,13 @@
action_search_execute_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EShellView *shell_view;
EShellWindow *shell_window;
EShellContent *shell_content;
GString *string;
EAddressbookView *view;
EAddressbookModel *model;
- EABContactDisplay *display;
FilterRule *rule;
const gchar *format;
const gchar *text;
@@ -503,13 +542,13 @@
g_object_unref (rule);
/* Submit the query. */
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
model = e_addressbook_view_get_model (view);
e_addressbook_model_set_query (model, query);
g_free (query);
- display = EAB_CONTACT_DISPLAY (book_shell_view->priv->preview);
- eab_contact_display_set_contact (display, NULL);
+ e_book_shell_content_set_preview_contact (book_shell_content, NULL);
}
static GtkActionEntry contact_entries[] = {
@@ -806,6 +845,7 @@
EShellWindow *shell_window;
EAddressbookModel *model;
EAddressbookView *view;
+ EBookShellContent *book_shell_content;
EBookShellSidebar *book_shell_sidebar;
ESelectionModel *selection_model;
ESourceSelector *selector;
@@ -819,9 +859,11 @@
shell_view = E_SHELL_VIEW (book_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
- view = e_book_shell_view_get_current_view (book_shell_view);
- book_shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
+
+ book_shell_sidebar = book_shell_view->priv->book_shell_sidebar;
selector = e_book_shell_sidebar_get_selector (book_shell_sidebar);
source = e_source_selector_peek_primary_selection (selector);
Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.c (original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.c Wed Sep 24 22:53:30 2008
@@ -45,40 +45,40 @@
book_shell_view_selection_change_foreach (gint row,
EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
EAddressbookModel *model;
- EABContactDisplay *display;
EContact *contact;
/* XXX A "foreach" function is kind of a silly way to retrieve
* the one and only selected contact, but this is the only
* means that ESelectionModel provides. */
- view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ view = e_book_shell_content_get_current_view (book_shell_content);
model = e_addressbook_view_get_model (view);
contact = e_addressbook_model_get_contact (model, row);
- display = EAB_CONTACT_DISPLAY (book_shell_view->priv->preview);
- eab_contact_display_set_contact (display, contact);
+ e_book_shell_content_set_preview_contact (book_shell_content, contact);
}
static void
selection_change (EBookShellView *book_shell_view,
EAddressbookView *view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *current_view;
ESelectionModel *selection_model;
- EABContactDisplay *display;
gint n_selected;
- current_view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ current_view = e_book_shell_content_get_current_view (book_shell_content);
if (view != current_view)
return;
e_book_shell_view_actions_update (book_shell_view);
- display = EAB_CONTACT_DISPLAY (book_shell_view->priv->preview);
selection_model = e_addressbook_view_get_selection_model (view);
n_selected = (selection_model != NULL) ?
@@ -90,24 +90,27 @@
book_shell_view_selection_change_foreach,
book_shell_view);
else
- eab_contact_display_set_contact (display, NULL);
+ e_book_shell_content_set_preview_contact (
+ book_shell_content, NULL);
}
static void
contact_changed (EBookShellView *book_shell_view,
EContact *contact)
{
- EABContactDisplay *display;
- EContact *displayed_contact;
+ EBookShellContent *book_shell_content;
+ EContact *preview_contact;
- display = EAB_CONTACT_DISPLAY (book_shell_view->priv->preview);
- displayed_contact = eab_contact_display_get_contact (display);
+ book_shell_content = book_shell_view->priv->book_shell_content;
- if (contact != displayed_contact)
+ preview_contact =
+ e_book_shell_content_get_preview_contact (book_shell_content);
+
+ if (contact != preview_contact)
return;
/* Re-render the same contact. */
- eab_contact_display_set_contact (display, contact);
+ e_book_shell_content_set_preview_contact (book_shell_content, contact);
}
static void
@@ -115,21 +118,23 @@
GArray *removed_indices,
EAddressbookModel *model)
{
- EABContactDisplay *display;
- EContact *displayed_contact;
+ EBookShellContent *book_shell_content;
+ EContact *preview_contact;
+
+ book_shell_content = book_shell_view->priv->book_shell_content;
- display = EAB_CONTACT_DISPLAY (book_shell_view->priv->preview);
- displayed_contact = eab_contact_display_get_contact (display);
+ preview_contact =
+ e_book_shell_content_get_preview_contact (book_shell_content);
- if (displayed_contact == NULL)
+ if (preview_contact == NULL)
return;
/* Is the displayed contact still in the model? */
- if (e_addressbook_model_find (model, displayed_contact) < 0)
+ if (e_addressbook_model_find (model, preview_contact) < 0)
return;
/* If not, clear the contact display. */
- eab_contact_display_set_contact (display, NULL);
+ e_book_shell_content_set_preview_contact (book_shell_content, NULL);
}
static void
@@ -156,19 +161,18 @@
ESourceSelector *selector)
{
EShellView *shell_view;
+ EBookShellContent *book_shell_content;
EAddressbookView *view;
EAddressbookModel *model;
ESource *source;
GalViewInstance *view_instance;
GHashTable *hash_table;
- GtkNotebook *notebook;
GtkWidget *widget;
const gchar *uid;
gchar *view_id;
- gint page_num;
shell_view = E_SHELL_VIEW (book_shell_view);
- notebook = GTK_NOTEBOOK (book_shell_view->priv->notebook);
+ book_shell_content = book_shell_view->priv->book_shell_content;
source = e_source_selector_peek_primary_selection (selector);
if (source == NULL)
@@ -202,9 +206,13 @@
widget = e_addressbook_view_new (shell_view, source);
gtk_widget_show (widget);
- g_object_ref_sink (widget);
- gtk_notebook_append_page (notebook, widget, NULL);
- g_hash_table_insert (hash_table, g_strdup (uid), widget);
+ e_book_shell_content_insert_view (
+ book_shell_content,
+ E_ADDRESSBOOK_VIEW (widget));
+
+ g_hash_table_insert (
+ hash_table, g_strdup (uid),
+ g_object_ref (widget));
g_signal_connect_swapped (
widget, "popup-event",
@@ -236,8 +244,8 @@
G_CALLBACK (contacts_removed), book_shell_view);
}
- page_num = gtk_notebook_page_num (notebook, widget);
- gtk_notebook_set_current_page (notebook, page_num);
+ e_book_shell_content_set_current_view (
+ book_shell_content, E_ADDRESSBOOK_VIEW (widget));
view_instance = e_addressbook_view_get_view_instance (view);
view_id = gal_view_instance_get_current_view_id (view_instance);
@@ -333,11 +341,13 @@
static void
book_shell_view_notify_view_id_cb (EBookShellView *book_shell_view)
{
+ EBookShellContent *book_shell_content;
EAddressbookView *address_view;
GalViewInstance *view_instance;
const gchar *view_id;
- address_view = e_book_shell_view_get_current_view (book_shell_view);
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ address_view = e_book_shell_content_get_current_view (book_shell_content);
view_instance = e_addressbook_view_get_view_instance (address_view);
view_id = e_shell_view_get_view_id (E_SHELL_VIEW (book_shell_view));
@@ -399,54 +409,16 @@
EShellView *shell_view;
EShellWindow *shell_window;
ESourceSelector *selector;
- GConfBridge *bridge;
- GtkWidget *container;
- GtkWidget *widget;
- GObject *object;
- const gchar *key;
shell_view = E_SHELL_VIEW (book_shell_view);
- shell_window = e_shell_view_get_shell_window (shell_view);
-
- /* Construct view widgets. */
-
shell_content = e_shell_view_get_shell_content (shell_view);
- container = GTK_WIDGET (shell_content);
+ shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
- widget = gtk_vpaned_new ();
- gtk_container_add (GTK_CONTAINER (container), widget);
- priv->paned = g_object_ref (widget);
- gtk_widget_show (widget);
-
- container = widget;
-
- widget = gtk_notebook_new ();
- gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
- gtk_notebook_set_show_border (GTK_NOTEBOOK (widget), FALSE);
- gtk_paned_add1 (GTK_PANED (container), widget);
- priv->notebook = g_object_ref (widget);
- gtk_widget_show (widget);
-
- widget = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (
- GTK_SCROLLED_WINDOW (widget),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (
- GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
- gtk_paned_add2 (GTK_PANED (container), widget);
- gtk_widget_show (widget);
-
- container = widget;
-
- widget = eab_contact_display_new ();
- eab_contact_display_set_mode (
- EAB_CONTACT_DISPLAY (widget),
- EAB_CONTACT_DISPLAY_RENDER_NORMAL);
- gtk_container_add (GTK_CONTAINER (container), widget);
- priv->preview = g_object_ref (widget);
- gtk_widget_show (widget);
+ /* Cache these to avoid lots of awkward casting. */
+ priv->book_shell_content = g_object_ref (shell_content);
+ priv->book_shell_sidebar = g_object_ref (shell_sidebar);
- shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
selector = e_book_shell_sidebar_get_selector (
E_BOOK_SHELL_SIDEBAR (shell_sidebar));
@@ -477,14 +449,6 @@
e_book_shell_view_actions_init (book_shell_view);
e_book_shell_view_update_search_filter (book_shell_view);
book_shell_view_activate_selected_source (book_shell_view, selector);
-
- /* Bind GObject properties to GConf keys. */
-
- bridge = gconf_bridge_get ();
-
- object = G_OBJECT (book_shell_view->priv->paned);
- key = "/apps/evolution/addressbook/display/vpane_position";
- gconf_bridge_bind_property_delayed (bridge, key, object, "position");
}
void
@@ -497,9 +461,8 @@
DISPOSE (priv->contact_actions);
DISPOSE (priv->filter_actions);
- DISPOSE (priv->paned);
- DISPOSE (priv->notebook);
- DISPOSE (priv->preview);
+ DISPOSE (priv->book_shell_content);
+ DISPOSE (priv->book_shell_sidebar);
g_hash_table_remove_all (priv->uid_to_view);
g_hash_table_remove_all (priv->uid_to_editor);
@@ -514,22 +477,6 @@
g_hash_table_destroy (priv->uid_to_editor);
}
-EAddressbookView *
-e_book_shell_view_get_current_view (EBookShellView *book_shell_view)
-{
- GtkNotebook *notebook;
- GtkWidget *widget;
- gint page_num;
-
- g_return_val_if_fail (E_IS_BOOK_SHELL_VIEW (book_shell_view), NULL);
-
- notebook = GTK_NOTEBOOK (book_shell_view->priv->notebook);
- page_num = gtk_notebook_get_current_page (notebook);
- widget = gtk_notebook_get_nth_page (notebook, page_num);
-
- return E_ADDRESSBOOK_VIEW (widget);
-}
-
void
e_book_shell_view_editor_weak_notify (EditorUidClosure *closure,
GObject *where_the_object_was)
Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.h
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.h (original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.h Wed Sep 24 22:53:30 2008
@@ -37,6 +37,7 @@
#include <eab-gui-util.h>
#include <e-addressbook-view.h>
+#include <e-book-shell-content.h>
#include <e-book-shell-sidebar.h>
#include <e-book-shell-view-actions.h>
@@ -90,9 +91,9 @@
/*** Other Stuff ***/
- GtkWidget *paned;
- GtkWidget *notebook;
- GtkWidget *preview;
+ /* These are just for convenience. */
+ EBookShellContent *book_shell_content;
+ EBookShellSidebar *book_shell_sidebar;
GHashTable *uid_to_view;
GHashTable *uid_to_editor;
@@ -114,9 +115,6 @@
(EBookShellView *book_shell_view);
void e_book_shell_view_actions_update
(EBookShellView *book_shell_view);
-EAddressbookView *
- e_book_shell_view_get_current_view
- (EBookShellView *book_shell_view);
void e_book_shell_view_editor_weak_notify
(EditorUidClosure *closure,
GObject *where_the_object_was);
Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-view.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-view.c (original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-view.c Wed Sep 24 22:53:30 2008
@@ -20,8 +20,6 @@
#include "e-book-shell-view-private.h"
-#define SEARCH_OPTIONS_PATH "/contact-search-options"
-
enum {
PROP_0,
PROP_SOURCE_LIST
@@ -35,25 +33,23 @@
ESourceList *source_list)
{
EBookShellViewPrivate *priv = book_shell_view->priv;
- GtkNotebook *notebook;
+ EBookShellContent *book_shell_content;
GList *keys, *iter;
- notebook = GTK_NOTEBOOK (priv->notebook);
+ book_shell_content = book_shell_view->priv->book_shell_content;
keys = g_hash_table_get_keys (priv->uid_to_view);
for (iter = keys; iter != NULL; iter = iter->next) {
gchar *uid = iter->data;
- GtkWidget *widget;
- gint page_num;
+ EAddressbookView *view;
/* If the source still exists, move on. */
if (e_source_list_peek_source_by_uid (source_list, uid))
continue;
/* Remove the view for the deleted source. */
- widget = g_hash_table_lookup (priv->uid_to_view, uid);
- page_num = gtk_notebook_page_num (notebook, widget);
- gtk_notebook_remove_page (notebook, page_num);
+ view = g_hash_table_lookup (priv->uid_to_view, uid);
+ e_book_shell_content_remove_view (book_shell_content, view);
g_hash_table_remove (priv->uid_to_view, uid);
}
g_list_free (keys);
@@ -166,10 +162,11 @@
shell_view_class = E_SHELL_VIEW_CLASS (class);
shell_view_class->label = N_("Contacts");
shell_view_class->icon_name = "x-office-address-book";
+ shell_view_class->search_options = "/contact-search-options";
shell_view_class->type_module = type_module;
- shell_view_class->changed = book_shell_view_changed;
- shell_view_class->search_options_path = SEARCH_OPTIONS_PATH;
+ shell_view_class->new_shell_content = e_book_shell_content_new;
shell_view_class->new_shell_sidebar = e_book_shell_sidebar_new;
+ shell_view_class->changed = book_shell_view_changed;
g_object_class_install_property (
object_class,
Modified: branches/kill-bonobo/addressbook/gui/widgets/e-addressbook-view.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/widgets/e-addressbook-view.c (original)
+++ branches/kill-bonobo/addressbook/gui/widgets/e-addressbook-view.c Wed Sep 24 22:53:30 2008
@@ -853,8 +853,10 @@
const gchar *status)
{
EActivity *activity;
+ EShellView *shell_view;
activity = view->priv->activity;
+ shell_view = e_addressbook_view_get_shell_view (view);
if (status == NULL || *status == '\0') {
if (activity != NULL) {
@@ -866,6 +868,7 @@
} else if (activity == NULL) {
activity = e_activity_new (status);
view->priv->activity = activity;
+ e_shell_view_add_activity (shell_view, activity);
} else
e_activity_set_primary_text (activity, status);
Modified: branches/kill-bonobo/calendar/Makefile.am
==============================================================================
--- branches/kill-bonobo/calendar/Makefile.am (original)
+++ branches/kill-bonobo/calendar/Makefile.am Wed Sep 24 22:53:30 2008
@@ -4,7 +4,7 @@
CONDUIT_DIR =
endif
-SUBDIRS = idl common importers gui $(CONDUIT_DIR)
+SUBDIRS = idl common importers gui $(CONDUIT_DIR) modules
error_DATA = calendar.error
errordir = $(privdatadir)/errors
Modified: branches/kill-bonobo/calendar/gui/Makefile.am
==============================================================================
--- branches/kill-bonobo/calendar/gui/Makefile.am (original)
+++ branches/kill-bonobo/calendar/gui/Makefile.am Wed Sep 24 22:53:30 2008
@@ -34,61 +34,6 @@
$(LIBSOUP_CFLAGS) \
$(EVOLUTION_CALENDAR_CFLAGS)
-module_LTLIBRARIES = \
- libevolution-calendar.la \
- libevolution-memos.la \
- libevolution-tasks.la
-
-libevolution_calendar_la_SOURCES = \
- calendar-config-keys.h \
- calendar-config.c \
- calendar-config.h \
- e-cal-shell-module.c \
- e-cal-shell-sidebar.c \
- e-cal-shell-sidebar.h \
- e-cal-shell-view-actions.c \
- e-cal-shell-view-actions.h \
- e-cal-shell-view-private.c \
- e-cal-shell-view-private.h \
- e-cal-shell-view.c \
- e-cal-shell-view.h \
- e-calendar-selector.c \
- e-calendar-selector.h
-
-libevolution_memos_la_SOURCES = \
- calendar-config-keys.h \
- calendar-config.c \
- calendar-config.h \
- e-calendar-selector.c \
- e-calendar-selector.h \
- e-memo-shell-module.c \
- e-memo-shell-sidebar.c \
- e-memo-shell-sidebar.h \
- e-memo-shell-view-actions.c \
- e-memo-shell-view-actions.h \
- e-memo-shell-view-private.c \
- e-memo-shell-view-private.h \
- e-memo-shell-view.c \
- e-memo-shell-view.h \
- e-memos.c \
- e-memos.h
-
-libevolution_tasks_la_SOURCES = \
- calendar-config-keys.h \
- calendar-config.c \
- calendar-config.h \
- e-calendar-selector.c \
- e-calendar-selector.h \
- e-task-shell-module.c \
- e-task-shell-sidebar.c \
- e-task-shell-sidebar.h \
- e-task-shell-view-actions.c \
- e-task-shell-view-actions.h \
- e-task-shell-view-private.c \
- e-task-shell-view-private.h \
- e-task-shell-view.c \
- e-task-shell-view.h
-
glade_DATA = \
e-itip-control.glade \
goto-dialog.glade
@@ -99,182 +44,150 @@
e-cal-list-view.etspec \
e-memo-table.etspec
-#libevolution_calendar_la_SOURCES = \
-# cal-search-bar.c \
-# cal-search-bar.h \
-# calendar-config.c \
-# calendar-config.h \
-# calendar-config-keys.h \
-# calendar-commands.c \
-# calendar-commands.h \
-# calendar-component.c \
-# calendar-component.h \
-# calendar-view.c \
-# calendar-view.h \
-# calendar-view-factory.c \
-# calendar-view-factory.h \
-# comp-editor-factory.c \
-# comp-editor-factory.h \
-# comp-util.c \
-# comp-util.h \
-# control-factory.c \
-# control-factory.h \
-# e-alarm-list.c \
-# e-alarm-list.h \
-# e-cal-component-preview.c \
-# e-cal-component-preview.h \
-# e-cal-component-memo-preview.c \
-# e-cal-component-memo-preview.h \
-# e-cal-config.c \
-# e-cal-config.h \
-# e-cal-event.c \
-# e-cal-event.h \
-# e-cal-menu.c \
-# e-cal-menu.h \
-# e-cal-model-calendar.h \
-# e-cal-model-calendar.c \
-# e-cal-model-calendar.h \
-# e-cal-model-tasks.c \
-# e-cal-model-tasks.h \
-# e-cal-model.c \
-# e-cal-model.h \
-# e-cal-popup.h \
-# e-cal-popup.c \
-# e-calendar-view.c \
-# e-calendar-view.h \
-# e-cal-list-view.c \
-# e-cal-list-view.h \
-# e-cal-list-view-config.c \
-# e-cal-list-view-config.h \
-# e-cal-model-memos.c \
-# e-cal-model-memos.h \
-# e-calendar-table.c \
-# e-calendar-table.h \
-# e-calendar-table-config.c \
-# e-calendar-table-config.h \
-# e-cell-date-edit-config.c \
-# e-cell-date-edit-config.h \
-# e-cell-date-edit-text.h \
-# e-cell-date-edit-text.c \
-# e-comp-editor-registry.c \
-# e-comp-editor-registry.h \
-# e-date-edit-config.c \
-# e-date-edit-config.h \
-# e-date-time-list.c \
-# e-date-time-list.h \
-# e-day-view-config.c \
-# e-day-view-config.h \
-# e-day-view-layout.c \
-# e-day-view-layout.h \
-# e-day-view-main-item.c \
-# e-day-view-main-item.h \
-# e-day-view-time-item.c \
-# e-day-view-time-item.h \
-# e-day-view-top-item.c \
-# e-day-view-top-item.h \
-# e-day-view.c \
-# e-day-view.h \
-# e-itip-control.h \
-# e-itip-control.c \
-# e-meeting-attendee.c \
-# e-meeting-attendee.h \
-# e-meeting-list-view.c \
-# e-meeting-list-view.h \
-# e-meeting-store.c \
-# e-meeting-store.h \
-# e-meeting-time-sel.c \
-# e-meeting-time-sel.h \
-# e-meeting-time-sel-item.c \
-# e-meeting-time-sel-item.h \
-# e-meeting-types.h \
-# e-meeting-utils.c \
-# e-meeting-utils.h \
-# e-memo-table.c \
-# e-memo-table.h \
-# e-memo-table-config.c \
-# e-memo-table-config.h \
-# e-memos.c \
-# e-memos.h \
-# e-mini-calendar-config.c \
-# e-mini-calendar-config.h \
-# e-select-names-editable.c \
-# e-select-names-editable.h \
-# e-select-names-renderer.c \
-# e-select-names-renderer.h \
-# e-week-view-config.c \
-# e-week-view-config.h \
-# e-week-view-event-item.c \
-# e-week-view-event-item.h \
-# e-week-view-layout.c \
-# e-week-view-layout.h \
-# e-week-view-main-item.c \
-# e-week-view-main-item.h \
-# e-week-view-titles-item.c \
-# e-week-view-titles-item.h \
-# e-week-view.c \
-# e-week-view.h \
-# e-tasks.c \
-# e-tasks.h \
-# e-timezone-entry.c \
-# e-timezone-entry.h \
-# gnome-cal.c \
-# gnome-cal.h \
-# goto.c \
-# goto.h \
-# itip-bonobo-control.c \
-# itip-bonobo-control.h \
-# itip-utils.c \
-# itip-utils.h \
-# main.c \
-# memos-component.c \
-# memos-component.h \
-# migration.c \
-# migration.h \
-# misc.c \
-# misc.h \
-# print.c \
-# print.h \
-# tag-calendar.c \
-# tag-calendar.h \
-# tasks-component.c \
-# tasks-component.h \
-# tasks-control.c \
-# tasks-control.h \
-# weekday-picker.c \
-# weekday-picker.h
+privsolib_LTLIBRARIES = libcal-gui.la
-libevolution_calendar_la_LIBADD = \
- $(WIN32_BOOTSTRAP_LIBS) \
- $(top_builddir)/widgets/menus/libmenus.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/calendar/common/libevolution-calendarprivate.la \
- $(top_builddir)/calendar/gui/dialogs/libcal-dialogs.la \
- $(top_builddir)/calendar/importers/libevolution-calendar-importers.la \
- $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/filter/libfilter.la \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/a11y/calendar/libevolution-calendar-a11y.la \
- $(LIBSOUP_LIBS) \
- $(CAMEL_LIBS) \
- $(EVOLUTION_CALENDAR_LIBS)
+# Removed from SOURCES
+# cal-search-bar.c
+# cal-search-bar.h
+# calendar-commands.c
+# calendar-commands.h
+# comp-editor-factory.c
+# comp-editor-factory.h
+# e-calendar-view.c
+# e-calendar-view.h
+# e-calendar-table.c
+# e-calendar-table.h
+# e-memos.c
+# e-memos.h
+# e-tasks.c
+# e-tasks.h
+# gnome-cal.c
+# gnome-cal.h
+# main.c
+# migration.c
+# migration.h
+# tasks-control.c
+# tasks-control.h
+
+libcal_gui_la_SOURCES = \
+ calendar-config.c \
+ calendar-config.h \
+ calendar-config-keys.h \
+ calendar-view.c \
+ calendar-view.h \
+ calendar-view-factory.c \
+ calendar-view-factory.h \
+ comp-util.c \
+ comp-util.h \
+ control-factory.c \
+ control-factory.h \
+ e-alarm-list.c \
+ e-alarm-list.h \
+ e-cal-component-preview.c \
+ e-cal-component-preview.h \
+ e-cal-config.c \
+ e-cal-config.h \
+ e-cal-event.c \
+ e-cal-event.h \
+ e-cal-menu.c \
+ e-cal-menu.h \
+ e-cal-model-calendar.h \
+ e-cal-model-calendar.c \
+ e-cal-model-calendar.h \
+ e-cal-model-tasks.c \
+ e-cal-model-tasks.h \
+ e-cal-model.c \
+ e-cal-model.h \
+ e-cal-popup.h \
+ e-cal-popup.c \
+ e-cal-list-view.c \
+ e-cal-list-view.h \
+ e-cal-list-view-config.c \
+ e-cal-list-view-config.h \
+ e-cal-model-memos.c \
+ e-cal-model-memos.h \
+ e-calendar-table-config.c \
+ e-calendar-table-config.h \
+ e-cell-date-edit-config.c \
+ e-cell-date-edit-config.h \
+ e-cell-date-edit-text.h \
+ e-cell-date-edit-text.c \
+ e-comp-editor-registry.c \
+ e-comp-editor-registry.h \
+ e-date-edit-config.c \
+ e-date-edit-config.h \
+ e-date-time-list.c \
+ e-date-time-list.h \
+ e-day-view-config.c \
+ e-day-view-config.h \
+ e-day-view-layout.c \
+ e-day-view-layout.h \
+ e-day-view-main-item.c \
+ e-day-view-main-item.h \
+ e-day-view-time-item.c \
+ e-day-view-time-item.h \
+ e-day-view-top-item.c \
+ e-day-view-top-item.h \
+ e-day-view.c \
+ e-day-view.h \
+ e-itip-control.h \
+ e-itip-control.c \
+ e-meeting-attendee.c \
+ e-meeting-attendee.h \
+ e-meeting-list-view.c \
+ e-meeting-list-view.h \
+ e-meeting-store.c \
+ e-meeting-store.h \
+ e-meeting-time-sel.c \
+ e-meeting-time-sel.h \
+ e-meeting-time-sel-item.c \
+ e-meeting-time-sel-item.h \
+ e-meeting-types.h \
+ e-meeting-utils.c \
+ e-meeting-utils.h \
+ e-memo-table.c \
+ e-memo-table.h \
+ e-memo-table-config.c \
+ e-memo-table-config.h \
+ e-mini-calendar-config.c \
+ e-mini-calendar-config.h \
+ e-select-names-editable.c \
+ e-select-names-editable.h \
+ e-select-names-renderer.c \
+ e-select-names-renderer.h \
+ e-week-view-config.c \
+ e-week-view-config.h \
+ e-week-view-event-item.c \
+ e-week-view-event-item.h \
+ e-week-view-layout.c \
+ e-week-view-layout.h \
+ e-week-view-main-item.c \
+ e-week-view-main-item.h \
+ e-week-view-titles-item.c \
+ e-week-view-titles-item.h \
+ e-week-view.c \
+ e-week-view.h \
+ e-timezone-entry.c \
+ e-timezone-entry.h \
+ goto.c \
+ goto.h \
+ itip-bonobo-control.c \
+ itip-bonobo-control.h \
+ itip-utils.c \
+ itip-utils.h \
+ misc.c \
+ misc.h \
+ print.c \
+ print.h \
+ tag-calendar.c \
+ tag-calendar.h \
+ weekday-picker.c \
+ weekday-picker.h
-libevolution_memos_la_LIBADD = \
- $(WIN32_BOOTSTRAP_LIBS) \
- $(top_builddir)/widgets/menus/libmenus.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/calendar/common/libevolution-calendarprivate.la \
- $(top_builddir)/calendar/gui/dialogs/libcal-dialogs.la \
- $(top_builddir)/calendar/importers/libevolution-calendar-importers.la \
- $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/filter/libfilter.la \
- $(top_builddir)/e-util/libeutil.la \
- $(LIBSOUP_LIBS) \
- $(CAMEL_LIBS) \
- $(EVOLUTION_CALENDAR_LIBS)
+# REMOVED
+# $(top_builddir)/a11y/calendar/libevolution-calendar-a11y.la
-libevolution_tasks_la_LIBADD = \
+libcal_gui_la_LIBADD = \
$(WIN32_BOOTSTRAP_LIBS) \
$(top_builddir)/widgets/menus/libmenus.la \
$(top_builddir)/shell/libeshell.la \
@@ -289,9 +202,7 @@
$(CAMEL_LIBS) \
$(EVOLUTION_CALENDAR_LIBS)
-libevolution_calendar_la_LDFLAGS = -avoid-version -module $(NO_UNDEFINED)
-libevolution_memos_la_LDFLAGS = -avoid-version -module $(NO_UNDEFINED)
-libevolution_tasks_la_LDFLAGS = -avoid-version -module $(NO_UNDEFINED)
+libcal_gui_la_LDFLAGS = -avoid-version -module $(NO_UNDEFINED)
@INTLTOOL_SERVER_RULE@
Modified: branches/kill-bonobo/calendar/gui/calendar-component.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/calendar-component.c (original)
+++ branches/kill-bonobo/calendar/gui/calendar-component.c Wed Sep 24 22:53:30 2008
@@ -110,9 +110,6 @@
GList *notifications;
};
-/* FIXME This should be gnome cal likely */
-extern ECompEditorRegistry *comp_editor_registry;
-
static void
calcomp_vpane_realized (GtkWidget *vpane, CalendarComponentView *view)
{
@@ -650,60 +647,6 @@
g_error_free(err);
}
-static gboolean
-update_single_object (ECal *client, icalcomponent *icalcomp)
-{
- char *uid;
- icalcomponent *tmp_icalcomp;
-
- uid = (char *) icalcomponent_get_uid (icalcomp);
-
- if (e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL))
- return e_cal_modify_object (client, icalcomp, CALOBJ_MOD_ALL, NULL);
-
- return e_cal_create_object (client, icalcomp, &uid, NULL);
-}
-
-static gboolean
-update_objects (ECal *client, icalcomponent *icalcomp)
-{
- icalcomponent *subcomp;
- icalcomponent_kind kind;
-
- kind = icalcomponent_isa (icalcomp);
- if (kind == ICAL_VTODO_COMPONENT || kind == ICAL_VEVENT_COMPONENT)
- return update_single_object (client, icalcomp);
- else if (kind != ICAL_VCALENDAR_COMPONENT)
- return FALSE;
-
- subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT);
- while (subcomp) {
- gboolean success;
-
- kind = icalcomponent_isa (subcomp);
- if (kind == ICAL_VTIMEZONE_COMPONENT) {
- icaltimezone *zone;
-
- zone = icaltimezone_new ();
- icaltimezone_set_component (zone, subcomp);
-
- success = e_cal_add_timezone (client, zone, NULL);
- icaltimezone_free (zone, 1);
- if (!success)
- return success;
- } else if (kind == ICAL_VTODO_COMPONENT ||
- kind == ICAL_VEVENT_COMPONENT) {
- success = update_single_object (client, subcomp);
- if (!success)
- return success;
- }
-
- subcomp = icalcomponent_get_next_component (icalcomp, ICAL_ANY_COMPONENT);
- }
-
- return TRUE;
-}
-
static void
config_create_ecal_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
{
Modified: branches/kill-bonobo/calendar/gui/comp-editor-factory.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/comp-editor-factory.c (original)
+++ branches/kill-bonobo/calendar/gui/comp-editor-factory.c Wed Sep 24 22:53:30 2008
@@ -36,10 +36,6 @@
#include "dialogs/event-editor.h"
#include "dialogs/task-editor.h"
-extern ECompEditorRegistry *comp_editor_registry;
-
-
-
/* A pending request */
typedef enum {
Modified: branches/kill-bonobo/calendar/gui/dialogs/comp-editor.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/comp-editor.c (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/comp-editor.c Wed Sep 24 22:53:30 2008
@@ -214,7 +214,15 @@
LAST_SIGNAL
};
-static guint comp_editor_signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL];
+static GList *active_editors;
+
+static void
+comp_editor_weak_notify_cb (gpointer unused,
+ GObject *where_the_object_was)
+{
+ active_editors = g_list_remove (active_editors, where_the_object_was);
+}
static void
attach_message(CompEditor *editor, CamelMimeMessage *msg)
@@ -1704,7 +1712,7 @@
NULL,
G_PARAM_READWRITE));
- comp_editor_signals[OBJECT_CREATED] =
+ signals[OBJECT_CREATED] =
g_signal_new ("object_created",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
@@ -1724,6 +1732,12 @@
editor->priv = priv = COMP_EDITOR_GET_PRIVATE (editor);
+ g_object_weak_ref (
+ G_OBJECT (editor), (GWeakNotify)
+ comp_editor_weak_notify_cb, NULL);
+
+ active_editors = g_list_prepend (active_editors, editor);
+
priv->pages = NULL;
priv->changed = FALSE;
priv->needs_send = FALSE;
@@ -2279,7 +2293,18 @@
gtk_widget_destroy (GTK_WIDGET (editor));
}
-
+gint
+comp_editor_compare (CompEditor *editor_a,
+ CompEditor *editor_b)
+{
+ const gchar *uid_a = NULL;
+ const gchar *uid_b = NULL;
+
+ e_cal_component_get_uid (editor_a->priv->comp, &uid_a);
+ e_cal_component_get_uid (editor_b->priv->comp, &uid_b);
+
+ return g_strcmp0 (uid_a, uid_b);
+}
void
comp_editor_set_existing_org (CompEditor *editor, gboolean existing_org)
@@ -2547,6 +2572,16 @@
return widget;
}
+CompEditor *
+comp_editor_find_instance (const gchar *uid)
+{
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ return g_list_find_custom (
+ active_editors, uid,
+ (GCompareFunc) comp_editor_compare);
+}
+
/**
* comp_editor_set_needs_send:
* @editor: A component editor
Modified: branches/kill-bonobo/calendar/gui/dialogs/comp-editor.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/comp-editor.h (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/comp-editor.h Wed Sep 24 22:53:30 2008
@@ -87,6 +87,8 @@
} CompEditorFlags;
GType comp_editor_get_type (void);
+gint comp_editor_compare (CompEditor *editor_a,
+ CompEditor *editor_b);
void comp_editor_set_changed (CompEditor *editor,
gboolean changed);
gboolean comp_editor_get_changed (CompEditor *editor);
@@ -149,6 +151,7 @@
const gchar *group_name);
GtkWidget * comp_editor_get_managed_widget (CompEditor *editor,
const gchar *widget_path);
+CompEditor * comp_editor_find_instance (const gchar *uid);
G_END_DECLS
Modified: branches/kill-bonobo/calendar/gui/e-cal-model.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-cal-model.c (original)
+++ branches/kill-bonobo/calendar/gui/e-cal-model.c Wed Sep 24 22:53:30 2008
@@ -35,8 +35,8 @@
#include "e-cal-model.h"
#include "itip-utils.h"
#include "misc.h"
-#include "e-calendar-marshal.h"
#include "calendar-config.h"
+#include "e-util/e-util.h"
typedef struct {
ECal *client;
@@ -149,7 +149,7 @@
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ECalModelClass, time_range_changed),
NULL, NULL,
- e_calendar_marshal_VOID__LONG_LONG,
+ e_marshal_VOID__LONG_LONG,
G_TYPE_NONE, 2, G_TYPE_LONG, G_TYPE_LONG);
signals[ROW_APPENDED] =
@@ -176,7 +176,7 @@
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ECalModelClass, cal_view_progress),
NULL, NULL,
- e_calendar_marshal_VOID__STRING_INT_INT,
+ e_marshal_VOID__STRING_INT_INT,
G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
signals[CAL_VIEW_DONE] =
g_signal_new ("cal_view_done",
@@ -184,7 +184,7 @@
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ECalModelClass, cal_view_done),
NULL, NULL,
- e_calendar_marshal_VOID__INT_INT,
+ e_marshal_VOID__INT_INT,
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
}
Modified: branches/kill-bonobo/calendar/gui/e-calendar-selector.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-calendar-selector.c (original)
+++ branches/kill-bonobo/calendar/gui/e-calendar-selector.c Wed Sep 24 22:53:30 2008
@@ -42,6 +42,67 @@
static gpointer parent_class;
+static gboolean
+calendar_selector_update_single_object (ECal *client,
+ icalcomponent *icalcomp)
+{
+ gchar *uid;
+ icalcomponent *tmp_icalcomp;
+
+ uid = (gchar *) icalcomponent_get_uid (icalcomp);
+
+ if (e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL))
+ return e_cal_modify_object (
+ client, icalcomp, CALOBJ_MOD_ALL, NULL);
+
+ return e_cal_create_object (client, icalcomp, &uid, NULL);
+}
+
+static gboolean
+calendar_selector_update_objects (ECal *client,
+ icalcomponent *icalcomp)
+{
+ icalcomponent *subcomp;
+ icalcomponent_kind kind;
+
+ kind = icalcomponent_isa (icalcomp);
+ if (kind == ICAL_VTODO_COMPONENT || kind == ICAL_VEVENT_COMPONENT)
+ return calendar_selector_update_single_object (
+ client, icalcomp);
+ else if (kind != ICAL_VCALENDAR_COMPONENT)
+ return FALSE;
+
+ subcomp = icalcomponent_get_first_component (
+ icalcomp, ICAL_ANY_COMPONENT);
+ while (subcomp != NULL) {
+ gboolean success;
+
+ kind = icalcomponent_isa (subcomp);
+ if (kind == ICAL_VTIMEZONE_COMPONENT) {
+ icaltimezone *zone;
+
+ zone = icaltimezone_new ();
+ icaltimezone_set_component (zone, subcomp);
+
+ success = e_cal_add_timezone (client, zone, NULL);
+ icaltimezone_free (zone, 1);
+ if (!success)
+ return FALSE;
+ } else if (kind == ICAL_VTODO_COMPONENT ||
+ kind == ICAL_VEVENT_COMPONENT) {
+ success = calendar_selector_update_single_object (
+ client, subcomp);
+ if (!success)
+ return FALSE;
+ }
+
+ subcomp = icalcomponent_get_next_component (
+ icalcomp, ICAL_ANY_COMPONENT);
+ }
+
+ return TRUE;
+}
+
static void
calendar_selector_drag_leave (GtkWidget *widget,
GdkDragContext *context,
@@ -208,7 +269,7 @@
if (client != NULL) {
if (e_cal_open (client, TRUE, NULL)) {
success = TRUE;
- update_objects (client, icalcomp);
+ calendar_selector_update_objects (client, icalcomp);
}
g_object_unref (client);
Modified: branches/kill-bonobo/calendar/gui/e-calendar-table-config.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-calendar-table-config.c (original)
+++ branches/kill-bonobo/calendar/gui/e-calendar-table-config.c Wed Sep 24 22:53:30 2008
@@ -24,221 +24,245 @@
#include "e-cell-date-edit-config.h"
#include "e-calendar-table-config.h"
+#define E_CALENDAR_TABLE_CONFIG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CALENDAR_TABLE_CONFIG, ECalendarTableConfigPrivate))
+
struct _ECalendarTableConfigPrivate {
ECalendarTable *table;
-
ECellDateEditConfig *cell_config;
-
GList *notifications;
};
-/* Property IDs */
-enum props {
+enum {
PROP_0,
PROP_TABLE
};
-G_DEFINE_TYPE (ECalendarTableConfig, e_calendar_table_config, G_TYPE_OBJECT)
+static gpointer parent_class;
static void
-e_calendar_table_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
+calendar_table_config_set_timezone (ECalendarTable *table)
{
- ECalendarTableConfig *table_config;
-
- table_config = E_CALENDAR_TABLE_CONFIG (object);
+ ECalModel *model;
+ icaltimezone *zone;
- switch (property_id) {
- case PROP_TABLE:
- e_calendar_table_config_set_table (table_config, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
+ zone = calendar_config_get_icaltimezone ();
+ model = e_calendar_table_get_model (table);
+ if (model != NULL)
+ e_cal_model_set_timezone (model, zone);
}
static void
-e_calendar_table_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+calendar_table_config_timezone_changed_cb (GConfClient *client,
+ guint id,
+ GConfEntry *entry,
+ gpointer data)
{
- ECalendarTableConfig *table_config;
-
- table_config = E_CALENDAR_TABLE_CONFIG (object);
+ ECalendarTableConfig *table_config = data;
- switch (property_id) {
- case PROP_TABLE:
- g_value_set_object (value, e_calendar_table_config_get_table (table_config));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
+ calendar_table_config_set_timezone (table_config->priv->table);
}
static void
-e_calendar_table_config_dispose (GObject *object)
+calendar_table_config_set_twentyfour_hour (ECalendarTable *table)
{
- ECalendarTableConfig *table_config = E_CALENDAR_TABLE_CONFIG (object);
+ ECalModel *model;
+ gboolean use_24_hour;
- e_calendar_table_config_set_table (table_config, NULL);
+ use_24_hour = calendar_config_get_24_hour_format ();
- if (G_OBJECT_CLASS (e_calendar_table_config_parent_class)->dispose)
- G_OBJECT_CLASS (e_calendar_table_config_parent_class)->dispose (object);
+ model = e_calendar_table_get_model (table);
+ if (model != NULL)
+ e_cal_model_set_use_24_hour_format (model, use_24_hour);
}
static void
-e_calendar_table_config_finalize (GObject *object)
+calendar_table_config_twentyfour_hour_changed_cb (GConfClient *client,
+ guint id,
+ GConfEntry *entry,
+ gpointer data)
{
- ECalendarTableConfig *table_config = E_CALENDAR_TABLE_CONFIG (object);
- ECalendarTableConfigPrivate *priv;
-
- priv = table_config->priv;
-
- g_free (priv);
+ ECalendarTableConfig *table_config = data;
- if (G_OBJECT_CLASS (e_calendar_table_config_parent_class)->finalize)
- G_OBJECT_CLASS (e_calendar_table_config_parent_class)->finalize (object);
+ calendar_table_config_set_twentyfour_hour (table_config->priv->table);
}
static void
-e_calendar_table_config_class_init (ECalendarTableConfigClass *klass)
+calendar_table_config_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GParamSpec *spec;
-
- /* Method override */
- gobject_class->set_property = e_calendar_table_config_set_property;
- gobject_class->get_property = e_calendar_table_config_get_property;
- gobject_class->dispose = e_calendar_table_config_dispose;
- gobject_class->finalize = e_calendar_table_config_finalize;
+ switch (property_id) {
+ case PROP_TABLE:
+ e_calendar_table_config_set_table (
+ E_CALENDAR_TABLE_CONFIG (object),
+ g_value_get_object (value));
+ return;
+ }
- spec = g_param_spec_object ("table", NULL, NULL, e_calendar_table_get_type (),
- G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT);
- g_object_class_install_property (gobject_class, PROP_TABLE, spec);
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
static void
-e_calendar_table_config_init (ECalendarTableConfig *table_config)
+calendar_table_config_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- table_config->priv = g_new0 (ECalendarTableConfigPrivate, 1);
+ switch (property_id) {
+ case PROP_TABLE:
+ g_value_set_object (
+ value, e_calendar_table_config_get_table (
+ E_CALENDAR_TABLE_CONFIG (object)));
+ return;
+ }
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
-ECalendarTableConfig *
-e_calendar_table_config_new (ECalendarTable *table)
+static void
+calendar_table_config_dispose (GObject *object)
{
- ECalendarTableConfig *table_config;
+ ECalendarTableConfig *table_config = E_CALENDAR_TABLE_CONFIG (object);
- table_config = g_object_new (e_calendar_table_config_get_type (), "table", table, NULL);
+ e_calendar_table_config_set_table (table_config, NULL);
- return table_config;
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
-ECalendarTable *
-e_calendar_table_config_get_table (ECalendarTableConfig *table_config)
+static void
+calendar_table_config_class_init (ECalendarTableConfigClass *class)
{
- ECalendarTableConfigPrivate *priv;
+ GObjectClass *object_class;
- g_return_val_if_fail (table_config != NULL, NULL);
- g_return_val_if_fail (E_IS_CALENDAR_TABLE_CONFIG (table_config), NULL);
+ parent_class = g_type_class_peek_parent (class);
+ g_type_class_add_private (class, sizeof (ECalendarTableConfigPrivate));
- priv = table_config->priv;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = calendar_table_config_set_property;
+ object_class->get_property = calendar_table_config_get_property;
+ object_class->dispose = calendar_table_config_dispose;
- return priv->table;
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE,
+ g_param_spec_object (
+ "table",
+ NULL,
+ NULL,
+ E_TYPE_CALENDAR_TABLE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
}
static void
-set_timezone (ECalendarTable *table)
+calendar_table_config_init (ECalendarTableConfig *table_config)
{
- ECalModel *model;
- icaltimezone *zone;
-
- zone = calendar_config_get_icaltimezone ();
- model = e_calendar_table_get_model (table);
- if (model)
- e_cal_model_set_timezone (model, zone);
+ table_config->priv =
+ E_CALENDAR_TABLE_CONFIG_GET_PRIVATE (table_config);
}
-static void
-timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
+GType
+e_calendar_table_config_get_type (void)
{
- ECalendarTableConfig *table_config = data;
- ECalendarTableConfigPrivate *priv;
+ static GType type = 0;
- priv = table_config->priv;
+ if (G_UNLIKELY (type == 0)) {
+ static const GTypeInfo type_info = {
+ sizeof (ECalendarTableConfigClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) calendar_table_config_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class_data */
+ sizeof (ECalendarTableConfig),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) calendar_table_config_init,
+ NULL /* value_table */
+ };
+
+ type = g_type_register_static (
+ G_TYPE_OBJECT, "ECalendarTableConfig", &type_info, 0);
+ }
- set_timezone (priv->table);
+ return type;
}
-static void
-set_twentyfour_hour (ECalendarTable *table)
+ECalendarTableConfig *
+e_calendar_table_config_new (ECalendarTable *table)
{
- ECalModel *model;
- gboolean use_24_hour;
+ g_return_val_if_fail (E_IS_CALENDAR_TABLE (table), NULL);
- use_24_hour = calendar_config_get_24_hour_format ();
-
- model = e_calendar_table_get_model (table);
- if (model)
- e_cal_model_set_use_24_hour_format (model, use_24_hour);
+ return g_object_new (
+ E_TYPE_CALENDAR_TABLE_CONFIG,
+ "table", table, NULL);
}
-static void
-twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
+ECalendarTable *
+e_calendar_table_config_get_table (ECalendarTableConfig *table_config)
{
- ECalendarTableConfig *table_config = data;
- ECalendarTableConfigPrivate *priv;
-
- priv = table_config->priv;
+ g_return_val_if_fail (E_IS_CALENDAR_TABLE_CONFIG (table_config), NULL);
- set_twentyfour_hour (priv->table);
+ return table_config->priv->table;
}
void
-e_calendar_table_config_set_table (ECalendarTableConfig *table_config, ECalendarTable *table)
+e_calendar_table_config_set_table (ECalendarTableConfig *table_config,
+ ECalendarTable *table)
{
ECalendarTableConfigPrivate *priv;
- guint not;
- GList *l;
+ guint notification;
+ GList *list, *iter;
- g_return_if_fail (table_config != NULL);
g_return_if_fail (E_IS_CALENDAR_TABLE_CONFIG (table_config));
priv = table_config->priv;
- if (priv->table) {
- g_object_unref (priv->table);
- priv->table = NULL;
+ if (table_config->priv->table) {
+ g_object_unref (table_config->priv->table);
+ table_config->priv->table = NULL;
}
- if (priv->cell_config) {
- g_object_unref (priv->cell_config);
- priv->cell_config = NULL;
+ if (table_config->priv->cell_config) {
+ g_object_unref (table_config->priv->cell_config);
+ table_config->priv->cell_config = NULL;
}
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
-
- g_list_free (priv->notifications);
- priv->notifications = NULL;
+ list = table_config->priv->notifications;
+ for (iter = list; iter != NULL; iter = iter->next) {
+ notification = GPOINTER_TO_UINT (iter->data);
+ calendar_config_remove_notification (notification);
+ }
+ g_list_free (list);
+ table_config->priv->notifications = NULL;
- /* If the new view is NULL, return right now */
- if (!table)
+ if (table == NULL)
return;
- priv->table = g_object_ref (table);
+ table_config->priv->table = g_object_ref (table);
/* Time zone */
- set_timezone (table);
+ calendar_table_config_set_timezone (table);
- not = calendar_config_add_notification_timezone (timezone_changed_cb, table_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
+ notification = calendar_config_add_notification_timezone (
+ calendar_table_config_timezone_changed_cb, table_config);
+ table_config->priv->notifications = g_list_prepend (
+ table_config->priv->notifications,
+ GUINT_TO_POINTER (notification));
/* 24 Hour format */
- set_twentyfour_hour (table);
+ calendar_table_config_set_twentyfour_hour (table);
- not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, table_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
+ notification = calendar_config_add_notification_24_hour_format (
+ calendar_table_config_twentyfour_hour_changed_cb, table_config);
+ table_config->priv->notifications = g_list_prepend (
+ table_config->priv->notifications,
+ GUINT_TO_POINTER (notification));
/* Date cell */
- priv->cell_config = e_cell_date_edit_config_new (table->dates_cell);
+ table_config->priv->cell_config =
+ e_cell_date_edit_config_new (table->dates_cell);
}
Modified: branches/kill-bonobo/calendar/gui/e-calendar-table-config.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-calendar-table-config.h (original)
+++ branches/kill-bonobo/calendar/gui/e-calendar-table-config.h Wed Sep 24 22:53:30 2008
@@ -21,24 +21,38 @@
*
*/
-#ifndef _E_CALENDAR_TABLE_CONFIG_H_
-#define _E_CALENDAR_TABLE_CONFIG_H_
+#ifndef E_CALENDAR_TABLE_CONFIG_H
+#define E_CALENDAR_TABLE_CONFIG_H
#include "e-calendar-table.h"
-G_BEGIN_DECLS
+/* Standard GObject macros */
+#define E_TYPE_CALENDAR_TABLE_CONFIG \
+ (e_calendar_table_config_get_type ())
+#define E_CALENDAR_TABLE_CONFIG(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_CALENDAR_TABLE_CONFIG, ECalendarTableConfig))
+#define E_CALENDAR_TABLE_CONFIG_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_CALENDAR_TABLE_CONFIG, ECalendarTableConfigClass))
+#define E_IS_CALENDAR_TABLE_CONFIG(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_CALENDAR_TABLE_CONFIG))
+#define E_IS_CALENDAR_TABLE_CONFIG_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_CALENDAR_TABLE_CONFIG))
+#define E_CALENDAR_TABLE_CONFIG_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_CALENDAR_TABLE_CONFIG, ECalendarTableConfigClass))
-#define E_CALENDAR_TABLE_CONFIG(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, e_calendar_table_config_get_type (), ECalendarTableConfig)
-#define E_CALENDAR_TABLE_CONFIG_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, e_calendar_table_config_get_type (), ECalendarTableConfigClass)
-#define E_IS_CALENDAR_TABLE_CONFIG(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, e_calendar_table_config_get_type ())
+G_BEGIN_DECLS
-typedef struct _ECalendarTableConfig ECalendarTableConfig;
-typedef struct _ECalendarTableConfigClass ECalendarTableConfigClass;
+typedef struct _ECalendarTableConfig ECalendarTableConfig;
+typedef struct _ECalendarTableConfigClass ECalendarTableConfigClass;
typedef struct _ECalendarTableConfigPrivate ECalendarTableConfigPrivate;
struct _ECalendarTableConfig {
GObject parent;
-
ECalendarTableConfigPrivate *priv;
};
@@ -46,11 +60,15 @@
GObjectClass parent_class;
};
-GType e_calendar_table_config_get_type (void);
-ECalendarTableConfig *e_calendar_table_config_new (ECalendarTable *table);
-ECalendarTable *e_calendar_table_config_get_table (ECalendarTableConfig *view_config);
-void e_calendar_table_config_set_table (ECalendarTableConfig *view_config, ECalendarTable *table);
+GType e_calendar_table_config_get_type(void);
+ECalendarTableConfig *
+ e_calendar_table_config_new (ECalendarTable *table);
+ECalendarTable *e_calendar_table_config_get_table
+ (ECalendarTableConfig *table_config);
+void e_calendar_table_config_set_table
+ (ECalendarTableConfig *table_config,
+ ECalendarTable *table);
G_END_DECLS
-#endif
+#endif /* E_CALENDAR_TABLE_CONFIG_H */
Modified: branches/kill-bonobo/calendar/gui/e-calendar-table.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-calendar-table.c (original)
+++ branches/kill-bonobo/calendar/gui/e-calendar-table.c Wed Sep 24 22:53:30 2008
@@ -65,6 +65,16 @@
#include "e-tasks.h"
#include "misc.h"
+#define E_CALENDAR_TABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CALENDAR_TABLE, ECalendarTablePrivate))
+
+struct _ECalendarTablePrivate {
+ gpointer shell_view; /* weak pointer */
+
+ EActivity *activity;
+};
+
enum TargetType{
TARGET_TYPE_VCALENDAR
};
@@ -76,12 +86,6 @@
static guint n_target_types = G_N_ELEMENTS (target_types);
-extern ECompEditorRegistry *comp_editor_registry;
-
-static void e_calendar_table_class_init (ECalendarTableClass *class);
-static void e_calendar_table_init (ECalendarTable *cal_table);
-static void e_calendar_table_destroy (GtkObject *object);
-
static void e_calendar_table_on_double_click (ETable *table,
gint row,
gint col,
@@ -118,7 +122,8 @@
LAST_SIGNAL
};
-static guint signals[LAST_SIGNAL] = { 0 };
+static gpointer parent_class;
+static guint signals[LAST_SIGNAL];
/* The icons to represent the task. */
#define E_CALENDAR_MODEL_NUM_ICONS 4
@@ -129,30 +134,395 @@
static GdkAtom clipboard_atom = GDK_NONE;
-G_DEFINE_TYPE (ECalendarTable, e_calendar_table, GTK_TYPE_TABLE)
+static void
+calendar_table_emit_user_created (ECalendarTable *cal_table)
+{
+ g_signal_emit (cal_table, signals[USER_CREATED], 0);
+}
+
+static void
+calendar_table_set_shell_view (ECalendarTable *cal_table,
+ EShellView *shell_view)
+{
+ g_return_if_fail (cal_table->priv->shell_view == NULL);
+
+ cal_table->priv->shell_view = shell_view;
+
+ g_object_add_weak_pointer (
+ G_OBJECT (shell_view),
+ &cal_table->priv->shell_view);
+}
+
+static void
+calendar_table_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ calendar_table_set_shell_view (
+ E_CALENDAR_TABLE (object),
+ g_value_get_object (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+calendar_table_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ g_value_set_object (
+ value, e_calendar_table_get_shell_view (
+ E_CALENDAR_TABLE (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+calendar_table_dispose (GObject *object)
+{
+ ECalendarTable *cal_table;
+
+ cal_table = E_CALENDAR_TABLE (object);
+
+ if (cal_table->model != NULL) {
+ g_object_unref (cal_table->model);
+ cal_table->model = NULL;
+ }
+
+ if (cal_table->priv->activity != NULL) {
+ /* XXX Activity is not cancellable. */
+ e_activity_complete (cal_table->priv->activity);
+ g_object_unref (cal_table->priv->activity);
+ cal_table->priv->activity = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+calendar_table_class_init (ECalendarTableClass *class)
+{
+ GObjectClass *object_class;
+
+ parent_class = g_type_class_peek_parent (class);
+ g_type_class_add_private (class, sizeof (ECalendarTablePrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = calendar_table_dispose;
+
+ signals[USER_CREATED] =
+ g_signal_new ("user_created",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ECalendarTableClass, user_created),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
+}
static void
-e_calendar_table_class_init (ECalendarTableClass *class)
+calendar_table_init (ECalendarTable *cal_table)
+{
+ GtkWidget *table;
+ ETable *e_table;
+ ECell *cell, *popup_cell;
+ ETableExtras *extras;
+ gint i;
+ GdkPixbuf *pixbuf;
+ GList *strings;
+ AtkObject *a11y;
+ char *etspecfile;
+
+ cal_table->priv = E_CALENDAR_TABLE_GET_PRIVATE (cal_table);
+
+ /* Create the model */
+
+ cal_table->model = (ECalModel *) e_cal_model_tasks_new ();
+ g_signal_connect_swapped (
+ cal_table->model, "row_appended",
+ G_CALLBACK (calendar_table_emit_user_created), cal_table);
+
+ /* Create the header columns */
+
+ extras = e_table_extras_new ();
+
+ /*
+ * Normal string fields.
+ */
+ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
+ g_object_set (G_OBJECT (cell),
+ "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
+ "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
+ "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
+ NULL);
+
+ e_table_extras_add_cell (extras, "calstring", cell);
+
+
+ /*
+ * Date fields.
+ */
+ cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT);
+ g_object_set (G_OBJECT (cell),
+ "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
+ "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
+ "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
+ NULL);
+
+ popup_cell = e_cell_date_edit_new ();
+ e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
+ g_object_unref (cell);
+ e_table_extras_add_cell (extras, "dateedit", popup_cell);
+ cal_table->dates_cell = E_CELL_DATE_EDIT (popup_cell);
+
+ e_cell_date_edit_set_get_time_callback (E_CELL_DATE_EDIT (popup_cell),
+ e_calendar_table_get_current_time,
+ cal_table, NULL);
+
+
+ /*
+ * Combo fields.
+ */
+
+ /* Classification field. */
+ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
+ g_object_set (G_OBJECT (cell),
+ "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
+ "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
+ "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
+
+ popup_cell = e_cell_combo_new ();
+ e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
+ g_object_unref (cell);
+
+ strings = NULL;
+ strings = g_list_append (strings, (char*) _("Public"));
+ strings = g_list_append (strings, (char*) _("Private"));
+ strings = g_list_append (strings, (char*) _("Confidential"));
+ e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
+ strings);
+
+ e_table_extras_add_cell (extras, "classification", popup_cell);
+
+ /* Priority field. */
+ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
+ g_object_set (G_OBJECT (cell),
+ "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
+ "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
+ "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
+
+ popup_cell = e_cell_combo_new ();
+ e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
+ g_object_unref (cell);
+
+ strings = NULL;
+ strings = g_list_append (strings, (char*) _("High"));
+ strings = g_list_append (strings, (char*) _("Normal"));
+ strings = g_list_append (strings, (char*) _("Low"));
+ strings = g_list_append (strings, (char*) _("Undefined"));
+ e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
+ strings);
+
+ e_table_extras_add_cell (extras, "priority", popup_cell);
+
+ /* Percent field. */
+ cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT);
+ g_object_set (G_OBJECT (cell),
+ "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
+ "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
+ "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
+ NULL);
+
+ popup_cell = e_cell_combo_new ();
+ e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
+ g_object_unref (cell);
+
+ strings = NULL;
+ strings = g_list_append (strings, (char*) _("0%"));
+ strings = g_list_append (strings, (char*) _("10%"));
+ strings = g_list_append (strings, (char*) _("20%"));
+ strings = g_list_append (strings, (char*) _("30%"));
+ strings = g_list_append (strings, (char*) _("40%"));
+ strings = g_list_append (strings, (char*) _("50%"));
+ strings = g_list_append (strings, (char*) _("60%"));
+ strings = g_list_append (strings, (char*) _("70%"));
+ strings = g_list_append (strings, (char*) _("80%"));
+ strings = g_list_append (strings, (char*) _("90%"));
+ strings = g_list_append (strings, (char*) _("100%"));
+ e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
+ strings);
+
+ e_table_extras_add_cell (extras, "percent", popup_cell);
+
+ /* Transparency field. */
+ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
+ g_object_set (G_OBJECT (cell),
+ "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
+ "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
+ "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
+
+ popup_cell = e_cell_combo_new ();
+ e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
+ g_object_unref (cell);
+
+ strings = NULL;
+ strings = g_list_append (strings, (char*) _("Free"));
+ strings = g_list_append (strings, (char*) _("Busy"));
+ e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
+ strings);
+
+ e_table_extras_add_cell (extras, "transparency", popup_cell);
+
+ /* Status field. */
+ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
+ g_object_set (G_OBJECT (cell),
+ "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
+ "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
+ "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
+
+ popup_cell = e_cell_combo_new ();
+ e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
+ g_object_unref (cell);
+
+ strings = NULL;
+ strings = g_list_append (strings, (char*) _("Not Started"));
+ strings = g_list_append (strings, (char*) _("In Progress"));
+ strings = g_list_append (strings, (char*) _("Completed"));
+ strings = g_list_append (strings, (char*) _("Canceled"));
+ e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
+ strings);
+
+ e_table_extras_add_cell (extras, "calstatus", popup_cell);
+
+ e_table_extras_add_compare (extras, "date-compare",
+ date_compare_cb);
+ e_table_extras_add_compare (extras, "percent-compare",
+ percent_compare_cb);
+ e_table_extras_add_compare (extras, "priority-compare",
+ priority_compare_cb);
+ e_table_extras_add_compare (extras, "status-compare",
+ status_compare_cb);
+
+ /* Create pixmaps */
+
+ if (!icon_pixbufs[0])
+ for (i = 0; i < E_CALENDAR_MODEL_NUM_ICONS; i++) {
+ icon_pixbufs[i] = e_icon_factory_get_icon (icon_names[i], E_ICON_SIZE_LIST);
+ }
+
+ cell = e_cell_toggle_new (0, E_CALENDAR_MODEL_NUM_ICONS, icon_pixbufs);
+ e_table_extras_add_cell(extras, "icon", cell);
+ e_table_extras_add_pixbuf(extras, "icon", icon_pixbufs[0]);
+
+ pixbuf = e_icon_factory_get_icon ("stock_check-filled", E_ICON_SIZE_LIST);
+ e_table_extras_add_pixbuf(extras, "complete", pixbuf);
+ g_object_unref(pixbuf);
+
+ /* Create the table */
+
+ etspecfile = g_build_filename (EVOLUTION_ETSPECDIR,
+ "e-calendar-table.etspec",
+ NULL);
+ table = e_table_scrolled_new_from_spec_file (E_TABLE_MODEL (cal_table->model),
+ extras,
+ etspecfile,
+ NULL);
+ g_free (etspecfile);
+
+ /* FIXME: this causes a message from GLib about 'extras' having only a floating
+ reference */
+ /* g_object_unref (extras); */
+
+ cal_table->etable = table;
+ gtk_table_attach (GTK_TABLE (cal_table), table, 0, 1, 0, 1,
+ GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+ gtk_widget_show (table);
+
+
+ e_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (table));
+ g_signal_connect (e_table, "double_click", G_CALLBACK (e_calendar_table_on_double_click), cal_table);
+ g_signal_connect (e_table, "right_click", G_CALLBACK (e_calendar_table_on_right_click), cal_table);
+ g_signal_connect (e_table, "key_press", G_CALLBACK (e_calendar_table_on_key_press), cal_table);
+ g_signal_connect (e_table, "popup_menu", G_CALLBACK (e_calendar_table_on_popup_menu), cal_table);
+ g_signal_connect (e_table, "query-tooltip", G_CALLBACK (query_tooltip_cb), cal_table);
+ gtk_widget_set_has_tooltip (GTK_WIDGET (e_table), TRUE);
+
+ a11y = gtk_widget_get_accessible ((GtkWidget *)e_table);
+ if (a11y)
+ atk_object_set_name (a11y, _("Tasks"));
+}
+
+GType
+e_calendar_table_get_type (void)
+{
+ static GType type = 0;
+
+ if (G_UNLIKELY (type == 0)) {
+ static const GTypeInfo type_info = {
+ sizeof (ECalendarTableClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) calendar_table_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class_data */
+ sizeof (ECalendarTable),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) calendar_table_init,
+ NULL /* value_table */
+ };
+
+ type = g_type_register_static (
+ GTK_TYPE_TABLE, "ECalendarTable", &type_info, 0);
+ }
+
+ return type;
+}
+
+/**
+ * e_calendar_table_new:
+ * @shell_view: an #EShellView
+ *
+ * Returns a new #ECalendarTable.
+ *
+ * Returns: a new #ECalendarTable
+ **/
+GtkWidget *
+e_calendar_table_new (EShellView *shell_view)
{
- GtkObjectClass *object_class;
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
- object_class = (GtkObjectClass *) class;
-
- /* Method override */
- object_class->destroy = e_calendar_table_destroy;
+ return g_object_new (
+ E_TYPE_CALENDAR_TABLE,
+ "shell-view", shell_view, NULL);
+}
- signals[USER_CREATED] =
- g_signal_new ("user_created",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECalendarTableClass, user_created),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+EShellView *
+e_calendar_table_get_shell_view (ECalendarTable *cal_table)
+{
+ g_return_val_if_fail (E_IS_CALENDAR_TABLE (cal_table), NULL);
- /* clipboard atom */
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
+ return cal_table->priv->shell_view;
}
static gint
@@ -257,12 +627,6 @@
}
static void
-row_appended_cb (ECalModel *model, ECalendarTable *cal_table)
-{
- g_signal_emit (cal_table, signals[USER_CREATED], 0);
-}
-
-static void
get_time_as_text (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t_zone, char *buff, int buff_len)
{
struct tm tmp_tm;
@@ -321,403 +685,148 @@
if (!comp || !comp->icalcomp)
return FALSE;
- new_comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (new_comp, icalcomponent_new_clone (comp->icalcomp))) {
- g_object_unref (new_comp);
- return FALSE;
- }
-
- box = gtk_vbox_new (FALSE, 0);
-
- str = e_calendar_view_get_icalcomponent_summary (comp->client, comp->icalcomp, &free_text);
- if (!(str && *str)) {
- if (free_text)
- g_free ((char *)str);
- free_text = FALSE;
- str = _("* No Summary *");
- }
-
- l = gtk_label_new (NULL);
- tmp = g_markup_printf_escaped ("<b>%s</b>", str);
- gtk_label_set_line_wrap (GTK_LABEL (l), TRUE);
- gtk_label_set_markup (GTK_LABEL (l), tmp);
- gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
- w = gtk_event_box_new ();
-
- gtk_widget_modify_bg (w, GTK_STATE_NORMAL, &(style->bg[GTK_STATE_SELECTED]));
- gtk_widget_modify_fg (l, GTK_STATE_NORMAL, &(style->text[GTK_STATE_SELECTED]));
- gtk_container_add (GTK_CONTAINER (w), l);
- gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
- g_free (tmp);
-
- if (free_text)
- g_free ((char *)str);
- free_text = FALSE;
-
- w = gtk_event_box_new ();
- gtk_widget_modify_bg (w, GTK_STATE_NORMAL, &(style->bg[GTK_STATE_NORMAL]));
-
- l = gtk_vbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (w), l);
- gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0);
- w = l;
-
- e_cal_component_get_organizer (new_comp, &organizer);
- if (organizer.cn) {
- char *ptr ;
- ptr = strchr( organizer.value, ':');
-
- if (ptr) {
- ptr++;
- /* To Translators: It will display "Organiser: NameOfTheUser <email ofuser com>" */
- tmp = g_strdup_printf (_("Organizer: %s <%s>"), organizer.cn, ptr);
- } else {
- /* With SunOne accounts, there may be no ':' in organiser.value */
- tmp = g_strdup_printf (_("Organizer: %s"), organizer.cn);
- }
-
- l = gtk_label_new (tmp);
- gtk_label_set_line_wrap (GTK_LABEL (l), FALSE);
- gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (w), l, FALSE, FALSE, 0);
- g_free (tmp);
- }
-
- e_cal_component_get_dtstart (new_comp, &dtstart);
- e_cal_component_get_due (new_comp, &dtdue);
-
- default_zone = e_cal_model_get_timezone (cal_table->model);
-
- if (dtstart.tzid) {
- zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (new_comp), dtstart.tzid);
- if (!zone)
- e_cal_get_timezone (comp->client, dtstart.tzid, &zone, NULL);
- if (!zone)
- zone = default_zone;
- } else {
- zone = NULL;
- }
-
- tmp2 = g_string_new ("");
-
- if (dtstart.value) {
- get_time_as_text (dtstart.value, zone, default_zone, buff, 1000);
-
- if (buff [0]) {
- g_string_append (tmp2, _("Start: "));
- g_string_append (tmp2, buff);
- }
- }
-
- if (dtdue.value) {
- get_time_as_text (dtdue.value, zone, default_zone, buff, 1000);
-
- if (buff [0]) {
- if (tmp2->len)
- g_string_append (tmp2, "; ");
-
- g_string_append (tmp2, _("Due: "));
- g_string_append (tmp2, buff);
- }
- }
-
- if (tmp2->len) {
- l = gtk_label_new (tmp2->str);
- gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (w), l, FALSE, FALSE, 0);
- }
-
- g_string_free (tmp2, TRUE);
-
- e_cal_component_free_datetime (&dtstart);
- e_cal_component_free_datetime (&dtdue);
-
- tmp2 = g_string_new ("");
- e_cal_component_get_description_list (new_comp, &desc);
- for (len = 0, p = desc; p != NULL; p = p->next) {
- ECalComponentText *text = p->data;
-
- if (text->value != NULL) {
- len += strlen (text->value);
- g_string_append (tmp2, text->value);
- if (len > 1024) {
- g_string_set_size (tmp2, 1020);
- g_string_append (tmp2, "...");
- break;
- }
- }
- }
- e_cal_component_free_text_list (desc);
-
- if (tmp2->len) {
- l = gtk_label_new (tmp2->str);
- gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (box), l, FALSE, FALSE, 0);
- }
-
- g_string_free (tmp2, TRUE);
-
- gtk_widget_show_all (box);
- gtk_tooltip_set_custom (tooltip, box);
-
- g_object_unref (new_comp);
-
- return TRUE;
-}
-
-static void
-e_calendar_table_init (ECalendarTable *cal_table)
-{
- GtkWidget *table;
- ETable *e_table;
- ECell *cell, *popup_cell;
- ETableExtras *extras;
- gint i;
- GdkPixbuf *pixbuf;
- GList *strings;
- AtkObject *a11y;
- char *etspecfile;
-
- /* Create the model */
-
- cal_table->model = (ECalModel *) e_cal_model_tasks_new ();
- g_signal_connect (cal_table->model, "row_appended", G_CALLBACK (row_appended_cb), cal_table);
-
- cal_table->user_created_cal = NULL;
-
- /* Create the header columns */
-
- extras = e_table_extras_new();
-
- /*
- * Normal string fields.
- */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- NULL);
-
- e_table_extras_add_cell (extras, "calstring", cell);
-
-
- /*
- * Date fields.
- */
- cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- NULL);
-
- popup_cell = e_cell_date_edit_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
- e_table_extras_add_cell (extras, "dateedit", popup_cell);
- cal_table->dates_cell = E_CELL_DATE_EDIT (popup_cell);
-
- e_cell_date_edit_set_get_time_callback (E_CELL_DATE_EDIT (popup_cell),
- e_calendar_table_get_current_time,
- cal_table, NULL);
-
-
- /*
- * Combo fields.
- */
-
- /* Classification field. */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- "editable", FALSE,
- NULL);
-
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Public"));
- strings = g_list_append (strings, (char*) _("Private"));
- strings = g_list_append (strings, (char*) _("Confidential"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
-
- e_table_extras_add_cell (extras, "classification", popup_cell);
-
- /* Priority field. */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- "editable", FALSE,
- NULL);
-
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("High"));
- strings = g_list_append (strings, (char*) _("Normal"));
- strings = g_list_append (strings, (char*) _("Low"));
- strings = g_list_append (strings, (char*) _("Undefined"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
+ new_comp = e_cal_component_new ();
+ if (!e_cal_component_set_icalcomponent (new_comp, icalcomponent_new_clone (comp->icalcomp))) {
+ g_object_unref (new_comp);
+ return FALSE;
+ }
- e_table_extras_add_cell (extras, "priority", popup_cell);
+ box = gtk_vbox_new (FALSE, 0);
- /* Percent field. */
- cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- NULL);
+ str = e_calendar_view_get_icalcomponent_summary (comp->client, comp->icalcomp, &free_text);
+ if (!(str && *str)) {
+ if (free_text)
+ g_free ((char *)str);
+ free_text = FALSE;
+ str = _("* No Summary *");
+ }
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ l = gtk_label_new (NULL);
+ tmp = g_markup_printf_escaped ("<b>%s</b>", str);
+ gtk_label_set_line_wrap (GTK_LABEL (l), TRUE);
+ gtk_label_set_markup (GTK_LABEL (l), tmp);
+ gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
+ w = gtk_event_box_new ();
- strings = NULL;
- strings = g_list_append (strings, (char*) _("0%"));
- strings = g_list_append (strings, (char*) _("10%"));
- strings = g_list_append (strings, (char*) _("20%"));
- strings = g_list_append (strings, (char*) _("30%"));
- strings = g_list_append (strings, (char*) _("40%"));
- strings = g_list_append (strings, (char*) _("50%"));
- strings = g_list_append (strings, (char*) _("60%"));
- strings = g_list_append (strings, (char*) _("70%"));
- strings = g_list_append (strings, (char*) _("80%"));
- strings = g_list_append (strings, (char*) _("90%"));
- strings = g_list_append (strings, (char*) _("100%"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
+ gtk_widget_modify_bg (w, GTK_STATE_NORMAL, &(style->bg[GTK_STATE_SELECTED]));
+ gtk_widget_modify_fg (l, GTK_STATE_NORMAL, &(style->text[GTK_STATE_SELECTED]));
+ gtk_container_add (GTK_CONTAINER (w), l);
+ gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
+ g_free (tmp);
- e_table_extras_add_cell (extras, "percent", popup_cell);
+ if (free_text)
+ g_free ((char *)str);
+ free_text = FALSE;
- /* Transparency field. */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ w = gtk_event_box_new ();
+ gtk_widget_modify_bg (w, GTK_STATE_NORMAL, &(style->bg[GTK_STATE_NORMAL]));
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ l = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (w), l);
+ gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0);
+ w = l;
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Free"));
- strings = g_list_append (strings, (char*) _("Busy"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
+ e_cal_component_get_organizer (new_comp, &organizer);
+ if (organizer.cn) {
+ char *ptr ;
+ ptr = strchr( organizer.value, ':');
- e_table_extras_add_cell (extras, "transparency", popup_cell);
+ if (ptr) {
+ ptr++;
+ /* To Translators: It will display "Organiser: NameOfTheUser <email ofuser com>" */
+ tmp = g_strdup_printf (_("Organizer: %s <%s>"), organizer.cn, ptr);
+ } else {
+ /* With SunOne accounts, there may be no ':' in organiser.value */
+ tmp = g_strdup_printf (_("Organizer: %s"), organizer.cn);
+ }
- /* Status field. */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ l = gtk_label_new (tmp);
+ gtk_label_set_line_wrap (GTK_LABEL (l), FALSE);
+ gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (w), l, FALSE, FALSE, 0);
+ g_free (tmp);
+ }
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ e_cal_component_get_dtstart (new_comp, &dtstart);
+ e_cal_component_get_due (new_comp, &dtdue);
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Not Started"));
- strings = g_list_append (strings, (char*) _("In Progress"));
- strings = g_list_append (strings, (char*) _("Completed"));
- strings = g_list_append (strings, (char*) _("Canceled"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
+ default_zone = e_cal_model_get_timezone (cal_table->model);
- e_table_extras_add_cell (extras, "calstatus", popup_cell);
+ if (dtstart.tzid) {
+ zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (new_comp), dtstart.tzid);
+ if (!zone)
+ e_cal_get_timezone (comp->client, dtstart.tzid, &zone, NULL);
+ if (!zone)
+ zone = default_zone;
+ } else {
+ zone = NULL;
+ }
- e_table_extras_add_compare (extras, "date-compare",
- date_compare_cb);
- e_table_extras_add_compare (extras, "percent-compare",
- percent_compare_cb);
- e_table_extras_add_compare (extras, "priority-compare",
- priority_compare_cb);
- e_table_extras_add_compare (extras, "status-compare",
- status_compare_cb);
+ tmp2 = g_string_new ("");
- /* Create pixmaps */
+ if (dtstart.value) {
+ get_time_as_text (dtstart.value, zone, default_zone, buff, 1000);
- if (!icon_pixbufs[0])
- for (i = 0; i < E_CALENDAR_MODEL_NUM_ICONS; i++) {
- icon_pixbufs[i] = e_icon_factory_get_icon (icon_names[i], E_ICON_SIZE_LIST);
+ if (buff [0]) {
+ g_string_append (tmp2, _("Start: "));
+ g_string_append (tmp2, buff);
}
+ }
- cell = e_cell_toggle_new (0, E_CALENDAR_MODEL_NUM_ICONS, icon_pixbufs);
- e_table_extras_add_cell(extras, "icon", cell);
- e_table_extras_add_pixbuf(extras, "icon", icon_pixbufs[0]);
+ if (dtdue.value) {
+ get_time_as_text (dtdue.value, zone, default_zone, buff, 1000);
- pixbuf = e_icon_factory_get_icon ("stock_check-filled", E_ICON_SIZE_LIST);
- e_table_extras_add_pixbuf(extras, "complete", pixbuf);
- g_object_unref(pixbuf);
+ if (buff [0]) {
+ if (tmp2->len)
+ g_string_append (tmp2, "; ");
- /* Create the table */
+ g_string_append (tmp2, _("Due: "));
+ g_string_append (tmp2, buff);
+ }
+ }
- etspecfile = g_build_filename (EVOLUTION_ETSPECDIR,
- "e-calendar-table.etspec",
- NULL);
- table = e_table_scrolled_new_from_spec_file (E_TABLE_MODEL (cal_table->model),
- extras,
- etspecfile,
- NULL);
- g_free (etspecfile);
+ if (tmp2->len) {
+ l = gtk_label_new (tmp2->str);
+ gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (w), l, FALSE, FALSE, 0);
+ }
- /* FIXME: this causes a message from GLib about 'extras' having only a floating
- reference */
- /* g_object_unref (extras); */
+ g_string_free (tmp2, TRUE);
- cal_table->etable = table;
- gtk_table_attach (GTK_TABLE (cal_table), table, 0, 1, 0, 1,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (table);
+ e_cal_component_free_datetime (&dtstart);
+ e_cal_component_free_datetime (&dtdue);
+ tmp2 = g_string_new ("");
+ e_cal_component_get_description_list (new_comp, &desc);
+ for (len = 0, p = desc; p != NULL; p = p->next) {
+ ECalComponentText *text = p->data;
- e_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (table));
- g_signal_connect (e_table, "double_click", G_CALLBACK (e_calendar_table_on_double_click), cal_table);
- g_signal_connect (e_table, "right_click", G_CALLBACK (e_calendar_table_on_right_click), cal_table);
- g_signal_connect (e_table, "key_press", G_CALLBACK (e_calendar_table_on_key_press), cal_table);
- g_signal_connect (e_table, "popup_menu", G_CALLBACK (e_calendar_table_on_popup_menu), cal_table);
- g_signal_connect (e_table, "query-tooltip", G_CALLBACK (query_tooltip_cb), cal_table);
- gtk_widget_set_has_tooltip (GTK_WIDGET (e_table), TRUE);
+ if (text->value != NULL) {
+ len += strlen (text->value);
+ g_string_append (tmp2, text->value);
+ if (len > 1024) {
+ g_string_set_size (tmp2, 1020);
+ g_string_append (tmp2, "...");
+ break;
+ }
+ }
+ }
+ e_cal_component_free_text_list (desc);
- a11y = gtk_widget_get_accessible ((GtkWidget *)e_table);
- if (a11y)
- atk_object_set_name (a11y, _("Tasks"));
-}
+ if (tmp2->len) {
+ l = gtk_label_new (tmp2->str);
+ gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (box), l, FALSE, FALSE, 0);
+ }
+ g_string_free (tmp2, TRUE);
-/**
- * e_calendar_table_new:
- * @Returns: a new #ECalendarTable.
- *
- * Creates a new #ECalendarTable.
- **/
-GtkWidget *
-e_calendar_table_new (void)
-{
- GtkWidget *cal_table;
+ gtk_widget_show_all (box);
+ gtk_tooltip_set_custom (tooltip, box);
- cal_table = GTK_WIDGET (g_object_new (e_calendar_table_get_type (), NULL));
+ g_object_unref (new_comp);
- return cal_table;
+ return TRUE;
}
@@ -739,21 +848,6 @@
}
-static void
-e_calendar_table_destroy (GtkObject *object)
-{
- ECalendarTable *cal_table;
-
- cal_table = E_CALENDAR_TABLE (object);
-
- if (cal_table->model) {
- g_object_unref (cal_table->model);
- cal_table->model = NULL;
- }
-
- GTK_OBJECT_CLASS (e_calendar_table_parent_class)->destroy (object);
-}
-
/**
* e_calendar_table_get_table:
* @cal_table: A calendar table.
@@ -1836,20 +1930,35 @@
#endif
void
-e_calendar_table_set_activity_handler (ECalendarTable *cal_table, EActivityHandler *activity_handler)
+e_calendar_table_set_status_message (ECalendarTable *cal_table,
+ const gchar *message,
+ gdouble percent)
{
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- cal_table->activity_handler = activity_handler;
-}
+ EActivity *activity;
+ EShellView *shell_view;
-void
-e_calendar_table_set_status_message (ECalendarTable *cal_table, const gchar *message, int percent)
-{
g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
- if (!cal_table->activity_handler)
- return;
+ activity = cal_table->priv->activity;
+ shell_view = e_calendar_table_get_shell_view (cal_table);
+
+ if (message == NULL || *message == '\0') {
+ if (activity != NULL) {
+ e_activity_complete (activity);
+ g_object_unref (activity);
+ cal_table->priv->activity = NULL;
+ }
+
+ } else if (activity == NULL) {
+ activity = e_activity_new (message);
+ cal_able->priv->activity = activity;
+ e_activity_set_percent (activity, percent);
+ e_shell_view_add_activity (shell_view, activity);
+
+ } else {
+ e_activity_set_percent (activity, percent);
+ e_activity_set_primary_text (activity, message);
+ }
if (!message || !*message) {
if (cal_table->activity_id != 0) {
Modified: branches/kill-bonobo/calendar/gui/e-calendar-table.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-calendar-table.h (original)
+++ branches/kill-bonobo/calendar/gui/e-calendar-table.h Wed Sep 24 22:53:30 2008
@@ -23,29 +23,43 @@
#ifndef _E_CALENDAR_TABLE_H_
#define _E_CALENDAR_TABLE_H_
-#include <gtk/gtk.h>
+#include <shell/e-shell-view.h>
#include <table/e-table-scrolled.h>
#include <misc/e-cell-date-edit.h>
#include "e-cal-model.h"
-G_BEGIN_DECLS
-
/*
* ECalendarTable - displays the iCalendar objects in a table (an ETable).
* Used for calendar events and tasks.
*/
-#define E_CALENDAR_TABLE(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, e_calendar_table_get_type (), ECalendarTable)
-#define E_CALENDAR_TABLE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, e_calendar_table_get_type (), ECalendarTableClass)
-#define E_IS_CALENDAR_TABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, e_calendar_table_get_type ())
-
+/* Standard GObject macros */
+#define E_TYPE_CALENDAR_TABLE \
+ (e_calendar_table_get_type ())
+#define E_CALENDAR_TABLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_CALENDAR_TABLE, ECalendarTable))
+#define E_CALENDAR_TABLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_CALENDAR_TABLE, ECalendarTableClass))
+#define E_IS_CALENDAR_TABLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_CALENDAR_TABLE))
+#define E_IS_CALENDAR_TABLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_CALENDAR_TABLE))
+#define E_CALENDAR_TABLE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_CALENDAR_TABLE, ECalendarTableClass))
-typedef struct _ECalendarTable ECalendarTable;
-typedef struct _ECalendarTableClass ECalendarTableClass;
+G_BEGIN_DECLS
+typedef struct _ECalendarTable ECalendarTable;
+typedef struct _ECalendarTableClass ECalendarTableClass;
+typedef struct _ECalendarTablePrivate ECalendarTablePrivate;
struct _ECalendarTable {
- GtkTable table;
+ GtkTable parent;
/* The model that we use */
ECalModel *model;
@@ -58,14 +72,9 @@
/* Fields used for cut/copy/paste */
icalcomponent *tmp_vcal;
-#if 0 /* KILL-BONOBO */
- /* Activity ID for the EActivityHandler (i.e. the status bar). */
- EActivityHandler *activity_handler;
- guint activity_id;
-#endif
-
- /* We should know which calendar has been used to create object, so store it here
- before emitting "user_created" signal and make it NULL just after the emit. */
+ /* We should know which calendar has been used to create object,
+ * so store it here before emitting "user_created" signal and make
+ * it NULL just after the emit. */
ECal *user_created_cal;
};
@@ -77,42 +86,48 @@
};
-GType e_calendar_table_get_type (void);
-GtkWidget* e_calendar_table_new (void);
-
-ECalModel *e_calendar_table_get_model (ECalendarTable *cal_table);
-
-ETable *e_calendar_table_get_table (ECalendarTable *cal_table);
-
-void e_calendar_table_open_selected (ECalendarTable *cal_table);
-void e_calendar_table_complete_selected (ECalendarTable *cal_table);
-void e_calendar_table_delete_selected (ECalendarTable *cal_table);
-
-GSList *e_calendar_table_get_selected (ECalendarTable *cal_table);
+GType e_calendar_table_get_type (void);
+GtkWidget * e_calendar_table_new (void);
+ECalModel * e_calendar_table_get_model (ECalendarTable *cal_table);
+ETable * e_calendar_table_get_table (ECalendarTable *cal_table);
+EShellView * e_calendar_table_get_shell_view (ECalendarTable *cal_table);
+void e_calendar_table_open_selected (ECalendarTable *cal_table);
+void e_calendar_table_complete_selected
+ (ECalendarTable *cal_table);
+void e_calendar_table_delete_selected(ECalendarTable *cal_table);
+GSList * e_calendar_table_get_selected (ECalendarTable *cal_table);
/* Clipboard related functions */
-void e_calendar_table_cut_clipboard (ECalendarTable *cal_table);
-void e_calendar_table_copy_clipboard (ECalendarTable *cal_table);
-void e_calendar_table_paste_clipboard (ECalendarTable *cal_table);
+void e_calendar_table_cut_clipboard (ECalendarTable *cal_table);
+void e_calendar_table_copy_clipboard (ECalendarTable *cal_table);
+void e_calendar_table_paste_clipboard(ECalendarTable *cal_table);
/* These load and save the state of the table (headers shown etc.) to/from
the given file. */
-void e_calendar_table_load_state (ECalendarTable *cal_table,
- gchar *filename);
-void e_calendar_table_save_state (ECalendarTable *cal_table,
- gchar *filename);
-
-void e_calendar_table_set_status_message (ECalendarTable *cal_table,
- const gchar *message,
- int percent);
-void e_calendar_table_open_task (ECalendarTable *cal_table,
- ECal *client,
- icalcomponent *icalcomp,
- gboolean assign);
-ECalModelComponent * e_calendar_table_get_selected_comp (ECalendarTable *cal_table);
-void e_calendar_table_hide_completed_tasks (ECalendarTable *table, GList *clients_list, gboolean config_changed);
-
-void e_calendar_table_process_completed_tasks (ECalendarTable *table, GList *clients_list, gboolean config_changed);
+void e_calendar_table_load_state (ECalendarTable *cal_table,
+ gchar *filename);
+void e_calendar_table_save_state (ECalendarTable *cal_table,
+ gchar *filename);
+
+void e_calendar_table_set_status_message
+ (ECalendarTable *cal_table,
+ const gchar *message,
+ gdouble percent);
+void e_calendar_table_open_task (ECalendarTable *cal_table,
+ ECal *client,
+ icalcomponent *icalcomp,
+ gboolean assign);
+ECalModelComponent *
+ e_calendar_table_get_selected_comp
+ (ECalendarTable *cal_table);
+void e_calendar_table_hide_completed_tasks
+ (ECalendarTable *table,
+ GList *clients_list,
+ gboolean config_changed);
+void e_calendar_table_process_completed_tasks
+ (ECalendarTable *table,
+ GList *clients_list,
+ gboolean config_changed);
G_END_DECLS
Modified: branches/kill-bonobo/calendar/gui/e-calendar-view.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-calendar-view.c (original)
+++ branches/kill-bonobo/calendar/gui/e-calendar-view.c Wed Sep 24 22:53:30 2008
@@ -35,7 +35,7 @@
#include <e-util/e-error.h>
#include <e-util/e-dialog-utils.h>
#include <e-util/e-icon-factory.h>
-#include "e-calendar-marshal.h"
+#include <e-util/e-util.h>
#include <libecal/e-cal-time-util.h>
#include <libecal/e-cal-component.h>
@@ -82,7 +82,6 @@
static void open_event_with_flags (ECalendarView *cal_view, ECal *client, icalcomponent *icalcomp, guint32 flags);
static GdkAtom clipboard_atom = GDK_NONE;
-extern ECompEditorRegistry *comp_editor_registry;
/* Property IDs */
enum props {
@@ -194,7 +193,7 @@
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ECalendarViewClass, timezone_changed),
NULL, NULL,
- e_calendar_marshal_VOID__POINTER_POINTER,
+ e_marshal_VOID__POINTER_POINTER,
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
e_calendar_view_signals[EVENT_CHANGED] =
Modified: branches/kill-bonobo/calendar/gui/e-meeting-time-sel.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-meeting-time-sel.c (original)
+++ branches/kill-bonobo/calendar/gui/e-meeting-time-sel.c Wed Sep 24 22:53:30 2008
@@ -46,7 +46,6 @@
#include <e-util/e-cursor.h>
#include <e-util/e-util.h>
-#include "calendar-component.h"
#include "calendar-config.h"
#include "e-meeting-utils.h"
#include "e-meeting-list-view.h"
Copied: branches/kill-bonobo/calendar/gui/e-memo-preview.c (from r36307, /branches/kill-bonobo/calendar/gui/e-cal-component-memo-preview.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-cal-component-memo-preview.c (original)
+++ branches/kill-bonobo/calendar/gui/e-memo-preview.c Wed Sep 24 22:53:30 2008
@@ -23,53 +23,53 @@
* Nathan Owens <pianocomp81 yahoo com>
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "e-memo-preview.h"
#include <string.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <libgnome/gnome-url.h>
#include <libecal/e-cal-time-util.h>
#include <libedataserver/e-categories.h>
-#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-stream.h>
#include <libedataserver/e-time-utils.h>
#include <e-util/e-categories-config.h>
#include "calendar-config.h"
-#include "e-cal-component-memo-preview.h"
#include "e-cal-component-preview.h"
#include <camel/camel-mime-filter-tohtml.h>
-struct _ECalComponentMemoPreviewPrivate {
- GtkWidget *html;
+#define E_MEMO_PREVIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEMO_PREVIEW, EMemoPreviewPrivate))
+struct _EMemoPreviewPrivate {
icaltimezone *zone;
};
-G_DEFINE_TYPE (ECalComponentMemoPreview, e_cal_component_memo_preview, GTK_TYPE_TABLE)
-
+static gpointer parent_class;
static void
-on_link_clicked (GtkHTML *html, const char *url, gpointer data)
+memo_preview_link_clicked (GtkHTML *html,
+ const gchar *url)
{
- GError *err = NULL;
+ GdkScreen *screen;
+ GError *error = NULL;
- gnome_url_show (url, &err);
+ screen = gtk_widget_get_screen (GTK_WIDGET (html));
+ gtk_show_uri (screen, url, GDK_CURRENT_TIME, &error);
- if (err) {
- g_warning ("gnome_url_show: %s", err->message);
- g_error_free (err);
+ if (error != NULL) {
+ g_warning ("%s", error->message);
+ g_error_free (error);
}
}
static void
-on_url_cb (GtkHTML *html, const char *url, gpointer data)
+memo_preview_on_url (GtkHTML *html,
+ const gchar *url)
{
#if 0
char *msg;
- ECalComponentMemoPreview *preview = data;
+ EMemoPreview *preview = data;
if (url && *url) {
msg = g_strdup_printf (_("Click to open %s"), url);
@@ -82,7 +82,9 @@
/* Converts a time_t to a string, relative to the specified timezone */
static char *
-timet_to_str_with_zone (ECalComponentDateTime *dt, ECal *ecal, icaltimezone *default_zone)
+timet_to_str_with_zone (ECalComponentDateTime *dt,
+ ECal *ecal,
+ icaltimezone *default_zone)
{
struct icaltimetype itt;
icaltimezone *zone;
@@ -112,7 +114,10 @@
}
static void
-write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone *default_zone)
+memo_preview_write_html (GtkHTMLStream *stream,
+ ECal *ecal,
+ ECalComponent *comp,
+ icaltimezone *default_zone)
{
ECalComponentText text;
ECalComponentDateTime dt;
@@ -232,135 +237,120 @@
}
static void
-e_cal_component_memo_preview_init (ECalComponentMemoPreview *preview)
+memo_preview_finalize (GObject *object)
{
- ECalComponentMemoPreviewPrivate *priv;
- GtkWidget *scroll;
+ EMemoPreviewPrivate *priv;
- priv = g_new0 (ECalComponentMemoPreviewPrivate, 1);
- preview->priv = priv;
+ priv = E_MEMO_PREVIEW_GET_PRIVATE (object);
- priv->html = gtk_html_new ();
- gtk_html_set_default_content_type (GTK_HTML (priv->html), "charset=utf-8");
- gtk_html_load_empty (GTK_HTML (priv->html));
-
- g_signal_connect (G_OBJECT (priv->html), "url_requested",
- G_CALLBACK (e_cal_comp_preview_url_requested_cb), NULL);
- g_signal_connect (G_OBJECT (priv->html), "link_clicked",
- G_CALLBACK (on_link_clicked), preview);
- g_signal_connect (G_OBJECT (priv->html), "on_url",
- G_CALLBACK (on_url_cb), preview);
-
- scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
-
- gtk_container_add (GTK_CONTAINER (scroll), priv->html);
- gtk_container_add (GTK_CONTAINER (preview), scroll);
- gtk_widget_show_all (scroll);
+ /* XXX Nothing to do? */
- priv->zone = icaltimezone_get_utc_timezone ();
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
-e_cal_component_memo_preview_destroy (GtkObject *object)
+memo_preview_class_init (EMemoPreviewClass *class)
{
- ECalComponentMemoPreview *preview;
- ECalComponentMemoPreviewPrivate *priv;
+ GObjectClass *object_class;
+ GtkHTMLClass *gtkhtml_class;
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_CAL_COMPONENT_MEMO_PREVIEW (object));
+ parent_class = g_type_class_peek_parent (class);
+ g_type_class_add_private (class, sizeof (EMemoPreviewPrivate));
- preview = E_CAL_COMPONENT_MEMO_PREVIEW (object);
- priv = preview->priv;
-
- if (priv) {
-
- g_free (priv);
- preview->priv = NULL;
- }
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = memo_preview_finalize;
- if (GTK_OBJECT_CLASS (e_cal_component_memo_preview_parent_class)->destroy)
- (* GTK_OBJECT_CLASS (e_cal_component_memo_preview_parent_class)->destroy) (object);
+ gtkhtml_class = GTK_HTML_CLASS (class);
+ gtkhtml_class->link_clicked = memo_preview_link_clicked;
+ gtkhtml_class->on_url = memo_preview_on_url;
}
static void
-e_cal_component_memo_preview_class_init (ECalComponentMemoPreviewClass *klass)
+memo_preview_init (EMemoPreview *preview)
{
- GtkObjectClass *object_class;
+ EMemoPreviewPrivate *priv;
+ GtkHTML *html;
- object_class = (GtkObjectClass *) klass;
+ preview->priv = E_MEMO_PREVIEW_GET_PRIVATE (preview);
- object_class->destroy = e_cal_component_memo_preview_destroy;
+ html = GTK_HTML (preview);
+ gtk_html_set_default_content_type (html, "charset=utf-8");
+ gtk_html_load_empty (html);
+
+ priv->zone = icaltimezone_get_utc_timezone ();
}
-GtkWidget *
-e_cal_component_memo_preview_new (void)
+GType
+e_memo_preview_get_type (void)
{
- ECalComponentMemoPreview *preview;
+ static GType type = 0;
+
+ if (G_UNLIKELY (type == 0)) {
+ static const GTypeInfo type_info = {
+ sizeof (EMemoPreviewClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) memo_preview_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class_data */
+ sizeof (EMemoPreview),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) memo_preview_init,
+ NULL /* value_table */
+ };
+
+ type = g_type_register_static (
+ GTK_TYPE_HTML, "EMemoPreview", &type_info, 0);
+ }
- preview = g_object_new (e_cal_component_memo_preview_get_type (), NULL);
+ return type;
+}
- return GTK_WIDGET (preview);
+GtkWidget *
+e_memo_preview_new (void)
+{
+ return g_object_new (E_TYPE_MEMO_PREVIEW, NULL);
}
icaltimezone *
-e_cal_component_memo_preview_get_default_timezone (ECalComponentMemoPreview *preview)
+e_memo_preview_get_default_timezone (EMemoPreview *preview)
{
- ECalComponentMemoPreviewPrivate *priv;
-
- g_return_val_if_fail (preview != NULL, NULL);
- g_return_val_if_fail (E_IS_CAL_COMPONENT_MEMO_PREVIEW (preview), NULL);
-
- priv = preview->priv;
+ g_return_val_if_fail (E_IS_MEMO_PREVIEW (preview), NULL);
- return priv->zone;
+ return preview->priv->zone;
}
void
-e_cal_component_memo_preview_set_default_timezone (ECalComponentMemoPreview *preview, icaltimezone *zone)
+e_memo_preview_set_default_timezone (EMemoPreview *preview,
+ icaltimezone *zone)
{
- ECalComponentMemoPreviewPrivate *priv;
-
- g_return_if_fail (preview != NULL);
- g_return_if_fail (E_IS_CAL_COMPONENT_MEMO_PREVIEW (preview));
+ g_return_if_fail (E_IS_MEMO_PREVIEW (preview));
g_return_if_fail (zone != NULL);
- priv = preview->priv;
-
- priv->zone = zone;
+ preview->priv->zone = zone;
}
void
-e_cal_component_memo_preview_display (ECalComponentMemoPreview *preview, ECal *ecal, ECalComponent *comp)
+e_memo_preview_display (EMemoPreview *preview,
+ ECal *ecal,
+ ECalComponent *comp)
{
- ECalComponentMemoPreviewPrivate *priv;
GtkHTMLStream *stream;
- g_return_if_fail (preview != NULL);
- g_return_if_fail (E_IS_CAL_COMPONENT_MEMO_PREVIEW (preview));
- g_return_if_fail (comp != NULL);
+ g_return_if_fail (E_IS_MEMO_PREVIEW (preview));
g_return_if_fail (E_IS_CAL_COMPONENT (comp));
- priv = preview->priv;
-
- stream = gtk_html_begin (GTK_HTML (priv->html));
- write_html (stream, ecal, comp, priv->zone);
+ stream = gtk_html_begin (GTK_HTML (preview));
+ memo_preview_write_html (stream, ecal, comp, preview->priv->zone);
gtk_html_stream_close (stream, GTK_HTML_STREAM_OK);
}
void
-e_cal_component_memo_preview_clear (ECalComponentMemoPreview *preview)
+e_memo_preview_clear (EMemoPreview *preview)
{
- ECalComponentMemoPreviewPrivate *priv;
-
- g_return_if_fail (preview != NULL);
- g_return_if_fail (E_IS_CAL_COMPONENT_MEMO_PREVIEW (preview));
-
- priv = preview->priv;
+ g_return_if_fail (E_IS_MEMO_PREVIEW (preview));
- gtk_html_load_empty (GTK_HTML (priv->html));
+ gtk_html_load_empty (GTK_HTML (preview));
}
Copied: branches/kill-bonobo/calendar/gui/e-memo-preview.h (from r36307, /branches/kill-bonobo/calendar/gui/e-cal-component-memo-preview.h)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-cal-component-memo-preview.h (original)
+++ branches/kill-bonobo/calendar/gui/e-memo-preview.h Wed Sep 24 22:53:30 2008
@@ -14,53 +14,71 @@
*
*
* Authors:
- * Federico Mena Quintero <federico ximian com>
- * Damon Chaplin <damon ximian com>
- * Nathan Owens <pianocomp81 yahoo com>
+ * Federico Mena Quintero <federico ximian com>
+ * Damon Chaplin <damon ximian com>
+ * Nathan Owens <pianocomp81 yahoo com>
*
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
*/
-#ifndef _E_CAL_COMPONENT_MEMO_PREVIEW_H_
-#define _E_CAL_COMPONENT_MEMO_PREVIEW_H_
+#ifndef E_MEMO_PREVIEW_H
+#define E_MEMO_PREVIEW_H
#include <gtk/gtk.h>
#include <libecal/e-cal.h>
+#include <gtkhtml/gtkhtml.h>
-#define E_TYPE_CAL_COMPONENT_MEMO_PREVIEW (e_cal_component_memo_preview_get_type ())
-#define E_CAL_COMPONENT_MEMO_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_COMPONENT_MEMO_PREVIEW, ECalComponentMemoPreview))
-#define E_CAL_COMPONENT_MEMO_PREVIEW_CLASS(klass) (G_TYPE_CHECK_INSTANCE_CAST_CLASS ((klass), E_TYPE_CAL_COMPONENT_MEMO_PREVIEW, \
- ECalComponentMemoPreviewClass))
-#define E_IS_CAL_COMPONENT_MEMO_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_COMPONENT_MEMO_PREVIEW))
-#define E_IS_CAL_COMPONENT_MEMO_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_COMPONENT_MEMO_PREVIEW))
-
-typedef struct _ECalComponentMemoPreview ECalComponentMemoPreview;
-typedef struct _ECalComponentMemoPreviewClass ECalComponentMemoPreviewClass;
-typedef struct _ECalComponentMemoPreviewPrivate ECalComponentMemoPreviewPrivate;
-
-struct _ECalComponentMemoPreview {
- GtkTable table;
-
- /* Private data */
- ECalComponentMemoPreviewPrivate *priv;
+/* Standard GObject macros */
+#define E_TYPE_MEMO_PREVIEW \
+ (e_memo_preview_get_type ())
+#define E_MEMO_PREVIEW(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_MEMO_PREVIEW, EMemoPreview))
+#define E_MEMO_PREVIEW_CLASS(cls) \
+ (G_TYPE_CHECK_INSTANCE_CAST_CLASS \
+ ((cls), E_TYPE_MEMO_PREVIEW, EMemoPreviewClass))
+#define E_IS_MEMO_PREVIEW(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_MEMO_PREVIEW))
+#define E_IS_MEMO_PREVIEW_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_MEMO_PREVIEW))
+#define E_MEMO_PREVIEW_GET_CLASS \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_MEMO_PREVIEW, EMemoPreviewClass))
+
+G_BEGIN_DECLS
+
+typedef struct _EMemoPreview EMemoPreview;
+typedef struct _EMemoPreviewClass EMemoPreviewClass;
+typedef struct _EMemoPreviewPrivate EMemoPreviewPrivate;
+
+struct _EMemoPreview {
+ GtkHTML parent;
+ EMemoPreviewPrivate *priv;
};
-struct _ECalComponentMemoPreviewClass {
- GtkTableClass parent_class;
+struct _EMemoPreviewClass {
+ GtkHTMLClass parent_class;
/* Notification signals */
- void (* selection_changed) (ECalComponentMemoPreview *preview, int n_selected);
+ void (*selection_changed) (EMemoPreview *preview, int n_selected);
};
-GType e_cal_component_memo_preview_get_type (void);
-GtkWidget *e_cal_component_memo_preview_new (void);
-
-icaltimezone *e_cal_component_memo_preview_get_default_timezone (ECalComponentMemoPreview *preview);
-void e_cal_component_memo_preview_set_default_timezone (ECalComponentMemoPreview *preview, icaltimezone *zone);
+GType e_memo_preview_get_type (void);
+GtkWidget * e_memo_preview_new (void);
+icaltimezone * e_memo_preview_get_default_timezone
+ (EMemoPreview *preview);
+void e_memo_preview_set_default_timezone
+ (EMemoPreview *preview,
+ icaltimezone *zone);
+void e_memo_preview_display (EMemoPreview *preview,
+ ECal *ecal,
+ ECalComponent *comp);
+void e_memo_preview_clear (EMemoPreview *preview);
-void e_cal_component_memo_preview_display (ECalComponentMemoPreview *preview, ECal *ecal, ECalComponent *comp);
-void e_cal_component_memo_preview_clear (ECalComponentMemoPreview *preview);
+G_END_DECLS
-#endif /* _E_CAL_COMPONENT_MEMO_PREVIEW_H_ */
+#endif /* E_MEMO_PREVIEW_H */
Modified: branches/kill-bonobo/calendar/gui/e-memo-table.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-memo-table.c (original)
+++ branches/kill-bonobo/calendar/gui/e-memo-table.c Wed Sep 24 22:53:30 2008
@@ -54,12 +54,26 @@
#include "e-cal-model-memos.h"
#include "e-memo-table.h"
#include "e-cell-date-edit-text.h"
-#include "e-comp-editor-registry.h"
#include "print.h"
#include <e-util/e-icon-factory.h>
#include <e-util/e-util-private.h>
#include "e-cal-popup.h"
+#define E_MEMO_TABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEMO_TABLE, EMemoTablePrivate))
+
+struct _EMemoTablePrivate {
+ gpointer shell_view; /* weak pointer */
+
+ EActivity *activity;
+};
+
+enum {
+ PROP_0,
+ PROP_SHELL_VIEW
+};
+
enum TargetType{
TARGET_TYPE_VCALENDAR
};
@@ -72,12 +86,6 @@
static guint n_target_types = G_N_ELEMENTS (target_types);
-extern ECompEditorRegistry *comp_editor_registry;
-
-static void e_memo_table_class_init (EMemoTableClass *klass);
-static void e_memo_table_init (EMemoTable *memo_table);
-static void e_memo_table_destroy (GtkObject *object);
-
static void e_memo_table_on_double_click (ETable *table,
gint row,
gint col,
@@ -111,7 +119,8 @@
LAST_SIGNAL
};
-static guint signals[LAST_SIGNAL] = { 0 };
+static gpointer parent_class;
+static guint signals[LAST_SIGNAL];
/* The icons to represent the task. */
#define E_MEMO_MODEL_NUM_ICONS 2
@@ -122,35 +131,14 @@
static GdkAtom clipboard_atom = GDK_NONE;
-G_DEFINE_TYPE (EMemoTable, e_memo_table, GTK_TYPE_TABLE)
-
-
static void
-e_memo_table_class_init (EMemoTableClass *klass)
+memo_table_emit_user_created (EMemoTable *memo_table)
{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass *) klass;
-
- /* Method override */
- object_class->destroy = e_memo_table_destroy;
-
- signals[USER_CREATED] =
- g_signal_new ("user_created",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMemoTableClass, user_created),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /* clipboard atom */
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
+ g_signal_emit (memo_table, signals[USER_CREATED], 0);
}
static gint
-date_compare_cb (gconstpointer a, gconstpointer b)
+memo_table_date_compare_cb (gconstpointer a, gconstpointer b)
{
ECellDateEditValue *dv1 = (ECellDateEditValue *) a;
ECellDateEditValue *dv2 = (ECellDateEditValue *) b;
@@ -178,13 +166,102 @@
}
static void
-row_appended_cb (ECalModel *model, EMemoTable *memo_table)
+memo_table_set_shell_view (EMemoTable *memo_table,
+ EShellView *shell_view)
{
- g_signal_emit (memo_table, signals[USER_CREATED], 0);
+ g_return_if_fail (memo_table->priv->shell_view == NULL);
+
+ memo_table->priv->shell_view = shell_view;
+
+ g_object_add_weak_pointer (
+ G_OBJECT (shell_view),
+ &memo_table->priv->shell_view);
}
static void
-e_memo_table_init (EMemoTable *memo_table)
+memo_table_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ memo_table_set_shell_view (
+ E_MEMO_TABLE (object),
+ g_value_get_object (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+memo_table_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ g_value_set_object (
+ value, e_memo_table_get_shell_view (
+ E_MEMO_TABLE (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+memo_table_dispose (GObject *object)
+{
+ EMemoTable *memo_table;
+
+ memo_table = E_MEMO_TABLE (object);
+
+ if (memo_table->model != NULL) {
+ g_object_unref (memo_table->model);
+ memo_table->model = NULL;
+ }
+
+ if (memo_table->priv->activity != NULL) {
+ /* XXX Activity is not cancellable. */
+ e_activity_complete (memo_table->priv->activity);
+ g_object_unref (memo_table->priv->activity);
+ memo_table->priv->activity = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+memo_table_class_init (EMemoTableClass *class)
+{
+ GObjectClass *object_class;
+
+ parent_class = g_type_class_peek_parent (class);
+ g_type_class_add_private (class, sizeof (EMemoTablePrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = memo_table_set_property;
+ object_class->get_property = memo_table_get_property;
+ object_class->dispose = memo_table_dispose;
+
+ signals[USER_CREATED] =
+ g_signal_new ("user_created",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EMemoTableClass, user_created),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
+}
+
+static void
+memo_table_init (EMemoTable *memo_table)
{
GtkWidget *table;
ETable *e_table;
@@ -194,16 +271,18 @@
AtkObject *a11y;
gchar *etspecfile;
+ memo_table->priv = E_MEMO_TABLE_GET_PRIVATE (memo_table);
+
/* Create the model */
memo_table->model = (ECalModel *) e_cal_model_memos_new ();
- g_signal_connect (memo_table->model, "row_appended", G_CALLBACK (row_appended_cb), memo_table);
-
- memo_table->user_created_cal = NULL;
+ g_signal_connect_swapped (
+ memo_table->model, "row_appended",
+ G_CALLBACK (memo_table_emit_user_created), memo_table);
/* Create the header columns */
- extras = e_table_extras_new();
+ extras = e_table_extras_new ();
/*
* Normal string fields.
@@ -235,7 +314,7 @@
/* Sorting */
e_table_extras_add_compare (extras, "date-compare",
- date_compare_cb);
+ memo_table_date_compare_cb);
/* Create pixmaps */
@@ -280,23 +359,57 @@
atk_object_set_name (a11y, _("Memos"));
}
+GType
+e_memo_table_get_type (void)
+{
+ static GType type = 0;
+
+ if (G_UNLIKELY (type == 0)) {
+ static const GTypeInfo type_info = {
+ sizeof (EMemoTableClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) memo_table_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class_data */
+ sizeof (EMemoTable),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) memo_table_init,
+ NULL /* value_table */
+ };
+
+ type = g_type_register_static (
+ GTK_TYPE_TABLE, "EMemoTable", &type_info, 0);
+ }
+
+ return type;
+}
/**
* e_memo_table_new:
- * @Returns: a new #EMemoTable.
+ * @shell_view: an #EShellView
+ *
+ * Returns a new #EMemoTable.
*
- * Creates a new #EMemoTable.
+ * Returns: a new #EMemoTable
**/
GtkWidget *
-e_memo_table_new (void)
+e_memo_table_new (EShellView *shell_view)
{
- GtkWidget *memo_table;
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
- memo_table = GTK_WIDGET (g_object_new (e_memo_table_get_type (), NULL));
-
- return memo_table;
+ return g_object_new (
+ E_TYPE_MEMO_TABLE,
+ "shell-view", shell_view, NULL);
}
+EShellView *
+e_memo_table_get_shell_view (EMemoTable *memo_table)
+{
+ g_return_val_if_fail (E_IS_MEMO_TABLE (memo_table), NULL);
+
+ return memo_table->priv->shell_view;
+}
/**
* e_memo_table_get_model:
@@ -316,21 +429,6 @@
}
-static void
-e_memo_table_destroy (GtkObject *object)
-{
- EMemoTable *memo_table;
-
- memo_table = E_MEMO_TABLE (object);
-
- if (memo_table->model) {
- g_object_unref (memo_table->model);
- memo_table->model = NULL;
- }
-
- GTK_OBJECT_CLASS (e_memo_table_parent_class)->destroy (object);
-}
-
/**
* e_memo_table_get_table:
* @memo_table: A calendar table.
@@ -749,7 +847,7 @@
uid = icalcomponent_get_uid (comp_data->icalcomp);
- medit = e_comp_editor_registry_find (comp_editor_registry, uid);
+ medit = comp_editor_find_instance (uid);
if (medit == NULL) {
ECalComponent *comp;
CompEditorFlags flags = 0;
@@ -767,8 +865,6 @@
comp_editor_edit_comp (medit, comp);
g_object_unref (comp);
-
- e_comp_editor_registry_add (comp_editor_registry, medit, FALSE);
}
gtk_window_present (GTK_WINDOW (medit));
@@ -1096,34 +1192,29 @@
#endif
void
-e_memo_table_set_activity_handler (EMemoTable *memo_table, EActivityHandler *activity_handler)
+e_memo_table_set_status_message (EMemoTable *memo_table,
+ const gchar *message)
{
- g_return_if_fail (E_IS_MEMO_TABLE (memo_table));
+ EActivity *activity;
+ EShellView *shell_view;
- memo_table->activity_handler = activity_handler;
-}
-
-void
-e_memo_table_set_status_message (EMemoTable *memo_table, const gchar *message)
-{
g_return_if_fail (E_IS_MEMO_TABLE (memo_table));
- if (!memo_table->activity_handler)
- return;
+ activity = memo_table->priv->activity;
+ shell_view = e_memo_table_get_shell_view (memo_table);
- if (!message || !*message) {
- if (memo_table->activity_id != 0) {
- e_activity_handler_operation_finished (memo_table->activity_handler, memo_table->activity_id);
- memo_table->activity_id = 0;
+ if (message == NULL || *message == '\0') {
+ if (activity != NULL) {
+ e_activity_complete (activity);
+ g_object_unref (activity);
+ memo_table->priv->activity = NULL;
}
- } else if (memo_table->activity_id == 0) {
- char *client_id = g_strdup_printf ("%p", memo_table);
- memo_table->activity_id = e_activity_handler_operation_started (
- memo_table->activity_handler, client_id, message, TRUE);
+ } else if (activity == NULL) {
+ activity = e_activity_new (message);
+ memo_table->priv->activity = activity;
+ e_shell_view_add_activity (shell_view, activity);
- g_free (client_id);
- } else {
- e_activity_handler_operation_progressing (memo_table->activity_handler, memo_table->activity_id, message, -1.0);
- }
+ } else
+ e_activity_set_primary_text (activity, message);
}
Modified: branches/kill-bonobo/calendar/gui/e-memo-table.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-memo-table.h (original)
+++ branches/kill-bonobo/calendar/gui/e-memo-table.h Wed Sep 24 22:53:30 2008
@@ -25,31 +25,43 @@
#ifndef _E_MEMO_TABLE_H_
#define _E_MEMO_TABLE_H_
-#include <gtk/gtk.h>
-#include <table/e-table-scrolled.h>
+#include <shell/e-shell-view.h>
+#include <widgets/table/e-table-scrolled.h>
#include <widgets/misc/e-cell-date-edit.h>
-#include "e-activity-handler.h"
#include "e-cal-model.h"
-G_BEGIN_DECLS
-
/*
* EMemoTable - displays the iCalendar objects in a table (an ETable).
* Used for memo events and tasks.
*/
+/* Standard GObject macros */
+#define E_TYPE_MEMO_TABLE \
+ (e_memo_table_get_type ())
+#define E_MEMO_TABLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_MEMO_TABLE, EMemoTable))
+#define E_MEMO_TABLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_MEMO_TABLE, EMemoTableClass))
+#define E_IS_MEMO_TABLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_MEMO_TABLE))
+#define E_IS_MEMO_TABLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_MEMO_TABLE))
+#define E_MEMO_TABLE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_MEMO_TABLE, EMemoTableClass))
-#define E_MEMO_TABLE(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, e_memo_table_get_type (), EMemoTable)
-#define E_MEMO_TABLE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, e_memo_table_get_type (), EMemoTableClass)
-#define E_IS_MEMO_TABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, e_memo_table_get_type ())
-
-
-typedef struct _EMemoTable EMemoTable;
-typedef struct _EMemoTableClass EMemoTableClass;
+G_BEGIN_DECLS
+typedef struct _EMemoTable EMemoTable;
+typedef struct _EMemoTableClass EMemoTableClass;
+typedef struct _EMemoTablePrivate EMemoTablePrivate;
struct _EMemoTable {
- GtkTable table;
+ GtkTable parent;
/* The model that we use */
ECalModel *model;
@@ -62,13 +74,12 @@
/* Fields used for cut/copy/paste */
icalcomponent *tmp_vcal;
- /* Activity ID for the EActivityHandler (i.e. the status bar). */
- EActivityHandler *activity_handler;
- guint activity_id;
-
- /* We should know which calendar has been used to create object, so store it here
- before emitting "user_created" signal and make it NULL just after the emit. */
+ /* We should know which calendar has been used to create object,
+ * so store it here before emitting "user_created" signal and make
+ * it NULL just after the emit. */
ECal *user_created_cal;
+
+ EMemoTablePrivate *priv;
};
struct _EMemoTableClass {
@@ -79,34 +90,29 @@
};
-GType e_memo_table_get_type (void);
-GtkWidget* e_memo_table_new (void);
-
-ECalModel *e_memo_table_get_model (EMemoTable *memo_table);
-
-ETable *e_memo_table_get_table (EMemoTable *memo_table);
-
-void e_memo_table_open_selected (EMemoTable *memo_table);
-void e_memo_table_delete_selected (EMemoTable *memo_table);
-
-GSList *e_memo_table_get_selected (EMemoTable *memo_table);
+GType e_memo_table_get_type (void);
+GtkWidget * e_memo_table_new (EShellView *shell_view);
+ECalModel * e_memo_table_get_model (EMemoTable *memo_table);
+ETable * e_memo_table_get_table (EMemoTable *memo_table);
+EShellView * e_memo_table_get_shell_view (EMemoTable *memo_table);
+void e_memo_table_open_selected (EMemoTable *memo_table);
+void e_memo_table_delete_selected (EMemoTable *memo_table);
+GSList * e_memo_table_get_selected (EMemoTable *memo_table);
/* Clipboard related functions */
-void e_memo_table_cut_clipboard (EMemoTable *memo_table);
-void e_memo_table_copy_clipboard (EMemoTable *memo_table);
-void e_memo_table_paste_clipboard (EMemoTable *memo_table);
+void e_memo_table_cut_clipboard (EMemoTable *memo_table);
+void e_memo_table_copy_clipboard (EMemoTable *memo_table);
+void e_memo_table_paste_clipboard (EMemoTable *memo_table);
/* These load and save the state of the table (headers shown etc.) to/from
the given file. */
-void e_memo_table_load_state (EMemoTable *memo_table,
- gchar *filename);
-void e_memo_table_save_state (EMemoTable *memo_table,
- gchar *filename);
-
-void e_memo_table_set_activity_handler (EMemoTable *memo_table,
- EActivityHandler *activity_handler);
-void e_memo_table_set_status_message (EMemoTable *memo_table,
- const gchar *message);
+void e_memo_table_load_state (EMemoTable *memo_table,
+ gchar *filename);
+void e_memo_table_save_state (EMemoTable *memo_table,
+ gchar *filename);
+
+void e_memo_table_set_status_message (EMemoTable *memo_table,
+ const gchar *message);
G_END_DECLS
Modified: branches/kill-bonobo/calendar/gui/e-memos.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-memos.c (original)
+++ branches/kill-bonobo/calendar/gui/e-memos.c Wed Sep 24 22:53:30 2008
@@ -69,9 +69,6 @@
/* Calendar search bar for memos */
GtkWidget *search_bar;
- /* Paned widget */
- GtkWidget *paned;
-
/* The preview */
GtkWidget *preview;
@@ -90,7 +87,6 @@
static void update_view (EMemos *memos);
static void categories_changed_cb (gpointer object, gpointer user_data);
-static void backend_error_cb (ECal *client, const char *message, gpointer data);
/* Signal IDs */
enum {
@@ -100,100 +96,10 @@
LAST_SIGNAL
};
-enum DndTargetType {
- TARGET_VCALENDAR
-};
-
-static GtkTargetEntry list_drag_types[] = {
- { "text/calendar", 0, TARGET_VCALENDAR },
- { "text/x-calendar", 0, TARGET_VCALENDAR }
-};
-static const int num_list_drag_types = sizeof (list_drag_types) / sizeof (list_drag_types[0]);
-
static guint e_memos_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (EMemos, e_memos, GTK_TYPE_TABLE)
-/* Callback used when the cursor changes in the table */
-static void
-table_cursor_change_cb (ETable *etable, int row, gpointer data)
-{
- EMemos *memos;
- EMemosPrivate *priv;
- ECalModel *model;
- ECalModelComponent *comp_data;
- ECalComponent *comp;
- const char *uid;
-
- int n_selected;
-
- memos = E_MEMOS (data);
- priv = memos->priv;
-
- n_selected = e_table_selected_count (etable);
-
- /* update the HTML widget */
- if (n_selected != 1) {
- e_cal_component_memo_preview_clear (E_CAL_COMPONENT_MEMO_PREVIEW (priv->preview));
-
- return;
- }
-
- model = e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view));
-
- comp_data = e_cal_model_get_component_at (model, e_table_get_cursor_row (etable));
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
-
- e_cal_component_memo_preview_display (E_CAL_COMPONENT_MEMO_PREVIEW (priv->preview), comp_data->client, comp);
-
- e_cal_component_get_uid (comp, &uid);
- if (priv->current_uid)
- g_free (priv->current_uid);
- priv->current_uid = g_strdup (uid);
-
- g_object_unref (comp);
-}
-
-/* Callback used when the selection changes in the table. */
-static void
-table_selection_change_cb (ETable *etable, gpointer data)
-{
- EMemos *memos;
- int n_selected;
-
- memos = E_MEMOS (data);
-
- n_selected = e_table_selected_count (etable);
- g_signal_emit (memos, e_memos_signals[SELECTION_CHANGED], 0, n_selected);
-
- if (n_selected != 1)
- e_cal_component_memo_preview_clear (E_CAL_COMPONENT_MEMO_PREVIEW (memos->priv->preview));
-
-}
-
-static void
-user_created_cb (GtkWidget *view, EMemos *memos)
-{
- EMemosPrivate *priv;
- EMemoTable *memo_table;
- ECal *ecal;
-
- priv = memos->priv;
- memo_table = E_MEMO_TABLE (priv->memos_view);
-
- if (memo_table->user_created_cal)
- ecal = memo_table->user_created_cal;
- else {
- ECalModel *model;
-
- model = e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view));
- ecal = e_cal_model_get_default_client (model);
- }
-
- e_memos_add_memo_source (memos, e_cal_get_source (ecal));
-}
-
/* Callback used when the sexp in the search bar changes */
static void
search_bar_sexp_changed_cb (CalSearchBar *cal_search, const char *sexp, gpointer data)
@@ -227,14 +133,6 @@
e_cal_model_set_default_category (model, category);
}
-static gboolean
-vpaned_resized_cb (GtkWidget *widget, GdkEventButton *event, EMemos *memos)
-{
- calendar_config_set_task_vpane_pos (gtk_paned_get_position (GTK_PANED (widget)));
-
- return FALSE;
-}
-
static void
set_timezone (EMemos *memos)
{
@@ -285,33 +183,6 @@
}
static void
-model_row_changed_cb (ETableModel *etm, int row, gpointer data)
-{
- EMemos *memos;
- EMemosPrivate *priv;
- ECalModelComponent *comp_data;
-
- memos = E_MEMOS (data);
- priv = memos->priv;
-
- if (priv->current_uid) {
- const char *uid;
-
- comp_data = e_cal_model_get_component_at (E_CAL_MODEL (etm), row);
- if (comp_data) {
- uid = icalcomponent_get_uid (comp_data->icalcomp);
- if (!strcmp (uid ? uid : "", priv->current_uid)) {
- ETable *etable;
-
- etable = e_table_scrolled_get_table (
- E_TABLE_SCROLLED (E_MEMO_TABLE (priv->memos_view)->etable));
- table_cursor_change_cb (etable, 0, memos);
- }
- }
- }
-}
-
-static void
setup_config (EMemos *memos)
{
EMemosPrivate *priv;
@@ -447,35 +318,6 @@
}
static void
-table_drag_data_delete (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- EMemos *memos)
-{
- /* Moved components are deleted from source immediately when moved,
- because some of them can be part of destination source, and we
- don't want to delete not-moved tasks. There is no such information
- which event has been moved and which not, so skip this method.
- */
-}
-
-#define E_MEMOS_TABLE_DEFAULT_STATE \
- "<?xml version=\"1.0\"?>" \
- "<ETableState>" \
- "<column source=\"1\"/>" \
- "<column source=\"0\"/>" \
- "<column source=\"2\"/>" \
- "<grouping></grouping>" \
- "</ETableState>"
-
-static void
-pane_realized (GtkWidget *widget, EMemos *memos)
-{
- gtk_paned_set_position ((GtkPaned *)widget, calendar_config_get_task_vpane_pos ());
-}
-
-static void
setup_widgets (EMemos *memos)
{
EMemosPrivate *priv;
@@ -496,51 +338,12 @@
GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0);
gtk_widget_show (priv->search_bar);
- /* add the paned widget for the memo list and memo detail areas */
- priv->paned = gtk_vpaned_new ();
- g_signal_connect (priv->paned, "realize", G_CALLBACK (pane_realized), memos);
-
- g_signal_connect (G_OBJECT (priv->paned), "button_release_event",
- G_CALLBACK (vpaned_resized_cb), memos);
- gtk_table_attach (GTK_TABLE (memos), priv->paned, 0, 1, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (priv->paned);
-
/* create the memo list */
priv->memos_view = e_memo_table_new ();
priv->memos_view_config = e_memo_table_config_new (E_MEMO_TABLE (priv->memos_view));
- g_signal_connect (priv->memos_view, "user_created", G_CALLBACK (user_created_cb), memos);
-
- etable = e_table_scrolled_get_table (
- E_TABLE_SCROLLED (E_MEMO_TABLE (priv->memos_view)->etable));
- e_table_set_state (etable, E_MEMOS_TABLE_DEFAULT_STATE);
-
- gtk_paned_add1 (GTK_PANED (priv->paned), priv->memos_view);
- gtk_widget_show (priv->memos_view);
-
-
- e_table_drag_source_set (etable, GDK_BUTTON1_MASK,
- list_drag_types, num_list_drag_types,
- GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_ASK);
-
g_signal_connect (etable, "table_drag_data_get",
G_CALLBACK(table_drag_data_get), memos);
- g_signal_connect (etable, "table_drag_data_delete",
- G_CALLBACK(table_drag_data_delete), memos);
-
- g_signal_connect (etable, "cursor_change", G_CALLBACK (table_cursor_change_cb), memos);
- g_signal_connect (etable, "selection_change", G_CALLBACK (table_selection_change_cb), memos);
-
- /* create the memo detail */
- priv->preview = e_cal_component_memo_preview_new ();
- e_cal_component_memo_preview_set_default_timezone (E_CAL_COMPONENT_MEMO_PREVIEW (priv->preview), calendar_config_get_icaltimezone ());
- gtk_paned_add2 (GTK_PANED (priv->paned), priv->preview);
- gtk_widget_show (priv->preview);
-
- model = e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view));
- g_signal_connect (G_OBJECT (model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), memos);
}
/* Class initialization function for the gnome calendar */
@@ -675,10 +478,6 @@
g_hash_table_destroy (priv->clients);
g_list_free (priv->clients_list);
- if (priv->default_client)
- g_object_unref (priv->default_client);
- priv->default_client = NULL;
-
if (priv->current_uid) {
g_free (priv->current_uid);
priv->current_uid = NULL;
@@ -725,56 +524,6 @@
e_memo_table_set_status_message (E_MEMO_TABLE (priv->memos_view), msg_string);
}
-/* Callback from the calendar client when an error occurs in the backend */
-static void
-backend_error_cb (ECal *client, const char *message, gpointer data)
-{
- EMemos *memos;
- GtkWidget *dialog;
- char *urinopwd;
-
- memos = E_MEMOS (data);
-
- urinopwd = get_uri_without_password (e_cal_get_uri (client));
-
- dialog = gtk_message_dialog_new (
- GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (memos))),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Error on %s:\n %s"), urinopwd, message);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- g_free (urinopwd);
-}
-
-/* Callback from the calendar client when the backend dies */
-static void
-backend_died_cb (ECal *client, gpointer data)
-{
- EMemos *memos;
- EMemosPrivate *priv;
- ESource *source;
-
- memos = E_MEMOS (data);
- priv = memos->priv;
-
- source = g_object_ref (e_cal_get_source (client));
-
- priv->clients_list = g_list_remove (priv->clients_list, client);
- g_hash_table_remove (priv->clients, e_source_peek_uid (source));
-
- g_signal_emit (memos, e_memos_signals[SOURCE_REMOVED], 0, source);
-
- e_memo_table_set_status_message (E_MEMO_TABLE (e_memos_get_calendar_table (memos)), NULL);
-
- e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (memos))),
- "calendar:memos-crashed", NULL);
-
- g_object_unref (source);
-}
-
/* Callback from the calendar client when the calendar is opened */
static void
client_cal_opened_cb (ECal *ecal, ECalendarStatus status, EMemos *memos)
@@ -880,21 +629,6 @@
return TRUE;
}
-void
-e_memos_open_memo (EMemos *memos)
-{
- EMemoTable *cal_table;
-
- cal_table = e_memos_get_calendar_table (memos);
- e_memo_table_open_selected (cal_table);
-}
-
-void
-e_memos_new_memo (EMemos *memos)
-{
- /* used for click_to_add ?? Can't figure out anything else it's used for */
-}
-
gboolean
e_memos_add_memo_source (EMemos *memos, ESource *source)
{
@@ -1024,173 +758,3 @@
return e_cal_model_get_default_client (e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view)));
}
-
-
-/**
- * e_memos_delete_selected:
- * @memos: A memos control widget.
- *
- * Deletes the selected memos in the memo list.
- **/
-void
-e_memos_delete_selected (EMemos *memos)
-{
- EMemosPrivate *priv;
- EMemoTable *cal_table;
-
- g_return_if_fail (memos != NULL);
- g_return_if_fail (E_IS_MEMOS (memos));
-
- priv = memos->priv;
-
- cal_table = E_MEMO_TABLE (priv->memos_view);
- set_status_message (memos, _("Deleting selected objects..."));
- e_memo_table_delete_selected (cal_table);
- set_status_message (memos, NULL);
-
- e_cal_component_memo_preview_clear (E_CAL_COMPONENT_MEMO_PREVIEW (priv->preview));
-}
-
-
-/* Callback used from the view collection when we need to display a new view */
-static void
-display_view_cb (GalViewInstance *instance, GalView *view, gpointer data)
-{
- EMemos *memos;
-
- memos = E_MEMOS (data);
-
- if (GAL_IS_VIEW_ETABLE (view)) {
- gal_view_etable_attach_table (GAL_VIEW_ETABLE (view), e_table_scrolled_get_table (E_TABLE_SCROLLED (E_MEMO_TABLE (memos->priv->memos_view)->etable)));
- }
-
- gtk_paned_set_position ((GtkPaned *)memos->priv->paned, calendar_config_get_task_vpane_pos ());
-}
-
-/**
- * e_memos_setup_view_menus:
- * @memos: A memos widget.
- * @uic: UI controller to use for the menus.
- *
- * Sets up the #GalView menus for a memos control. This function should be
- * called from the Bonobo control activation callback for this memos control.
- * Also, the menus should be discarded using e_memos_discard_view_menus().
- */
-void
-e_memos_setup_view_menus (EMemos *memos, BonoboUIComponent *uic)
-{
- EMemosPrivate *priv;
- GalViewFactory *factory;
- ETableSpecification *spec;
- char *dir0, *dir1, *filename;
- static GalViewCollection *collection = NULL;
-
- g_return_if_fail (memos != NULL);
- g_return_if_fail (E_IS_MEMOS (memos));
- g_return_if_fail (uic != NULL);
- g_return_if_fail (BONOBO_IS_UI_COMPONENT (uic));
-
- priv = memos->priv;
-
- g_return_if_fail (priv->view_instance == NULL);
-
- g_return_if_fail (priv->view_instance == NULL);
- g_return_if_fail (priv->view_menus == NULL);
-
- /* Create the view instance */
-
- if (collection == NULL) {
- collection = gal_view_collection_new ();
-
- gal_view_collection_set_title (collection, _("Memos"));
-
- dir0 = g_build_filename (EVOLUTION_GALVIEWSDIR,
- "memos",
- NULL);
- dir1 = g_build_filename (memos_component_peek_base_directory (memos_component_peek ()),
- "views", NULL);
- gal_view_collection_set_storage_directories (collection,
- dir0,
- dir1);
- g_free (dir1);
- g_free (dir0);
-
- /* Create the views */
-
- spec = e_table_specification_new ();
- filename = g_build_filename (EVOLUTION_ETSPECDIR,
- "e-memo-table.etspec",
- NULL);
- if (!e_table_specification_load_from_file (spec, filename))
- g_error ("Unable to load ETable specification file "
- "for memos");
- g_free (filename);
-
- factory = gal_view_factory_etable_new (spec);
- g_object_unref (spec);
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-
- /* Load the collection and create the menus */
-
- gal_view_collection_load (collection);
- }
-
- priv->view_instance = gal_view_instance_new (collection, NULL);
-
- priv->view_menus = gal_view_menus_new (priv->view_instance);
- gal_view_menus_apply (priv->view_menus, uic, NULL);
- g_signal_connect (priv->view_instance, "display_view", G_CALLBACK (display_view_cb), memos);
- display_view_cb (priv->view_instance, gal_view_instance_get_current_view (priv->view_instance), memos);
-}
-
-/**
- * e_memos_discard_view_menus:
- * @memos: A memos widget.
- *
- * Discards the #GalView menus used by a memos control. This function should be
- * called from the Bonobo control deactivation callback for this memos control.
- * The menus should have been set up with e_memos_setup_view_menus().
- **/
-void
-e_memos_discard_view_menus (EMemos *memos)
-{
- EMemosPrivate *priv;
-
- g_return_if_fail (memos != NULL);
- g_return_if_fail (E_IS_MEMOS (memos));
-
- priv = memos->priv;
-
- g_return_if_fail (priv->view_instance != NULL);
-
- g_return_if_fail (priv->view_instance != NULL);
- g_return_if_fail (priv->view_menus != NULL);
-
- g_object_unref (priv->view_instance);
- priv->view_instance = NULL;
-
- g_object_unref (priv->view_menus);
- priv->view_menus = NULL;
-}
-
-/**
- * e_memos_get_calendar_table:
- * @memos: A memos widget.
- *
- * Queries the #EMemoTable contained in a memos widget.
- *
- * Return value: The #EMemoTable that the memos widget uses to display its
- * information.
- **/
-EMemoTable *
-e_memos_get_calendar_table (EMemos *memos)
-{
- EMemosPrivate *priv;
-
- g_return_val_if_fail (memos != NULL, NULL);
- g_return_val_if_fail (E_IS_MEMOS (memos), NULL);
-
- priv = memos->priv;
- return E_MEMO_TABLE (priv->memos_view);
-}
Modified: branches/kill-bonobo/calendar/gui/e-select-names-renderer.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-select-names-renderer.c (original)
+++ branches/kill-bonobo/calendar/gui/e-select-names-renderer.c Wed Sep 24 22:53:30 2008
@@ -22,7 +22,7 @@
#include <config.h>
-#include "e-calendar-marshal.h"
+#include "e-util/e-util.h"
#include "e-select-names-editable.h"
#include "e-select-names-renderer.h"
@@ -192,7 +192,7 @@
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ESelectNamesRendererClass, cell_edited),
NULL, NULL,
- e_calendar_marshal_VOID__STRING_POINTER_POINTER,
+ e_marshal_VOID__STRING_POINTER_POINTER,
G_TYPE_NONE, 3,
G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);
}
Modified: branches/kill-bonobo/calendar/gui/e-tasks.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-tasks.c (original)
+++ branches/kill-bonobo/calendar/gui/e-tasks.c Wed Sep 24 22:53:30 2008
@@ -109,16 +109,6 @@
LAST_SIGNAL
};
-enum DndTargetType {
- TARGET_VCALENDAR
-};
-
-static GtkTargetEntry list_drag_types[] = {
- { "text/calendar", 0, TARGET_VCALENDAR },
- { "text/x-calendar", 0, TARGET_VCALENDAR }
-};
-static const int num_list_drag_types = sizeof (list_drag_types) / sizeof (list_drag_types[0]);
-
static guint e_tasks_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (ETasks, e_tasks, GTK_TYPE_TABLE)
Modified: branches/kill-bonobo/calendar/gui/gnome-cal.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/gnome-cal.c (original)
+++ branches/kill-bonobo/calendar/gui/gnome-cal.c Wed Sep 24 22:53:30 2008
@@ -44,12 +44,10 @@
#include <libedataserver/e-url.h>
#include <libedataserverui/e-passwords.h>
-#include "shell/e-user-creatable-items-handler.h"
#include <libecal/e-cal-time-util.h>
#include <widgets/menus/gal-view-factory-etable.h>
#include <widgets/menus/gal-view-etable.h>
#include <widgets/menus/gal-define-views-dialog.h>
-#include "widgets/menus/gal-view-menus.h"
#include "e-util/e-error.h"
#include "e-util/e-util-private.h"
#include "e-comp-editor-registry.h"
@@ -57,7 +55,6 @@
#include "dialogs/event-editor.h"
#include "dialogs/task-editor.h"
#include "comp-util.h"
-#include "e-calendar-marshal.h"
#include "e-cal-model-calendar.h"
#include "e-day-view.h"
#include "e-day-view-config.h"
@@ -69,10 +66,7 @@
#include "e-mini-calendar-config.h"
#include "e-calendar-table-config.h"
#include "e-memo-table-config.h"
-#include "evolution-calendar.h"
#include "gnome-cal.h"
-#include "calendar-component.h"
-#include "memos-component.h"
#include "cal-search-bar.h"
#include "calendar-commands.h"
#include "calendar-config.h"
@@ -86,11 +80,6 @@
#include "e-cal-menu.h"
#include "e-cal-model-tasks.h"
-/* FIXME glib 2.4 and above has this */
-#ifndef G_MAXINT32
-#define G_MAXINT32 ((gint32) 0x7fffffff)
-#endif
-
#define d(x) x
/* Private part of the GnomeCalendar structure */
@@ -369,7 +358,7 @@
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GnomeCalendarClass, source_added),
NULL, NULL,
- e_calendar_marshal_VOID__INT_OBJECT,
+ e_marshal_VOID__INT_OBJECT,
G_TYPE_NONE,
2,
G_TYPE_INT, G_TYPE_OBJECT);
@@ -380,7 +369,7 @@
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GnomeCalendarClass, source_removed),
NULL, NULL,
- e_calendar_marshal_VOID__INT_OBJECT,
+ e_marshal_VOID__INT_OBJECT,
G_TYPE_NONE,
2,
G_TYPE_INT, G_TYPE_OBJECT);
Modified: branches/kill-bonobo/calendar/gui/main.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/main.c (original)
+++ branches/kill-bonobo/calendar/gui/main.c Wed Sep 24 22:53:30 2008
@@ -62,8 +62,6 @@
#define CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_Calendar_ConfigControl:" BASE_VERSION
#define COMP_EDITOR_FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_CompEditorFactory:" BASE_VERSION
-ECompEditorRegistry *comp_editor_registry = NULL;
-
/* The component editor factory */
static CompEditorFactory *comp_editor_factory = NULL;
Modified: branches/kill-bonobo/calendar/gui/memos-component.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/memos-component.c (original)
+++ branches/kill-bonobo/calendar/gui/memos-component.c Wed Sep 24 22:53:30 2008
@@ -65,10 +65,6 @@
static BonoboObjectClass *parent_class = NULL;
-/* Memos should have their own registry */
-extern ECompEditorRegistry *comp_editor_registry;
-
-
typedef struct _MemosComponentView
{
ESourceList *source_list;
@@ -79,7 +75,6 @@
ETable *table;
ETableModel *model;
- EInfoLabel *info_label;
GtkWidget *source_selector;
BonoboControl *view_control;
@@ -88,9 +83,6 @@
GList *notifications;
- EUserCreatableItemsHandler *creatable_items_handler;
-
- EActivityHandler *activity_handler;
} MemosComponentView;
struct _MemosComponentPrivate {
@@ -733,15 +725,6 @@
priv = memos_component->priv;
- for (l = priv->views; l; l = l->next) {
- component_view = l->data;
-
- if (component_view->creatable_items_handler == handler)
- break;
-
- component_view = NULL;
- }
-
if (strcmp (item_type_name, CREATE_MEMO_ID) == 0) {
create_new_memo (memos_component, FALSE, component_view);
} else if (strcmp (item_type_name, CREATE_SHARED_MEMO_ID) == 0) {
@@ -787,8 +770,6 @@
g_signal_connect (component_view->memos, "source_removed",
G_CALLBACK (source_removed_cb), component_view);
- e_memo_table_set_activity_handler (e_memos_get_calendar_table (component_view->memos), component_view->activity_handler);
-
/* connect after setting the initial selections, or we'll get unwanted calls
to calendar_control_sensitize_calendar_commands */
g_signal_connect (component_view->source_selector, "selection_changed",
@@ -820,69 +801,10 @@
calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
g_list_free (component_view->notifications);
- if (component_view->creatable_items_handler)
- g_object_unref (component_view->creatable_items_handler);
-
- if (component_view->activity_handler)
- g_object_unref (component_view->activity_handler);
-
g_free (component_view);
}
static void
-view_destroyed_cb (gpointer data, GObject *where_the_object_was)
-{
- MemosComponent *memos_component = data;
- MemosComponentPrivate *priv;
- GList *l;
-
- priv = memos_component->priv;
-
- for (l = priv->views; l; l = l->next) {
- MemosComponentView *component_view = l->data;
-
- if (G_OBJECT (component_view->view_control) == where_the_object_was) {
- priv->views = g_list_remove (priv->views, component_view);
- destroy_component_view (component_view);
-
- break;
- }
- }
-}
-
-static GNOME_Evolution_ComponentView
-impl_createView (PortableServer_Servant servant,
- GNOME_Evolution_ShellView parent,
- CORBA_boolean select_item,
- CORBA_Environment *ev)
-{
- MemosComponent *component = MEMOS_COMPONENT (bonobo_object_from_servant (servant));
- MemosComponentPrivate *priv;
- MemosComponentView *component_view;
- EComponentView *ecv;
-
- priv = component->priv;
-
- /* Create the calendar component view */
- component_view = create_component_view (component);
- if (!component_view) {
- /* FIXME Should we describe the problem in a control? */
- bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed);
-
- return CORBA_OBJECT_NIL;
- }
-
- g_object_weak_ref (G_OBJECT (component_view->view_control), view_destroyed_cb, component);
- priv->views = g_list_append (priv->views, component_view);
-
- /* TODO: Make CalendarComponentView just subclass EComponentView */
- ecv = e_component_view_new_controls (parent, "memos", component_view->sidebar_control,
- component_view->view_control, component_view->statusbar_control);
-
- return BONOBO_OBJREF(ecv);
-}
-
-static void
impl_requestCreateItem (PortableServer_Servant servant,
const CORBA_char *item_type_name,
CORBA_Environment *ev)
@@ -928,14 +850,6 @@
priv->create_ecal = NULL;
}
- for (l = priv->views; l; l = l->next) {
- MemosComponentView *component_view = l->data;
-
- g_object_weak_unref (G_OBJECT (component_view->view_control), view_destroyed_cb, memos_component);
- }
- g_list_free (priv->views);
- priv->views = NULL;
-
for (l = priv->notifications; l; l = l->next)
calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
g_list_free (priv->notifications);
@@ -945,24 +859,6 @@
}
static void
-impl_finalize (GObject *object)
-{
- MemosComponentPrivate *priv = MEMOS_COMPONENT (object)->priv;
- GList *l;
-
- for (l = priv->views; l; l = l->next) {
- MemosComponentView *component_view = l->data;
-
- destroy_component_view (component_view);
- }
- g_list_free (priv->views);
-
- g_free (priv);
-
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-static void
memos_component_class_init (MemosComponentClass *klass)
{
POA_GNOME_Evolution_Component__epv *epv = &klass->epv;
@@ -971,21 +867,7 @@
parent_class = g_type_class_peek_parent (klass);
epv->upgradeFromVersion = impl_upgradeFromVersion;
- epv->createView = impl_createView;
epv->requestCreateItem = impl_requestCreateItem;
object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
}
-
-static void
-memos_component_init (MemosComponent *component, MemosComponentClass *klass)
-{
- MemosComponentPrivate *priv;
-
- priv = g_new0 (MemosComponentPrivate, 1);
-
- component->priv = priv;
-}
-
-BONOBO_TYPE_FUNC_FULL (MemosComponent, GNOME_Evolution_Component, PARENT_TYPE, memos_component)
Modified: branches/kill-bonobo/calendar/gui/tasks-component.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/tasks-component.c (original)
+++ branches/kill-bonobo/calendar/gui/tasks-component.c Wed Sep 24 22:53:30 2008
@@ -64,10 +64,6 @@
static BonoboObjectClass *parent_class = NULL;
-/* Tasks should have their own registry */
-extern ECompEditorRegistry *comp_editor_registry;
-
-
typedef struct
{
ESourceList *source_list;
Modified: branches/kill-bonobo/calendar/gui/tasks-control.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/tasks-control.c (original)
+++ branches/kill-bonobo/calendar/gui/tasks-control.c Wed Sep 24 22:53:30 2008
@@ -56,36 +56,15 @@
static void tasks_control_activate_cb (BonoboControl *control,
gboolean activate,
gpointer user_data);
-static void tasks_control_open_task_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
static void tasks_control_new_task_cmd (BonoboUIComponent *uic,
gpointer data,
const char *path);
-static void tasks_control_cut_cmd (BonoboUIComponent *uic,
- gpointer data,
- const gchar *path);
-static void tasks_control_copy_cmd (BonoboUIComponent *uic,
- gpointer data,
- const gchar *path);
-static void tasks_control_paste_cmd (BonoboUIComponent *uic,
- gpointer data,
- const gchar *path);
-static void tasks_control_delete_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
static void tasks_control_complete_cmd (BonoboUIComponent *uic,
gpointer data,
const char *path);
static void tasks_control_purge_cmd (BonoboUIComponent *uic,
gpointer data,
const char *path);
-static void tasks_control_print_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
-static void tasks_control_print_preview_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
static void tasks_control_assign_cmd (BonoboUIComponent *uic,
gpointer data,
const char *path);
@@ -94,12 +73,6 @@
gpointer data,
const char *path);
-static void tasks_control_view_preview (BonoboUIComponent *uic,
- const char *path,
- Bonobo_UIComponent_EventType type,
- const char *state,
- void *data);
-
BonoboControl *
tasks_control_new (void)
{
@@ -234,16 +207,9 @@
}
static BonoboUIVerb verbs [] = {
- BONOBO_UI_VERB ("TasksOpenTask", tasks_control_open_task_cmd),
BONOBO_UI_VERB ("TasksNewTask", tasks_control_new_task_cmd),
- BONOBO_UI_VERB ("TasksCut", tasks_control_cut_cmd),
- BONOBO_UI_VERB ("TasksCopy", tasks_control_copy_cmd),
- BONOBO_UI_VERB ("TasksPaste", tasks_control_paste_cmd),
- BONOBO_UI_VERB ("TasksDelete", tasks_control_delete_cmd),
BONOBO_UI_VERB ("TasksMarkComplete", tasks_control_complete_cmd),
BONOBO_UI_VERB ("TasksPurge", tasks_control_purge_cmd),
- BONOBO_UI_VERB ("TasksPrint", tasks_control_print_cmd),
- BONOBO_UI_VERB ("TasksPrintPreview", tasks_control_print_preview_cmd),
BONOBO_UI_VERB ("TasksAssign", tasks_control_assign_cmd),
BONOBO_UI_VERB ("TasksForward", tasks_control_forward_cmd),
BONOBO_UI_VERB_END
@@ -329,16 +295,6 @@
bonobo_ui_component_unset_container (uic, NULL);
}
-static void tasks_control_open_task_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
-
- tasks = E_TASKS (data);
- e_tasks_open_task (tasks);
-}
-
static void
tasks_control_new_task_cmd (BonoboUIComponent *uic,
gpointer data,
@@ -351,56 +307,6 @@
}
static void
-tasks_control_cut_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
- ECalendarTable *cal_table;
-
- tasks = E_TASKS (data);
- cal_table = e_tasks_get_calendar_table (tasks);
- e_calendar_table_cut_clipboard (cal_table);
-}
-
-static void
-tasks_control_copy_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
- ECalendarTable *cal_table;
-
- tasks = E_TASKS (data);
- cal_table = e_tasks_get_calendar_table (tasks);
- e_calendar_table_copy_clipboard (cal_table);
-}
-
-static void
-tasks_control_paste_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
- ECalendarTable *cal_table;
-
- tasks = E_TASKS (data);
- cal_table = e_tasks_get_calendar_table (tasks);
- e_calendar_table_paste_clipboard (cal_table);
-}
-
-static void
-tasks_control_delete_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
-
- tasks = E_TASKS (data);
- e_tasks_delete_selected (tasks);
-}
-
-static void
tasks_control_complete_cmd (BonoboUIComponent *uic,
gpointer data,
const char *path)
@@ -457,39 +363,6 @@
e_tasks_delete_completed (tasks);
}
-/* File/Print callback */
-static void
-tasks_control_print_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks = E_TASKS (data);
- ETable *table;
-
- table = e_calendar_table_get_table (
- E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)));
-
- print_table (
- table, _("Print Tasks"), _("Tasks"),
- GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
-}
-
-static void
-tasks_control_print_preview_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks = E_TASKS (data);
- ETable *table;
-
- table = e_calendar_table_get_table (
- E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)));
-
- print_table (
- table, _("Print Tasks"), _("Tasks"),
- GTK_PRINT_OPERATION_ACTION_PREVIEW);
-}
-
static void
tasks_control_assign_cmd (BonoboUIComponent *uic,
gpointer data,
@@ -526,17 +399,3 @@
g_object_unref (comp);
}
}
-
-static void
-tasks_control_view_preview (BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data)
-{
- ETasks *tasks;
-
- if (type != Bonobo_UIComponent_STATE_CHANGED)
- return;
-
- tasks = E_TASKS (data);
-
- calendar_config_set_preview_state (state[0] != '0');
- e_tasks_show_preview (tasks, state[0] != '0');
-}
Copied: branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c (from r36311, /branches/kill-bonobo/calendar/gui/e-cal-shell-view-private.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-cal-shell-view-private.c (original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c Wed Sep 24 22:53:30 2008
@@ -40,6 +40,17 @@
e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
{
ECalShellViewPrivate *priv = cal_shell_view->priv;
+ EShellContent *shell_content;
+ EShellSidebar *shell_sidebar;
+ EShellView *shell_view;
+
+ shell_view = E_SHELL_VIEW (cal_shell_view);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+ shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+
+ /* Cache these to avoid lots of awkward casting. */
+ priv->cal_shell_content = g_object_ref (shell_content);
+ priv->cal_shell_sidebar = g_object_ref (shell_sidebar);
}
void
@@ -50,6 +61,9 @@
DISPOSE (priv->source_list);
DISPOSE (priv->calendar_actions);
+
+ DISPOSE (priv->cal_shell_content);
+ DISPOSE (priv->cal_shell_sidebar);
}
void
Copied: branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.h (from r36317, /branches/kill-bonobo/calendar/gui/e-cal-shell-view-private.h)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-cal-shell-view-private.h (original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.h Wed Sep 24 22:53:30 2008
@@ -29,6 +29,7 @@
#include <shell/e-shell-content.h>
#include <gnome-cal.h>
+#include <e-cal-shell-content.h>
#include <e-cal-shell-sidebar.h>
#include <e-cal-shell-view-actions.h>
@@ -59,6 +60,10 @@
/*** UI Management ***/
GtkActionGroup *calendar_actions;
+
+ /* These are just for convenience. */
+ ECalShellContent *cal_shell_content;
+ ECalShellSidebar *cal_shell_sidebar;
};
void e_cal_shell_view_private_init
Copied: branches/kill-bonobo/calendar/modules/e-cal-shell-view.c (from r36359, /branches/kill-bonobo/calendar/gui/e-cal-shell-view.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-cal-shell-view.c (original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view.c Wed Sep 24 22:53:30 2008
@@ -82,7 +82,7 @@
priv = E_CAL_SHELL_VIEW_GET_PRIVATE (shell_view);
action_group = priv->calendar_actions;
- visible = e_shell_view_is_selected (shell_view);
+ visible = e_shell_view_is_active (shell_view);
gtk_action_group_set_visible (action_group, visible);
}
@@ -105,9 +105,10 @@
shell_view_class = E_SHELL_VIEW_CLASS (class);
shell_view_class->label = N_("Cals");
shell_view_class->icon_name = "evolution-cals";
+ shell_view_class->search_options = "/calendar-search-options";
shell_view_class->type_module = type_module;
- shell_view_class->changed = cal_shell_view_changed;
shell_view_class->new_shell_sidebar = e_cal_shell_sidebar_new;
+ shell_view_class->changed = cal_shell_view_changed;
g_object_class_install_property (
object_class,
Added: branches/kill-bonobo/calendar/modules/e-memo-shell-content.c
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-content.c Wed Sep 24 22:53:30 2008
@@ -0,0 +1,550 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-memo-shell-content.h
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "e-memo-shell-content.h"
+
+#include <glib/gi18n.h>
+
+#include "e-util/gconf-bridge.h"
+
+#include "calendar/gui/calendar-config.h"
+#include "calendar/gui/e-memo-table.h"
+#include "calendar/gui/e-memo-table-config.h"
+
+#include "widgets/menus/gal-view-etable.h"
+
+#define E_MEMO_SHELL_CONTENT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEMO_SHELL_CONTENT, EMemoShellContentPrivate))
+
+#define E_MEMO_TABLE_DEFAULT_STATE \
+ "<?xml version=\"1.0\"?>" \
+ "<ETableState>" \
+ " <column source=\"1\"/>" \
+ " <column source=\"0\"/>" \
+ " <column source=\"2\"/>" \
+ " <grouping/>" \
+ "</ETableState>"
+
+struct _EMemoShellContentPrivate {
+ GtkWidget *paned;
+ GtkWidget *memo_table;
+ GtkWidget *memo_preview;
+
+ EMemoTableConfig *table_config;
+ GalViewInstance *view_instance;
+
+ gchar *current_uid;
+};
+
+enum {
+ PROP_0,
+ PROP_PREVIEW_VISIBLE
+};
+
+enum {
+ TARGET_VCALENDAR
+};
+
+static GtkTargetEntry drag_types[] = {
+ { "text/calendar", 0, TARGET_VCALENDAR },
+ { "text/x-calendar", 0, TARGET_VCALENDAR }
+};
+
+static gpointer parent_class;
+
+static void
+memo_shell_content_changed_cb (EMemoShellContent *memo_shell_content,
+ GalViewInstance *view_instance)
+{
+ EShellView *shell_view;
+ EShellContent *shell_content;
+ gchar *view_id;
+
+ shell_content = E_SHELL_CONTENT (memo_shell_content);
+ shell_view = e_shell_content_get_shell_view (shell_content);
+ view_id = gal_view_instance_get_current_view_id (view_instance);
+ e_shell_view_set_view_id (shell_view, view_id);
+ g_free (view_id);
+}
+
+static void
+memo_shell_content_display_view_cb (EMemoShellContent *memo_shell_content,
+ GalView *gal_view)
+{
+ EMemoTable *memo_table;
+ ETableScrolled *table_scrolled;
+ ETable *table;
+
+ if (!GAL_IS_VIEW_ETABLE (gal_view))
+ return;
+
+ memo_table = E_MEMO_TABLE (memo_shell_content->priv->memo_table);
+ table_scrolled = E_TABLE_SCROLLED (memo_table->etable);
+ table = e_table_scrolled_get_table (table_scrolled);
+
+ gal_view_etable_attach_table (GAL_VIEW_ETABLE (gal_view), table);
+}
+
+static void
+memo_shell_content_table_drag_data_get_cb (EMemoShellContent *memo_shell_content,
+ gint row,
+ gint col,
+ GdkDragContext *context,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint time)
+{
+ /* FIXME */
+}
+
+static void
+memo_shell_content_table_drag_data_delete_cb (EMemoShellContent *memo_shell_content,
+ gint row,
+ gint col,
+ GdkDragContext *context)
+{
+ /* Moved components are deleted from source immediately when moved,
+ * because some of them can be part of destination source, and we
+ * don't want to delete not-moved tasks. There is no such information
+ * which event has been moved and which not, so skip this method. */
+}
+
+static void
+memo_shell_content_cursor_change_cb (EMemoShellContent *memo_shell_content,
+ gint row,
+ ETable *table)
+{
+ EMemoPreview *memo_preview;
+ EMemoTable *memo_table;
+ ECalModel *model;
+ ECalModelComponent *comp_data;
+ ECalComponent *comp;
+ const gchar *uid;
+
+ memo_preview = E_MEMO_PREVIEW (memo_shell_content->priv->memo_preview);
+ memo_table = E_MEMO_TABLE (memo_shell_content->priv->memo_table);
+
+ if (e_table_selected_count (table) != 1) {
+ e_memo_preview_clear (memo_preview);
+ return;
+ }
+
+ model = e_memo_table_get_model (memo_table);
+ row = e_table_get_cursor_row (table);
+ comp_data = e_cal_model_get_component_at (model, row);
+
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (
+ comp, icalcomponent_new_clone (comp_data->icalcomp));
+ e_memo_preview_display (memo_preview, comp_data->client, comp);
+
+ e_cal_component_get_uid (comp, &uid);
+ g_free (memo_shell_content->priv->current_uid);
+ memo_shell_content->priv->current_uid = g_strdup (uid);
+
+ g_object_unref (comp);
+}
+
+static void
+memo_shell_content_selection_change_cb (EMemoShellContent *memo_shell_content,
+ ETable *table)
+{
+ EMemoPreview *memo_preview;
+
+ memo_preview = E_MEMO_PREVIEW (memo_shell_content->priv->memo_preview);
+
+ /* XXX Old code emits a "selection-changed" signal here. */
+
+ if (e_table_selected_count (table) != 1)
+ e_memo_preview_clear (memo_preview);
+}
+
+static void
+memo_shell_content_model_row_changed_cb (EMemoShellContent *memo_shell_content,
+ gint row,
+ ETableModel *model)
+{
+ ECalModelComponent *comp_data;
+ EMemoTable *memo_table;
+ ETableScrolled *table_scrolled;
+ ETable *table;
+ const gchar *current_uid;
+ const gchar *uid;
+
+ current_uid = memo_shell_content->priv->current_uid;
+ if (current_uid == NULL)
+ return;
+
+ comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
+ if (comp_data == NULL)
+ return;
+
+ uid = icalcomponent_get_uid (comp_data->icalcomp);
+ if (g_strcmp0 (uid, current_uid) != 0)
+ return;
+
+ memo_table = E_MEMO_TABLE (memo_shell_content->priv->memo_table);
+ table_scrolled = E_TABLE_SCROLLED (memo_table->etable);
+ table = e_table_scrolled_get_table (table_scrolled);
+
+ memo_shell_content_cursor_change_cb (memo_shell_content, 0, table);
+}
+
+static void
+memo_shell_content_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_PREVIEW_VISIBLE:
+ e_memo_shell_content_set_preview_visible (
+ E_MEMO_SHELL_CONTENT (object),
+ g_value_get_boolean (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+memo_shell_content_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_PREVIEW_VISIBLE:
+ g_value_set_boolean (
+ value, e_memo_shell_content_get_preview_visible (
+ E_MEMO_SHELL_CONTENT (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+memo_shell_content_dispose (GObject *object)
+{
+ EMemoShellContentPrivate *priv;
+
+ priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object);
+
+ if (priv->paned != NULL) {
+ g_object_unref (priv->paned);
+ priv->paned = NULL;
+ }
+
+ if (priv->memo_table != NULL) {
+ g_object_unref (priv->memo_table);
+ priv->memo_table = NULL;
+ }
+
+ if (priv->memo_preview != NULL) {
+ g_object_unref (priv->memo_preview);
+ priv->memo_preview = NULL;
+ }
+
+ if (priv->table_config != NULL) {
+ g_object_unref (priv->table_config);
+ priv->table_config = NULL;
+ }
+
+ if (priv->view_instance != NULL) {
+ g_object_unref (priv->view_instance);
+ priv->view_instance = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+memo_shell_content_finalize (GObject *object)
+{
+ EMemoShellContentPrivate *priv;
+
+ priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object);
+
+ g_free (priv->current_uid);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
+memo_shell_content_constructed (GObject *object)
+{
+ EMemoShellContentPrivate *priv;
+ EShellContent *shell_content;
+ EShellView *shell_view;
+ EShellViewClass *shell_view_class;
+ GalViewCollection *view_collection;
+ GalViewInstance *view_instance;
+ ECalModel *model;
+ ETable *table;
+ GConfBridge *bridge;
+ GtkWidget *container;
+ GtkWidget *widget;
+ const gchar *key;
+
+ priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object);
+
+ /* Chain up to parent's constructed() method. */
+ G_OBJECT_CLASS (parent_class)->constructed (object);
+
+ shell_content = E_SHELL_CONTENT (object);
+ shell_view = e_shell_content_get_shell_view (shell_content);
+ shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
+ view_collection = shell_view_class->view_collection;
+
+ /* Load the view instance. */
+
+ view_instance = gal_view_instance_new (view_collection, NULL);
+ g_signal_connect_swapped (
+ view_instance, "changed",
+ G_CALLBACK (memo_shell_content_changed_cb),
+ object);
+ g_signal_connect_swapped (
+ view_instance, "display-view",
+ G_CALLBACK (memo_shell_content_display_view_cb),
+ object);
+ gal_view_instance_load (view_instance);
+ priv->view_instance = view_instance;
+
+ /* Build content widgets. */
+
+ container = GTK_WIDGET (object);
+
+ widget = gtk_vpaned_new ();
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ priv->paned = g_object_ref (widget);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ widget = e_memo_table_new (shell_view);
+ gtk_paned_add1 (GTK_PANED (container), widget);
+ priv->memo_table = g_object_ref (widget);
+ gtk_widget_show (widget);
+
+ widget = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (
+ GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
+ gtk_paned_add2 (GTK_PANED (container), widget);
+
+ container = widget;
+
+ widget = e_memo_preview_new ();
+ e_memo_preview_set_default_timezone (
+ E_MEMO_PREVIEW (widget),
+ calendar_config_get_icaltimezone ());
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ priv->memo_preview = g_object_ref (widget);
+ gtk_widget_show (widget);
+
+ /* Configure the memo table. */
+
+ widget = E_MEMO_TABLE (priv->memo_table)->etable;
+ table = e_table_scrolled_get_table (E_TABLE_SCROLLED (widget));
+ model = e_memo_table_get_model (E_MEMO_TABLE (priv->memo_table));
+
+ priv->table_config = e_memo_table_config_new (
+ E_MEMO_TABLE (priv->memo_table));
+
+ e_table_set_state (table, E_MEMO_TABLE_DEFAULT_STATE);
+
+ e_table_drag_source_set (
+ table, GDK_BUTTON1_MASK,
+ drag_types, G_N_ELEMENTS (drag_types),
+ GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_ASK);
+
+ g_signal_connect_swapped (
+ table, "table-drag-data-get",
+ G_CALLBACK (memo_shell_content_table_drag_data_get_cb),
+ object);
+
+ g_signal_connect_swapped (
+ table, "table-drag-data-delete",
+ G_CALLBACK (memo_shell_content_table_drag_data_delete_cb),
+ object);
+
+ g_signal_connect_swapped (
+ table, "cursor-change",
+ G_CALLBACK (memo_shell_content_cursor_change_cb),
+ object);
+
+ g_signal_connect_swapped (
+ table, "selection-change",
+ G_CALLBACK (memo_shell_content_selection_change_cb),
+ object);
+
+ g_signal_connect_swapped (
+ model, "model-row-changed",
+ G_CALLBACK (memo_shell_content_model_row_changed_cb),
+ object);
+
+ /* Bind GObject properties to GConf keys. */
+
+ bridge = gconf_bridge_get ();
+
+ object = G_OBJECT (priv->paned);
+ key = "/apps/evolution/calendar/display/memo_vpane_position";
+ gconf_bridge_bind_property_delayed (bridge, key, object, "position");
+}
+
+static void
+memo_shell_content_class_init (EMemoShellContentClass *class)
+{
+ GObjectClass *object_class;
+
+ parent_class = g_type_class_peek_parent (class);
+ g_type_class_add_private (class, sizeof (EMemoShellContentPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = memo_shell_content_set_property;
+ object_class->get_property = memo_shell_content_get_property;
+ object_class->dispose = memo_shell_content_dispose;
+ object_class->finalize = memo_shell_content_finalize;
+ object_class->constructed = memo_shell_content_constructed;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_PREVIEW_VISIBLE,
+ g_param_spec_boolean (
+ "preview-visible",
+ _("Preview is Visible"),
+ _("Whether the preview pane is visible"),
+ TRUE,
+ G_PARAM_READWRITE));
+}
+
+static void
+memo_shell_content_init (EMemoShellContent *memo_shell_content)
+{
+ memo_shell_content->priv =
+ E_MEMO_SHELL_CONTENT_GET_PRIVATE (memo_shell_content);
+
+ /* Postpone widget construction until we have a shell view. */
+}
+
+GType
+e_memo_shell_content_get_type (void)
+{
+ static GType type = 0;
+
+ if (G_UNLIKELY (type == 0)) {
+ static const GTypeInfo type_info = {
+ sizeof (EMemoShellContentClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) memo_shell_content_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class_data */
+ sizeof (EMemoShellContent),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) memo_shell_content_init,
+ NULL /* value_table */
+ };
+
+ type = g_type_register_static (
+ E_TYPE_SHELL_CONTENT, "EMemoShellContent",
+ &type_info, 0);
+ }
+
+ return type;
+}
+
+GtkWidget *
+e_memo_shell_content_new (EShellView *shell_view)
+{
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
+
+ return g_object_new (
+ E_TYPE_MEMO_SHELL_CONTENT,
+ "shell-view", shell_view, NULL);
+}
+
+EMemoPreview *
+e_memo_shell_content_get_memo_preview (EMemoShellContent *memo_shell_content)
+{
+ g_return_val_if_fail (
+ E_IS_MEMO_SHELL_CONTENT (memo_shell_content), NULL);
+
+ return E_MEMO_PREVIEW (memo_shell_content->priv->memo_preview);
+}
+
+EMemoTable *
+e_memo_shell_content_get_memo_table (EMemoShellContent *memo_shell_content)
+{
+ g_return_val_if_fail (
+ E_IS_MEMO_SHELL_CONTENT (memo_shell_content), NULL);
+
+ return E_MEMO_TABLE (memo_shell_content->priv->memo_table);
+}
+
+GalViewInstance *
+e_memo_shell_content_get_view_instance (EMemoShellContent *memo_shell_content)
+{
+ g_return_val_if_fail (
+ E_IS_MEMO_SHELL_CONTENT (memo_shell_content), NULL);
+
+ return memo_shell_content->priv->view_instance;
+}
+
+gboolean
+e_memo_shell_content_get_preview_visible (EMemoShellContent *memo_shell_content)
+{
+ GtkPaned *paned;
+ GtkWidget *child;
+
+ g_return_val_if_fail (
+ E_IS_MEMO_SHELL_CONTENT (memo_shell_content), FALSE);
+
+ paned = GTK_PANED (memo_shell_content->priv->paned);
+ child = gtk_paned_get_child2 (paned);
+
+ return GTK_WIDGET_VISIBLE (child);
+}
+
+void
+e_memo_shell_content_set_preview_visible (EMemoShellContent *memo_shell_content,
+ gboolean preview_visible)
+{
+ GtkPaned *paned;
+ GtkWidget *child;
+
+ g_return_if_fail (E_IS_MEMO_SHELL_CONTENT (memo_shell_content));
+
+ paned = GTK_PANED (memo_shell_content->priv->paned);
+ child = gtk_paned_get_child2 (paned);
+
+ if (preview_visible)
+ gtk_widget_show (child);
+ else
+ gtk_widget_hide (child);
+
+ g_object_notify (G_OBJECT (memo_shell_content), "preview-visible");
+}
Added: branches/kill-bonobo/calendar/modules/e-memo-shell-content.h
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-content.h Wed Sep 24 22:53:30 2008
@@ -0,0 +1,83 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-memo-shell-content.h
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef E_MEMO_SHELL_CONTENT_H
+#define E_MEMO_SHELL_CONTENT_H
+
+#include <shell/e-shell-content.h>
+#include <shell/e-shell-view.h>
+
+#include <calendar/gui/e-memo-preview.h>
+#include <calendar/gui/e-memo-table.h>
+
+#include <widgets/menus/gal-view-instance.h>
+
+/* Standard GObject macros */
+#define E_TYPE_MEMO_SHELL_CONTENT \
+ (e_memo_shell_content_get_type ())
+#define E_MEMO_SHELL_CONTENT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_MEMO_SHELL_CONTENT, EMemoShellContent))
+#define E_MEMO_SHELL_CONTENT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_MEMO_SHELL_CONTENT, EMemoShellContentClass))
+#define E_IS_MEMO_SHELL_CONTENT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_MEMO_SHELL_CONTENT))
+#define E_IS_MEMO_SHELL_CONTENT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_MEMO_SHELL_CONTENT))
+#define E_MEMO_SHELL_CONTENT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_MEMO_SHELL_CONTENT, EMemoShellContentClass))
+
+G_BEGIN_DECLS
+
+typedef struct _EMemoShellContent EMemoShellContent;
+typedef struct _EMemoShellContentClass EMemoShellContentClass;
+typedef struct _EMemoShellContentPrivate EMemoShellContentPrivate;
+
+struct _EMemoShellContent {
+ EShellContent parent;
+ EMemoShellContentPrivate *priv;
+};
+
+struct _EMemoShellContentClass {
+ EShellContentClass parent_class;
+};
+
+GType e_memo_shell_content_get_type (void);
+GtkWidget * e_memo_shell_content_new (EShellView *shell_view);
+EMemoPreview * e_memo_shell_content_get_memo_preview
+ (EMemoShellContent *memo_shell_content);
+EMemoTable * e_memo_shell_content_get_memo_table
+ (EMemoShellContent *memo_shell_content);
+GalViewInstance *
+ e_memo_shell_content_get_view_instance
+ (EMemoShellContent *memo_shell_content);
+gboolean e_memo_shell_content_get_preview_visible
+ (EMemoShellContent *memo_shell_content);
+void e_memo_shell_content_set_preview_visible
+ (EMemoShellContent *memo_shell_content,
+ gboolean preview_visible);
+
+G_END_DECLS
+
+#endif /* E_MEMO_SHELL_CONTENT_H */
Copied: branches/kill-bonobo/calendar/modules/e-memo-shell-module.c (from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-module.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-memo-shell-module.c (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-module.c Wed Sep 24 22:53:30 2008
@@ -25,13 +25,14 @@
#include <libedataserver/e-source-list.h>
#include <libedataserver/e-source-group.h>
-#include <e-shell.h>
-#include <e-shell-module.h>
-#include <e-shell-window.h>
-
-#include <calendar-config.h>
-#include <e-memo-shell-view.h>
-#include <dialogs/calendar-setup.h>
+#include "shell/e-shell.h"
+#include "shell/e-shell-module.h"
+#include "shell/e-shell-window.h"
+
+#include "calendar/gui/calendar-config.h"
+#include "calendar/gui/dialogs/calendar-setup.h"
+
+#include "e-memo-shell-view.h"
#define MODULE_NAME "memos"
#define MODULE_ALIASES ""
Copied: branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c (from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-sidebar.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-memo-shell-sidebar.c (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c Wed Sep 24 22:53:30 2008
@@ -21,11 +21,10 @@
#include "e-memo-shell-sidebar.h"
#include <glib/gi18n.h>
-#include <libedataserverui/e-source-selector.h>
-#include <e-memos.h>
-#include <e-memo-shell-view.h>
-#include <e-calendar-selector.h>
+#include "calendar/gui/e-calendar-selector.h"
+
+#include "e-memo-shell-view.h"
#define E_MEMO_SHELL_SIDEBAR_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -42,6 +41,7 @@
static gpointer parent_class;
+#if 0 /* MOVE THIS TO EMemoShellView */
static void
memo_shell_sidebar_update (EShellSidebar *shell_sidebar)
{
@@ -79,6 +79,7 @@
g_string_free (string, TRUE);
}
+#endif
static void
memo_shell_sidebar_get_property (GObject *object,
@@ -123,10 +124,6 @@
ESourceList *source_list;
GtkContainer *container;
GtkWidget *widget;
- EMemos *memos;
- ETable *table;
- ECalModel *model;
- EMemoTable *memo_table;
priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (object);
@@ -154,6 +151,8 @@
priv->selector = g_object_ref (widget);
gtk_widget_show (widget);
+#if 0 /* MOVE THIS TO EMemoShellView */
+
/* Setup signal handlers. */
memos = e_memo_shell_view_get_memos (memo_shell_view);
@@ -182,6 +181,8 @@
shell_sidebar);
memo_shell_sidebar_update (shell_sidebar);
+
+#endif
}
static void
@@ -254,11 +255,11 @@
"shell-view", shell_view, NULL);
}
-GtkWidget *
+ESourceSelector *
e_memo_shell_sidebar_get_selector (EMemoShellSidebar *memo_shell_sidebar)
{
g_return_val_if_fail (
E_IS_MEMO_SHELL_SIDEBAR (memo_shell_sidebar), NULL);
- return memo_shell_sidebar->priv->selector;
+ return E_SOURCE_SELECTOR (memo_shell_sidebar->priv->selector);
}
Copied: branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.h (from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-sidebar.h)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-memo-shell-sidebar.h (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.h Wed Sep 24 22:53:30 2008
@@ -21,8 +21,10 @@
#ifndef E_MEMO_SHELL_SIDEBAR_H
#define E_MEMO_SHELL_SIDEBAR_H
-#include <e-shell-sidebar.h>
-#include <e-shell-view.h>
+#include <libedataserverui/e-source-selector.h>
+
+#include <shell/e-shell-sidebar.h>
+#include <shell/e-shell-view.h>
/* Standard GObject macros */
#define E_TYPE_MEMO_SHELL_SIDEBAR \
@@ -60,7 +62,8 @@
GType e_memo_shell_sidebar_get_type (void);
GtkWidget * e_memo_shell_sidebar_new (EShellView *shell_view);
-GtkWidget * e_memo_shell_sidebar_get_selector
+ESourceSelector *
+ e_memo_shell_sidebar_get_selector
(EMemoShellSidebar *memo_shell_sidebar);
G_END_DECLS
Copied: branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c (from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-view-actions.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-memo-shell-view-actions.c (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c Wed Sep 24 22:53:30 2008
@@ -20,19 +20,19 @@
#include "e-memo-shell-view-private.h"
-#include <e-util/gconf-bridge.h>
+#include "e-util/gconf-bridge.h"
-#include "print.h"
+#include "calendar/gui/print.h"
static void
action_memo_clipboard_copy_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
- EMemos *memos;
+ EMemoShellContent *memo_shell_content;
EMemoTable *memo_table;
- memos = E_MEMOS (memo_shell_view->priv->memos);
- memo_table = e_memos_get_calendar_table (memos);
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
e_memo_table_copy_clipboard (memo_table);
}
@@ -40,11 +40,11 @@
action_memo_clipboard_cut_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
- EMemos *memos;
+ EMemoShellContent *memo_shell_content;
EMemoTable *memo_table;
- memos = E_MEMOS (memo_shell_view->priv->memos);
- memo_table = e_memos_get_calendar_table (memos);
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
e_memo_table_cut_clipboard (memo_table);
}
@@ -52,11 +52,11 @@
action_memo_clipboard_paste_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
- EMemos *memos;
+ EMemoShellContent *memo_shell_content;
EMemoTable *memo_table;
- memos = E_MEMOS (memo_shell_view->priv->memos);
- memo_table = e_memos_get_calendar_table (memos);
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
e_memo_table_paste_clipboard (memo_table);
}
@@ -64,10 +64,21 @@
action_memo_delete_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
- EMemos *memos;
+ EMemoShellContent *memo_shell_content;
+ EMemoPreview *memo_preview;
+ EMemoTable *memo_table;
+ const gchar *status_message;
+
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
+ memo_preview = e_memo_shell_content_get_memo_preview (memo_shell_content);
+
+ status_message = _("Deleting selected memos...");
+ e_memo_shell_view_set_status_message (memo_shell_view, status_message);
+ e_memo_table_delete_selected (memo_table);
+ e_memo_shell_view_set_status_message (memo_shell_view, NULL);
- memos = E_MEMOS (memo_shell_view->priv->memos);
- e_memos_delete_selected (memos);
+ e_memo_preview_clear (memo_preview);
}
static void
@@ -100,6 +111,7 @@
action_memo_list_properties_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
+ EMemoShellSidebar *memo_shell_sidebar;
EShellView *shell_view;
EShellWindow *shell_window;
ESource *source;
@@ -108,7 +120,8 @@
shell_view = E_SHELL_VIEW (memo_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
- selector = E_SOURCE_SELECTOR (memo_shell_view->priv->selector);
+ memo_shell_sidebar = memo_shell_view->priv->memo_shell_sidebar;
+ selector = e_memo_shell_sidebar_get_selector (memo_shell_sidebar);
source = e_source_selector_peek_primary_selection (selector);
g_return_if_fail (source != NULL);
@@ -119,29 +132,36 @@
action_memo_open_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
- EMemos *memos;
+ EMemoShellContent *memo_shell_content;
+ EMemoTable *memo_table;
- memos = E_MEMOS (memo_shell_view->priv->memos);
- e_memos_open_memo (memos);
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
+ e_memo_table_open_selected (memo_table);
}
static void
action_memo_preview_cb (GtkToggleAction *action,
EMemoShellView *memo_shell_view)
{
- /* FIXME */
+ EMemoShellContent *memo_shell_content;
+ gboolean visible;
+
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ visible = gtk_toggle_action_get_active (action);
+ e_memo_shell_content_set_preview_visible (memo_shell_content, visible);
}
static void
action_memo_print_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
- EMemos *memos;
- ETable *table;
+ EMemoShellContent *memo_shell_content;
EMemoTable *memo_table;
+ ETable *table;
- memos = E_MEMOS (memo_shell_view->priv->memos);
- memo_table = e_memos_get_calendar_table (memos);
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
table = e_memo_table_get_table (memo_table);
print_table (
@@ -153,12 +173,12 @@
action_memo_print_preview_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
- EMemos *memos;
- ETable *table;
+ EMemoShellContent *memo_shell_content;
EMemoTable *memo_table;
+ ETable *table;
- memos = E_MEMOS (memo_shell_view->priv->memos);
- memo_table = e_memos_get_calendar_table (memos);
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
table = e_memo_table_get_table (memo_table);
print_table (
@@ -298,8 +318,8 @@
void
e_memo_shell_view_actions_update (EMemoShellView *memo_shell_view)
{
- ECal *cal;
- EMemos *memos;
+ EMemoShellContent *memo_shell_content;
+ ECal *client;
ETable *table;
ECalModel *model;
EMemoTable *memo_table;
@@ -313,17 +333,17 @@
shell_view = E_SHELL_VIEW (memo_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
- memos = E_MEMOS (memo_shell_view->priv->memos);
- memo_table = e_memos_get_calendar_table (memos);
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
model = e_memo_table_get_model (memo_table);
- cal = e_cal_model_get_default_client (model);
+ client = e_cal_model_get_default_client (model);
table = e_memo_table_get_table (memo_table);
n_selected = e_table_selected_count (table);
- if (cal != NULL)
- e_cal_is_read_only (cal, &read_only, NULL);
+ if (client != NULL)
+ e_cal_is_read_only (client, &read_only, NULL);
action = ACTION (MEMO_OPEN);
sensitive = (n_selected == 1);
Copied: branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c (from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-view-private.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-memo-shell-view-private.c (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c Wed Sep 24 22:53:30 2008
@@ -20,21 +20,238 @@
#include "e-memo-shell-view-private.h"
+#include <widgets/menus/gal-view-factory-etable.h>
+
+static void
+memo_shell_view_backend_died_cb (EMemoShellView *memo_shell_view,
+ ECal *client)
+{
+ EShellView *shell_view;
+ EShellWindow *shell_window;
+ GHashTable *client_table;
+ ESource *source;
+ const gchar *uid;
+
+ shell_view = E_SHELL_VIEW (memo_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ source = e_cal_get_source (client);
+ uid = e_source_peek_uid (source);
+
+ g_object_ref (source);
+
+ g_hash_table_remove (client_table, uid);
+ e_memo_shell_view_set_status_message (memo_shell_view, NULL);
+
+ e_error_run (
+ GTK_WINDOW (shell_window),
+ "calendar:memos-crashed", NULL);
+
+ g_object_unref (source);
+}
+
+static void
+memo_shell_view_backend_error_cb (EMemoShellView *memo_shell_view,
+ const gchar *message,
+ ECal *client)
+{
+ EShellView *shell_view;
+ EShellWindow *shell_window;
+ GtkWidget *dialog;
+ const gchar *uri;
+ gchar *uri_no_passwd;
+
+ shell_view = E_SHELL_VIEW (memo_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ uri = e_cal_get_uri (client);
+ uri_no_passwd = get_uri_without_password (uri);
+
+ dialog = gtk_message_dialog_new (
+ GTK_WINDOW (shell_window),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+ _("Error on %s:\n%s"),
+ uri_no_passwd, message);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+
+ g_free (uri_no_passwd);
+}
+
+static void
+memo_shell_view_client_opened_cb (EMemoShellView *memo_shell_view,
+ ECalendarStatus status,
+ ECal *client)
+{
+ /* FIXME */
+}
+
+static gboolean
+memo_shell_view_add_source (EMemoShellView *memo_shell_view,
+ ESource *source)
+{
+ GHashTable *client_table;
+ ECal *default_client;
+ ECal *client;
+ const gchar *uid;
+ const gchar *uri;
+ gchar *status_message;
+
+ client_table = memo_shell_view->priv->client_table;
+ default_client = memo_shell_view->priv->default_client;
+
+ uid = e_source_peek_uid (source);
+ client = g_hash_table_lookup (client_table, uid);
+
+ if (client != NULL)
+ return TRUE;
+
+ if (default_client != NULL) {
+ ESource *default_source;
+ const gchar *default_uid;
+
+ default_source = e_cal_get_source (default_client);
+ default_uid = e_source_peek_uid (default_source);
+
+ if (strcmp (uid, default_uid) == 0)
+ client = g_object_ref (default_client);
+ }
+
+ if (client == NULL)
+ client = auth_new_cal_from_source (
+ source, E_CAL_SOURCE_TYPE_JOURNAL);
+
+ if (client == NULL)
+ return FALSE;
+
+ g_signal_connect_swapped (
+ client, "backend-died",
+ G_CALLBACK (memo_shell_view_backend_died_cb),
+ memo_shell_view);
+
+ g_signal_connect_swapped (
+ client, "backend-error",
+ G_CALLBACK (memo_shell_view_backend_error_cb),
+ memo_shell_view);
+
+ g_hash_table_insert (client_table, g_strdup (uid), client);
+
+ uri = e_cal_get_uri (client);
+
+ status_message = g_strdup_printf (_("Opening memos at %s"), uri);
+ e_memo_shell_view_set_status_message (memo_shell_view, status_message);
+ g_free (status_message);
+
+ g_signal_connect_swapped (
+ client, "cal-opened",
+ G_CALLBACK (memo_shell_view_client_opened_cb),
+ memo_shell_view);
+
+ e_cal_open_async (client, FALSE);
+
+ return TRUE;
+}
+
+static void
+memo_shell_view_user_created_cb (EMemoShellView *memo_shell_view,
+ EMemoTable *memo_table)
+{
+ ECal *client;
+ ESource *source;
+
+ if (memo_table->user_created_cal != NULL)
+ client = memo_table->user_created_cal;
+ else {
+ ECalModel *model;
+
+ model = e_memo_table_get_model (memo_table);
+ client = e_cal_model_get_default_client (model);
+ }
+
+ source = e_cal_get_source (client);
+ memo_shell_view_add_source (memo_shell_view, source);
+}
+
+static void
+memo_shell_view_load_view_collection (EShellViewClass *shell_view_class)
+{
+ GalViewCollection *collection;
+ GalViewFactory *factory;
+ ETableSpecification *spec;
+ const gchar *base_dir;
+ gchar *filename;
+
+ collection = shell_view_class->view_collection;
+
+ base_dir = EVOLUTION_ETSPECDIR;
+ spec = e_table_specification_new ();
+ filename = g_build_filename (base_dir, ETSPEC_FILENAME, NULL);
+ if (!e_table_specification_load_from_file (spec, filename))
+ g_critical ("Unable to load ETable specification file "
+ "for memos");
+ g_free (filename);
+
+ factory = gal_view_factory_etable_new (spec);
+ gal_view_collection_add_factory (collection, factory);
+ g_object_unref (factory);
+ g_object_unref (spec);
+
+ gal_view_collection_load (collection);
+}
+
+static void
+memo_shell_view_notify_view_id_cb (EMemoShellView *memo_shell_view)
+{
+ EMemoShellContent *memo_shell_content;
+ GalViewInstance *view_instance;
+ const gchar *view_id;
+
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ view_instance =
+ e_memo_shell_content_get_view_instance (memo_shell_content);
+ view_id = e_shell_view_get_view_id (E_SHELL_VIEW (memo_shell_view));
+
+ /* A NULL view ID implies we're in a custom view. But you can
+ * only get to a custom view via the "Define Views" dialog, which
+ * would have already modified the view instance appropriately.
+ * Furthermore, there's no way to refer to a custom view by ID
+ * anyway, since custom views have no IDs. */
+ if (view_id == NULL)
+ return;
+
+ gal_view_instance_set_current_view_id (view_instance, view_id);
+}
+
void
e_memo_shell_view_private_init (EMemoShellView *memo_shell_view,
EShellViewClass *shell_view_class)
{
EMemoShellViewPrivate *priv = memo_shell_view->priv;
ESourceList *source_list;
+ GHashTable *client_table;
GObject *object;
object = G_OBJECT (shell_view_class->type_module);
source_list = g_object_get_data (object, "source-list");
g_return_if_fail (E_IS_SOURCE_LIST (source_list));
+ client_table = g_hash_table_new_full (
+ g_str_hash, g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) g_object_unref);
+
priv->source_list = g_object_ref (source_list);
priv->memo_actions = gtk_action_group_new ("memos");
- priv->activity_handler = e_activity_handler_new ();
+ priv->client_table = client_table;
+
+ if (!gal_view_collection_loaded (shell_view_class->view_collection))
+ memo_shell_view_load_view_collection (shell_view_class);
+
+ g_signal_connect (
+ memo_shell_view, "notify::view-id",
+ G_CALLBACK (memo_shell_view_notify_view_id_cb), NULL);
}
void
@@ -42,24 +259,25 @@
{
EMemoShellViewPrivate *priv = memo_shell_view->priv;
EShellContent *shell_content;
- EShellTaskbar *shell_taskbar;
+ EShellSidebar *shell_sidebar;
EShellView *shell_view;
- GtkWidget *container;
- GtkWidget *widget;
+ EMemoTable *memo_table;
shell_view = E_SHELL_VIEW (memo_shell_view);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+ shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
- /* Construct view widgets. */
-
- widget = e_memos_new ();
- shell_content = e_shell_view_get_content (shell_view);
- gtk_container_add (GTK_CONTAINER (shell_content), widget);
- priv->memos = g_object_ref (widget);
- gtk_widget_show (widget);
-
- shell_taskbar = e_shell_view_get_taskbar (shell_view);
- e_activity_handler_attach_task_bar (
- priv->activity_handler, shell_taskbar);
+ /* Cache these to avoid lots of awkward casting. */
+ priv->memo_shell_content = g_object_ref (shell_content);
+ priv->memo_shell_sidebar = g_object_ref (shell_sidebar);
+
+ memo_table = e_memo_shell_content_get_memo_table (
+ priv->memo_shell_content);
+
+ g_signal_connect_swapped (
+ memo_table, "user-created",
+ G_CALLBACK (memo_shell_view_user_created_cb),
+ memo_shell_view);
e_memo_shell_view_actions_update (memo_shell_view);
}
@@ -73,13 +291,26 @@
DISPOSE (priv->memo_actions);
- DISPOSE (priv->memos);
+ DISPOSE (priv->memo_shell_content);
+ DISPOSE (priv->memo_shell_sidebar);
- DISPOSE (priv->activity_handler);
+ g_hash_table_remove_all (priv->client_table);
+ DISPOSE (priv->default_client);
}
void
e_memo_shell_view_private_finalize (EMemoShellView *memo_shell_view)
{
EMemoShellViewPrivate *priv = memo_shell_view->priv;
+
+ g_hash_table_destroy (priv->client_table);
+}
+
+void
+e_memo_shell_view_set_status_message (EMemoShellView *memo_shell_view,
+ const gchar *status_message)
+{
+ g_return_if_fail (E_IS_MEMO_SHELL_VIEW (memo_shell_view));
+
+ /* FIXME */
}
Copied: branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.h (from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-view-private.h)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-memo-shell-view-private.h (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.h Wed Sep 24 22:53:30 2008
@@ -23,17 +23,21 @@
#include "e-memo-shell-view.h"
+#include <string.h>
#include <glib/gi18n.h>
-#include <e-util/e-util.h>
-#include <shell/e-shell-content.h>
-#include <shell/e-activity-handler.h>
-
-#include <e-memos.h>
-#include <e-calendar-selector.h>
-#include <e-memo-shell-sidebar.h>
-#include <e-memo-shell-view-actions.h>
-#include <dialogs/calendar-setup.h>
+#include "e-util/e-error.h"
+#include "e-util/e-util.h"
+
+#include "calendar/gui/misc.h"
+#include "calendar/gui/e-calendar-selector.h"
+#include "calendar/gui/e-memo-preview.h"
+#include "calendar/common/authentication.h"
+#include "calendar/gui/dialogs/calendar-setup.h"
+
+#include "e-memo-shell-content.h"
+#include "e-memo-shell-sidebar.h"
+#include "e-memo-shell-view-actions.h"
#define E_MEMO_SHELL_VIEW_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -51,6 +55,9 @@
if ((obj) != NULL) { g_object_unref (obj); (obj) = NULL; } \
} G_STMT_END
+/* ETable Specifications */
+#define ETSPEC_FILENAME "e-memo-table.etspec"
+
G_BEGIN_DECLS
struct _EMemoShellViewPrivate {
@@ -65,9 +72,13 @@
/*** Other Stuff ***/
- GtkWidget *memos;
-
- EActivityHandler *activity_handler;
+ /* These are just for convenience. */
+ EMemoShellContent *memo_shell_content;
+ EMemoShellSidebar *memo_shell_sidebar;
+
+ /* UID -> ECal */
+ GHashTable *client_table;
+ ECal *default_client;
};
void e_memo_shell_view_private_init
@@ -86,6 +97,9 @@
(EMemoShellView *memo_shell_view);
void e_memo_shell_view_actions_update
(EMemoShellView *memo_shell_view);
+void e_memo_shell_view_set_status_message
+ (EMemoShellView *memo_shell_view,
+ const gchar *status_message);
G_END_DECLS
Copied: branches/kill-bonobo/calendar/modules/e-memo-shell-view.c (from r36317, /branches/kill-bonobo/calendar/gui/e-memo-shell-view.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-memo-shell-view.c (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view.c Wed Sep 24 22:53:30 2008
@@ -82,7 +82,7 @@
priv = E_MEMO_SHELL_VIEW_GET_PRIVATE (shell_view);
action_group = priv->memo_actions;
- visible = e_shell_view_is_selected (shell_view);
+ visible = e_shell_view_is_active (shell_view);
gtk_action_group_set_visible (action_group, visible);
}
@@ -105,9 +105,11 @@
shell_view_class = E_SHELL_VIEW_CLASS (class);
shell_view_class->label = N_("Memos");
shell_view_class->icon_name = "evolution-memos";
+ shell_view_class->search_options = "/memo-search-options";
shell_view_class->type_module = type_module;
- shell_view_class->changed = memo_shell_view_changed;
+ shell_view_class->new_shell_content = e_memo_shell_content_new;
shell_view_class->new_shell_sidebar = e_memo_shell_sidebar_new;
+ shell_view_class->changed = memo_shell_view_changed;
g_object_class_install_property (
object_class,
Copied: branches/kill-bonobo/calendar/modules/e-memo-shell-view.h (from r36311, /branches/kill-bonobo/calendar/gui/e-memo-shell-view.h)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-memo-shell-view.h (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view.h Wed Sep 24 22:53:30 2008
@@ -21,7 +21,7 @@
#ifndef E_MEMO_SHELL_VIEW_H
#define E_MEMO_SHELL_VIEW_H
-#include <e-shell-view.h>
+#include <shell/e-shell-view.h>
#include <libedataserver/e-source-list.h>
/* Standard GObject macros */
Added: branches/kill-bonobo/calendar/modules/e-task-shell-content.c
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-content.c Wed Sep 24 22:53:30 2008
@@ -0,0 +1,550 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-task-shell-content.h
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "e-task-shell-content.h"
+
+#include <glib/gi18n.h>
+
+#include "e-util/gconf-bridge.h"
+
+#include "calendar/gui/e-calendar-table.h"
+#include "calendar/gui/e-calendar-table-config.h"
+
+#include "widgets/menus/gal-view-etable.h"
+
+#define E_TASK_SHELL_CONTENT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TASK_SHELL_CONTENT, ETaskShellContentPrivate))
+
+#define E_TASK_TABLE_DEFAULT_STATE \
+ "<?xml version=\"1.0\"?>" \
+ "<ETableState>" \
+ " <column source=\"13\"/>" \
+ " <column source=\"14\"/>" \
+ " <column source=\"9\"/>" \
+ " <column source=\"5\"/>" \
+ " <grouping/>
+ "</ETableState>"
+
+struct _ETaskShellContentPrivate {
+ GtkWidget *paned;
+ GtkWidget *task_table;
+ GtkWidget *task_preview;
+
+ ETaskTableConfig *table_config;
+ GalViewInstance *view_instance;
+
+ gchar *current_uid;
+};
+
+enum {
+ PROP_0,
+ PROP_PREVIEW_VISIBLE
+};
+
+enum {
+ TARGET_VCALENDAR
+};
+
+static GtkTargetEntry drag_types[] = {
+ { "text/calendar", 0, TARGET_VCALENDAR },
+ { "text/x-calendar", 0, TARGET_VCALENDAR }
+};
+
+static gpointer parent_class;
+
+static void
+task_shell_content_changed_cb (ETaskShellContent *task_shell_content,
+ GalViewInstance *view_instance)
+{
+ EShellView *shell_view;
+ EShellContent *shell_content;
+ gchar *view_id;
+
+ shell_content = E_SHELL_CONTENT (task_shell_content);
+ shell_view = e_shell_content_get_shell_view (shell_content);
+ view_id = gal_view_instance_get_current_view_id (view_instance);
+ e_shell_view_set_view_id (shell_view, view_id);
+ g_free (view_id);
+}
+
+static void
+task_shell_content_display_view_cb (ETaskShellContent *task_shell_content,
+ GalView *gal_view)
+{
+ ECalendarTable *task_table;
+ ETableScrolled *table_scrolled;
+ ETable *table;
+
+ if (!GAL_IS_VIEW_ETABLE (gal_view))
+ return;
+
+ task_table = E_CALENDAR_TABLE (task_shell_content->priv->task_table);
+ table_scrolled = E_TABLE_SCROLLED (task_table->etable);
+ table = e_table_scrolled_get_table (table_scrolled);
+
+ gal_view_etable_attach_table (GAL_VIEW_ETABLE (gal_view), table);
+}
+
+static void
+task_shell_content_table_drag_data_get_cb (ETaskShellContent *task_shell_content,
+ gint row,
+ gint col,
+ GdkDragContext *context,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint time)
+{
+ /* FIXME */
+}
+
+static void
+task_shell_content_table_drag_data_delete_cb (ETaskShellContent *task_shell_content,
+ gint row,
+ gint col,
+ GdkDragContext *context)
+{
+ /* Moved components are deleted from source immediately when moved,
+ * because some of them can be part of destination source, and we
+ * don't want to delete not-moved tasks. There is no such information
+ * which event has been moved and which not, so skip this method. */
+}
+
+static void
+task_shell_content_cursor_change_cb (ETaskShellContent *task_shell_content,
+ gint row,
+ ETable *table)
+{
+ ETaskPreview *task_preview;
+ ETaskTable *task_table;
+ ECalModel *model;
+ ECalModelComponent *comp_data;
+ ECalComponent *comp;
+ const gchar *uid;
+
+ task_preview = E_TASK_PREVIEW (task_shell_content->priv->task_preview);
+ task_table = E_TASK_TABLE (task_shell_content->priv->task_table);
+
+ if (e_table_selected_count (table) != 1) {
+ e_task_preview_clear (task_preview);
+ return;
+ }
+
+ model = e_task_table_get_model (task_table);
+ row = e_table_get_cursor_row (table);
+ comp_data = e_cal_model_get_component_at (model, row);
+
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (
+ comp, icalcomponent_new_clone (comp_data->icalcomp));
+ e_task_preview_display (task_preview, comp_data->client, comp);
+
+ e_cal_component_get_uid (comp, &uid);
+ g_free (task_shell_content->priv->current_uid);
+ task_shell_content->priv->current_uid = g_strdup (uid);
+
+ g_object_unref (comp);
+}
+
+static void
+task_shell_content_selection_change_cb (ETaskShellContent *task_shell_content,
+ ETable *table)
+{
+ ETaskPreview *task_preview;
+
+ task_preview = E_TASK_PREVIEW (task_shell_content->priv->task_preview);
+
+ /* XXX Old code emits a "selection-changed" signal here. */
+
+ if (e_table_selected_count (table) != 1)
+ e_task_preview_clear (task_preview);
+}
+
+static void
+task_shell_content_model_row_changed_cb (ETaskShellContent *task_shell_content,
+ gint row,
+ ETableModel *model)
+{
+ ECalModelComponent *comp_data;
+ ETaskTable *task_table;
+ ETableScrolled *table_scrolled;
+ ETable *table;
+ const gchar *current_uid;
+ const gchar *uid;
+
+ current_uid = task_shell_content->priv->current_uid;
+ if (current_uid == NULL)
+ return;
+
+ comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
+ if (comp_data == NULL)
+ return;
+
+ uid = icalcomponent_get_uid (comp_data->icalcomp);
+ if (g_strcmp0 (uid, current_uid) != 0)
+ return;
+
+ task_table = E_TASK_TABLE (task_shell_content->priv->task_table);
+ table_scrolled = E_TABLE_SCROLLED (task_table->etable);
+ table = e_table_scrolled_get_table (table_scrolled);
+
+ task_shell_content_cursor_change_cb (task_shell_content, 0, table);
+}
+
+static void
+task_shell_content_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_PREVIEW_VISIBLE:
+ e_task_shell_content_set_preview_visible (
+ E_TASK_SHELL_CONTENT (object),
+ g_value_get_boolean (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+task_shell_content_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_PREVIEW_VISIBLE:
+ g_value_set_boolean (
+ value, e_task_shell_content_get_preview_visible (
+ E_TASK_SHELL_CONTENT (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+task_shell_content_dispose (GObject *object)
+{
+ ETaskShellContentPrivate *priv;
+
+ priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object);
+
+ if (priv->paned != NULL) {
+ g_object_unref (priv->paned);
+ priv->paned = NULL;
+ }
+
+ if (priv->task_table != NULL) {
+ g_object_unref (priv->task_table);
+ priv->task_table = NULL;
+ }
+
+ if (priv->task_preview != NULL) {
+ g_object_unref (priv->task_preview);
+ priv->task_preview = NULL;
+ }
+
+ if (priv->table_config != NULL) {
+ g_object_unref (priv->table_config);
+ priv->table_config = NULL;
+ }
+
+ if (priv->view_instance != NULL) {
+ g_object_unref (priv->view_instance);
+ priv->view_instance = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+task_shell_content_finalize (GObject *object)
+{
+ ETaskShellContentPrivate *priv;
+
+ priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object);
+
+ g_free (priv->current_uid);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
+task_shell_content_constructed (GObject *object)
+{
+ ETaskShellContentPrivate *priv;
+ EShellContent *shell_content;
+ EShellView *shell_view;
+ EShellViewClass *shell_view_class;
+ GalViewCollection *view_collection;
+ GalViewInstance *view_instance;
+ ECalModel *model;
+ ETable *table;
+ GConfBridge *bridge;
+ GtkWidget *container;
+ GtkWidget *widget;
+ const gchar *key;
+
+ priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object);
+
+ /* Chain up to parent's constructed() method. */
+ G_OBJECT_CLASS (parent_class)->constructed (object);
+
+ shell_content = E_SHELL_CONTENT (object);
+ shell_view = e_shell_content_get_shell_view (shell_content);
+ shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
+ view_collection = shell_view_class->view_collection;
+
+ /* Load the view instance. */
+
+ view_instance = gal_view_instance_new (view_collection, NULL);
+ g_signal_connect_swapped (
+ view_instance, "changed",
+ G_CALLBACK (task_shell_content_changed_cb),
+ object);
+ g_signal_connect_swapped (
+ view_instance, "display-view",
+ G_CALLBACK (task_shell_content_display_view_cb),
+ object);
+ gal_view_instance_load (view_instance);
+ priv->view_instance = view_instance;
+
+ /* Build content widgets. */
+
+ container = GTK_WIDGET (object);
+
+ widget = gtk_vpaned_new ();
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ priv->paned = g_object_ref (widget);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ widget = e_task_table_new (shell_view);
+ gtk_paned_add1 (GTK_PANED (container), widget);
+ priv->task_table = g_object_ref (widget);
+ gtk_widget_show (widget);
+
+ widget = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (
+ GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
+ gtk_paned_add2 (GTK_PANED (container), widget);
+
+ container = widget;
+
+ widget = e_task_preview_new ();
+ e_task_preview_set_default_timezone (
+ E_TASK_PREVIEW (widget),
+ calendar_config_get_icaltimezone ());
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ priv->task_preview = g_object_ref (widget);
+ gtk_widget_show (widget);
+
+ /* Configure the task table. */
+
+ widget = E_TASK_TABLE (priv->task_table)->etable;
+ table = e_table_scrolled_get_table (E_TABLE_SCROLLED (widget));
+ model = e_task_table_get_model (E_TASK_TABLE (priv->task_table));
+
+ priv->table_config = e_task_table_config_new (
+ E_TASK_TABLE (priv->task_table));
+
+ e_table_set_state (table, E_TASK_TABLE_DEFAULT_STATE);
+
+ e_table_drag_source_set (
+ table, GDK_BUTTON1_MASK,
+ drag_types, G_N_ELEMENTS (drag_types),
+ GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_ASK);
+
+ g_signal_connect_swapped (
+ table, "table-drag-data-get",
+ G_CALLBACK (task_shell_content_table_drag_data_get_cb),
+ object);
+
+ g_signal_connect_swapped (
+ table, "table-drag-data-delete",
+ G_CALLBACK (task_shell_content_table_drag_data_delete_cb),
+ object);
+
+ g_signal_connect_swapped (
+ table, "cursor-change",
+ G_CALLBACK (task_shell_content_cursor_change_cb),
+ object);
+
+ g_signal_connect_swapped (
+ table, "selection-change",
+ G_CALLBACK (task_shell_content_selection_change_cb),
+ object);
+
+ g_signal_connect_swapped (
+ model, "model-row-changed",
+ G_CALLBACK (task_shell_content_model_row_changed_cb),
+ object);
+
+ /* Bind GObject properties to GConf keys. */
+
+ bridge = gconf_bridge_get ();
+
+ object = G_OBJECT (priv->paned);
+ key = "/apps/evolution/calendar/display/task_vpane_position";
+ gconf_bridge_bind_property_delayed (bridge, key, object, "position");
+}
+
+static void
+task_shell_content_class_init (ETaskShellContentClass *class)
+{
+ GObjectClass *object_class;
+
+ parent_class = g_type_class_peek_parent (class);
+ g_type_class_add_private (class, sizeof (ETaskShellContentPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = task_shell_content_set_property;
+ object_class->get_property = task_shell_content_get_property;
+ object_class->dispose = task_shell_content_dispose;
+ object_class->finalize = task_shell_content_finalize;
+ object_class->constructed = task_shell_content_constructed;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_PREVIEW_VISIBLE,
+ g_param_spec_boolean (
+ "preview-visible",
+ _("Preview is Visible"),
+ _("Whether the preview pane is visible"),
+ TRUE,
+ G_PARAM_READWRITE));
+}
+
+static void
+task_shell_content_init (ETaskShellContent *task_shell_content)
+{
+ task_shell_content->priv =
+ E_TASK_SHELL_CONTENT_GET_PRIVATE (task_shell_content);
+
+ /* Postpone widget construction until we have a shell view. */
+}
+
+GType
+e_task_shell_content_get_type (void)
+{
+ static GType type = 0;
+
+ if (G_UNLIKELY (type == 0)) {
+ static const GTypeInfo type_info = {
+ sizeof (ETaskShellContentClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) task_shell_content_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class_data */
+ sizeof (ETaskShellContent),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) task_shell_content_init,
+ NULL /* value_table */
+ };
+
+ type = g_type_register_static (
+ E_TYPE_SHELL_CONTENT, "ETaskShellContent",
+ &type_info, 0);
+ }
+
+ return type;
+}
+
+GtkWidget *
+e_task_shell_content_new (EShellView *shell_view)
+{
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
+
+ return g_object_new (
+ E_TYPE_TASK_SHELL_CONTENT,
+ "shell-view", shell_view, NULL);
+}
+
+ETaskPreview *
+e_task_shell_content_get_task_preview (ETaskShellContent *task_shell_content)
+{
+ g_return_val_if_fail (
+ E_IS_TASK_SHELL_CONTENT (task_shell_content), NULL);
+
+ return E_TASK_PREVIEW (task_shell_content->priv->task_preview);
+}
+
+ETaskTable *
+e_task_shell_content_get_task_table (ETaskShellContent *task_shell_content)
+{
+ g_return_val_if_fail (
+ E_IS_TASK_SHELL_CONTENT (task_shell_content), NULL);
+
+ return E_TASK_TABLE (task_shell_content->priv->task_table);
+}
+
+GalViewInstance *
+e_task_shell_content_get_view_instance (ETaskShellContent *task_shell_content)
+{
+ g_return_val_if_fail (
+ E_IS_TASK_SHELL_CONTENT (task_shell_content), NULL);
+
+ return task_shell_content->priv->view_instance;
+}
+
+gboolean
+e_task_shell_content_get_preview_visible (ETaskShellContent *task_shell_content)
+{
+ GtkPaned *paned;
+ GtkWidget *child;
+
+ g_return_val_if_fail (
+ E_IS_TASK_SHELL_CONTENT (task_shell_content), FALSE);
+
+ paned = GTK_PANED (task_shell_content->priv->paned);
+ child = gtk_paned_get_child2 (paned);
+
+ return GTK_WIDGET_VISIBLE (child);
+}
+
+void
+e_task_shell_content_set_preview_visible (ETaskShellContent *task_shell_content,
+ gboolean preview_visible)
+{
+ GtkPaned *paned;
+ GtkWidget *child;
+
+ g_return_if_fail (E_IS_TASK_SHELL_CONTENT (task_shell_content));
+
+ paned = GTK_PANED (task_shell_content->priv->paned);
+ child = gtk_paned_get_child2 (paned);
+
+ if (preview_visible)
+ gtk_widget_show (child);
+ else
+ gtk_widget_hide (child);
+
+ g_object_notify (G_OBJECT (task_shell_content), "preview-visible");
+}
Added: branches/kill-bonobo/calendar/modules/e-task-shell-content.h
==============================================================================
--- (empty file)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-content.h Wed Sep 24 22:53:30 2008
@@ -0,0 +1,76 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-task-shell-content.h
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef E_TASK_SHELL_CONTENT_H
+#define E_TASK_SHELL_CONTENT_H
+
+#include <shell/e-shell-content.h>
+#include <shell/e-shell-view.h>
+
+#include <widgets/menus/gal-view-instance.h>
+
+/* Standard GObject macros */
+#define E_TYPE_TASK_SHELL_CONTENT \
+ (e_task_shell_content_get_type ())
+#define E_TASK_SHELL_CONTENT(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_TASK_SHELL_CONTENT, ETaskShellContent))
+#define E_TASK_SHELL_CONTENT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_TASK_SHELL_CONTENT, ETaskShellContentClass))
+#define E_IS_TASK_SHELL_CONTENT(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_TASK_SHELL_CONTENT))
+#define E_IS_TASK_SHELL_CONTENT_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_TASK_SHELL_CONTENT))
+#define E_TASK_SHELL_CONTENT_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_TASK_SHELL_CONTENT, ETaskShellContentClass))
+
+G_BEGIN_DECLS
+
+typedef struct _ETaskShellContent ETaskShellContent;
+typedef struct _ETaskShellContentClass ETaskShellContentClass;
+typedef struct _ETaskShellContentPrivate ETaskShellContentPrivate;
+
+struct _ETaskShellContent {
+ EShellContent parent;
+ ETaskShellContentPrivate *priv;
+};
+
+struct _ETaskShellContentClass {
+ EShellContentClass parent_class;
+};
+
+GType e_task_shell_content_get_type (void);
+GtkWidget * e_task_shell_content_new (EShellView *shell_view);
+GalViewInstance *
+ e_task_shell_content_get_view_instance
+ (ETaskShellContent *task_shell_content);
+gboolean e_task_shell_content_get_preview_visible
+ (ETaskShellContent *task_shell_content);
+void e_task_shell_content_set_preview_visible
+ (ETaskShellContent *task_shell_content,
+ gboolean preview_visible);
+
+G_END_DECLS
+
+#endif /* E_TASK_SHELL_CONTENT_H */
Copied: branches/kill-bonobo/calendar/modules/e-task-shell-module.c (from r36311, /branches/kill-bonobo/calendar/gui/e-task-shell-module.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-task-shell-module.c (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-module.c Wed Sep 24 22:53:30 2008
@@ -25,12 +25,13 @@
#include <libedataserver/e-source-list.h>
#include <libedataserver/e-source-group.h>
-#include <e-shell.h>
-#include <e-shell-module.h>
-#include <e-shell-window.h>
+#include "shell/e-shell.h"
+#include "shell/e-shell-module.h"
+#include "shell/e-shell-window.h"
-#include <calendar-config.h>
-#include <e-task-shell-view.h>
+#include "calendar/gui/calendar-config.h"
+
+#include "e-task-shell-view.h"
#define MODULE_NAME "tasks"
#define MODULE_ALIASES ""
Copied: branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c (from r36317, /branches/kill-bonobo/calendar/gui/e-task-shell-sidebar.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-task-shell-sidebar.c (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c Wed Sep 24 22:53:30 2008
@@ -21,11 +21,10 @@
#include "e-task-shell-sidebar.h"
#include <glib/gi18n.h>
-#include <libedataserverui/e-source-selector.h>
-#include <e-tasks.h>
-#include <e-task-shell-view.h>
-#include <e-calendar-selector.h>
+#include "calendar/gui/e-calendar-selector.h"
+
+#include "e-task-shell-view.h"
#define E_TASK_SHELL_SIDEBAR_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -42,6 +41,7 @@
static gpointer parent_class;
+#if 0 /* MOVE THIS TO ETaskShellView */
static void
task_shell_sidebar_update (EShellSidebar *shell_sidebar)
{
@@ -79,6 +79,7 @@
g_string_free (string, TRUE);
}
+#endif
static void
task_shell_sidebar_get_property (GObject *object,
@@ -123,10 +124,6 @@
ESourceList *source_list;
GtkContainer *container;
GtkWidget *widget;
- ETasks *tasks;
- ETable *table;
- ECalModel *model;
- ECalendarTable *cal_table;
priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (object);
@@ -154,6 +151,8 @@
priv->selector = g_object_ref (widget);
gtk_widget_show (widget);
+#if 0 /* MOVE THIS TO ETaskShellView */
+
/* Setup signal handlers. */
tasks = e_task_shell_view_get_tasks (task_shell_view);
@@ -182,6 +181,8 @@
shell_sidebar);
task_shell_sidebar_update (shell_sidebar);
+
+#endif
}
static void
Copied: branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.h (from r36317, /branches/kill-bonobo/calendar/gui/e-task-shell-sidebar.h)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-task-shell-sidebar.h (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.h Wed Sep 24 22:53:30 2008
@@ -21,8 +21,8 @@
#ifndef E_TASK_SHELL_SIDEBAR_H
#define E_TASK_SHELL_SIDEBAR_H
-#include <e-shell-sidebar.h>
-#include <e-shell-view.h>
+#include <shell/e-shell-sidebar.h>
+#include <shell/e-shell-view.h>
/* Standard GObject macros */
#define E_TYPE_TASK_SHELL_SIDEBAR \
Copied: branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c (from r36304, /branches/kill-bonobo/calendar/gui/e-task-shell-view-actions.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-task-shell-view-actions.c (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c Wed Sep 24 22:53:30 2008
@@ -30,24 +30,57 @@
action_task_clipboard_copy_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
+ ETaskShellContent *task_shell_content;
+ ETaskTable *task_table;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+ e_task_table_copy_clipboard (task_table);
}
static void
action_task_clipboard_cut_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
+ ETaskShellContent *task_shell_content;
+ ETaskTable *task_table;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+ e_task_table_cut_clipboard (task_table);
}
static void
action_task_clipboard_paste_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
+ ETaskShellContent *task_shell_content;
+ ETaskTable *task_table;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+ e_task_table_paste_clipboard (task_table);
}
static void
action_task_delete_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
+ ETaskShellContent *task_shell_content;
+ ETaskPreview *task_preview;
+ ETaskTable *task_table;
+ const gchar *status_message;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+ task_preview = e_task_shell_content_get_task_preview (task_shell_content);
+
+ status_message = _("Deleting selected tasks...");
+ e_task_shell_view_set_status_message (task_shell_view, status_message);
+ e_task_table_delete_selected (task_table);
+ e_task_shell_view_set_status_message (task_shell_view, NULL);
+
+ e_task_preview_clear (task_preview);
}
static void
@@ -60,12 +93,14 @@
action_task_list_copy_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
+ /* FIXME */
}
static void
action_task_list_delete_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
+ /* FIXME */
}
static void
@@ -90,24 +125,58 @@
action_task_open_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
+ ETaskShellContent *task_shell_content;
+ ETaskTable *task_table;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+ e_task_table_open_selected (task_table);
}
static void
action_task_preview_cb (GtkToggleAction *action,
ETaskShellView *task_shell_view)
{
+ ETaskShellContent *task_shell_content;
+ gboolean visible;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ visible = gtk_toggle_action_get_active (action);
+ e_task_shell_content_set_preview_visible (task_shell_content, visible);
}
static void
action_task_print_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
+ ETaskShellContent *task_shell_content;
+ ETaskTable *task_table;
+ ETable *table;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+ table = e_task_table_get_table (task_table);
+
+ print_table (
+ table, _("Print Tasks"), _("Tasks"),
+ GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
}
static void
action_task_print_preview_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
+ ETaskShellContent *task_shell_content;
+ ETaskTable *task_table;
+ ETable *table;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+ table = e_task_table_get_table (task_table);
+
+ print_table (
+ table, _("Print Tasks"), _("Tasks"),
+ GTK_PRINT_OPERATION_ACTION_PREVIEW);
}
static void
Copied: branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c (from r36311, /branches/kill-bonobo/calendar/gui/e-task-shell-view-private.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-task-shell-view-private.c (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c Wed Sep 24 22:53:30 2008
@@ -20,6 +20,58 @@
#include "e-task-shell-view-private.h"
+#include <widgets/menus/gal-view-factory-etable.h>
+
+static void
+task_shell_view_load_view_collection (EShellViewClass *shell_view_class)
+{
+ GalViewCollection *collection;
+ GalViewFactory *factory;
+ ETableSpecification *spec;
+ const gchar *base_dir;
+ gchar *filename;
+
+ collection = shell_view_class->view_collection;
+
+ base_dir = EVOLUTION_ETSPECDIR;
+ spec = e_table_specification_new ();
+ filename = g_build_filename (base_dir, ETSPEC_FILENAME, NULL);
+ if (!e_table_specification_load_from_file (spec, filename))
+ g_critical ("Unable to load ETable specification file "
+ "for tasks");
+ g_free (filename);
+
+ factory = gal_view_factory_etable_new (spec);
+ gal_view_collection_add_factory (collection, factory);
+ g_object_unref (factory);
+ g_object_unref (spec);
+
+ gal_view_collection_load (collection);
+}
+
+static void
+task_shell_view_notify_view_id_cb (ETaskShellView *task_shell_view)
+{
+ ETaskShellContent *task_shell_content;
+ GalViewInstance *view_instance;
+ const gchar *view_id;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ view_instance =
+ e_task_shell_content_get_view_instance (task_shell_content);
+ view_id = e_shell_view_get_view_id (E_SHELL_VIEW (task_shell_view));
+
+ /* A NULL view ID implies we're in a custom view. But you can
+ * only get to a custom view via the "Define Views" dialog, which
+ * would have already modified the view instance appropriately.
+ * Furthermore, there's no way to refer to a custom view by ID
+ * anyway, since custom views have no IDs. */
+ if (view_id == NULL)
+ return;
+
+ gal_view_instance_set_current_view_id (view_instance, view_id);
+}
+
void
e_task_shell_view_private_init (ETaskShellView *task_shell_view,
EShellViewClass *shell_view_class)
@@ -34,12 +86,30 @@
priv->source_list = g_object_ref (source_list);
priv->task_actions = gtk_action_group_new ("tasks");
+
+ if (!gal_view_collection_loaded (shell_view_class->view_collection))
+ task_shell_view_load_view_collection (shell_view_class);
+
+ g_signal_connect (
+ task_shell_view, "notify::view-id",
+ G_CALLBACK (task_shell_view_notify_view_id_cb), NULL);
}
void
e_task_shell_view_private_constructed (ETaskShellView *task_shell_view)
{
ETaskShellViewPrivate *priv = task_shell_view->priv;
+ EShellContent *shell_content;
+ EShellSidebar *shell_sidebar;
+ EShellView *shell_view;
+
+ shell_view = E_SHELL_VIEW (task_shell_view);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+ shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+
+ /* Cache these to avoid lots of awkward casting. */
+ priv->task_shell_content = g_object_ref (shell_content);
+ priv->task_shell_sidebar = g_object_ref (shell_sidebar);
}
void
@@ -50,6 +120,9 @@
DISPOSE (priv->source_list);
DISPOSE (priv->task_actions);
+
+ DISPOSE (priv->task_shell_content);
+ DISPOSE (priv->task_shell_sidebar);
}
void
@@ -57,3 +130,12 @@
{
ETaskShellViewPrivate *priv = task_shell_view->priv;
}
+
+void
+e_task_shell_view_set_status_message (ETaskShellView *task_shell_view,
+ const gchar *status_message)
+{
+ g_return_if_fail (E_IS_TASK_SHELL_VIEW (task_shell_view));
+
+ /* FIXME */
+}
Copied: branches/kill-bonobo/calendar/modules/e-task-shell-view-private.h (from r36317, /branches/kill-bonobo/calendar/gui/e-task-shell-view-private.h)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-task-shell-view-private.h (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view-private.h Wed Sep 24 22:53:30 2008
@@ -23,13 +23,14 @@
#include "e-task-shell-view.h"
+#include <string.h>
#include <glib/gi18n.h>
-#include <e-util/e-util.h>
-#include <shell/e-shell-content.h>
+#include "e-util/e-util.h"
-#include <e-task-shell-sidebar.h>
-#include <e-task-shell-view-actions.h>
+#include "e-task-shell-content.h"
+#include "e-task-shell-sidebar.h"
+#include "e-task-shell-view-actions.h"
#define E_TASK_SHELL_VIEW_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -47,6 +48,9 @@
if ((obj) != NULL) { g_object_unref (obj); (obj) = NULL; } \
} G_STMT_END
+/* ETable Specifications */
+#define ETSPEC_FILENAME "e-calendar-table.etspec"
+
G_BEGIN_DECLS
struct _ETaskShellViewPrivate {
@@ -58,6 +62,12 @@
/*** UI Management ***/
GtkActionGroup *task_actions;
+
+ /*** Other Stuff ***/
+
+ /* These are just for convenience. */
+ ETaskShellContent *task_shell_content;
+ ETaskShellSidebar *task_shell_sidebar;
};
void e_task_shell_view_private_init
@@ -74,6 +84,11 @@
void e_task_shell_view_actions_init
(ETaskShellView *task_shell_view);
+void e_task_shell_view_actions_update
+ (ETaskShellView *task_shell_view);
+void e_task_shell_view_set_status_message
+ (ETaskShellView *task_shell_view,
+ const gchar *status_message);
G_END_DECLS
Copied: branches/kill-bonobo/calendar/modules/e-task-shell-view.c (from r36317, /branches/kill-bonobo/calendar/gui/e-task-shell-view.c)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-task-shell-view.c (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view.c Wed Sep 24 22:53:30 2008
@@ -82,7 +82,7 @@
priv = E_TASK_SHELL_VIEW_GET_PRIVATE (shell_view);
action_group = priv->task_actions;
- visible = e_shell_view_is_selected (shell_view);
+ visible = e_shell_view_is_active (shell_view);
gtk_action_group_set_visible (action_group, visible);
}
@@ -105,9 +105,10 @@
shell_view_class = E_SHELL_VIEW_CLASS (class);
shell_view_class->label = N_("Tasks");
shell_view_class->icon_name = "evolution-tasks";
+ shell_view_class->search_options = "/task-search-options";
shell_view_class->type_module = type_module;
- shell_view_class->changed = task_shell_view_changed;
shell_view_class->new_shell_sidebar = e_task_shell_sidebar_new;
+ shell_view_class->changed = task_shell_view_changed;
g_object_class_install_property (
object_class,
Copied: branches/kill-bonobo/calendar/modules/e-task-shell-view.h (from r36311, /branches/kill-bonobo/calendar/gui/e-task-shell-view.h)
==============================================================================
--- /branches/kill-bonobo/calendar/gui/e-task-shell-view.h (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view.h Wed Sep 24 22:53:30 2008
@@ -21,7 +21,7 @@
#ifndef E_TASK_SHELL_VIEW_H
#define E_TASK_SHELL_VIEW_H
-#include <e-shell-view.h>
+#include <shell/e-shell-view.h>
#include <libedataserver/e-source-list.h>
/* Standard GObject macros */
Modified: branches/kill-bonobo/configure.in
==============================================================================
--- branches/kill-bonobo/configure.in (original)
+++ branches/kill-bonobo/configure.in Wed Sep 24 22:53:30 2008
@@ -1985,6 +1985,7 @@
calendar/gui/Makefile
calendar/gui/alarm-notify/Makefile
calendar/gui/dialogs/Makefile
+calendar/modules/Makefile
composer/Makefile
mail/Makefile
mail/default/Makefile
Modified: branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-window.sgml
==============================================================================
--- branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-window.sgml (original)
+++ branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-window.sgml Wed Sep 24 22:53:30 2008
@@ -48,16 +48,6 @@
@Returns:
-<!-- ##### FUNCTION e_shell_window_get_view ##### -->
-<para>
-
-</para>
-
- shell_window:
- view_name:
- Returns:
-
-
<!-- ##### FUNCTION e_shell_window_get_shell ##### -->
<para>
Modified: branches/kill-bonobo/doc/reference/shell/tmpl/eshell-unused.sgml
==============================================================================
--- branches/kill-bonobo/doc/reference/shell/tmpl/eshell-unused.sgml (original)
+++ branches/kill-bonobo/doc/reference/shell/tmpl/eshell-unused.sgml Wed Sep 24 22:53:30 2008
@@ -1914,6 +1914,15 @@
@shell_window:
@Returns:
+<!-- ##### FUNCTION e_shell_window_get_view ##### -->
+<para>
+
+</para>
+
+ shell_window:
+ view_name:
+ Returns:
+
<!-- ##### FUNCTION e_shell_window_private_dispose ##### -->
<para>
Modified: branches/kill-bonobo/shell/e-shell-content.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-content.c (original)
+++ branches/kill-bonobo/shell/e-shell-content.c Wed Sep 24 22:53:30 2008
@@ -96,7 +96,6 @@
EShellView *shell_view;
EShellWindow *shell_window;
EIconEntry *icon_entry;
- GtkWidget *child;
GtkStateType visual_state;
const gchar *search_text;
Modified: branches/kill-bonobo/shell/e-shell-content.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-content.h (original)
+++ branches/kill-bonobo/shell/e-shell-content.h Wed Sep 24 22:53:30 2008
@@ -21,7 +21,7 @@
#ifndef E_SHELL_CONTENT_H
#define E_SHELL_CONTENT_H
-#include <e-shell-common.h>
+#include <shell/e-shell-common.h>
#include <filter/filter-rule.h>
#include <filter/rule-context.h>
Modified: branches/kill-bonobo/shell/e-shell-module.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-module.h (original)
+++ branches/kill-bonobo/shell/e-shell-module.h Wed Sep 24 22:53:30 2008
@@ -21,7 +21,7 @@
#ifndef E_SHELL_MODULE_H
#define E_SHELL_MODULE_H
-#include <e-shell-common.h>
+#include <shell/e-shell-common.h>
#include <widgets/misc/e-activity.h>
/* Standard GObject macros */
Modified: branches/kill-bonobo/shell/e-shell-sidebar.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-sidebar.c (original)
+++ branches/kill-bonobo/shell/e-shell-sidebar.c Wed Sep 24 22:53:30 2008
@@ -203,6 +203,13 @@
}
static void
+shell_sidebar_constructed (GObject *object)
+{
+ /* XXX This is here to let subclasses safely chain up.
+ * GObject does not define a constructed() method. */
+}
+
+static void
shell_sidebar_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
@@ -309,6 +316,7 @@
object_class->get_property = shell_sidebar_get_property;
object_class->dispose = shell_sidebar_dispose;
object_class->finalize = shell_sidebar_finalize;
+ object_class->constructed = shell_sidebar_constructed;
widget_class = GTK_WIDGET_CLASS (class);
widget_class->size_request = shell_sidebar_size_request;
Modified: branches/kill-bonobo/shell/e-shell-sidebar.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-sidebar.h (original)
+++ branches/kill-bonobo/shell/e-shell-sidebar.h Wed Sep 24 22:53:30 2008
@@ -21,7 +21,7 @@
#ifndef E_SHELL_SIDEBAR_H
#define E_SHELL_SIDEBAR_H
-#include <e-shell-common.h>
+#include <shell/e-shell-common.h>
/* Standard GObject macros */
#define E_TYPE_SHELL_SIDEBAR \
Modified: branches/kill-bonobo/shell/e-shell-taskbar.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-taskbar.h (original)
+++ branches/kill-bonobo/shell/e-shell-taskbar.h Wed Sep 24 22:53:30 2008
@@ -21,7 +21,7 @@
#ifndef E_SHELL_TASKBAR_H
#define E_SHELL_TASKBAR_H
-#include <e-shell-common.h>
+#include <shell/e-shell-common.h>
/* Standard GObject macros */
#define E_TYPE_SHELL_TASKBAR \
Modified: branches/kill-bonobo/shell/e-shell-view.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-view.c (original)
+++ branches/kill-bonobo/shell/e-shell-view.c Wed Sep 24 22:53:30 2008
@@ -579,28 +579,28 @@
return shell_view->priv->page_num;
}
-gpointer
+EShellContent *
e_shell_view_get_shell_content (EShellView *shell_view)
{
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
- return shell_view->priv->shell_content;
+ return E_SHELL_CONTENT (shell_view->priv->shell_content);
}
-gpointer
+EShellSidebar *
e_shell_view_get_shell_sidebar (EShellView *shell_view)
{
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
- return shell_view->priv->shell_sidebar;
+ return E_SHELL_SIDEBAR (shell_view->priv->shell_sidebar);
}
-gpointer
+EShellTaskbar *
e_shell_view_get_shell_taskbar (EShellView *shell_view)
{
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
- return shell_view->priv->shell_taskbar;
+ return E_SHELL_TASKBAR (shell_view->priv->shell_taskbar);
}
void
Modified: branches/kill-bonobo/shell/e-shell-view.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-view.h (original)
+++ branches/kill-bonobo/shell/e-shell-view.h Wed Sep 24 22:53:30 2008
@@ -22,8 +22,11 @@
#ifndef E_SHELL_VIEW_H
#define E_SHELL_VIEW_H
-#include <e-shell-common.h>
-#include <e-shell-window.h>
+#include <shell/e-shell-common.h>
+#include <shell/e-shell-content.h>
+#include <shell/e-shell-sidebar.h>
+#include <shell/e-shell-taskbar.h>
+#include <shell/e-shell-window.h>
#include <widgets/misc/e-activity.h>
#include <widgets/menus/gal-view-collection.h>
@@ -61,10 +64,13 @@
struct _EShellViewClass {
GObjectClass parent_class;
- /* Initial GtkRadioAction values */
+ /* Initial switcher action values. */
const gchar *label;
const gchar *icon_name;
+ /* Path to the search entry popup menu. */
+ const gchar *search_options;
+
/* Subclasses should set this via the "class_data" field in
* the GTypeInfo they pass to g_type_module_register_type(). */
GTypeModule *type_module;
@@ -72,9 +78,6 @@
/* A unique instance is created for each subclass. */
GalViewCollection *view_collection;
- /* Path to the search entry popup menu. */
- const gchar *search_options_path;
-
/* Factory Methods */
GtkWidget * (*new_shell_content) (EShellView *shell_view);
GtkWidget * (*new_shell_sidebar) (EShellView *shell_view);
@@ -97,9 +100,9 @@
void e_shell_view_add_activity (EShellView *shell_view,
EActivity *activity);
gint e_shell_view_get_page_num (EShellView *shell_view);
-gpointer e_shell_view_get_shell_content (EShellView *shell_view);
-gpointer e_shell_view_get_shell_sidebar (EShellView *shell_view);
-gpointer e_shell_view_get_shell_taskbar (EShellView *shell_view);
+EShellContent * e_shell_view_get_shell_content (EShellView *shell_view);
+EShellSidebar * e_shell_view_get_shell_sidebar (EShellView *shell_view);
+EShellTaskbar * e_shell_view_get_shell_taskbar (EShellView *shell_view);
EShellWindow * e_shell_view_get_shell_window (EShellView *shell_view);
void e_shell_view_changed (EShellView *shell_view);
Modified: branches/kill-bonobo/shell/e-shell-window-actions.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window-actions.c (original)
+++ branches/kill-bonobo/shell/e-shell-window-actions.c Wed Sep 24 22:53:30 2008
@@ -686,7 +686,7 @@
g_return_if_fail (rule != NULL);
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
shell_content = e_shell_view_get_shell_content (shell_view);
rule = g_object_get_data (G_OBJECT (action), "rule");
@@ -735,7 +735,7 @@
const gchar *view_name;
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
view_collection = shell_view_class->view_collection;
g_return_if_fail (view_collection != NULL);
@@ -758,7 +758,7 @@
const gchar *view_id;
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
view_id = g_object_get_data (G_OBJECT (current), "view-id");
e_shell_view_set_view_id (shell_view, view_id);
}
@@ -869,7 +869,7 @@
const gchar *view_name;
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
shell_content = e_shell_view_get_shell_content (shell_view);
e_shell_content_run_advanced_search_dialog (shell_content);
@@ -885,7 +885,7 @@
const gchar *view_name;
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
shell_content = e_shell_view_get_shell_content (shell_view);
e_shell_content_set_search_rule (shell_content, NULL);
@@ -905,7 +905,7 @@
const gchar *view_name;
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
shell_content = e_shell_view_get_shell_content (shell_view);
e_shell_content_run_edit_searches_dialog (shell_content);
@@ -922,10 +922,10 @@
const gchar *widget_path;
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
- widget_path = shell_view_class->search_options_path;
+ widget_path = shell_view_class->search_options;
e_shell_window_show_popup_menu (shell_window, widget_path, NULL);
}
@@ -938,7 +938,7 @@
const gchar *view_name;
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
shell_content = e_shell_view_get_shell_content (shell_view);
e_shell_content_run_save_search_dialog (shell_content);
@@ -1777,7 +1777,7 @@
ui_manager = e_shell_window_get_ui_manager (shell_window);
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
view_collection = shell_view_class->view_collection;
view_id = e_shell_view_get_view_id (shell_view);
@@ -1880,7 +1880,7 @@
ui_manager = e_shell_window_get_ui_manager (shell_window);
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
shell_content = e_shell_view_get_shell_content (shell_view);
context = e_shell_content_get_search_context (shell_content);
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
@@ -1892,7 +1892,7 @@
gtk_action_set_sensitive (ACTION (SEARCH_CLEAR), sensitive);
gtk_action_set_sensitive (ACTION (SEARCH_SAVE), sensitive);
- sensitive = (shell_view_class->search_options_path != NULL);
+ sensitive = (shell_view_class->search_options != NULL);
gtk_action_set_sensitive (ACTION (SEARCH_OPTIONS), sensitive);
/* Add custom rules to the Search menu. */
Modified: branches/kill-bonobo/shell/e-shell-window-private.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window-private.c (original)
+++ branches/kill-bonobo/shell/e-shell-window-private.c Wed Sep 24 22:53:30 2008
@@ -410,7 +410,7 @@
GList *list;
gint page_num;
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
page_num = e_shell_view_get_page_num (shell_view);
g_return_if_fail (page_num >= 0);
@@ -448,7 +448,7 @@
gchar *icon_name;
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
action = e_shell_view_get_action (shell_view);
g_object_get (action, "icon-name", &icon_name, NULL);
@@ -465,7 +465,7 @@
gchar *window_title;
view_name = e_shell_window_get_active_view (shell_window);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
view_title = e_shell_view_get_title (shell_view);
/* Translators: This is used for the main window title. */
Modified: branches/kill-bonobo/shell/e-shell-window.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window.c (original)
+++ branches/kill-bonobo/shell/e-shell-window.c Wed Sep 24 22:53:30 2008
@@ -347,7 +347,23 @@
}
/**
- * e_shell_window_get_view:
+ * e_shell_window_get_shell:
+ * @shell_window: an #EShellWindow
+ *
+ * Returns the #EShell that was passed to e_shell_window_new().
+ *
+ * Returns: the #EShell
+ **/
+EShell *
+e_shell_window_get_shell (EShellWindow *shell_window)
+{
+ g_return_val_if_fail (E_IS_SHELL_WINDOW (shell_window), NULL);
+
+ return shell_window->priv->shell;
+}
+
+/**
+ * e_shell_window_get_shell_view:
* @shell_window: an #EShellWindow
* @view_name: name of a shell view
*
@@ -363,8 +379,8 @@
* registered
**/
gpointer
-e_shell_window_get_view (EShellWindow *shell_window,
- const gchar *view_name)
+e_shell_window_get_shell_view (EShellWindow *shell_window,
+ const gchar *view_name)
{
GHashTable *loaded_views;
EShellView *shell_view;
@@ -410,22 +426,6 @@
}
/**
- * e_shell_window_get_shell:
- * @shell_window: an #EShellWindow
- *
- * Returns the #EShell that was passed to e_shell_window_new().
- *
- * Returns: the #EShell
- **/
-EShell *
-e_shell_window_get_shell (EShellWindow *shell_window)
-{
- g_return_val_if_fail (E_IS_SHELL_WINDOW (shell_window), NULL);
-
- return shell_window->priv->shell;
-}
-
-/**
* e_shell_window_get_ui_manager:
* @shell_window: an #EShellWindow
*
@@ -590,7 +590,7 @@
g_return_if_fail (E_IS_SHELL_WINDOW (shell_window));
g_return_if_fail (view_name != NULL);
- shell_view = e_shell_window_get_view (shell_window, view_name);
+ shell_view = e_shell_window_get_shell_view (shell_window, view_name);
g_return_if_fail (shell_view != NULL);
action = e_shell_view_get_action (shell_view);
Modified: branches/kill-bonobo/shell/e-shell-window.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window.h (original)
+++ branches/kill-bonobo/shell/e-shell-window.h Wed Sep 24 22:53:30 2008
@@ -24,7 +24,7 @@
#ifndef E_SHELL_WINDOW_H
#define E_SHELL_WINDOW_H
-#include <e-shell.h>
+#include <shell/e-shell.h>
/* Standard GObject macros */
#define E_TYPE_SHELL_WINDOW \
@@ -63,9 +63,9 @@
GType e_shell_window_get_type (void);
GtkWidget * e_shell_window_new (EShell *shell,
gboolean safe_mode);
-gpointer e_shell_window_get_view (EShellWindow *shell_window,
- const gchar *view_name);
EShell * e_shell_window_get_shell (EShellWindow *shell_window);
+gpointer e_shell_window_get_shell_view (EShellWindow *shell_window,
+ const gchar *view_name);
GtkUIManager * e_shell_window_get_ui_manager (EShellWindow *shell_window);
GtkAction * e_shell_window_get_action (EShellWindow *shell_window,
const gchar *action_name);
Modified: branches/kill-bonobo/shell/e-shell.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell.h (original)
+++ branches/kill-bonobo/shell/e-shell.h Wed Sep 24 22:53:30 2008
@@ -23,8 +23,8 @@
#ifndef E_SHELL_H
#define E_SHELL_H
-#include <e-shell-common.h>
-#include <e-shell-module.h>
+#include <shell/e-shell-common.h>
+#include <shell/e-shell-module.h>
/* Standard GObject macros */
#define E_TYPE_SHELL \
Modified: branches/kill-bonobo/ui/evolution-calendars.ui
==============================================================================
--- branches/kill-bonobo/ui/evolution-calendars.ui (original)
+++ branches/kill-bonobo/ui/evolution-calendars.ui Wed Sep 24 22:53:30 2008
@@ -54,4 +54,11 @@
<separator/>
<menuitem action='calendar-properties'/>
</popup>
+ <popup name='calendar-search-options'>
+ <menuitem action='calendar-search-summary-contains'/>
+ <menuitem action='calendar-search-description-contains'/>
+ <menuitem action='calendar-search-any-field-contains'/>
+ <separator/>
+ <menuitem action='search-advanced'/>
+ </popup>
</ui>
Modified: branches/kill-bonobo/ui/evolution-memos.ui
==============================================================================
--- branches/kill-bonobo/ui/evolution-memos.ui (original)
+++ branches/kill-bonobo/ui/evolution-memos.ui Wed Sep 24 22:53:30 2008
@@ -38,4 +38,11 @@
<separator/>
<menuitem action='memo-list-properties'/>
</popup>
+ <popup name='memo-search-options'>
+ <menuitem action='memo-search-summary-contains'/>
+ <menuitem action='memo-search-description-contains'/>
+ <menuitem action='memo-search-any-field-contains'/>
+ <separator/>
+ <menuitem action='search-advanced'/>
+ </popup>
</ui>
Modified: branches/kill-bonobo/ui/evolution-tasks.ui
==============================================================================
--- branches/kill-bonobo/ui/evolution-tasks.ui (original)
+++ branches/kill-bonobo/ui/evolution-tasks.ui Wed Sep 24 22:53:30 2008
@@ -47,4 +47,11 @@
<separator/>
<menuitem action='task-list-properties'/>
</popup>
+ <popup name='task-search-options'>
+ <menuitem action='task-search-summary-contains'/>
+ <menuitem action='task-search-description-contains'/>
+ <menuitem action='task-search-any-field-contains'/>
+ <separator/>
+ <menuitem action='search-advanced'/>
+ </popup>
</ui>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]