[anjuta/gsettings-migration: 26/65] sourceview: Fixed preference names to match with GSettings rules



commit 25401141a31e0105f6584d08b1c319bd1b1c347a
Author: Johannes Schmid <jhs gnome org>
Date:   Thu Sep 30 22:14:51 2010 +0200

    sourceview: Fixed preference names to match with GSettings rules

 plugins/sourceview/anjuta-editor-sourceview.ui |   34 ++++++++++----------
 plugins/sourceview/plugin.c                    |    6 ++--
 plugins/sourceview/sourceview-io.c             |    4 +-
 plugins/sourceview/sourceview-prefs.c          |   41 +++++++++++++-----------
 plugins/sourceview/sourceview.c                |    4 +-
 5 files changed, 46 insertions(+), 43 deletions(-)
---
diff --git a/plugins/sourceview/anjuta-editor-sourceview.ui b/plugins/sourceview/anjuta-editor-sourceview.ui
index 9695fac..6fae4ec 100644
--- a/plugins/sourceview/anjuta-editor-sourceview.ui
+++ b/plugins/sourceview/anjuta-editor-sourceview.ui
@@ -46,7 +46,7 @@
                         <property name="column_spacing">5</property>
                         <property name="row_spacing">5</property>
                         <child>
-                          <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:use.tabs">
+                          <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:use-tabs">
                             <property name="label" translatable="yes">Use tabs for indentation</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
@@ -175,7 +175,7 @@
                             <property name="orientation">vertical</property>
                             <property name="spacing">5</property>
                             <child>
-                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview.syntax.highlight">
+                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview-syntax-highlight">
                                 <property name="label" translatable="yes">Highlight syntax</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -190,7 +190,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkCheckButton" id="preferences_toggle:bool:0:0:sourceview.brackets.highlight">
+                              <object class="GtkCheckButton" id="preferences_toggle:bool:0:0:sourceview-brackets-highlight">
                                 <property name="label" translatable="yes">Highlight matching brackets</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -205,7 +205,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview.backup">
+                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview-backup">
                                 <property name="label" translatable="yes">Create backup files</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -220,7 +220,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkCheckButton" id="preferences_toggle:bool:0:0:sourceview.autocomplete">
+                              <object class="GtkCheckButton" id="preferences_toggle:bool:0:0:sourceview-autocomplete">
                                 <property name="label" translatable="yes">Enable autocompletion for document words</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -280,7 +280,7 @@
                             <property name="orientation">vertical</property>
                             <property name="spacing">5</property>
                             <child>
-                              <object class="GtkCheckButton" id="preferences_toggle:bool:0:0:sourceview.currentline.highlight">
+                              <object class="GtkCheckButton" id="preferences_toggle:bool:0:0:sourceview-currentline-highlight">
                                 <property name="label" translatable="yes">Highlight current line</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -295,7 +295,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:margin.linenumber.visible">
+                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:margin-linenumber-visible">
                                 <property name="label" translatable="yes">Show line numbers</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -310,7 +310,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:margin.marker.visible">
+                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:margin-marker-visible">
                                 <property name="label" translatable="yes">Show marks</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -325,7 +325,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview.rightmargin.visible">
+                              <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview-rightmargin-visible">
                                 <property name="label" translatable="yes">Show right margin</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -360,7 +360,7 @@
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="preferences_spin:int:80:0:sourceview.rightmargin.position">
+                                  <object class="GtkSpinButton" id="preferences_spin:int:80:0:sourceview-rightmargin-position">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="adjustment">adjustment2</property>
@@ -450,7 +450,7 @@
                         <property name="column_spacing">5</property>
                         <property name="row_spacing">5</property>
                         <child>
-                          <object class="GtkFontButton" id="preferences_font:font:Monospace 12:0:sourceview.font">
+                          <object class="GtkFontButton" id="preferences_font:font:Monospace 12:0:sourceview-font">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
@@ -463,7 +463,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview.font.use_theme">
+                          <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview-font-use-theme">
                             <property name="label" translatable="yes">Use theme font</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
@@ -582,7 +582,7 @@
                 <property name="column_spacing">5</property>
                 <property name="row_spacing">5</property>
                 <child>
-                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.header">
+                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print-header">
                     <property name="label" translatable="yes">Print page header</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
@@ -598,7 +598,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.footer">
+                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print-footer">
                     <property name="label" translatable="yes">Print page footer</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
@@ -612,7 +612,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.linenumbers">
+                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print-linenumbers">
                     <property name="label" translatable="yes">Print line numbers</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
@@ -628,7 +628,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.highlight">
+                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print-highlight">
                     <property name="label" translatable="yes">Highlight syntax</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
@@ -644,7 +644,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.linewrap">
+                  <object class="GtkCheckButton" id="preferences_toggle:bool:1:0:print-linewrap">
                     <property name="label" translatable="yes">Wrap long lines to fit on paper</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
diff --git a/plugins/sourceview/plugin.c b/plugins/sourceview/plugin.c
index 82a6d36..b48fc6a 100644
--- a/plugins/sourceview/plugin.c
+++ b/plugins/sourceview/plugin.c
@@ -42,10 +42,10 @@
 #define ICON_FILE "anjuta-editor-sourceview-plugin-48.png"
 
 #define COMBO_STYLES "combo_styles"
-#define SOURCEVIEW_STYLE "sourceview.style"
+#define SOURCEVIEW_STYLE "sourceview-style"
 
-#define FONT_USE_THEME_BUTTON "preferences_toggle:bool:1:0:sourceview.font.use_theme"
-#define FONT_BUTTON "preferences_font:font:Monospace 12:0:sourceview.font"
+#define FONT_USE_THEME_BUTTON "preferences_toggle:bool:1:0:sourceview-font-use-theme"
+#define FONT_BUTTON "preferences_font:font:Monospace 12:0:sourceview-font"
 
 static gpointer parent_class;
 
diff --git a/plugins/sourceview/sourceview-io.c b/plugins/sourceview/sourceview-io.c
index 634d592..72805d8 100644
--- a/plugins/sourceview/sourceview-io.c
+++ b/plugins/sourceview/sourceview-io.c
@@ -289,8 +289,8 @@ sourceview_io_save_as (SourceviewIO* sio, GFile* file)
 	
 	cancel_monitor (sio);
 	
-	backup = anjuta_preferences_get_bool_with_default (sio->sv->priv->prefs,
-													  "sourceview.backup", TRUE);
+	backup = anjuta_preferences_get_bool (sio->sv->priv->prefs,
+					 "sourceview-backup");
 	
 	if (sio->last_encoding == NULL)
 	{
diff --git a/plugins/sourceview/sourceview-prefs.c b/plugins/sourceview/sourceview-prefs.c
index f80419e..5cd743e 100644
--- a/plugins/sourceview/sourceview-prefs.c
+++ b/plugins/sourceview/sourceview-prefs.c
@@ -30,28 +30,28 @@
 	sv->priv->notify_ids = g_list_prepend (sv->priv->notify_ids, \
 										   GUINT_TO_POINTER(notify_id));
 /* Editor preferences */
-#define HIGHLIGHT_SYNTAX           "sourceview.syntax.highlight"
-#define HIGHLIGHT_CURRENT_LINE	   "sourceview.currentline.highlight"
-#define USE_TABS                   "use.tabs"
-#define HIGHLIGHT_BRACKETS         "sourceview.brackets.highlight"
+#define HIGHLIGHT_SYNTAX           "sourceview-syntax-highlight"
+#define HIGHLIGHT_CURRENT_LINE	   "sourceview-currentline-highlight"
+#define USE_TABS                   "use-tabs"
+#define HIGHLIGHT_BRACKETS         "sourceview-brackets-highlight"
 #define TAB_SIZE                   "tabsize"
-#define INDENT_SIZE                "indent.size"
-#define AUTOCOMPLETION             "sourceview.autocomplete"
+#define INDENT_SIZE                "indent-size"
+#define AUTOCOMPLETION             "sourceview-autocomplete"
 
-#define VIEW_LINENUMBERS           "margin.linenumber.visible"
-#define VIEW_MARKS                 "margin.marker.visible"
-#define VIEW_RIGHTMARGIN           "sourceview.rightmargin.visible"
-#define VIEW_WHITE_SPACES          "view.whitespace"
-#define VIEW_EOL                   "view.eol"
-#define VIEW_LINE_WRAP             "view.line.wrap"
-#define RIGHTMARGIN_POSITION       "sourceview.rightmargin.position"
+#define VIEW_LINENUMBERS           "margin-linenumber-visible"
+#define VIEW_MARKS                 "margin-marker-visible"
+#define VIEW_RIGHTMARGIN           "sourceview-rightmargin-visible"
+#define VIEW_WHITE_SPACES          "docman-whitespace"
+#define VIEW_EOL                   "docman-eol"
+#define VIEW_LINE_WRAP             "docman-line-wrap"
+#define RIGHTMARGIN_POSITION       "sourceview-rightmargin-position"
 
-#define COLOR_ERROR								 "messages.color.error"
-#define COLOR_WARNING							 "messages.color.warning"
+#define COLOR_ERROR							 "msgman-color-error"
+#define COLOR_WARNING							 "msgman-color.warning"
 
 
-#define FONT_THEME "sourceview.font.use_theme"
-#define FONT "sourceview.font"
+#define FONT_THEME "sourceview-font-use-theme"
+#define FONT "sourceview-font"
 #define DESKTOP_FIXED_FONT "/desktop/gnome/interface/monospace_font_name"
 
 
@@ -311,10 +311,10 @@ on_notify_indic_colors (AnjutaPreferences* prefs,
 {
 	char* error_color =
 		anjuta_preferences_get (anjuta_preferences_default(),
-		                        "messages.color.error");
+		                        COLOR_ERROR);
 	char* warning_color =
 		anjuta_preferences_get (anjuta_preferences_default(),
-		                        "messages.color.warning");
+		                        COLOR_WARNING);
 	Sourceview* sv = ANJUTA_SOURCEVIEW (user_data);
 
 	g_object_set (sv->priv->warning_indic, "foreground", warning_color, NULL);
@@ -340,6 +340,8 @@ init_fonts(Sourceview* sv)
 	}
 	else
 	{
+		/* FIXME: Get font from GSettings */
+#if 0	
 		GConfClient *gclient;
 		gchar *desktop_fixed_font;
 		
@@ -352,6 +354,7 @@ init_fonts(Sourceview* sv)
 			anjuta_view_set_font(sv->priv->view, TRUE, NULL);
 		g_free (desktop_fixed_font);
 		g_object_unref (gclient);
+#endif
 	}
 }
 
diff --git a/plugins/sourceview/sourceview.c b/plugins/sourceview/sourceview.c
index 49753aa..ff7a28b 100644
--- a/plugins/sourceview/sourceview.c
+++ b/plugins/sourceview/sourceview.c
@@ -188,10 +188,10 @@ static void sourceview_create_highligth_indic(Sourceview* sv)
 {
 	char* error_color =
 		anjuta_preferences_get (anjuta_preferences_default(),
-		                        "messages.color.error");
+		                        "msgman-color-error");
 	char* warning_color =
 		anjuta_preferences_get (anjuta_preferences_default (),
-		                        "messages.color.warning");
+		                        "msgman-color-error");
 	sv->priv->important_indic = 
 		gtk_text_buffer_create_tag (GTK_TEXT_BUFFER(sv->priv->document),
 									IMPORTANT_INDIC,



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