** Fixes part of bug #526152, plus some tangential code cleanup.
2008-04-05 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #526152, plus some tangential code cleanup. * mail/Makefile.am: Remove all the IDL crud for GnomeSpell. * mail/em-composer-prefs.c: * mail/evolution-mail.schemas.in: * mail/mail-config.c: Define our own GConf keys for active spell checking languages and the underline color for misspelled words, instead of relying on GnomeSpell's GConf keys. The new keys are: /apps/evolution/mail/composer/spell_color (string) /apps/evolution/mail/composer/spell_languages (list of strings) * mail/em-composer-prefs.c: * mail/em-composer-prefs.h: Cleanup the logic a bit to improve readability. * mail/mail-config.c: Cleanup the GConf notification logic: - We don't need the notification IDs for GConf keys we're watching. - Minimize the repetition of GConf keys to reduce the risk of typos. - Reduce the number of notification callback functions. * mail/Spell.idl: Remove this file; we don't use GnomeSpell anymore. * composer/e-msg-composer.c: * composer/e-composer-private.h: Initialize a new composer's spell checking language menu via our new "spell_languages" GConf key. * tools/killev.c (main): No need to continue killing the GnomeSpell Bonobo server. svn path=/trunk/; revision=35322
This commit is contained in:
committed by
Matthew Barnes
parent
20fca64c5a
commit
52ba74cef4
@ -1,3 +1,10 @@
|
||||
2008-04-05 Matthew Barnes <mbarnes@redhat.com>
|
||||
|
||||
** Fixes part of bug #526152
|
||||
|
||||
* tools/killev.c (main):
|
||||
No need to continue killing the GnomeSpell Bonobo server.
|
||||
|
||||
2008-04-02 Matthew Barnes <mbarnes@redhat.com>
|
||||
|
||||
** Merge the mbarnes-composer branch
|
||||
|
||||
@ -1,3 +1,12 @@
|
||||
2008-04-05 Matthew Barnes <mbarnes@redhat.com>
|
||||
|
||||
** Fixes part of bug #526152
|
||||
|
||||
* e-msg-composer.c:
|
||||
* e-composer-private.h:
|
||||
Initialize a new composer's spell checking language menu via
|
||||
our new "spell_languages" GConf key.
|
||||
|
||||
2008-04-02 Matthew Barnes <mbarnes@redhat.com>
|
||||
|
||||
** Adapt to GtkHTML's new editor widget.
|
||||
|
||||
@ -62,6 +62,8 @@
|
||||
COMPOSER_GCONF_PREFIX "/top_signature"
|
||||
#define COMPOSER_GCONF_SEND_HTML_KEY \
|
||||
COMPOSER_GCONF_PREFIX "/send_html"
|
||||
#define COMPOSER_GCONF_SPELL_LANGUAGES_KEY \
|
||||
COMPOSER_GCONF_PREFIX "/spell_languages"
|
||||
#define COMPOSER_GCONF_VIEW_BCC_KEY \
|
||||
COMPOSER_GCONF_PREFIX "/view/Bcc"
|
||||
#define COMPOSER_GCONF_VIEW_CC_KEY \
|
||||
|
||||
@ -2044,8 +2044,10 @@ msg_composer_constructor (GType type,
|
||||
GObject *object;
|
||||
EMsgComposer *composer;
|
||||
GtkToggleAction *action;
|
||||
GList *spell_languages = NULL;
|
||||
GConfClient *client;
|
||||
GArray *array;
|
||||
GSList *list;
|
||||
gboolean active;
|
||||
guint binding_id;
|
||||
|
||||
@ -2112,6 +2114,25 @@ msg_composer_constructor (GType type,
|
||||
client, COMPOSER_GCONF_REQUEST_RECEIPT_KEY, NULL);
|
||||
gtk_toggle_action_set_active (action, active);
|
||||
|
||||
list = gconf_client_get_list (
|
||||
client, COMPOSER_GCONF_SPELL_LANGUAGES_KEY,
|
||||
GCONF_VALUE_STRING, NULL);
|
||||
while (list != NULL) {
|
||||
gchar *language_code = list->data;
|
||||
const GtkhtmlSpellLanguage *language;
|
||||
|
||||
language = gtkhtml_spell_language_lookup (language_code);
|
||||
if (language != NULL)
|
||||
spell_languages = g_list_prepend (
|
||||
spell_languages, (gpointer) language);
|
||||
|
||||
list = g_slist_delete_link (list, list);
|
||||
g_free (language_code);
|
||||
}
|
||||
gtkhtml_editor_set_spell_languages (
|
||||
GTKHTML_EDITOR (composer), spell_languages);
|
||||
g_list_free (spell_languages);
|
||||
|
||||
gconf_client_add_dir (
|
||||
client, COMPOSER_GCONF_PREFIX,
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
|
||||
@ -1,3 +1,32 @@
|
||||
2008-04-05 Matthew Barnes <mbarnes@redhat.com>
|
||||
|
||||
** Fixes part of bug #526152, plus some tangential code cleanup.
|
||||
|
||||
* Makefile.am:
|
||||
Remove all the IDL crud for GnomeSpell.
|
||||
|
||||
* em-composer-prefs.c:
|
||||
* evolution-mail.schemas.in:
|
||||
* mail-config.c:
|
||||
Define our own GConf keys for active spell checking languages
|
||||
and the underline color for misspelled words, instead of relying
|
||||
on GnomeSpell's GConf keys. The new keys are:
|
||||
/apps/evolution/mail/composer/spell_color (string)
|
||||
/apps/evolution/mail/composer/spell_languages (list of strings)
|
||||
|
||||
* em-composer-prefs.c:
|
||||
* em-composer-prefs.h:
|
||||
Cleanup the logic a bit to improve readability.
|
||||
|
||||
* mail-config.c:
|
||||
Cleanup the GConf notification logic:
|
||||
- We don't need the notification IDs for GConf keys we're watching.
|
||||
- Minimize the repetition of GConf keys to reduce the risk of typos.
|
||||
- Reduce the number of notification callback functions.
|
||||
|
||||
* Spell.idl:
|
||||
Remove this file; we don't use GnomeSpell anymore.
|
||||
|
||||
2008-04-04 Jeffrey Stedfast <fejj@novell.com>
|
||||
|
||||
* em-format-quote.c (emfq_format_header): Same as below.
|
||||
|
||||
@ -33,24 +33,6 @@ INCLUDES = \
|
||||
|
||||
component_LTLIBRARIES = libevolution-mail.la
|
||||
|
||||
# Code generation for Spell.idl
|
||||
|
||||
SPELL_IDL = Spell.idl
|
||||
|
||||
SPELL_IDL_GENERATED_H = \
|
||||
Spell.h
|
||||
SPELL_IDL_GENERATED_C = \
|
||||
Spell-common.c \
|
||||
Spell-skels.c \
|
||||
Spell-stubs.c
|
||||
SPELL_IDL_GENERATED = $(SPELL_IDL_GENERATED_C) $(SPELL_IDL_GENERATED_H)
|
||||
|
||||
$(SPELL_IDL_GENERATED_H): $(SPELL_IDL)
|
||||
$(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl $(IDL_INCLUDES) $(srcdir)/Spell.idl
|
||||
$(SPELL_IDL_GENERATED_C): $(SPELL_IDL_GENERATED_H)
|
||||
|
||||
Spell-impl.o: Spell.h
|
||||
|
||||
# Mail.idl
|
||||
MAIL_IDL = Evolution-Mail.idl
|
||||
MAIL_IDL_GENERATED_H = \
|
||||
@ -110,7 +92,6 @@ mailinclude_HEADERS = \
|
||||
# libevolution-mail
|
||||
|
||||
libevolution_mail_la_SOURCES = \
|
||||
$(SPELL_IDL_GENERATED) \
|
||||
$(MAIL_IDL_GENERATED) \
|
||||
$(MARSHAL_GENERATED) \
|
||||
$(mailinclude_HEADERS) \
|
||||
@ -271,7 +252,6 @@ EXTRA_DIST = \
|
||||
ChangeLog.pre-1-4 \
|
||||
README.async \
|
||||
em-marshal.list \
|
||||
$(SPELL_IDL) \
|
||||
$(MAIL_IDL) \
|
||||
mail.error.xml \
|
||||
$(glade_DATA) \
|
||||
@ -328,7 +308,7 @@ endif
|
||||
dist-hook:
|
||||
cd $(distdir); rm -f $(BUILT_SOURCES)
|
||||
|
||||
BUILT_SOURCES = $(SPELL_IDL_GENERATED) $(MAIL_IDL_GENERATED) $(MARSHAL_GENERATED) $(server_DATA) $(error_DATA)
|
||||
BUILT_SOURCES = $(MAIL_IDL_GENERATED) $(MARSHAL_GENERATED) $(server_DATA) $(error_DATA)
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
|
||||
@ -1,71 +0,0 @@
|
||||
/* This file is part of gnome-spell bonobo component
|
||||
|
||||
Copyright (C) 1999, 2000 Helix Code, Inc.
|
||||
Authors: Radek Doulik <rodo@helixcode.com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <Bonobo.idl>
|
||||
|
||||
module GNOME {
|
||||
module Spell {
|
||||
|
||||
typedef sequence<string> StringSeq;
|
||||
struct Language {
|
||||
string name;
|
||||
string abbreviation;
|
||||
};
|
||||
typedef sequence<Language> LanguageSeq;
|
||||
|
||||
interface Dictionary : Bonobo::Unknown {
|
||||
|
||||
exception Error {
|
||||
string error;
|
||||
};
|
||||
|
||||
LanguageSeq getLanguages ();
|
||||
|
||||
/**
|
||||
* sets language(s), language string could contain more languages separated by space
|
||||
*/
|
||||
void setLanguage (in string language);
|
||||
|
||||
/**
|
||||
* checks word
|
||||
*
|
||||
* returns true if word is valid
|
||||
*/
|
||||
boolean checkWord (in string word) raises (Error);
|
||||
|
||||
/**
|
||||
* returns suggestions for word
|
||||
*/
|
||||
StringSeq getSuggestions (in string word) raises (Error);
|
||||
|
||||
/**
|
||||
* add to session/personal dictionary
|
||||
*/
|
||||
void addWordToSession (in string word) raises (Error);
|
||||
void addWordToPersonal (in string word, in string language) raises (Error);
|
||||
|
||||
/**
|
||||
* informs dictionary, that word 'word' will be replaced/corrected by word 'replacement'
|
||||
*/
|
||||
void setCorrection (in string word, in string replacement, in string language);
|
||||
};
|
||||
};
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@ -20,83 +20,69 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __EM_COMPOSER_PREFS_H__
|
||||
#define __EM_COMPOSER_PREFS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#pragma }
|
||||
#endif /* __cplusplus */
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include "Spell.h"
|
||||
/* Standard GObject macros */
|
||||
#define EM_TYPE_COMPOSER_PREFS \
|
||||
(em_composer_prefs_get_type ())
|
||||
#define EM_COMPOSER_PREFS(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST \
|
||||
((obj), EM_TYPE_COMPOSER_PREFS, EMComposerPrefs))
|
||||
#define EM_COMPOSER_PREFS_CLASS(cls) \
|
||||
(G_TYPE_CHECK_CLASS_CAST \
|
||||
((cls), EM_TYPE_COMPOSER_PREFS, EMComposerPrefsClass))
|
||||
#define EM_IS_COMPOSER_PREFS(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE \
|
||||
((obj), EM_TYPE_COMPOSER_PREFS))
|
||||
#define EM_IS_COMPOSER_PREFS_CLASS(cls) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE \
|
||||
((cls), EM_TYPE_COMPOSER_PREFS))
|
||||
#define EM_COMPOSER_PREFS_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS \
|
||||
((obj), EM_TYPE_COMPOSER_PREFS, EMComposerPrefsClass))
|
||||
|
||||
#define EM_COMPOSER_PREFS_TYPE (em_composer_prefs_get_type ())
|
||||
#define EM_COMPOSER_PREFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EM_COMPOSER_PREFS_TYPE, EMComposerPrefs))
|
||||
#define EM_COMPOSER_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EM_COMPOSER_PREFS_TYPE, EMComposerPrefsClass))
|
||||
#define EM_IS_COMPOSER_PREFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EM_COMPOSER_PREFS_TYPE))
|
||||
#define EM_IS_COMPOSER_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EM_COMPOSER_PREFS_TYPE))
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _EMComposerPrefs EMComposerPrefs;
|
||||
typedef struct _EMComposerPrefsClass EMComposerPrefsClass;
|
||||
|
||||
struct _ESignature;
|
||||
struct _GtkToggleButton;
|
||||
struct _GtkOptionMenu;
|
||||
struct _GdkPixbuf;
|
||||
struct _GtkWidget;
|
||||
struct _GladeXML;
|
||||
struct _GConfClient;
|
||||
struct _GtkButton;
|
||||
struct _GtkTreeView;
|
||||
struct _GtkWindow;
|
||||
|
||||
struct _EMComposerPrefs {
|
||||
GtkVBox parent_object;
|
||||
|
||||
struct _GConfClient *gconf;
|
||||
GtkVBox parent;
|
||||
|
||||
struct _GladeXML *gui;
|
||||
|
||||
/* General tab */
|
||||
|
||||
/* Default Behavior */
|
||||
struct _GtkToggleButton *send_html;
|
||||
struct _GtkToggleButton *auto_smileys;
|
||||
struct _GtkToggleButton *auto_request_receipt;
|
||||
struct _GtkToggleButton *prompt_empty_subject;
|
||||
struct _GtkToggleButton *prompt_bcc_only;
|
||||
struct _GtkOptionMenu *charset;
|
||||
GtkOptionMenu *charset;
|
||||
|
||||
struct _GtkToggleButton *spell_check;
|
||||
struct _GtkColorButton *color;
|
||||
struct _GtkTreeView *language;
|
||||
CORBA_sequence_GNOME_Spell_Language *language_seq;
|
||||
gboolean spell_active;
|
||||
|
||||
struct _GdkPixbuf *enabled_pixbuf;
|
||||
GtkColorButton *color;
|
||||
GtkTreeModel *language_model;
|
||||
|
||||
/* Forwards and Replies */
|
||||
struct _GtkOptionMenu *forward_style;
|
||||
struct _GtkOptionMenu *reply_style;
|
||||
struct _GtkToggleButton *top_signature;
|
||||
GtkOptionMenu *forward_style;
|
||||
GtkOptionMenu *reply_style;
|
||||
|
||||
/* Keyboard Shortcuts */
|
||||
struct _GtkOptionMenu *shortcuts_type;
|
||||
GtkOptionMenu *shortcuts_type;
|
||||
|
||||
/* Signatures */
|
||||
struct _GtkTreeView *sig_list;
|
||||
GtkTreeView *sig_list;
|
||||
GHashTable *sig_hash;
|
||||
struct _GtkButton *sig_add;
|
||||
struct _GtkButton *sig_add_script;
|
||||
struct _GtkButton *sig_edit;
|
||||
struct _GtkButton *sig_delete;
|
||||
GtkButton *sig_add;
|
||||
GtkButton *sig_add_script;
|
||||
GtkButton *sig_edit;
|
||||
GtkButton *sig_delete;
|
||||
struct _GtkHTML *sig_preview;
|
||||
|
||||
struct _GladeXML *sig_script_gui;
|
||||
struct _GtkWidget *sig_script_dialog;
|
||||
GtkWidget *sig_script_dialog;
|
||||
|
||||
guint sig_added_id;
|
||||
guint sig_removed_id;
|
||||
@ -105,22 +91,17 @@ struct _EMComposerPrefs {
|
||||
|
||||
struct _EMComposerPrefsClass {
|
||||
GtkVBoxClass parent_class;
|
||||
|
||||
/* signals */
|
||||
|
||||
};
|
||||
|
||||
GType em_composer_prefs_get_type (void);
|
||||
|
||||
struct _GtkWidget *em_composer_prefs_new (void);
|
||||
|
||||
void em_composer_prefs_new_signature (struct _GtkWindow *parent, gboolean html);
|
||||
GType em_composer_prefs_get_type (void);
|
||||
GtkWidget * em_composer_prefs_new (void);
|
||||
void em_composer_prefs_new_signature (GtkWindow *parent,
|
||||
gboolean html_mode);
|
||||
|
||||
/* needed by global config */
|
||||
#define EM_COMPOSER_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_ComposerPrefs_ConfigControl:" BASE_VERSION
|
||||
#define EM_COMPOSER_PREFS_CONTROL_ID \
|
||||
"OAFIID:GNOME_Evolution_Mail_ComposerPrefs_ConfigControl:" BASE_VERSION
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __EM_COMPOSER_PREFS_H__ */
|
||||
|
||||
@ -18,15 +18,15 @@
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/evolution/mail/composer/send_html</key>
|
||||
<applyto>/apps/evolution/mail/composer/send_html</applyto>
|
||||
<key>/schemas/apps/evolution/mail/composer/inline_spelling</key>
|
||||
<applyto>/apps/evolution/mail/composer/inline_spelling</applyto>
|
||||
<owner>evolution-mail</owner>
|
||||
<type>bool</type>
|
||||
<default>false</default>
|
||||
<default>true</default>
|
||||
<locale name="C">
|
||||
<short>Send HTML mail by default</short>
|
||||
<short>Spell check inline</short>
|
||||
<long>
|
||||
Send HTML mail by default.
|
||||
Draw spelling error indicators on words as you type.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
@ -74,19 +74,47 @@
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/evolution/mail/composer/inline_spelling</key>
|
||||
<applyto>/apps/evolution/mail/composer/inline_spelling</applyto>
|
||||
<key>/schemas/apps/evolution/mail/composer/send_html</key>
|
||||
<applyto>/apps/evolution/mail/composer/send_html</applyto>
|
||||
<owner>evolution-mail</owner>
|
||||
<type>bool</type>
|
||||
<default>true</default>
|
||||
<default>false</default>
|
||||
<locale name="C">
|
||||
<short>Spell check inline</short>
|
||||
<short>Send HTML mail by default</short>
|
||||
<long>
|
||||
Draw spelling error indicators on words as you type.
|
||||
Send HTML mail by default.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/evolution/mail/composer/spell_color</key>
|
||||
<applyto>/apps/evolution/mail/composer/spell_color</applyto>
|
||||
<owner>evolution-mail</owner>
|
||||
<type>string</type>
|
||||
<default>#FFFF00000000</default>
|
||||
<locale name="C">
|
||||
<short>Spell checking color</short>
|
||||
<long>
|
||||
Underline color for misspelled words when using inline spelling.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schema/apps/evolution/mail/composer/spell_languages</key>
|
||||
<applyto>/apps/evolution/mail/composer/spell_languages</applyto>
|
||||
<owner>evolution-mail</owner>
|
||||
<type>list</type>
|
||||
<list_type>string</list_type>
|
||||
<locale name="C">
|
||||
<short>Spell checking languages</short>
|
||||
<long>
|
||||
List of dictionary language codes used for spell checking.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/evolution/mail/composer/view/From</key>
|
||||
<applyto>/apps/evolution/mail/composer/view/From</applyto>
|
||||
|
||||
@ -88,36 +88,20 @@ typedef struct {
|
||||
ESignatureList *signatures;
|
||||
|
||||
GSList *labels;
|
||||
guint label_notify_id;
|
||||
|
||||
guint font_notify_id;
|
||||
guint spell_notify_id;
|
||||
guint mark_citations__notify_id;
|
||||
guint citation_colour_notify_id;
|
||||
guint address_count_notify_id;
|
||||
guint address_compress_notify_id;
|
||||
gboolean address_compress;
|
||||
gint address_count;
|
||||
guint mlimit_size_notify_id;
|
||||
guint mlimit_notify_id;
|
||||
gboolean mlimit;
|
||||
gint mlimit_size;
|
||||
guint magic_spacebar_notify_id;
|
||||
gboolean magic_spacebar;
|
||||
guint error_time;
|
||||
guint error_notify_id;
|
||||
guint error_level;
|
||||
guint error_level_id;
|
||||
|
||||
GPtrArray *mime_types;
|
||||
guint mime_types_notify_id;
|
||||
|
||||
GSList *jh_header;
|
||||
gboolean jh_check;
|
||||
guint jh_header_id;
|
||||
guint jh_check_id;
|
||||
gboolean book_lookup;
|
||||
guint book_lookup_id;
|
||||
} MailConfig;
|
||||
|
||||
static MailConfig *config = NULL;
|
||||
@ -163,20 +147,16 @@ config_cache_mime_types (void)
|
||||
g_ptr_array_add (config->mime_types, NULL);
|
||||
}
|
||||
|
||||
#define CONFIG_GET_SPELL_VALUE(t,x,prop,f,c) G_STMT_START { \
|
||||
val = gconf_client_get_without_default (config->gconf, "/GNOME/Spell" x, NULL); \
|
||||
if (val) { f; prop = c (gconf_value_get_ ## t (val)); \
|
||||
gconf_value_free (val); } } G_STMT_END
|
||||
|
||||
static void
|
||||
config_write_style (void)
|
||||
{
|
||||
int red = 0xffff, green = 0, blue = 0;
|
||||
GConfValue *val;
|
||||
GConfClient *client;
|
||||
gboolean custom;
|
||||
char *fix_font;
|
||||
char *var_font;
|
||||
char *citation_color;
|
||||
gchar *fix_font;
|
||||
gchar *var_font;
|
||||
gchar *citation_color;
|
||||
gchar *spell_color;
|
||||
const gchar *key;
|
||||
FILE *rc;
|
||||
|
||||
if (!(rc = g_fopen (config->gtkrc, "wt"))) {
|
||||
@ -184,17 +164,26 @@ config_write_style (void)
|
||||
return;
|
||||
}
|
||||
|
||||
custom = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/fonts/use_custom", NULL);
|
||||
var_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/variable", NULL);
|
||||
fix_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/monospace", NULL);
|
||||
citation_color = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/citation_colour", NULL);
|
||||
CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_red", red, (void)0, (int));
|
||||
CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_green", green, (void)0, (int));
|
||||
CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_blue", blue, (void)0, (int));
|
||||
client = config->gconf;
|
||||
|
||||
key = "/apps/evolution/mail/display/fonts/use_custom";
|
||||
custom = gconf_client_get_bool (client, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/fonts/variable";
|
||||
var_font = gconf_client_get_string (client, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/fonts/monospace";
|
||||
fix_font = gconf_client_get_string (client, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/citation_colour";
|
||||
citation_color = gconf_client_get_string (client, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/composer/spell_color";
|
||||
spell_color = gconf_client_get_string (client, key, NULL);
|
||||
|
||||
fprintf (rc, "style \"evolution-mail-custom-fonts\" {\n");
|
||||
fprintf (rc, " GtkHTML::spell_error_color = \"#%02x%02x%02x\"\n",
|
||||
0xff & (red >> 8), 0xff & (green >> 8), 0xff & (blue >> 8));
|
||||
fprintf (rc, " GtkHTML::spell_error_color = \"%s\"\n", spell_color);
|
||||
g_free (spell_color);
|
||||
|
||||
if (gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/mark_citations", NULL))
|
||||
fprintf (rc, " GtkHTML::cite_color = \"%s\"\n",
|
||||
@ -283,16 +272,9 @@ gconf_jh_check_changed (GConfClient *client, guint cnxn_id,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gconf_lookup_book_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer data)
|
||||
{
|
||||
config->book_lookup = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/junk/lookup_addressbook", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gconf_jh_headers_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
{
|
||||
config->jh_header = gconf_client_get_list (config->gconf, "/apps/evolution/mail/junk/custom_header", GCONF_VALUE_STRING, NULL);
|
||||
GSList *node = config->jh_header;
|
||||
@ -309,59 +291,39 @@ gconf_jh_headers_changed (GConfClient *client, guint cnxn_id,
|
||||
mail_session_set_junk_headers ((const char **)name->pdata, (const char **)value->pdata, name->len);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gconf_address_count_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
gconf_bool_value_changed (GConfClient *client,
|
||||
guint cnxn_id,
|
||||
GConfEntry *entry,
|
||||
gboolean *save_location)
|
||||
{
|
||||
config->address_count = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/address_count", NULL);
|
||||
GError *error = NULL;
|
||||
|
||||
*save_location = gconf_client_get_bool (client, entry->key, &error);
|
||||
if (error != NULL) {
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gconf_error_time_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
gconf_int_value_changed (GConfClient *client,
|
||||
guint cnxn_id,
|
||||
GConfEntry *entry,
|
||||
gint *save_location)
|
||||
{
|
||||
config->error_time = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/error_timeout", NULL);
|
||||
}
|
||||
GError *error = NULL;
|
||||
|
||||
static void
|
||||
gconf_error_level_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
{
|
||||
config->error_level = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/error_level", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gconf_address_compress_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
{
|
||||
config->address_compress = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/address_compress", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gconf_mlimit_size_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
{
|
||||
config->mlimit_size = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/message_text_part_limit", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gconf_mlimit_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
{
|
||||
config->mlimit = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/force_message_limit", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gconf_magic_spacebar_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
{
|
||||
config->magic_spacebar = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/magic_spacebar", NULL);
|
||||
*save_location = gconf_client_get_int (client, entry->key, &error);
|
||||
if (error != NULL) {
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gconf_mime_types_changed (GConfClient *client, guint cnxn_id,
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
GConfEntry *entry, gpointer user_data)
|
||||
{
|
||||
config_clear_mime_types ();
|
||||
config_cache_mime_types ();
|
||||
@ -371,90 +333,174 @@ gconf_mime_types_changed (GConfClient *client, guint cnxn_id,
|
||||
void
|
||||
mail_config_init (void)
|
||||
{
|
||||
GConfClientNotifyFunc func;
|
||||
const gchar *key;
|
||||
|
||||
if (config)
|
||||
return;
|
||||
|
||||
config = g_new0 (MailConfig, 1);
|
||||
config->gconf = gconf_client_get_default ();
|
||||
config->mime_types = g_ptr_array_new ();
|
||||
config->gtkrc = g_build_filename (e_get_user_data_dir (), "mail", "config", "gtkrc-mail-fonts", NULL);
|
||||
config->gtkrc = g_build_filename (
|
||||
e_get_user_data_dir (), "mail",
|
||||
"config", "gtkrc-mail-fonts", NULL);
|
||||
|
||||
mail_config_clear ();
|
||||
|
||||
gtk_rc_parse (config->gtkrc);
|
||||
|
||||
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/display",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/display/fonts",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
gconf_client_add_dir (config->gconf, "/GNOME/Spell",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/junk",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
|
||||
config->font_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/fonts",
|
||||
gconf_style_changed, NULL, NULL, NULL);
|
||||
config->font_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/address_compress",
|
||||
gconf_address_compress_changed, NULL, NULL, NULL);
|
||||
config->font_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/address_count",
|
||||
gconf_address_count_changed, NULL, NULL, NULL);
|
||||
config->error_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/error_timeout",
|
||||
gconf_error_time_changed, NULL, NULL, NULL);
|
||||
config->error_level_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/error_level",
|
||||
gconf_error_level_changed, NULL, NULL, NULL);
|
||||
|
||||
config->mlimit_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/force_message_limit",
|
||||
gconf_mlimit_changed, NULL, NULL, NULL);
|
||||
config->mlimit_size_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/message_text_part_limit",
|
||||
gconf_mlimit_size_changed, NULL, NULL, NULL);
|
||||
config->magic_spacebar_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/magic_spacebar",
|
||||
gconf_magic_spacebar_changed, NULL, NULL, NULL);
|
||||
config->spell_notify_id = gconf_client_notify_add (config->gconf, "/GNOME/Spell",
|
||||
gconf_style_changed, NULL, NULL, NULL);
|
||||
config->mark_citations__notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/mark_citations",
|
||||
gconf_style_changed, NULL, NULL, NULL);
|
||||
config->citation_colour_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/citation_colour",
|
||||
gconf_style_changed, NULL, NULL, NULL);
|
||||
|
||||
gconf_client_add_dir (config->gconf, E_UTIL_LABELS_GCONF_KEY,
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
config->label_notify_id =
|
||||
gconf_client_notify_add (config->gconf, E_UTIL_LABELS_GCONF_KEY,
|
||||
gconf_labels_changed, NULL, NULL, NULL);
|
||||
|
||||
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/mime_types",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
config->mime_types_notify_id =
|
||||
gconf_client_notify_add (config->gconf, "/apps/evolution/mail/mime_types",
|
||||
gconf_mime_types_changed, NULL, NULL, NULL);
|
||||
|
||||
config_cache_labels (config->gconf);
|
||||
config_cache_mime_types ();
|
||||
config->address_compress = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/address_compress", NULL);
|
||||
config->address_count = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/address_count", NULL);
|
||||
config->error_time = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/error_timeout", NULL);
|
||||
config->error_level= gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/error_level", NULL);
|
||||
|
||||
config->mlimit = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/force_message_limit", NULL);
|
||||
config->mlimit_size = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/message_text_part_limit", NULL);
|
||||
config->magic_spacebar = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/magic_spacebar", NULL);
|
||||
config->accounts = e_account_list_new (config->gconf);
|
||||
config->signatures = e_signature_list_new (config->gconf);
|
||||
|
||||
config->jh_check = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/junk/check_custom_header", NULL);
|
||||
config->jh_check_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/junk/check_custom_header",
|
||||
gconf_jh_check_changed, NULL, NULL, NULL);
|
||||
config->jh_header_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/junk/custom_header",
|
||||
gconf_jh_headers_changed, NULL, NULL, NULL);
|
||||
config->book_lookup = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/junk/lookup_addressbook", NULL);
|
||||
config->book_lookup_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/junk/lookup_addressbook",
|
||||
gconf_lookup_book_changed, NULL, NULL, NULL);
|
||||
gtk_rc_parse (config->gtkrc);
|
||||
|
||||
/* Composer Configuration */
|
||||
|
||||
gconf_client_add_dir (
|
||||
config->gconf, "/apps/evolution/mail/composer",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/composer/spell_color";
|
||||
func = (GConfClientNotifyFunc) gconf_style_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func, NULL, NULL, NULL);
|
||||
|
||||
/* Display Configuration */
|
||||
|
||||
gconf_client_add_dir (
|
||||
config->gconf, "/apps/evolution/mail/display",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/address_compress";
|
||||
func = (GConfClientNotifyFunc) gconf_bool_value_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func,
|
||||
&config->address_compress, NULL, NULL);
|
||||
config->address_compress =
|
||||
gconf_client_get_bool (config->gconf, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/address_count";
|
||||
func = (GConfClientNotifyFunc) gconf_int_value_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func,
|
||||
&config->address_count, NULL, NULL);
|
||||
config->address_count =
|
||||
gconf_client_get_int (config->gconf, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/citation_colour";
|
||||
func = (GConfClientNotifyFunc) gconf_style_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func, NULL, NULL, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/error_timeout";
|
||||
func = (GConfClientNotifyFunc) gconf_int_value_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func,
|
||||
&config->error_time, NULL, NULL);
|
||||
config->error_time =
|
||||
gconf_client_get_int (config->gconf, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/error_level";
|
||||
func = (GConfClientNotifyFunc) gconf_int_value_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func,
|
||||
&config->error_level, NULL, NULL);
|
||||
config->error_level =
|
||||
gconf_client_get_int (config->gconf, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/force_message_limit";
|
||||
func = (GConfClientNotifyFunc) gconf_bool_value_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func,
|
||||
&config->mlimit, NULL, NULL);
|
||||
config->mlimit =
|
||||
gconf_client_get_bool (config->gconf, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/message_text_part_limit";
|
||||
func = (GConfClientNotifyFunc) gconf_int_value_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func,
|
||||
&config->mlimit_size, NULL, NULL);
|
||||
config->mlimit_size =
|
||||
gconf_client_get_int (config->gconf, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/magic_spacebar";
|
||||
func = (GConfClientNotifyFunc) gconf_bool_value_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func,
|
||||
&config->magic_spacebar, NULL, NULL);
|
||||
config->magic_spacebar =
|
||||
gconf_client_get_bool (config->gconf, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/mark_citations";
|
||||
func = (GConfClientNotifyFunc) gconf_style_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func, NULL, NULL, NULL);
|
||||
|
||||
/* Font Configuration */
|
||||
|
||||
gconf_client_add_dir (
|
||||
config->gconf, "/apps/evolution/mail/display/fonts",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/display/fonts";
|
||||
func = (GConfClientNotifyFunc) gconf_style_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func, NULL, NULL, NULL);
|
||||
|
||||
/* Label Configuration */
|
||||
|
||||
gconf_client_add_dir (
|
||||
config->gconf, E_UTIL_LABELS_GCONF_KEY,
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
|
||||
gconf_client_notify_add (
|
||||
config->gconf, E_UTIL_LABELS_GCONF_KEY,
|
||||
gconf_labels_changed, NULL, NULL, NULL);
|
||||
|
||||
config_cache_labels (config->gconf);
|
||||
|
||||
/* MIME Type Configuration */
|
||||
|
||||
gconf_client_add_dir (
|
||||
config->gconf, "/apps/evolution/mail/mime_types",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/mime_types";
|
||||
func = (GConfClientNotifyFunc) gconf_mime_types_changed,
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func, NULL, NULL, NULL);
|
||||
|
||||
config_cache_mime_types ();
|
||||
|
||||
/* Junk Configuration */
|
||||
|
||||
gconf_client_add_dir (
|
||||
config->gconf, "/apps/evolution/mail/junk",
|
||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/junk/check_custom_header";
|
||||
func = (GConfClientNotifyFunc) gconf_jh_check_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func, NULL, NULL, NULL);
|
||||
config->jh_check =
|
||||
gconf_client_get_bool (config->gconf, key, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/junk/custom_header";
|
||||
func = (GConfClientNotifyFunc) gconf_jh_headers_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func, NULL, NULL, NULL);
|
||||
|
||||
key = "/apps/evolution/mail/junk/lookup_addressbook";
|
||||
func = (GConfClientNotifyFunc) gconf_bool_value_changed;
|
||||
gconf_client_notify_add (
|
||||
config->gconf, key, func,
|
||||
&config->book_lookup, NULL, NULL);
|
||||
config->book_lookup =
|
||||
gconf_client_get_bool (config->gconf, key, NULL);
|
||||
|
||||
gconf_jh_check_changed (config->gconf, 0, NULL, config);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
mail_config_clear (void)
|
||||
{
|
||||
|
||||
@ -212,7 +212,6 @@ main (int argc, char **argv)
|
||||
add_matching_repo_id ("IDL:GNOME/Evolution/DataServer/BookFactory:" DATASERVER_API_VERSION);
|
||||
add_matching_repo_id ("IDL:GNOME/Evolution/Importer:" BASE_VERSION);
|
||||
add_matching_repo_id ("IDL:GNOME/Evolution/IntelligentImporter:" BASE_VERSION);
|
||||
add_matching_repo_id ("IDL:GNOME/Spell/Dictionary:0.3");
|
||||
|
||||
add_matching_iid ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify_Factory:" BASE_VERSION);
|
||||
add_matching_iid ("OAFIID:GNOME_GtkHTML_Editor_Factory:3.1");
|
||||
|
||||
Reference in New Issue
Block a user