From e0c501b7018f12d37b10e32923f95b7a01c7982c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 29 Aug 2008 22:32:46 +0000 Subject: Progress update: - Contacts module partially working! - Implement UI merging. Also merge EInfoLabel into ESidebar. The shell window now manages the icon and labels and keeps them up-to-date via EShellView properties. svn path=/branches/kill-bonobo/; revision=36214 --- addressbook/gui/component/autocompletion-config.c | 139 +++++++++------------- 1 file changed, 58 insertions(+), 81 deletions(-) (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index b410d74634..060ce01aee 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -16,47 +16,32 @@ * License along with this program; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. - * - * Authors: Chris Toshok */ -#ifdef HAVE_CONFIG_H -#include -#endif - - #include "autocompletion-config.h" -#include "Evolution.h" - -#include - -#include -#include +#include #include #include - - -typedef struct { - EvolutionConfigControl *config_control; - - GtkWidget *control_widget; - - ESourceList *source_list; -} AutocompletionConfig; +#include +#include +#include static void -source_selection_changed (ESourceSelector *selector, - AutocompletionConfig *ac) +source_selection_changed_cb (ESourceSelector *source_selector) { + ESourceList *source_list; GSList *selection; GSList *l; GSList *groups; + source_list = e_source_selector_get_source_list (source_selector); + /* first we clear all the completion flags from all sources */ - for (groups = e_source_list_peek_groups (ac->source_list); groups; groups = groups->next) { + for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) { ESourceGroup *group = E_SOURCE_GROUP (groups->data); GSList *sources; + for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { ESource *source = E_SOURCE (sources->data); @@ -66,86 +51,78 @@ source_selection_changed (ESourceSelector *selector, /* then we loop over the selector's selection, setting the property on those sources */ - selection = e_source_selector_get_selection (selector); + selection = e_source_selector_get_selection (source_selector); for (l = selection; l; l = l->next) { - e_source_set_property (E_SOURCE (l->data), "completion", "true"); + ESource *source = E_SOURCE (l->data); + + e_source_set_property (source, "completion", "true"); } e_source_selector_free_selection (selection); - e_source_list_sync (ac->source_list, NULL); /* XXX we should pop up a dialog if this fails */ + /* XXX we should pop up a dialog if this fails */ + e_source_list_sync (source_list, NULL); } static void -config_control_destroy_notify (void *data, - GObject *where_the_config_control_was) -{ - AutocompletionConfig *ac = (AutocompletionConfig *) data; - - g_object_unref (ac->source_list); - - g_free (ac); -} - -static void -initialize_selection (AutocompletionConfig *ac) +initialize_selection (ESourceSelector *source_selector) { + ESourceList *source_list; GSList *groups; - for (groups = e_source_list_peek_groups (ac->source_list); groups; groups = groups->next) { + source_list = e_source_selector_get_source_list (source_selector); + + for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) { ESourceGroup *group = E_SOURCE_GROUP (groups->data); GSList *sources; + for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { ESource *source = E_SOURCE (sources->data); - const char *completion = e_source_get_property (source, "completion"); + const char *completion; + + completion = e_source_get_property (source, "completion"); if (completion && !g_ascii_strcasecmp (completion, "true")) - e_source_selector_select_source (E_SOURCE_SELECTOR (ac->control_widget), - source); + e_source_selector_select_source (source_selector, source); } } } -EvolutionConfigControl* -autocompletion_config_control_new (void) +void +autocompletion_config_init (void) { - AutocompletionConfig *ac; - CORBA_Environment ev; - GtkWidget *scrolledwin; - - ac = g_new0 (AutocompletionConfig, 1); + ESourceList *source_list; + GtkWidget *scrolled_window; + GtkWidget *source_selector; + GtkWidget *preferences_window; - CORBA_exception_init (&ev); + source_list = e_source_list_new_for_gconf_default ( + "/apps/evolution/addressbook/sources"); - ac->source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources"); /* XXX should we watch for the source list to change and update it in the control? what about our local changes? */ /* g_signal_connect (ac->source_list, "changed", G_CALLBACK (source_list_changed), ac); */ - scrolledwin = gtk_scrolled_window_new (NULL, NULL); - - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwin), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwin), - GTK_SHADOW_IN); - - ac->control_widget = e_source_selector_new (ac->source_list); - - gtk_container_add (GTK_CONTAINER (scrolledwin), ac->control_widget); - - initialize_selection (ac); - - gtk_widget_show (ac->control_widget); - gtk_widget_show (scrolledwin); - - ac->config_control = evolution_config_control_new (scrolledwin); - - g_signal_connect (ac->control_widget, "selection_changed", - G_CALLBACK (source_selection_changed), ac); - - g_object_weak_ref (G_OBJECT (ac->config_control), config_control_destroy_notify, ac); - - CORBA_exception_free (&ev); - - return ac->config_control; + scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN); + gtk_widget_show (scrolled_window); + + source_selector = e_source_selector_new (source_list); + g_signal_connect ( + source_selector, "selection_changed", + G_CALLBACK (source_selection_changed_cb), NULL); + gtk_container_add (GTK_CONTAINER (scrolled_window), source_selector); + gtk_widget_show (source_selector); + + initialize_selection (E_SOURCE_SELECTOR (source_selector)); + + e_preferences_window_add_page ( + e_shell_get_preferences_window (), + "autocompletion", + "preferences-autocompletion", + _("Autocompletion"), + scrolled_window, + 200); } - -- cgit v1.2.3 From eca687589d106ff87cd4fca7bf581cb0532caf96 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 5 Sep 2008 15:47:38 +0000 Subject: Saving progress. Lots of changes. Things are a bit broken at the moment. svn path=/branches/kill-bonobo/; revision=36260 --- addressbook/gui/component/autocompletion-config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index 060ce01aee..9e42a375f9 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -118,8 +118,10 @@ autocompletion_config_init (void) initialize_selection (E_SOURCE_SELECTOR (source_selector)); + preferences_window = e_shell_get_preferences_window (); + e_preferences_window_add_page ( - e_shell_get_preferences_window (), + E_PREFERENCES_WINDOW (preferences_window), "autocompletion", "preferences-autocompletion", _("Autocompletion"), -- cgit v1.2.3 From c0a255eb90769638d57ae4122932f75c46e4e531 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 11 Sep 2008 15:34:29 +0000 Subject: Merge revisions 36016:36303 from trunk. svn path=/branches/kill-bonobo/; revision=36307 --- addressbook/gui/component/autocompletion-config.c | 26 +++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index 9e42a375f9..f093564f7e 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -1,21 +1,25 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-shell-config-autocompletion.h - Configuration page for addressbook autocompletion. - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) +/* + * e-shell-config-autocompletion.h - Configuration page for addressbook autocompletion. * * 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. + * 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 - * General Public License for more details. + * 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 + * + * + * Authors: + * Chris Toshok + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * - * 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 "autocompletion-config.h" -- cgit v1.2.3 From b2cda1d0c6d44f53f71bad9e256f41188677dfba Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 1 Oct 2008 20:56:04 +0000 Subject: Merge revisions 36016:36533 from trunk. svn path=/branches/kill-bonobo/; revision=36534 --- addressbook/gui/component/autocompletion-config.c | 1 + 1 file changed, 1 insertion(+) (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index f093564f7e..a2c40200d5 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -25,6 +25,7 @@ #include "autocompletion-config.h" #include +#include #include #include #include -- cgit v1.2.3 From 80e6c5adad4e89846c004efb2029d4db9ec2e64f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 30 Oct 2008 20:51:26 +0000 Subject: Add popup menus to the calendar memopad and taskpad. Implement support for "hide completed tasks" option (not yet tested). Flesh out most of the Preferences window. Still need Certificates page. svn path=/branches/kill-bonobo/; revision=36701 --- addressbook/gui/component/autocompletion-config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index a2c40200d5..018a2fd8f7 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -28,10 +28,11 @@ #include #include #include -#include #include #include +#include "widgets/misc/e-preferences-window.h" + static void source_selection_changed_cb (ESourceSelector *source_selector) { -- cgit v1.2.3 From 1a40acf554290883d6cf2a491dc36685842fd26b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 19 Feb 2009 06:22:32 +0000 Subject: Documentation tweaks. Have e_shell_get_preferences_window() take an EShell argument. svn path=/branches/kill-bonobo/; revision=37294 --- addressbook/gui/component/autocompletion-config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index 018a2fd8f7..a58e1f3195 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -99,6 +99,7 @@ autocompletion_config_init (void) GtkWidget *scrolled_window; GtkWidget *source_selector; GtkWidget *preferences_window; + EShell *shell; source_list = e_source_list_new_for_gconf_default ( "/apps/evolution/addressbook/sources"); @@ -124,7 +125,8 @@ autocompletion_config_init (void) initialize_selection (E_SOURCE_SELECTOR (source_selector)); - preferences_window = e_shell_get_preferences_window (); + shell = e_shell_get_default (); + preferences_window = e_shell_get_preferences_window (shell); e_preferences_window_add_page ( E_PREFERENCES_WINDOW (preferences_window), -- cgit v1.2.3 From 1b782407524f2ca4a2dc4849098a21f9d1bdff09 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 19 Feb 2009 12:31:06 +0000 Subject: Fix crash on startup. svn path=/branches/kill-bonobo/; revision=37295 --- addressbook/gui/component/autocompletion-config.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index a58e1f3195..3341f26147 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -24,12 +24,11 @@ #include "autocompletion-config.h" -#include -#include #include #include #include #include +#include #include "widgets/misc/e-preferences-window.h" @@ -93,13 +92,14 @@ initialize_selection (ESourceSelector *source_selector) } void -autocompletion_config_init (void) +autocompletion_config_init (EShell *shell) { ESourceList *source_list; GtkWidget *scrolled_window; GtkWidget *source_selector; GtkWidget *preferences_window; - EShell *shell; + + g_return_if_fail (E_IS_SHELL (shell)); source_list = e_source_list_new_for_gconf_default ( "/apps/evolution/addressbook/sources"); @@ -125,7 +125,6 @@ autocompletion_config_init (void) initialize_selection (E_SOURCE_SELECTOR (source_selector)); - shell = e_shell_get_default (); preferences_window = e_shell_get_preferences_window (shell); e_preferences_window_add_page ( -- cgit v1.2.3 From e4afd3f9fb962ea1295a0657ec9f83a427829171 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 26 May 2009 23:21:02 -0400 Subject: Remove trailing whitespace, again. --- addressbook/gui/component/autocompletion-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index 8c259c6a7a..f45f2228e1 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -12,7 +12,7 @@ * 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 + * License along with the program; if not, see * * * Authors: -- cgit v1.2.3 From 948235c3d1076dbe6ed2e57a24c16a083bbd9f01 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 27 May 2009 10:29:19 -0400 Subject: Prefer GLib basic types over C types. --- addressbook/gui/component/autocompletion-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index 548c0cbd7e..370c1a1e7e 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -82,7 +82,7 @@ initialize_selection (ESourceSelector *source_selector) for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { ESource *source = E_SOURCE (sources->data); - const char *completion; + const gchar *completion; completion = e_source_get_property (source, "completion"); if (completion && !g_ascii_strcasecmp (completion, "true")) -- cgit v1.2.3 From f0d3f3afdfa314e1e8cd7d8da790878008a46aad Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 24 Jun 2009 12:59:33 -0400 Subject: Radically reorganize source code. - Collect all shell modules into a new top-level 'modules' directory: $(top_srcdir)/modules/addressbook $(top_srcdir)/modules/calendar $(top_srcdir)/modules/mail Nothing is allowed to link to these, not plugins nor other modules. THIS SOLVES BUG #571275 AND OPENS THE DOOR TO PORTING TO MAC OS X. - Mimic the libevolution-mail-shared library from master (except drop the "shared" suffix) and have libevolution-mail-importers and all mail-related plugins link to it. - Discard the a11y subdirectories and have the files live alongside their counterpart widgets. --- addressbook/gui/component/autocompletion-config.c | 137 ---------------------- 1 file changed, 137 deletions(-) delete mode 100644 addressbook/gui/component/autocompletion-config.c (limited to 'addressbook/gui/component/autocompletion-config.c') diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c deleted file mode 100644 index 370c1a1e7e..0000000000 --- a/addressbook/gui/component/autocompletion-config.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * e-shell-config-autocompletion.h - Configuration page for addressbook autocompletion. - * - * 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 - * - * - * Authors: - * Chris Toshok - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include "autocompletion-config.h" - -#include -#include -#include -#include -#include - -#include "widgets/misc/e-preferences-window.h" - -static void -source_selection_changed_cb (ESourceSelector *source_selector) -{ - ESourceList *source_list; - GSList *selection; - GSList *l; - GSList *groups; - - source_list = e_source_selector_get_source_list (source_selector); - - /* first we clear all the completion flags from all sources */ - for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) { - ESourceGroup *group = E_SOURCE_GROUP (groups->data); - GSList *sources; - - for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { - ESource *source = E_SOURCE (sources->data); - - e_source_set_property (source, "completion", NULL); - } - } - - /* then we loop over the selector's selection, setting the - property on those sources */ - selection = e_source_selector_get_selection (source_selector); - for (l = selection; l; l = l->next) { - ESource *source = E_SOURCE (l->data); - - e_source_set_property (source, "completion", "true"); - } - e_source_selector_free_selection (selection); - - /* XXX we should pop up a dialog if this fails */ - e_source_list_sync (source_list, NULL); -} - -static void -initialize_selection (ESourceSelector *source_selector) -{ - ESourceList *source_list; - GSList *groups; - - source_list = e_source_selector_get_source_list (source_selector); - - for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) { - ESourceGroup *group = E_SOURCE_GROUP (groups->data); - GSList *sources; - - for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { - ESource *source = E_SOURCE (sources->data); - const gchar *completion; - - completion = e_source_get_property (source, "completion"); - if (completion && !g_ascii_strcasecmp (completion, "true")) - e_source_selector_select_source (source_selector, source); - } - } -} - -void -autocompletion_config_init (EShell *shell) -{ - ESourceList *source_list; - GtkWidget *scrolled_window; - GtkWidget *source_selector; - GtkWidget *preferences_window; - - g_return_if_fail (E_IS_SHELL (shell)); - - source_list = e_source_list_new_for_gconf_default ( - "/apps/evolution/addressbook/sources"); - - /* XXX should we watch for the source list to change and - update it in the control? what about our local changes? */ - /* g_signal_connect (ac->source_list, "changed", G_CALLBACK (source_list_changed), ac); */ - - scrolled_window = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy ( - GTK_SCROLLED_WINDOW (scrolled_window), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type ( - GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN); - gtk_widget_show (scrolled_window); - - source_selector = e_source_selector_new (source_list); - g_signal_connect ( - source_selector, "selection_changed", - G_CALLBACK (source_selection_changed_cb), NULL); - gtk_container_add (GTK_CONTAINER (scrolled_window), source_selector); - gtk_widget_show (source_selector); - - initialize_selection (E_SOURCE_SELECTOR (source_selector)); - - preferences_window = e_shell_get_preferences_window (shell); - - e_preferences_window_add_page ( - E_PREFERENCES_WINDOW (preferences_window), - "autocompletion", - "preferences-autocompletion", - _("Autocompletion"), - scrolled_window, - 200); -} -- cgit v1.2.3