diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-03-28 21:21:25 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-06-03 11:00:42 +0800 |
commit | 2b5a9b4eb44d4b9aa9f549d748b3eeb294c48ad6 (patch) | |
tree | 3c45762879da2a9c5888dc1884da31a41528869e /plugins | |
parent | 48e680cdf39ab5754b000229f8ded1a8eeebf437 (diff) | |
download | gsoc2013-evolution-2b5a9b4eb44d4b9aa9f549d748b3eeb294c48ad6.tar gsoc2013-evolution-2b5a9b4eb44d4b9aa9f549d748b3eeb294c48ad6.tar.gz gsoc2013-evolution-2b5a9b4eb44d4b9aa9f549d748b3eeb294c48ad6.tar.bz2 gsoc2013-evolution-2b5a9b4eb44d4b9aa9f549d748b3eeb294c48ad6.tar.lz gsoc2013-evolution-2b5a9b4eb44d4b9aa9f549d748b3eeb294c48ad6.tar.xz gsoc2013-evolution-2b5a9b4eb44d4b9aa9f549d748b3eeb294c48ad6.tar.zst gsoc2013-evolution-2b5a9b4eb44d4b9aa9f549d748b3eeb294c48ad6.zip |
Remove default-source plugin.
Obsoleted by EBookSourceConfig and ECalSourceConfig.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/default-source/Makefile.am | 28 | ||||
-rw-r--r-- | plugins/default-source/default-source.c | 215 | ||||
-rw-r--r-- | plugins/default-source/org-gnome-default-source.eplug.xml | 40 |
3 files changed, 0 insertions, 283 deletions
diff --git a/plugins/default-source/Makefile.am b/plugins/default-source/Makefile.am deleted file mode 100644 index 07efb18d20..0000000000 --- a/plugins/default-source/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -@EVO_PLUGIN_RULE@ - -plugin_DATA = org-gnome-default-source.eplug - -plugin_LTLIBRARIES = liborg-gnome-default-source.la - -liborg_gnome_default_source_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) - -liborg_gnome_default_source_la_SOURCES = default-source.c - -liborg_gnome_default_source_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) - -liborg_gnome_default_source_la_LIBADD = \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/shell/libeshell.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) - -EXTRA_DIST = org-gnome-default-source.eplug.xml - -BUILT_SOURCES = $(plugin_DATA) -CLEANFILES = $(BUILT_SOURCES) - --include $(top_srcdir)/git.mk diff --git a/plugins/default-source/default-source.c b/plugins/default-source/default-source.c deleted file mode 100644 index 0e4ce12b94..0000000000 --- a/plugins/default-source/default-source.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <gtk/gtk.h> -#include <glib/gi18n.h> - -#include <libebook/e-book-client.h> -#include <libecal/e-cal-client.h> -#include <libedataserver/e-source.h> - -#include <addressbook/gui/widgets/eab-config.h> -#include <calendar/gui/e-cal-config.h> -#include <e-util/e-config.h> -#include <e-util/e-plugin-util.h> -#include <e-util/e-plugin-util.h> -#include <shell/e-shell.h> -#include <shell/e-shell-backend.h> - -GtkWidget *org_gnome_default_book (EPlugin *epl, EConfigHookItemFactoryData *data); -GtkWidget *org_gnome_autocomplete_book (EPlugin *epl, EConfigHookItemFactoryData *data); - -void commit_default_calendar (EPlugin *epl, EConfigTarget *target); -void commit_default_book (EPlugin *epl, EConfigTarget *target); - -gint e_plugin_lib_enable (EPlugin *ep, gint enable); - -gint -e_plugin_lib_enable (EPlugin *ep, - gint enable) -{ - return 0; -} - -static void -mark_default_source_in_list (ESourceList *source_list, - ESource *source) -{ - GSList *g, *s; - g_return_if_fail (source_list != NULL); - g_return_if_fail (source != NULL); - - source = e_source_list_peek_source_by_uid (source_list, e_source_get_uid (source)); - - for (g = e_source_list_peek_groups (source_list); g; g = g->next) { - ESourceGroup *group = g->data; - - for (s = e_source_group_peek_sources (group); s; s = s->next) { - ESource *es = s->data; - - e_source_set_property (es, "default", es == source ? "true" : NULL); - } - } -} - -void -commit_default_calendar (EPlugin *epl, - EConfigTarget *target) -{ - ECalConfigTargetSource *cal_target; - ESource *source; - - cal_target = (ECalConfigTargetSource *) target; - source = cal_target->source; - if (e_source_get_property (source, "default")) { - EShellBackend *shell_backend = NULL; - ESourceList *source_list = NULL; - - switch (cal_target->source_type) { - case E_CAL_CLIENT_SOURCE_TYPE_EVENTS: - shell_backend = e_shell_get_backend_by_name (e_shell_get_default (), "calendar"); - break; - case E_CAL_CLIENT_SOURCE_TYPE_MEMOS: - shell_backend = e_shell_get_backend_by_name (e_shell_get_default (), "memos"); - break; - case E_CAL_CLIENT_SOURCE_TYPE_TASKS: - shell_backend = e_shell_get_backend_by_name (e_shell_get_default (), "tasks"); - break; - default: - break; - } - - if (shell_backend) - g_object_get (G_OBJECT (shell_backend), "source-list", &source_list, NULL); - - if (source_list) { - /* mark in the backend's source_list, to avoid race - * with saving of two different source lists - */ - mark_default_source_in_list (source_list, source); - } else { - GError *error = NULL; - - e_cal_client_set_default_source (source, cal_target->source_type, &error); - if (error) - g_debug ("%s: Failed to set default source: %s", G_STRFUNC, error->message); - g_clear_error (&error); - } - } -} - -void -commit_default_book (EPlugin *epl, - EConfigTarget *target) -{ - EABConfigTargetSource *book_target; - ESource *source; - - book_target = (EABConfigTargetSource *) target; - source = book_target->source; - if (e_source_get_property (source, "default")) { - EShellBackend *shell_backend; - ESourceList *source_list = NULL; - - shell_backend = e_shell_get_backend_by_name (e_shell_get_default (), "addressbook"); - if (shell_backend) - g_object_get (G_OBJECT (shell_backend), "source-list", &source_list, NULL); - - if (source_list) { - /* mark in the backend's source_list, to avoid race - * with saving of two different source lists - */ - mark_default_source_in_list (source_list, source); - } else { - GError *error = NULL; - - e_book_client_set_default_source (source, &error); - if (error) - g_debug ("%s: Failed to set default source: %s", G_STRFUNC, error->message); - g_clear_error (&error); - } - } - -} - -GtkWidget * -org_gnome_default_book (EPlugin *epl, - EConfigHookItemFactoryData *data) -{ - EABConfigTargetSource *book_target; - - if (data->old) - return data->old; - - book_target = (EABConfigTargetSource *) data->target; - - return e_plugin_util_add_check (data->parent, _("Mark as _default address book"), book_target->source, "default", "true", NULL); -} - -GtkWidget * -org_gnome_autocomplete_book (EPlugin *epl, - EConfigHookItemFactoryData *data) -{ - EABConfigTargetSource *book_target; - - if (data->old) - return data->old; - - book_target = (EABConfigTargetSource *) data->target; - - return e_plugin_util_add_check (data->parent, _("A_utocomplete with this address book"), book_target->source, "completion", "true", NULL); -} - -static const gchar * -get_calendar_option_caption (ECalClientSourceType source_type) -{ - const gchar *res = "???"; - - switch (source_type) { - case E_CAL_CLIENT_SOURCE_TYPE_EVENTS: res = _("Mark as _default calendar"); break; - case E_CAL_CLIENT_SOURCE_TYPE_TASKS: res = _("Mark as _default task list"); break; - case E_CAL_CLIENT_SOURCE_TYPE_MEMOS: res = _("Mark as _default memo list"); break; - default: break; - } - - return res; -} - -GtkWidget *org_gnome_default_cal (EPlugin *epl, EConfigHookItemFactoryData *data); - -GtkWidget * -org_gnome_default_cal (EPlugin *epl, - EConfigHookItemFactoryData *data) -{ - ECalConfigTargetSource *cal_target; - - if (data->old) - return data->old; - - cal_target = (ECalConfigTargetSource *) data->target; - - return e_plugin_util_add_check (data->parent, get_calendar_option_caption (cal_target->source_type), cal_target->source, "default", "true", NULL); -} diff --git a/plugins/default-source/org-gnome-default-source.eplug.xml b/plugins/default-source/org-gnome-default-source.eplug.xml deleted file mode 100644 index c5e29bcef9..0000000000 --- a/plugins/default-source/org-gnome-default-source.eplug.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0"?> -<e-plugin-list> - <e-plugin - type="shlib" - location="@PLUGINDIR@/liborg-gnome-default-source@SOEXT@" - id="org.gnome.evolution.plugin.default-source" - _name="Default Sources"> - <author name="Sivaiah Nallagatla" email="snallagatla@novell.com"/> - <_description>Mark your preferred address book and calendar as default.</_description> - <hook class="org.gnome.evolution.calendar.config:1.0"> - <group - target="source" - id="org.gnome.evolution.calendar.calendarProperties" - commit="commit_default_calendar" - > - <item - type="item_table" - path="00.general/00.source/40.default" - factory="org_gnome_default_cal"/> - </group> - </hook> - <hook class="org.gnome.evolution.addressbook.config:1.0"> - <group - target="source" - id="com.novell.evolution.addressbook.config.accountEditor" - commit="commit_default_book" - > - <item - type="item" - path="00.general/10.display/30.default" - factory="org_gnome_default_book"/> - <item - type="item" - path="00.general/10.display/31.default" - factory="org_gnome_autocomplete_book"/> - </group> - </hook> - - </e-plugin> -</e-plugin-list> |