[kupfer] settings, et. al.: Support configuring MagicKeybinding



commit e261a8d0f2a750ae4579d3e406ab2dd212d7ff96
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Tue Sep 15 17:10:31 2009 +0200

    settings, et. al.: Support configuring MagicKeybinding

 data/defaults.cfg     |    1 +
 kupfer/keybindings.py |    1 +
 kupfer/settings.py    |   10 +++++++++-
 3 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/data/defaults.cfg b/data/defaults.cfg
index 6d49b29..2f63b64 100644
--- a/data/defaults.cfg
+++ b/data/defaults.cfg
@@ -9,6 +9,7 @@
 
 [Kupfer]
 Keybinding = <Ctrl>space
+MagicKeybinding =
 ShowStatusIcon = True
 
 # Catalog: The sources of the plugin are included
diff --git a/kupfer/keybindings.py b/kupfer/keybindings.py
index e8dbed1..2d0bcbd 100644
--- a/kupfer/keybindings.py
+++ b/kupfer/keybindings.py
@@ -3,6 +3,7 @@ import gobject
 from kupfer import pretty
 
 KEYBINDING_DEFAULT = 1
+KEYBINDING_MAGIC = 2
 
 _keybound_object = None
 def GetKeyboundObject():
diff --git a/kupfer/settings.py b/kupfer/settings.py
index 556cedd..ebd4edc 100644
--- a/kupfer/settings.py
+++ b/kupfer/settings.py
@@ -28,7 +28,11 @@ class SettingsController (gobject.GObject, pretty.OutputMixin):
 	# Minimal "defaults" to define all fields
 	# Read defaults defined in a defaults.cfg file
 	defaults = {
-		"Kupfer": { "keybinding" : "" , "showstatusicon" : "true" },
+		"Kupfer": {
+			"keybinding" : "" ,
+			"magickeybinding": "",
+			"showstatusicon" : "true"
+		},
 		"Directories" : { "direct" : default_directories, "catalog" : (), },
 		"DeepDirectories" : { "direct" : (), "catalog" : (), "depth" : 1, },
 	}
@@ -216,6 +220,10 @@ class SettingsController (gobject.GObject, pretty.OutputMixin):
 		"""Convenience: Set Kupfer keybinding as string"""
 		return self._set_config("Kupfer", "keybinding", keystr)
 
+	def get_magic_keybinding(self):
+		"""Convenience: Kupfer alternate keybinding as string"""
+		return self.get_config("Kupfer", "magickeybinding")
+
 	def get_show_status_icon(self):
 		"""Convenience: Show icon in notification area as bool"""
 		return (self.get_config("Kupfer", "showstatusicon").lower()



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