[latexila] Load and save accelerator maps



commit fc40fc6e3cf6d74cd1f7bc67b67b0ff50332a41c
Author: SÃbastien Wilmet <swilmet gnome org>
Date:   Fri Feb 15 20:38:16 2013 +0100

    Load and save accelerator maps
    
    When a key binding is modified, it is now saved.
    
    How it works?
    
    $ gsettings set org.gnome.desktop.interface can-change-accels true
    
    We can then modify the keyboard shortcuts in the menu. When the
    application quits, the accelerator maps is saved in
    ~/.config/latexila/accels.

 src/latexila.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/latexila.vala b/src/latexila.vala
index 3d5ef6a..9704adc 100644
--- a/src/latexila.vala
+++ b/src/latexila.vala
@@ -47,6 +47,7 @@ public class Latexila : Gtk.Application
             Projects.get_default ().save ();
             PersonalBuildTools.get_default ().save ();
             MostUsedSymbols.get_default ().save ();
+            Gtk.AccelMap.save (get_accel_filename ());
             release ();
         });
     }
@@ -110,6 +111,7 @@ public class Latexila : Gtk.Application
         AppSettings.get_default ();
         create_window ();
         reopen_files ();
+        Gtk.AccelMap.load (get_accel_filename ());
         release ();
     }
 
@@ -210,4 +212,10 @@ public class Latexila : Gtk.Application
             jump_to = false;
         }
     }
+
+    private string get_accel_filename ()
+    {
+        return Path.build_filename (Environment.get_user_config_dir (),
+            "latexila", "accels");
+    }
 }


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