[evolution] Make the settings capplet optional.



commit 005ac1efa32c7e3a3dc5eb959b69fdee5fb91320
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon May 28 12:36:37 2012 -0400

    Make the settings capplet optional.
    
    The evolution-settings capplet was originally designed for Anjal, it was
    used in MeeGo as part of the Express Mode effort, but doesn't really fit
    in GNOME 3 nowadays (nor did it really fit in GNOME 2, in my opinion).
    
    Add a --with-capplet configure switch defaulting to 'no'.  The capplet
    will eventually be removed unless I see someone actively maintaining it.

 Makefile.am                                       |    6 ++-
 configure.ac                                      |   14 ++++
 data/Makefile.am                                  |    6 ++-
 modules/mail/Makefile.am                          |    7 ++-
 modules/mail/e-mail-shell-backend.c               |   71 ++++++++++++---------
 modules/mail/em-account-prefs.c                   |    2 -
 modules/startup-wizard/Makefile.am                |   11 +++-
 modules/startup-wizard/evolution-startup-wizard.c |   11 +++-
 8 files changed, 87 insertions(+), 41 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 8367d96..1372472 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,6 +39,10 @@ if ENABLE_SMIME
 SMIME_SUBDIR=smime
 endif
 
+if WITH_CAPPLET
+CAPPLET_SUBDIR=capplet
+endif
+
 if WITH_HELP
 HELP_SUBDIR=help
 endif
@@ -67,7 +71,7 @@ SUBDIRS = 			\
 	composer		\
 	mail			\
 	calendar		\
-	capplet			\
+	$(CAPPLET_SUBDIR)	\
 	art			\
 	plugins			\
 	modules			\
diff --git a/configure.ac b/configure.ac
index a9970d3..1eccf4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -305,6 +305,20 @@ AC_ARG_WITH([help],
 AM_CONDITIONAL(WITH_HELP, test "x$with_help" != "xno")
 AC_MSG_RESULT([$with_help])
 
+dnl ****************
+dnl Settings Capplet
+dnl ****************
+AC_MSG_CHECKING([whether to build the settings capplet])
+AC_ARG_WITH([capplet],
+	[AS_HELP_STRING([--with-capplet],
+	[Build the account settings capplet [default=no]])],
+	[with_capplet="$withval"],[with_capplet="no"])
+if test "x$with_capplet" = "xyes"; then
+	AC_DEFINE(WITH_CAPPLET, 1, [Define if building the settings capplet])
+fi
+AM_CONDITIONAL(WITH_CAPPLET, test "x$with_capplet" = "xyes")
+AC_MSG_RESULT([$with_capplet])
+
 dnl ******************************
 dnl iconv checking
 dnl ******************************
diff --git a/data/Makefile.am b/data/Makefile.am
index 9d9a886..ea2ca3f 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,7 +1,11 @@
 SUBDIRS = icons
 
+if WITH_CAPPLET
+evolution_settings_desktop_in = evolution-settings.desktop.in
+endif
+
 desktopdir = $(datadir)/applications
-desktop_in_files = evolution.desktop.in evolution-settings.desktop.in
+desktop_in_files = evolution.desktop.in $(evolution_settings_desktop_in)
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 
 autostartdir = $(sysconfdir)/xdg/autostart
diff --git a/modules/mail/Makefile.am b/modules/mail/Makefile.am
index 25b5b15..7d7f298 100644
--- a/modules/mail/Makefile.am
+++ b/modules/mail/Makefile.am
@@ -49,6 +49,11 @@ module_mail_la_SOURCES = \
 	em-network-prefs.c						\
 	em-network-prefs.h
 
+if WITH_CAPPLET
+libevolution_mail_settings_la = \
+	$(top_builddir)/capplet/settings/libevolution-mail-settings.la
+endif
+
 module_mail_la_LIBADD = \
 	$(top_builddir)/libemail-utils/libemail-utils.la		\
 	$(top_builddir)/libemail-engine/libemail-engine.la		\
@@ -66,8 +71,8 @@ module_mail_la_LIBADD = \
 	$(top_builddir)/em-format/libemformat.la			\
 	$(top_builddir)/widgets/menus/libmenus.la			\
 	$(top_builddir)/filter/libfilter.la				\
-	$(top_builddir)/capplet/settings/libevolution-mail-settings.la	\
 	$(top_builddir)/libevolution-utils/libevolution-utils.la	\
+	$(libevolution_mail_settings_la)				\
 	$(EVOLUTION_DATA_SERVER_LIBS)					\
 	$(GNOME_PLATFORM_LIBS)						\
 	$(GTKHTML_LIBS)
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 1039219..ab85d4e 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -33,7 +33,9 @@
 #include <shell/e-shell.h>
 #include <shell/e-shell-window.h>
 
+#ifdef WITH_CAPPLET
 #include <capplet/settings/mail-capplet-shell.h>
+#endif
 
 #include <composer/e-msg-composer.h>
 
@@ -698,6 +700,8 @@ void
 e_mail_shell_backend_new_account (EMailShellBackend *mail_shell_backend,
                                   GtkWindow *parent)
 {
+	EShell *shell;
+	EShellBackend *shell_backend;
 	EMailShellBackendPrivate *priv;
 
 	g_return_if_fail (mail_shell_backend != NULL);
@@ -705,41 +709,46 @@ e_mail_shell_backend_new_account (EMailShellBackend *mail_shell_backend,
 
 	priv = mail_shell_backend->priv;
 
-	if (priv->assistant) {
+	if (priv->assistant != NULL) {
 		gtk_window_present (GTK_WINDOW (priv->assistant));
-	} else {
-		EMAccountEditor *emae;
-		EShell *shell;
+		return;
+	}
 
-		shell = e_shell_backend_get_shell (E_SHELL_BACKEND (mail_shell_backend));
-
-		if (!e_shell_get_express_mode (shell)) {
-			/** @HookPoint-EMConfig: New Mail Account Assistant
-			 * @Id: org.gnome.evolution.mail.config.accountAssistant
-			 * @Type: E_CONFIG_ASSISTANT
-			 * @Class: org.gnome.evolution.mail.config:1.0
-			 * @Target: EMConfigTargetAccount
-			 *
-			 * The new mail account assistant.
-			 */
-			emae = em_account_editor_new (
-				NULL, EMAE_ASSISTANT, E_MAIL_BACKEND (mail_shell_backend),
-				"org.gnome.evolution.mail.config.accountAssistant");
-			e_config_create_window (
-				E_CONFIG (emae->config), NULL,
-				_("Evolution Account Assistant"));
-			priv->assistant = E_CONFIG (emae->config)->window;
-			g_object_set_data_full (
-				G_OBJECT (priv->assistant), "AccountEditor",
-				emae, (GDestroyNotify) g_object_unref);
-		} else {
-			priv->assistant = mail_capplet_shell_new (0, TRUE, FALSE);
-		}
+	shell_backend = E_SHELL_BACKEND (mail_shell_backend);
+	shell = e_shell_backend_get_shell (shell_backend);
+
+#ifdef WITH_CAPPLET
+	if (e_shell_get_express_mode (shell))
+		priv->assistant = mail_capplet_shell_new (0, TRUE, FALSE);
+#endif /* WITH_CAPPLET */
 
-		g_object_add_weak_pointer (G_OBJECT (priv->assistant), &priv->assistant);
-		gtk_window_set_transient_for (GTK_WINDOW (priv->assistant), parent);
-		gtk_widget_show (priv->assistant);
+	if (priv->assistant == NULL) {
+		EMAccountEditor *emae;
+
+		/** @HookPoint-EMConfig: New Mail Account Assistant
+		 * @Id: org.gnome.evolution.mail.config.accountAssistant
+		 * @Type: E_CONFIG_ASSISTANT
+		 * @Class: org.gnome.evolution.mail.config:1.0
+		 * @Target: EMConfigTargetAccount
+		 *
+		 * The new mail account assistant.
+		 */
+		emae = em_account_editor_new (
+			NULL, EMAE_ASSISTANT, E_MAIL_BACKEND (mail_shell_backend),
+			"org.gnome.evolution.mail.config.accountAssistant");
+		e_config_create_window (
+			E_CONFIG (emae->config), NULL,
+			_("Evolution Account Assistant"));
+		priv->assistant = E_CONFIG (emae->config)->window;
+		g_object_set_data_full (
+			G_OBJECT (priv->assistant), "AccountEditor",
+			emae, (GDestroyNotify) g_object_unref);
 	}
+
+	g_object_add_weak_pointer (
+		G_OBJECT (priv->assistant), &priv->assistant);
+	gtk_window_set_transient_for (GTK_WINDOW (priv->assistant), parent);
+	gtk_widget_show (priv->assistant);
 }
 
 void
diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c
index 1e492be..95a9f30 100644
--- a/modules/mail/em-account-prefs.c
+++ b/modules/mail/em-account-prefs.c
@@ -40,8 +40,6 @@
 
 #include <libemail-utils/e-account-utils.h>
 
-#include <capplet/settings/mail-capplet-shell.h>
-
 #include <mail/e-mail-backend.h>
 #include <mail/e-mail-ui-session.h>
 #include <mail/em-config.h>
diff --git a/modules/startup-wizard/Makefile.am b/modules/startup-wizard/Makefile.am
index 1401aba..ce86f1c 100644
--- a/modules/startup-wizard/Makefile.am
+++ b/modules/startup-wizard/Makefile.am
@@ -11,6 +11,11 @@ module_startup_wizard_la_CPPFLAGS = \
 module_startup_wizard_la_SOURCES = \
 	evolution-startup-wizard.c
 
+if WITH_CAPPLET
+libevolution_mail_settings_la = \
+	$(top_builddir)/capplet/settings/libevolution-mail-settings.la
+endif
+
 module_startup_wizard_la_LIBADD = \
 	$(top_builddir)/e-util/libeutil.la			\
 	$(top_builddir)/shell/libeshell.la			\
@@ -18,9 +23,9 @@ module_startup_wizard_la_LIBADD = \
 	$(top_builddir)/widgets/misc/libemiscwidgets.la		\
 	$(top_builddir)/calendar/gui/libevolution-calendar.la	\
 	$(top_builddir)/mail/libevolution-mail.la		\
-	$(top_builddir)/capplet/settings/libevolution-mail-settings.la \
-	$(top_builddir)/libemail-engine/libemail-engine.la \
-	$(top_builddir)/libemail-utils/libemail-utils.la  \
+	$(top_builddir)/libemail-engine/libemail-engine.la	\
+	$(top_builddir)/libemail-utils/libemail-utils.la	\
+	$(libevolution_mail_settings_la)			\
 	$(EVOLUTION_DATA_SERVER_LIBS)				\
 	$(GNOME_PLATFORM_LIBS)
 
diff --git a/modules/startup-wizard/evolution-startup-wizard.c b/modules/startup-wizard/evolution-startup-wizard.c
index 7dd1c67..92d62f5 100644
--- a/modules/startup-wizard/evolution-startup-wizard.c
+++ b/modules/startup-wizard/evolution-startup-wizard.c
@@ -33,7 +33,9 @@
 #include <mail/e-mail-backend.h>
 #include <mail/em-account-editor.h>
 
+#ifdef WITH_CAPPLET
 #include <capplet/settings/mail-capplet-shell.h>
+#endif
 
 #include <calendar/gui/calendar-config.h>
 
@@ -527,6 +529,7 @@ startup_wizard_new_assistant (EStartupWizard *extension)
 	return config->window;
 }
 
+#ifdef WITH_CAPPLET
 static GtkWidget *
 startup_wizard_new_capplet (EStartupWizard *extension)
 {
@@ -540,12 +543,13 @@ startup_wizard_new_capplet (EStartupWizard *extension)
 
 	return capplet;
 }
+#endif /* WITH_CAPPLET */
 
 static void
 startup_wizard_run (EStartupWizard *extension)
 {
 	EShell *shell;
-	GtkWidget *window;
+	GtkWidget *window = NULL;
 	EAccountList *account_list;
 	const gchar *startup_view;
 	gboolean express_mode;
@@ -564,9 +568,12 @@ startup_wizard_run (EStartupWizard *extension)
 	if (express_mode && g_strcmp0 (startup_view, "mail") != 0)
 		return;
 
+#ifdef WITH_CAPPLET
 	if (express_mode)
 		window = startup_wizard_new_capplet (extension);
-	else {
+#endif /* WITH_CAPPLET */
+
+	if (window == NULL) {
 		window = startup_wizard_new_assistant (extension);
 		g_signal_connect (
 			window, "delete-event",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]