gedit-plugins r416 - in trunk: . plugins/drawspaces



Author: icq
Date: Sun Dec 28 11:15:20 2008
New Revision: 416
URL: http://svn.gnome.org/viewvc/gedit-plugins?rev=416&view=rev

Log:
2008-12-28  Ignacio Casal Quinteiro  <nacho resa gmail com>

        * configure.ac: Bump gtksourceview to 2.5.1

        * plugins/drawspaces/gedit-drawspaces-plugin.c:
        * plugins/drawspaces/drawspaces.glade:
        * plugins/drawspaces/drawspaces.ui:
        Update drawspaces to show non breaking spaces.



Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/plugins/drawspaces/drawspaces.glade
   trunk/plugins/drawspaces/drawspaces.ui
   trunk/plugins/drawspaces/gedit-drawspaces-plugin.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sun Dec 28 11:15:20 2008
@@ -65,7 +65,7 @@
 	gio-2.0 >= 2.16.0
 	gtk+-2.0 >= 2.13.0
 	gconf-2.0 >= 1.1.11
-	gtksourceview-2.0 >= 2.4.0
+	gtksourceview-2.0 >= 2.5.1
 	gedit-2.20 >= 2.24.0
 ])
 GEDIT_LIBS="${GEDIT_LIBS}"

Modified: trunk/plugins/drawspaces/drawspaces.glade
==============================================================================
--- trunk/plugins/drawspaces/drawspaces.glade	(original)
+++ trunk/plugins/drawspaces/drawspaces.glade	Sun Dec 28 11:15:20 2008
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Sat Nov 15 16:38:11 2008 -->
+<!--Generated with glade3 3.4.5 on Wed Dec  3 11:13:00 2008 -->
 <glade-interface>
   <widget class="GtkDialog" id="config-dialog">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -25,6 +25,7 @@
                 <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="label" translatable="yes">Draw spaces</property>
+                <property name="response_id">0</property>
                 <property name="draw_indicator">True</property>
               </widget>
             </child>
@@ -34,6 +35,7 @@
                 <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="label" translatable="yes">Draw tabs</property>
+                <property name="response_id">0</property>
                 <property name="draw_indicator">True</property>
               </widget>
               <packing>
@@ -45,12 +47,25 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="label" translatable="yes">Draw new lines</property>
+                <property name="response_id">0</property>
                 <property name="draw_indicator">True</property>
               </widget>
               <packing>
                 <property name="position">2</property>
               </packing>
             </child>
+            <child>
+              <widget class="GtkCheckButton" id="draw-nbsp">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="label" translatable="yes">Draw non-breaking spaces</property>
+                <property name="response_id">0</property>
+                <property name="draw_indicator">True</property>
+              </widget>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
           </widget>
           <packing>
             <property name="expand">False</property>

Modified: trunk/plugins/drawspaces/drawspaces.ui
==============================================================================
--- trunk/plugins/drawspaces/drawspaces.ui	(original)
+++ trunk/plugins/drawspaces/drawspaces.ui	Sun Dec 28 11:15:20 2008
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!--Generated with glade3 3.4.5 on Sat Nov 15 16:38:11 2008 -->
+<!--Generated with glade3 3.4.5 on Wed Dec  3 11:13:00 2008 -->
 <interface>
   <object class="GtkDialog" id="config-dialog">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -50,6 +50,17 @@
                 <property name="position">2</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkCheckButton" id="draw-nbsp">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="label" translatable="yes">Draw non-breaking spaces</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>

Modified: trunk/plugins/drawspaces/gedit-drawspaces-plugin.c
==============================================================================
--- trunk/plugins/drawspaces/gedit-drawspaces-plugin.c	(original)
+++ trunk/plugins/drawspaces/gedit-drawspaces-plugin.c	Sun Dec 28 11:15:20 2008
@@ -36,6 +36,7 @@
 #define GCONF_KEY_DRAW_TABS    GCONF_KEY_BASE "/draw_tabs"
 #define GCONF_KEY_DRAW_SPACES  GCONF_KEY_BASE "/draw_spaces"
 #define GCONF_KEY_DRAW_NEWLINE GCONF_KEY_BASE "/draw_newline"
+#define GCONF_KEY_DRAW_NBSP    GCONF_KEY_BASE "/draw_nbsp"
 
 #define UI_FILE GEDIT_UIDIR "/drawspaces.ui"
 
@@ -79,6 +80,7 @@
 	GtkWidget *draw_tabs;
 	GtkWidget *draw_spaces;
 	GtkWidget *draw_newline;
+	GtkWidget *draw_nbsp;
 };
 
 static const gchar submenu [] = {
@@ -269,7 +271,7 @@
 get_config_options (WindowData *data,
 		    GeditDrawspacesPlugin *plugin)
 {
-	gboolean tabs, spaces, newline;
+	gboolean tabs, spaces, newline, nbsp;
 
 	data->enable = get_gconf_value_with_default (plugin, GCONF_KEY_ENABLE,
 						     FALSE);
@@ -281,7 +283,10 @@
 					       TRUE);
 
 	newline = get_gconf_value_with_default (plugin, GCONF_KEY_DRAW_NEWLINE,
-					        FALSE);			 
+					        FALSE);
+					        
+	nbsp = get_gconf_value_with_default (plugin, GCONF_KEY_DRAW_NBSP,
+					     FALSE);
 
 	if (tabs)
 		plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_TAB;
@@ -289,6 +294,8 @@
 		plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_SPACE;
 	if (newline)
 		plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_NEWLINE;
+	if (nbsp)
+		plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_NBSP;
 }
 
 static void
@@ -428,6 +435,20 @@
 }
 
 static void
+set_draw_nbsp (GeditDrawspacesPlugin *plugin,
+	       gboolean value)
+{
+	if (!gconf_client_key_is_writable (plugin->priv->gconf_client,
+					   GCONF_KEY_DRAW_NBSP,
+					   NULL))
+		return;
+	gconf_client_set_bool (plugin->priv->gconf_client,
+			       GCONF_KEY_DRAW_NBSP,
+			       value,
+			       NULL);
+}
+
+static void
 on_draw_tabs_toggled (GtkToggleButton *button,
 		      GeditDrawspacesPlugin *plugin)
 {
@@ -449,6 +470,13 @@
 }
 
 static void
+on_draw_nbsp_toggled (GtkToggleButton *button,
+		      GeditDrawspacesPlugin *plugin)
+{
+	set_draw_nbsp (plugin, gtk_toggle_button_get_active (button));
+}
+
+static void
 dialog_destroyed (GtkObject *obj, gpointer dialog_pointer)
 {
 	gedit_debug (DEBUG_PLUGINS);
@@ -478,6 +506,7 @@
 					  "draw-tabs", &dialog->draw_tabs,
 					  "draw-spaces", &dialog->draw_spaces,
 					  "draw-newlines", &dialog->draw_newline,
+					  "draw-nbsp", &dialog->draw_nbsp,
 					  NULL);
 
 	if(!ret)
@@ -507,6 +536,8 @@
 				      plugin->priv->flags & GTK_SOURCE_DRAW_SPACES_SPACE);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->draw_newline),
 				      plugin->priv->flags & GTK_SOURCE_DRAW_SPACES_NEWLINE);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->draw_nbsp),
+				      plugin->priv->flags & GTK_SOURCE_DRAW_SPACES_NBSP);
 
 	g_signal_connect (dialog->draw_tabs, "toggled",
 			  G_CALLBACK (on_draw_tabs_toggled), plugin);
@@ -514,6 +545,8 @@
 			  G_CALLBACK (on_draw_spaces_toggled), plugin);
 	g_signal_connect (dialog->draw_newline, "toggled",
 			  G_CALLBACK (on_draw_newline_toggled), plugin);
+	g_signal_connect (dialog->draw_nbsp, "toggled",
+			  G_CALLBACK (on_draw_nbsp_toggled), plugin);
 	g_signal_connect (dialog->dialog, "destroy",
 			  G_CALLBACK (dialog_destroyed), dialog);
 
@@ -568,6 +601,14 @@
 		else
 			plugin->priv->flags &= ~GTK_SOURCE_DRAW_SPACES_NEWLINE;
 	}
+	else if (strcmp (entry->key, GCONF_KEY_DRAW_NBSP) == 0)
+	{
+		value = gconf_value_get_bool (entry->value);
+		if (value)
+			plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_NBSP;
+		else
+			plugin->priv->flags &= ~GTK_SOURCE_DRAW_SPACES_NBSP;
+	}
 	
 	draw_spaces (plugin);
 }



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