From f9987008ded88dd073458bbf3d80417e032c5e3b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 10 Dec 2008 11:55:08 +0000 Subject: ** Fixes bug #563250 2008-12-10 Matthew Barnes ** Fixes bug #563250 * e-util/e-util.c (e_get_accels_filename): New function returns the filename where custom keyboard accelerators are stored. Currently only applies to the various editor windows in Evolution. * shell/main.c (main): Load on startup and save on shutdown, custom keyboard accelerators. svn path=/trunk/; revision=36864 --- e-util/ChangeLog | 9 +++++++++ e-util/e-util.c | 23 ++++++++++++++++++++++- e-util/e-util.h | 1 + shell/ChangeLog | 7 +++++++ shell/main.c | 3 +++ 5 files changed, 42 insertions(+), 1 deletion(-) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index b06be75c5b..2cc9357c29 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,12 @@ +2008-12-10 Matthew Barnes + + ** Fixes part of bug #563250 + + * e-util.c (e_get_accels_filename): + New function returns the filename where custom keyboard + accelerators are stored. Currently only applies to the + various editor windows in Evolution. + 2008-12-10 Milan Crha ** Part of fix for bug #563870 diff --git a/e-util/e-util.c b/e-util/e-util.c index 215a494df9..4ab1a39636 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include #ifdef G_OS_WIN32 #include @@ -71,6 +71,27 @@ e_get_user_data_dir (void) return dirname; } +/** + * e_get_accels_filename: + * + * Returns the name of the user data file containing custom keyboard + * accelerator specifications. + * + * Returns: filename for accelerator specifications + **/ +const gchar * +e_get_accels_filename (void) +{ + static gchar *filename = NULL; + + if (G_UNLIKELY (filename == NULL)) + filename = g_build_filename ( + gnome_user_dir_get (), + "accels", PACKAGE, NULL); + + return filename; +} + /** * e_display_help: * @parent: a parent #GtkWindow or %NULL diff --git a/e-util/e-util.h b/e-util/e-util.h index a27602848c..e2eafacd75 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -41,6 +41,7 @@ typedef enum { } EFocus; const gchar * e_get_user_data_dir (void); +const gchar * e_get_accels_filename (void); void e_display_help (GtkWindow *parent, const gchar *link_id); diff --git a/shell/ChangeLog b/shell/ChangeLog index ef89b297a9..05f0b2399c 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,10 @@ +2008-12-10 Matthew Barnes + + ** Fixes part of bug #563250 + + * main.c (main): + Load on startup and save on shutdown, custom keyboard accelerators. + 2008-12-08 Jeff Cai ** Fix for bug #563077 diff --git a/shell/main.c b/shell/main.c index 116f5a1fd3..81155975bc 100644 --- a/shell/main.c +++ b/shell/main.c @@ -661,6 +661,7 @@ main (int argc, char **argv) exit (0); gnome_sound_init ("localhost"); + gtk_accel_map_load (e_get_accels_filename ()); if (!disable_eplugin) { e_plugin_register_type(e_plugin_lib_get_type()); @@ -693,6 +694,8 @@ main (int argc, char **argv) bonobo_main (); + gtk_accel_map_save (e_get_accels_filename ()); + e_icon_factory_shutdown (); g_object_unref (program); gnome_sound_shutdown (); -- cgit