[gedit] We must not install external settings.



commit 33bc0189c65c64014b76c1bd4274dd4dbdb51398
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Jan 18 12:52:47 2011 +0100

    We must not install external settings.
    
    We moved the gnome terminal profile settings to our settings.
    For now we use always our settings because gnome terminal has not
    been ported to gsettings yet.

 ...e.gedit.plugins.pythonconsole.gschema.xml.in.in |   12 ++++++++++--
 plugins/pythonconsole/pythonconsole/console.py     |   10 +++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/plugins/pythonconsole/org.gnome.gedit.plugins.pythonconsole.gschema.xml.in.in b/plugins/pythonconsole/org.gnome.gedit.plugins.pythonconsole.gschema.xml.in.in
index 157c330..90a534e 100644
--- a/plugins/pythonconsole/org.gnome.gedit.plugins.pythonconsole.gschema.xml.in.in
+++ b/plugins/pythonconsole/org.gnome.gedit.plugins.pythonconsole.gschema.xml.in.in
@@ -10,13 +10,21 @@
       <_summary>Error Color Text</_summary>
       <_description>The error color text</_description>
     </key>
-  </schema>
-  <schema id="org.gnome.GnomeTerminal.profiles.Default" path="/org/gnome/gnome-terminal/profiles/Default/">
     <key name="use-system-font" type="b">
       <default>true</default>
+      <_summary>Whether to use the system font</_summary>
+      <_description>
+        If true, the terminal will use the desktop-global standard
+        font if it's monospace (and the most similar font it can
+        come up with otherwise).
+      </_description>
     </key>
     <key name="font" type="s">
       <default>'Monospace 10'</default>
+      <_summary>Font</_summary>
+      <_description>
+        A Pango font name. Examples are "Sans 12" or "Monospace Bold 14".
+      </_description>
     </key>
   </schema>
 </schemalist>
diff --git a/plugins/pythonconsole/pythonconsole/console.py b/plugins/pythonconsole/pythonconsole/console.py
index f02bb3a..6a59168 100644
--- a/plugins/pythonconsole/pythonconsole/console.py
+++ b/plugins/pythonconsole/pythonconsole/console.py
@@ -57,7 +57,7 @@ class PythonConsole(Gtk.ScrolledWindow):
         self._interface_settings = Gio.Settings.new(self.SETTINGS_INTERFACE_DIR)
         self._interface_settings.connect("changed", self.on_settings_changed)
 
-        self._profile_settings = Gio.Settings.new(self.SETTINGS_PROFILE_DIR)
+        self._profile_settings = self.get_profile_settings()
         self._profile_settings.connect("changed", self.on_settings_changed)
 
         self.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
@@ -101,6 +101,10 @@ class PythonConsole(Gtk.ScrolledWindow):
         self.view.connect("key-press-event", self.__key_press_event_cb)
         buf.connect("mark-set", self.__mark_set_cb)
 
+    def get_profile_settings(self):
+        #FIXME return either the gnome-terminal settings or the gedit one
+        return Gio.Settings.new(self.CONSOLE_KEY_BASE)
+
     def do_grab_focus(self):
         self.view.grab_focus()
 
@@ -120,13 +124,13 @@ class PythonConsole(Gtk.ScrolledWindow):
             if font_name != self.DEFAULT_FONT:
                 if font_name != system_font:
                     try:
-                        font_desc = pango.FontDescription(system_font)
+                        font_desc = Pango.FontDescription(system_font)
                     except:
                         pass
 
                 if font_desc == None:
                     try:
-                        font_desc = pango.FontDescription(self.DEFAULT_FONT)
+                        font_desc = Pango.FontDescription(self.DEFAULT_FONT)
                     except:
                         pass
 



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