aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-reader.c15
-rw-r--r--mail/e-mail-shell-module-settings.c32
-rw-r--r--mail/em-composer-prefs.c4
-rw-r--r--mail/mail-config.c46
-rw-r--r--mail/mail-config.h4
5 files changed, 23 insertions, 78 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 1d39309361..d1ea62857c 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -2300,6 +2300,9 @@ e_mail_reader_check_state (EMailReader *reader)
void
e_mail_reader_update_actions (EMailReader *reader)
{
+ EShell *shell;
+ EShellModule *shell_module;
+ EShellSettings *shell_settings;
GtkAction *action;
GtkActionGroup *action_group;
const gchar *action_name;
@@ -2308,6 +2311,7 @@ e_mail_reader_update_actions (EMailReader *reader)
/* Be descriptive. */
gboolean any_messages_selected;
+ gboolean disable_printing;
gboolean enable_flag_clear;
gboolean enable_flag_completed;
gboolean enable_flag_for_followup;
@@ -2328,6 +2332,13 @@ e_mail_reader_update_actions (EMailReader *reader)
action_group = e_mail_reader_get_action_group (reader);
state = e_mail_reader_check_state (reader);
+ shell_module = e_mail_reader_get_shell_module (reader);
+ shell = e_shell_module_get_shell (shell_module);
+ shell_settings = e_shell_get_shell_settings (shell);
+
+ disable_printing = e_shell_settings_get_boolean (
+ shell_settings, "disable-printing");
+
single_message_selected =
(state & E_MAIL_READER_SELECTION_SINGLE);
multiple_messages_selected =
@@ -2478,12 +2489,12 @@ e_mail_reader_update_actions (EMailReader *reader)
gtk_action_set_sensitive (action, sensitive);
action_name = "mail-print";
- sensitive = single_message_selected;
+ sensitive = single_message_selected && !disable_printing;
action = e_mail_reader_get_action (reader, action_name);
gtk_action_set_sensitive (action, sensitive);
action_name = "mail-print-preview";
- sensitive = single_message_selected;
+ sensitive = single_message_selected && !disable_printing;
action = e_mail_reader_get_action (reader, action_name);
gtk_action_set_sensitive (action, sensitive);
diff --git a/mail/e-mail-shell-module-settings.c b/mail/e-mail-shell-module-settings.c
index 4acce23ad2..d04bb23b91 100644
--- a/mail/e-mail-shell-module-settings.c
+++ b/mail/e-mail-shell-module-settings.c
@@ -29,11 +29,8 @@
void
e_mail_shell_module_init_settings (EShell *shell)
{
- GConfClient *client;
EShellSettings *shell_settings;
- gpointer object;
- client = gconf_client_get_default ();
shell_settings = e_shell_get_shell_settings (shell);
/* XXX Default values should match the GConf schema.
@@ -433,33 +430,4 @@ e_mail_shell_module_init_settings (EShell *shell)
e_shell_settings_bind_to_gconf (
shell_settings, "composer-top-signature",
"/apps/evolution/mail/composer/top_signature");
-
- /* These properties are not bound directly to GConf keys.
- * XXX Nor should they be stored in GConf to begin with. */
-
- e_shell_settings_install_property (
- g_param_spec_object (
- "accounts",
- NULL,
- NULL,
- E_TYPE_ACCOUNT_LIST,
- G_PARAM_READWRITE));
-
- object = e_account_list_new (client);
- e_shell_settings_set_object (shell_settings, "accounts", object);
- g_object_unref (object);
-
- e_shell_settings_install_property (
- g_param_spec_object (
- "signatures",
- NULL,
- NULL,
- E_TYPE_SIGNATURE_LIST,
- G_PARAM_READWRITE));
-
- object = e_signature_list_new (client);
- e_shell_settings_set_object (shell_settings, "signatures", object);
- g_object_unref (object);
-
- g_object_unref (client);
}
diff --git a/mail/em-composer-prefs.c b/mail/em-composer-prefs.c
index 2609e46835..6d5da4936c 100644
--- a/mail/em-composer-prefs.c
+++ b/mail/em-composer-prefs.c
@@ -1044,7 +1044,9 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
prefs->sig_add = GTK_BUTTON (widget);
widget = glade_xml_get_widget (gui, "cmdSignatureAddScript");
- gtk_widget_set_sensitive (widget, sensitive && !mail_config_scripts_disabled ());
+ e_binding_new_with_negation (
+ G_OBJECT (shell_settings), "disable-command-line",
+ G_OBJECT (widget), "sensitive");
g_signal_connect (
widget, "clicked",
G_CALLBACK (sig_add_script_cb), prefs);
diff --git a/mail/mail-config.c b/mail/mail-config.c
index fc97d3d953..00c847b3c4 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -54,11 +54,7 @@
#include <misc/e-gui-utils.h>
#include "e-util/e-util-labels.h"
#include "e-util/e-account-utils.h"
-
-#include <e-util/e-signature-list.h>
-
-#include "shell/e-shell.h"
-#include "shell/e-shell-settings.h"
+#include "e-util/e-signature-utils.h"
#include <camel/camel-service.h>
#include <camel/camel-stream-mem.h>
@@ -77,9 +73,6 @@
typedef struct {
GConfClient *gconf;
- EShellSettings *shell_settings;
-
- gboolean corrupt;
char *gtkrc;
@@ -340,21 +333,13 @@ void
mail_config_init (void)
{
GConfClientNotifyFunc func;
- EShellSettings *shell_settings;
- EShell *shell;
const gchar *key;
- g_return_if_fail (E_IS_SHELL_SETTINGS (shell_settings));
-
if (config)
return;
- shell = e_shell_get_default ();
- shell_settings = e_shell_get_shell_settings (shell);
-
config = g_new0 (MailConfig, 1);
config->gconf = gconf_client_get_default ();
- config->shell_settings = g_object_ref (shell_settings);
config->mime_types = g_ptr_array_new ();
config->gtkrc = g_build_filename (
e_get_user_data_dir (), "mail",
@@ -554,18 +539,13 @@ mail_config_write (void)
if (!config)
return;
- account_list = e_shell_settings_get_object (
- config->shell_settings, "accounts");
- signature_list = e_shell_settings_get_object (
- config->shell_settings, "signatures");
+ account_list = e_get_account_list ();
+ signature_list = e_get_signature_list ();
e_account_list_save (account_list);
e_signature_list_save (signature_list);
gconf_client_suggest_sync (config->gconf, NULL);
-
- g_object_unref (account_list);
- g_object_unref (signature_list);
}
void
@@ -649,12 +629,6 @@ mail_config_get_gconf_client (void)
return config->gconf;
}
-gboolean
-mail_config_is_corrupt (void)
-{
- return config->corrupt;
-}
-
int
mail_config_get_address_count (void)
{
@@ -1123,15 +1097,6 @@ mail_config_get_lookup_book_local_only (void)
return config->book_lookup_local_only;
}
-gboolean
-mail_config_scripts_disabled (void)
-{
- if (config == NULL)
- mail_config_init ();
-
- return config->scripts_disabled;
-}
-
char *
mail_config_signature_run_script (const char *script)
{
@@ -1140,7 +1105,10 @@ mail_config_signature_run_script (const char *script)
int in_fds[2];
pid_t pid;
- if (mail_config_scripts_disabled ())
+ if (config == NULL)
+ mail_config_init ();
+
+ if (config->scripts_disabled)
return NULL;
if (pipe (in_fds) == -1) {
diff --git a/mail/mail-config.h b/mail/mail-config.h
index e085a1be37..d34ecc71d8 100644
--- a/mail/mail-config.h
+++ b/mail/mail-config.h
@@ -96,8 +96,6 @@ void mail_config_write_on_exit (void);
struct _GConfClient *mail_config_get_gconf_client (void);
/* General Accessor functions */
-gboolean mail_config_is_corrupt (void);
-
GSList *mail_config_get_labels (void);
const char **mail_config_get_allowable_mime_types (void);
@@ -136,8 +134,6 @@ void mail_config_reload_junk_headers (void);
gboolean mail_config_get_lookup_book (void);
gboolean mail_config_get_lookup_book_local_only (void);
-gboolean mail_config_scripts_disabled (void);
-
GType evolution_mail_config_get_type (void);
gboolean evolution_mail_config_factory_init (void);