[gedit-latex/remove-prefs] Remove color prefs UI



commit ef8012b949551c123118c68019945d60a105e880
Author: John Stowers <john stowers gmail com>
Date:   Mon Jun 27 22:19:15 2011 +1200

    Remove color prefs UI

 latex/preferences/dialog.py |   52 +--------
 latex/ui/configure.ui       |  270 -------------------------------------------
 2 files changed, 2 insertions(+), 320 deletions(-)
---
diff --git a/latex/preferences/dialog.py b/latex/preferences/dialog.py
index cdfa167..101e5bb 100644
--- a/latex/preferences/dialog.py
+++ b/latex/preferences/dialog.py
@@ -59,48 +59,6 @@ class PreferencesSpinButtonProxy(object):
 	def _on_value_changed(self, spin_button):
 		self._preferences.set(self._key, spin_button.get_value_as_int())
 		
-
-class PreferencesColorProxy(object):
-	"""
-	This connects to a Gdk.Color and gets/sets the value of a certain
-	preference
-	"""
-	def __init__(self, widget, key):
-		"""
-		@param widget: the Gtk.Widget that serves as a proxy
-		@param key: the key of the preferences field to be managed
-		"""
-		self._widget = widget
-		self._key = key
-		self._preferences = Preferences()
-		
-		# init value
-		ok, color = Gdk.color_parse(self._preferences.get(key))
-		if ok:
-			self._widget.set_color(color)
-		
-		# listen to change
-		self._widget.connect("color-set", self._on_color_set)
-	
-	def _on_color_set(self, color_button):
-		self._preferences.set(self._key, self._color_to_hex(color_button.get_color()))
-	
-	def _color_to_hex(self, color):
-		"""
-		Convert the value of a Gdk.Color widget to a hex color value
-		
-		@param color: Gdk.Color
-		"""
-		
-		# Gdk.Color components have range 0-65535
-		
-		r = int((float(color.red) / 65535.0) * 255.0)
-		g = int((float(color.green) / 65535.0) * 255.0)
-		b = int((float(color.blue) / 65535.0) * 255.0)
-		
-		return "#%02x%02x%02x" % (r, g, b)
-
-
 class ConfigureToolDialog(GladeInterface):
 	"""
 	Wraps the dialog for setting up a Tool
@@ -417,15 +375,9 @@ class PreferencesDialog(GladeInterface):
 			
 			
 			#
-			# proxies for ColorButtons and SpinButtons
+			# proxies for SpinButtons
 			#
-			self._proxies = [ PreferencesColorProxy(self.find_widget("colorLight"), "light-foreground-color"),
-									PreferencesColorProxy(self.find_widget("colorWarning"), "warning-background-color"),
-									PreferencesColorProxy(self.find_widget("colorError"), "error-background-color"),
-									PreferencesColorProxy(self.find_widget("colorTemplateBackground"), "template-background-color"),
-									PreferencesColorProxy(self.find_widget("colorPlaceholderBackground"), "placeholder-background-color"),
-									PreferencesColorProxy(self.find_widget("colorPlaceholderForeground"), "placeholder-foreground-color"),
-									PreferencesSpinButtonProxy(self.find_widget("spinMaxBibSize"), "maximum-bibtex-size") ]
+			self._proxies = [PreferencesSpinButtonProxy(self.find_widget("spinMaxBibSize"), "maximum-bibtex-size")]
 			
 			#
 			# signals
diff --git a/latex/ui/configure.ui b/latex/ui/configure.ui
index c6310d8..c62ca54 100644
--- a/latex/ui/configure.ui
+++ b/latex/ui/configure.ui
@@ -540,275 +540,5 @@
         <property name="tab_fill">False</property>
       </packing>
     </child>
-    <child>
-      <object class="GtkTable" id="table5">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="border_width">10</property>
-        <property name="n_rows">8</property>
-        <property name="n_columns">4</property>
-        <property name="column_spacing">5</property>
-        <property name="row_spacing">5</property>
-        <child>
-          <object class="GtkColorButton" id="colorPlaceholderForeground">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="use_action_appearance">False</property>
-            <property name="color">#000000000000</property>
-          </object>
-          <packing>
-            <property name="left_attach">3</property>
-            <property name="right_attach">4</property>
-            <property name="top_attach">7</property>
-            <property name="bottom_attach">8</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label10">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">Placeholder Foreground:</property>
-          </object>
-          <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
-            <property name="top_attach">7</property>
-            <property name="bottom_attach">8</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkColorButton" id="colorPlaceholderBackground">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="use_action_appearance">False</property>
-            <property name="color">#000000000000</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">7</property>
-            <property name="bottom_attach">8</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label9">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">Placeholder Background:</property>
-          </object>
-          <packing>
-            <property name="top_attach">7</property>
-            <property name="bottom_attach">8</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkColorButton" id="colorTemplateBackground">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="use_action_appearance">False</property>
-            <property name="color">#000000000000</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">6</property>
-            <property name="bottom_attach">7</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label7">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">Template Background:</property>
-          </object>
-          <packing>
-            <property name="top_attach">6</property>
-            <property name="bottom_attach">7</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label6">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">&lt;b&gt;Template&lt;/b&gt;</property>
-            <property name="use_markup">True</property>
-          </object>
-          <packing>
-            <property name="right_attach">4</property>
-            <property name="top_attach">5</property>
-            <property name="bottom_attach">6</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkColorButton" id="colorError">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="use_action_appearance">False</property>
-            <property name="color">#000000000000</property>
-          </object>
-          <packing>
-            <property name="left_attach">3</property>
-            <property name="right_attach">4</property>
-            <property name="top_attach">3</property>
-            <property name="bottom_attach">4</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label19">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">Error:</property>
-          </object>
-          <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
-            <property name="top_attach">3</property>
-            <property name="bottom_attach">4</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label18">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">&lt;b&gt;Markers&lt;/b&gt;</property>
-            <property name="use_markup">True</property>
-          </object>
-          <packing>
-            <property name="right_attach">4</property>
-            <property name="top_attach">2</property>
-            <property name="bottom_attach">3</property>
-            <property name="y_options">GTK_FILL</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label17">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">&lt;b&gt;General&lt;/b&gt;</property>
-            <property name="use_markup">True</property>
-          </object>
-          <packing>
-            <property name="right_attach">4</property>
-            <property name="y_options">GTK_FILL</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkColorButton" id="colorLight">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="use_action_appearance">False</property>
-            <property name="color">#000000000000</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">1</property>
-            <property name="bottom_attach">2</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label15">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">Light Foreground:</property>
-          </object>
-          <packing>
-            <property name="top_attach">1</property>
-            <property name="bottom_attach">2</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label20">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">Warning:</property>
-          </object>
-          <packing>
-            <property name="top_attach">3</property>
-            <property name="bottom_attach">4</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkColorButton" id="colorWarning">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="use_action_appearance">False</property>
-            <property name="color">#000000000000</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">3</property>
-            <property name="bottom_attach">4</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-      </object>
-      <packing>
-        <property name="position">4</property>
-      </packing>
-    </child>
-    <child type="tab">
-      <object class="GtkLabel" id="label5">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Editor</property>
-      </object>
-      <packing>
-        <property name="position">4</property>
-        <property name="tab_fill">False</property>
-      </packing>
-    </child>
   </object>
 </interface>



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