aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-05-29 00:36:37 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-05-29 00:50:18 +0800
commit005ac1efa32c7e3a3dc5eb959b69fdee5fb91320 (patch)
treeb7eaca0fc61577360d34e35464465d7232e4b414
parent2c9f0932e8c2bc100f8ec7335a20fbfecea052a2 (diff)
downloadgsoc2013-evolution-005ac1efa32c7e3a3dc5eb959b69fdee5fb91320.tar.gz
gsoc2013-evolution-005ac1efa32c7e3a3dc5eb959b69fdee5fb91320.tar.zst
gsoc2013-evolution-005ac1efa32c7e3a3dc5eb959b69fdee5fb91320.zip
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.
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac14
-rw-r--r--data/Makefile.am6
-rw-r--r--modules/mail/Makefile.am7
-rw-r--r--modules/mail/e-mail-shell-backend.c71
-rw-r--r--modules/mail/em-account-prefs.c2
-rw-r--r--modules/startup-wizard/Makefile.am11
-rw-r--r--modules/startup-wizard/evolution-startup-wizard.c11
8 files changed, 87 insertions, 41 deletions
diff --git a/Makefile.am b/Makefile.am
index 8367d964d2..13724725f0 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 a9970d31e4..1eccf4fb40 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 9d9a8869c4..ea2ca3f6a4 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 25b5b15ef4..7d7f298b6c 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 10392198f0..ab85d4e6d4 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 1e492bebd6..95a9f30569 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 1401abae2f..ce86f1c9da 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 7dd1c679e8..92d62f52f8 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",