vinagre r348 - in trunk: . src
- From: jwendell svn gnome org
- To: svn-commits-list gnome org
- Subject: vinagre r348 - in trunk: . src
- Date: Sat, 31 May 2008 10:06:35 +0000 (UTC)
Author: jwendell
Date: Sat May 31 10:06:35 2008
New Revision: 348
URL: http://svn.gnome.org/viewvc/vinagre?rev=348&view=rev
Log:
2008-05-31 Jonh Wendell <jwendell gnome org>
* src/vinagre-app.c: Persist changes in menu shortcuts (Ubuntu #233918).
Modified:
trunk/ChangeLog
trunk/src/vinagre-app.c
Modified: trunk/src/vinagre-app.c
==============================================================================
--- trunk/src/vinagre-app.c (original)
+++ trunk/src/vinagre-app.c Sat May 31 10:06:35 2008
@@ -59,12 +59,56 @@
g_type_class_add_private (object_class, sizeof(VinagreAppPrivate));
}
+static gchar *
+get_accel_file (void)
+{
+ const gchar *home;
+
+ home = g_get_home_dir ();
+
+ if (home)
+ return g_build_filename (home,
+ ".gnome2",
+ "accels",
+ "vinagre",
+ NULL);
+ return NULL;
+}
+
+static void
+load_accels (void)
+{
+ gchar *filename;
+
+ filename = get_accel_file ();
+ if (!filename)
+ return;
+
+ gtk_accel_map_load (filename);
+ g_free (filename);
+}
+
+static void
+save_accels (void)
+{
+ gchar *filename;
+
+ filename = get_accel_file ();
+ if (!filename)
+ return;
+
+ gtk_accel_map_save (filename);
+ g_free (filename);
+}
+
static void
vinagre_app_init (VinagreApp *app)
{
app->priv = VINAGRE_APP_GET_PRIVATE (app);
app->priv->windows = NULL;
app->priv->active_window = NULL;
+
+ load_accels ();
}
static void
@@ -118,7 +162,10 @@
app->priv->windows->data : NULL;
if (app->priv->windows == NULL)
- g_object_unref (app);
+ {
+ save_accels ();
+ g_object_unref (app);
+ }
}
VinagreWindow *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]