eog r4936 - in trunk: . src



Author: friemann
Date: Fri Jan  9 13:53:46 2009
New Revision: 4936
URL: http://svn.gnome.org/viewvc/eog?rev=4936&view=rev

Log:
2009-01-09  Felix Riemann  <friemann svn gnome org>

	* src/eog-application.c: (eog_application_init),
	(eog_application_shutdown), (eog_application_load_accelerators),
	(eog_application_save_accelerators):
	* src/main.c: (main):
	Handle accelerator storage on our own without using libgnomeui.
	Let the EogApplication class handle it. Part of bug #559500.


Modified:
   trunk/ChangeLog
   trunk/src/eog-application.c
   trunk/src/main.c

Modified: trunk/src/eog-application.c
==============================================================================
--- trunk/src/eog-application.c	(original)
+++ trunk/src/eog-application.c	Fri Jan  9 13:53:46 2009
@@ -49,6 +49,9 @@
 #define APPLICATION_SERVICE_NAME "org.gnome.eog.ApplicationService"
 #endif
 
+static void eog_application_load_accelerators (void);
+static void eog_application_save_accelerators (void);
+
 #define EOG_APPLICATION_GET_PRIVATE(object) \
 	(G_TYPE_INSTANCE_GET_PRIVATE ((object), EOG_TYPE_APPLICATION, EogApplicationPrivate))
 
@@ -151,6 +154,8 @@
 
 	egg_toolbars_model_set_flags (eog_application->toolbars_model, 0,
 				      EGG_TB_MODEL_NOT_REMOVABLE);
+
+	eog_application_load_accelerators ();
 }
 
 /**
@@ -409,6 +414,8 @@
 		application->toolbars_file = NULL;
 	}
 
+	eog_application_save_accelerators ();
+
 	g_object_unref (application);
 
 	gtk_main_quit ();
@@ -529,3 +536,28 @@
                 totem_scrsaver_disable (application->scr_saver);
 }
 #endif
+
+static void
+eog_application_load_accelerators (void)
+{
+	gchar *accelfile = g_build_filename (g_get_home_dir (),
+					     ".gnome2",
+					     "accels",
+					     "eog", NULL);
+
+	/* gtk_accel_map_load does nothing if the file does not exist */
+	gtk_accel_map_load (accelfile);
+	g_free (accelfile);
+}
+
+static void
+eog_application_save_accelerators (void)
+{
+	gchar *accelfile = g_build_filename (g_get_home_dir (),
+					     ".gnome2",
+					     "accels",
+					     "eog", NULL);
+	
+	gtk_accel_map_save (accelfile);
+	g_free (accelfile);
+}

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Fri Jan  9 13:53:46 2009
@@ -231,8 +231,6 @@
 
 	gdk_threads_leave ();
 
-	gnome_accelerators_sync ();
-	
   	if (startup_files)
 		g_strfreev (startup_files);
 



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