aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2007-12-05 13:40:12 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-12-05 13:40:12 +0800
commit956cd913f1542ec212f2cc14a28da5b4f7d2e525 (patch)
tree21eff2768f48b2299738d115ce1cafdabaa38f5d
parentc2d2c2fbbd58465ce877a7537b5c14802ab2f22c (diff)
downloadgsoc2013-evolution-956cd913f1542ec212f2cc14a28da5b4f7d2e525.tar
gsoc2013-evolution-956cd913f1542ec212f2cc14a28da5b4f7d2e525.tar.gz
gsoc2013-evolution-956cd913f1542ec212f2cc14a28da5b4f7d2e525.tar.bz2
gsoc2013-evolution-956cd913f1542ec212f2cc14a28da5b4f7d2e525.tar.lz
gsoc2013-evolution-956cd913f1542ec212f2cc14a28da5b4f7d2e525.tar.xz
gsoc2013-evolution-956cd913f1542ec212f2cc14a28da5b4f7d2e525.tar.zst
gsoc2013-evolution-956cd913f1542ec212f2cc14a28da5b4f7d2e525.zip
** Added a preference to disable Magic Spacebar.
2007-12-05 Srinivasa Ragavan <sragavan@novell.com> ** Added a preference to disable Magic Spacebar. * em-folder-browser.c: (html_scroll), (emfb_list_key_press): Check the cfg before invoking Magic Spacebar * em-mailer-prefs.c: (em_mailer_prefs_construct): Preference window handling * em-mailer-prefs.h: * evolution-mail.schemas.in: * mail-config.c: (gconf_magic_spacebar_changed), (mail_config_init), (mail_config_get_enable_magic_spacebar): Add it part of MC. * mail-config.glade: * mail-config.h: svn path=/trunk/; revision=34650
-rw-r--r--mail/ChangeLog14
-rw-r--r--mail/em-folder-browser.c8
-rw-r--r--mail/em-mailer-prefs.c5
-rw-r--r--mail/em-mailer-prefs.h1
-rw-r--r--mail/evolution-mail.schemas.in13
-rw-r--r--mail/mail-config.c19
-rw-r--r--mail/mail-config.glade19
-rw-r--r--mail/mail-config.h1
8 files changed, 75 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 6db1ea2833..46e50e28ae 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,17 @@
+2007-12-05 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Added a preference to disable Magic Spacebar.
+
+ * em-folder-browser.c: (html_scroll), (emfb_list_key_press): Check the cfg
+ before invoking Magic Spacebar
+ * em-mailer-prefs.c: (em_mailer_prefs_construct): Preference window handling
+ * em-mailer-prefs.h:
+ * evolution-mail.schemas.in:
+ * mail-config.c: (gconf_magic_spacebar_changed),
+ (mail_config_init), (mail_config_get_enable_magic_spacebar): Add it part of MC.
+ * mail-config.glade:
+ * mail-config.h:
+
2007-12-04 David Turner <cillian64@googlemail.com>
** Fix for bug #347329
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 5253101c67..87bf65fd49 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -409,7 +409,7 @@ html_scroll (GtkHTML *html,
EMFolderBrowser *emfb)
{
- if (html->binding_handled || orientation != GTK_ORIENTATION_VERTICAL)
+ if (html->binding_handled || orientation != GTK_ORIENTATION_VERTICAL || !mail_config_get_enable_magic_spacebar ())
return;
if (scroll_type == GTK_SCROLL_PAGE_FORWARD) {
@@ -1169,7 +1169,7 @@ emfb_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev,
switch (ev->key.keyval) {
case GDK_space:
- if (!emfb->view.preview->caret_mode) {
+ if (!emfb->view.preview->caret_mode && mail_config_get_enable_magic_spacebar ()) {
state = gtk_html_command(((EMFormatHTML *)((EMFolderView *) emfb)->preview)->html, "scroll-forward");
if (!state) {
folder_choose = message_list_select(((EMFolderView *) emfb)->list, MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_SEEN);
@@ -1182,7 +1182,7 @@ emfb_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev,
em_utils_adjustment_page(gtk_scrolled_window_get_vadjustment((GtkScrolledWindow *)emfb->priv->scroll), TRUE);
break;
case GDK_BackSpace:
- if (!emfb->view.preview->caret_mode) {
+ if (!emfb->view.preview->caret_mode && mail_config_get_enable_magic_spacebar ()) {
state = gtk_html_command(((EMFormatHTML *)((EMFolderView *) emfb)->preview)->html, "scroll-backward");
if (!state) {
folder_choose = message_list_select(((EMFolderView *) emfb)->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, CAMEL_MESSAGE_SEEN);
@@ -1198,7 +1198,7 @@ emfb_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev,
return FALSE;
}
- if (!folder_choose && !emfb->view.preview->caret_mode) {
+ if (!folder_choose && !emfb->view.preview->caret_mode && mail_config_get_enable_magic_spacebar ()) {
//check for unread messages. if yes .. rewindback to the folder
EMFolderTree *emft = g_object_get_data((GObject*)emfb, "foldertree");
switch (ev->key.keyval) {
diff --git a/mail/em-mailer-prefs.c b/mail/em-mailer-prefs.c
index 9746e620bb..2a4e81117d 100644
--- a/mail/em-mailer-prefs.c
+++ b/mail/em-mailer-prefs.c
@@ -927,6 +927,11 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs)
"/apps/evolution/mail/display/force_message_limit",
G_CALLBACK (toggle_button_toggled));
+ prefs->magic_spacebar = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "magic_spacebar_checkbox"));
+ toggle_button_init (prefs, prefs->magic_spacebar, FALSE,
+ "/apps/evolution/mail/display/magic_spacebar",
+ G_CALLBACK (toggle_button_toggled));
+
prefs->mlimit_count = GTK_SPIN_BUTTON (glade_xml_get_widget (gui, "mlimit_spin"));
spin_button_init (prefs, prefs->mlimit_count,
"/apps/evolution/mail/display/message_text_part_limit",
diff --git a/mail/em-mailer-prefs.h b/mail/em-mailer-prefs.h
index 163d6f9406..647da6e571 100644
--- a/mail/em-mailer-prefs.h
+++ b/mail/em-mailer-prefs.h
@@ -80,6 +80,7 @@ struct _EMMailerPrefs {
struct _GtkOptionMenu *charset;
struct _GtkToggleButton *citation_highlight;
struct _GtkColorButton *citation_color;
+ struct _GtkToggleButton *magic_spacebar;
/* Deleting Mail */
struct _GtkToggleButton *empty_trash;
diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in
index a60d34d8ce..8affc57671 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -184,6 +184,19 @@
</schema>
<schema>
+ <key>/schemas/apps/evolution/mail/display/magic_spacebar</key>
+ <applyto>/apps/evolution/mail/display/magic_spacebar</applyto>
+ <owner>evolution-mail</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Enable or disable magic space bar</short>
+ <long> Enable this to use Space bar key to scroll in message preview, message list and folders.
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/evolution/mail/display/mark_citations</key>
<applyto>/apps/evolution/mail/display/mark_citations</applyto>
<owner>evolution-mail</owner>
diff --git a/mail/mail-config.c b/mail/mail-config.c
index eda95c7982..f10ac3e868 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -110,7 +110,8 @@ typedef struct {
guint mlimit_notify_id;
gboolean mlimit;
gint mlimit_size;
-
+ guint magic_spacebar_notify_id;
+ gboolean magic_spacebar;
GPtrArray *mime_types;
guint mime_types_notify_id;
@@ -360,6 +361,13 @@ gconf_mlimit_changed (GConfClient *client, guint cnxn_id,
}
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);
+}
+
+static void
gconf_mime_types_changed (GConfClient *client, guint cnxn_id,
GConfEntry *entry, gpointer user_data)
{
@@ -399,6 +407,8 @@ mail_config_init (void)
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",
@@ -424,6 +434,7 @@ mail_config_init (void)
config->address_count = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/address_count", 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);
}
@@ -574,6 +585,12 @@ mail_config_get_message_limit (void)
return config->mlimit_size;
}
+gboolean
+mail_config_get_enable_magic_spacebar ()
+{
+ return config->magic_spacebar;
+}
+
const char *
mail_config_get_label_color_by_name (const char *name)
{
diff --git a/mail/mail-config.glade b/mail/mail-config.glade
index 265082d962..4c6cc805c9 100644
--- a/mail/mail-config.glade
+++ b/mail/mail-config.glade
@@ -5104,6 +5104,25 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
</child>
<child>
+ <widget class="GtkCheckButton" id="magic_spacebar_checkbox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable Magic S_pacebar </property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
<widget class="GtkHBox" id="hboxHighlightColor">
<property name="visible">True</property>
<property name="homogeneous">False</property>
diff --git a/mail/mail-config.h b/mail/mail-config.h
index 33b7deea36..ede7291dc4 100644
--- a/mail/mail-config.h
+++ b/mail/mail-config.h
@@ -136,6 +136,7 @@ void mail_config_remove_account (struct _EAccount *account);
void mail_config_set_default_account (struct _EAccount *account);
int mail_config_get_address_count (void);
int mail_config_get_message_limit (void);
+gboolean mail_config_get_enable_magic_spacebar ();
void mail_config_remove_account_proxies (struct _EAccount *account);
void mail_config_prune_proxies (void);