gtranslator r3478 - in branches/GOBJECT_WORK: . src



Author: icq
Date: Sun Feb  3 23:40:46 2008
New Revision: 3478
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3478&view=rev

Log:
2008-02-04  Ignacio Casal Quinteiro  <nacho resa gmail com>

        * src/application.c:
        Now you can edit the menu shortcuts. (Fixes bug #514177)



Modified:
   branches/GOBJECT_WORK/ChangeLog
   branches/GOBJECT_WORK/src/application.c

Modified: branches/GOBJECT_WORK/src/application.c
==============================================================================
--- branches/GOBJECT_WORK/src/application.c	(original)
+++ branches/GOBJECT_WORK/src/application.c	Sun Feb  3 23:40:46 2008
@@ -45,6 +45,50 @@
 	EggToolbarsModel *toolbars_model;
 };
 
+static gchar *
+get_accel_file (void)
+{
+	const gchar *home;
+
+	home = g_get_home_dir();
+
+	if (home != NULL)
+	{
+		return g_build_filename (home,
+					 ".config",
+					 "accels"
+					 "gtranslator",
+					 NULL);
+	}
+
+	return NULL;
+}
+
+static void
+load_accels (void)
+{
+	gchar *filename;
+
+	filename = get_accel_file ();
+	if (filename != NULL)
+	{
+		gtk_accel_map_load (filename);
+		g_free (filename);
+	}
+}
+
+static void
+save_accels (void)
+{
+	gchar *filename;
+
+	filename = get_accel_file ();
+	if (filename != NULL)
+	{
+		gtk_accel_map_save (filename);
+		g_free (filename);
+	}
+}
 
 static gboolean
 on_window_delete_event_cb(GtranslatorWindow *window,
@@ -59,6 +103,7 @@
 on_window_destroy_cb(GtranslatorWindow *window,
 		     GtranslatorApplication *app)
 {
+	save_accels ();
 	//if(app->priv->active_window == NULL)
 		g_object_unref(app);
 }
@@ -89,6 +134,8 @@
 
 	egg_toolbars_model_set_flags (priv->toolbars_model, 0,
 				      EGG_TB_MODEL_NOT_REMOVABLE);
+	
+	load_accels ();
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]