Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gedit/ChangeLog,v
retrieving revision 1.666
diff -u -p -B -r1.666 ChangeLog
--- ChangeLog	22 Feb 2006 11:46:42 -0000	1.666
+++ ChangeLog	23 Feb 2006 01:17:47 -0000
@@ -1,3 +1,11 @@
+2006-02-22  Steve Frécinaux  <steve@istique.net>
+
+	* plugins/externaltools/tools/tools.glade:
+	* plugins/externaltools/tools/manager.py:
+	
+	Use a GtkSourceView (with bash highlighting) and text wrapping for
+	command text view. Fix bug #331114 by removing all the size requests.
+
 2006-02-22  Jesse van den Kieboom  <jesse@icecrew.nl>
 
 	* plugins/snippets/snippets/SnippetsLibrary.py: fixed get_snippets()
Index: plugins/externaltools/tools/manager.py
===================================================================
RCS file: /cvs/gnome/gedit/plugins/externaltools/tools/manager.py,v
retrieving revision 1.4
diff -u -p -B -r1.4 manager.py
--- plugins/externaltools/tools/manager.py	13 Feb 2006 13:07:43 -0000	1.4
+++ plugins/externaltools/tools/manager.py	23 Feb 2006 01:17:47 -0000
@@ -19,6 +19,7 @@
 __all__ = ('Manager', )
 
 import gtk
+import gtksourceview as gsv
 from gtk import glade
 import os.path
 from gettext import gettext as _
@@ -80,6 +81,7 @@ class Manager:
 		}
 		
 		# Load the "main-window" widget from the glade file.
+		glade.set_custom_handler(self.custom_handler)
 		self.ui = glade.XML(self.GLADE_FILE, 'tool-manager-dialog')
 		self.ui.signal_autoconnect(callbacks)
 		self.dialog = self.ui.get_widget('tool-manager-dialog')
@@ -126,6 +128,27 @@ class Manager:
 	def __getitem__(self, key):
 		"""Convenience function to get a widget from its name"""
 		return self.ui.get_widget(key)
+
+	def custom_handler(self, xml, function_name, widget_name,
+	                   str1, str2, int1 , int2):
+		if function_name == 'create_commands':
+			buf = gsv.SourceBuffer()
+			# Syntax highlighting
+			manager = gsv.SourceLanguagesManager()
+			language = manager.get_language_from_mime_type('text/x-shellscript')
+			buf.set_language(language)
+			buf.set_highlight(True)
+			view = gsv.SourceView(buf)
+			# FIXME: use prefs from pref manager
+			view.set_auto_indent(True)
+			view.set_insert_spaces_instead_of_tabs(False)
+			view.set_smart_home_end(True)
+			view.set_tabs_width(4)
+			view.set_wrap_mode(gtk.WRAP_WORD)
+			view.show()
+			return view
+		else:
+			return None
 
 	def set_active_by_name(self, combo_name, option_name):
 		combo = self[combo_name]
Index: plugins/externaltools/tools/tools.glade
===================================================================
RCS file: /cvs/gnome/gedit/plugins/externaltools/tools/tools.glade,v
retrieving revision 1.5
diff -u -p -B -r1.5 tools.glade
--- plugins/externaltools/tools/tools.glade	14 Feb 2006 23:45:57 -0000	1.5
+++ plugins/externaltools/tools/tools.glade	23 Feb 2006 01:17:48 -0000
@@ -159,11 +159,10 @@
 	  <property name="border_width">6</property>
 	  <property name="visible">True</property>
 	  <property name="can_focus">True</property>
-	  <property name="position">160</property>
+	  <property name="position">1</property>
 
 	  <child>
 	    <widget class="GtkVBox" id="vbox2">
-	      <property name="width_request">200</property>
 	      <property name="visible">True</property>
 	      <property name="homogeneous">False</property>
 	      <property name="spacing">6</property>
@@ -225,7 +224,6 @@
 
 	      <child>
 		<widget class="GtkHBox" id="hbox2">
-		  <property name="width_request">180</property>
 		  <property name="visible">True</property>
 		  <property name="homogeneous">True</property>
 		  <property name="spacing">8</property>
@@ -250,7 +248,6 @@
 		  <child>
 		    <widget class="GtkButton" id="remove-tool-button">
 		      <property name="visible">True</property>
-		      <property name="sensitive">False</property>
 		      <property name="can_default">True</property>
 		      <property name="label">gtk-remove</property>
 		      <property name="use_stock">True</property>
@@ -280,7 +277,6 @@
 
 	  <child>
 	    <widget class="GtkVBox" id="vbox5">
-	      <property name="width_request">400</property>
 	      <property name="visible">True</property>
 	      <property name="homogeneous">False</property>
 	      <property name="spacing">6</property>
@@ -381,28 +377,6 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkEntry" id="description">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="editable">True</property>
-			  <property name="visibility">True</property>
-			  <property name="max_length">0</property>
-			  <property name="text" translatable="yes" context="yes">Run “make” in the document dir</property>
-			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
-			  <property name="activates_default">False</property>
-			  <signal name="focus_out_event" handler="on_description_focus_out" last_modification_time="Fri, 13 Jan 2006 17:37:56 GMT"/>
-			</widget>
-			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">2</property>
-			  <property name="top_attach">0</property>
-			  <property name="bottom_attach">1</property>
-			  <property name="y_options"></property>
-			</packing>
-		      </child>
-
-		      <child>
 			<widget class="GtkLabel" id="label3">
 			  <property name="visible">True</property>
 			  <property name="label" translatable="yes" context="yes">_Accelerator:</property>
@@ -432,30 +406,6 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkEntry" id="accelerator">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="editable">True</property>
-			  <property name="visibility">True</property>
-			  <property name="max_length">0</property>
-			  <property name="text" translatable="yes" context="yes">F7</property>
-			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
-			  <property name="activates_default">False</property>
-			  <signal name="focus_out_event" handler="on_accelerator_focus_out" last_modification_time="Mon, 16 Jan 2006 00:02:25 GMT"/>
-			  <signal name="focus_in_event" handler="on_accelerator_focus_in" last_modification_time="Mon, 16 Jan 2006 00:02:39 GMT"/>
-			  <signal name="key_press_event" handler="on_accelerator_key_press" last_modification_time="Mon, 16 Jan 2006 00:02:58 GMT"/>
-			</widget>
-			<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>
 			<widget class="GtkLabel" id="label6">
 			  <property name="label" translatable="yes" context="yes">_Save:</property>
 			  <property name="use_underline">True</property>
@@ -541,58 +491,27 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkComboBox" id="output">
-			  <property name="visible">True</property>
-			  <property name="items" translatable="yes"></property>
-			  <property name="add_tearoffs">False</property>
-			  <property name="focus_on_click">True</property>
-			  <signal name="focus_out_event" handler="on_output_focus_out" last_modification_time="Sun, 15 Jan 2006 12:52:08 GMT"/>
-			</widget>
-			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">2</property>
-			  <property name="top_attach">5</property>
-			  <property name="bottom_attach">6</property>
-			  <property name="x_options">fill</property>
-			  <property name="y_options">fill</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkScrolledWindow" id="scrolledwindow3">
+			<widget class="GtkLabel" id="label4">
 			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-			  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-			  <property name="shadow_type">GTK_SHADOW_IN</property>
-			  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-			  <child>
-			    <widget class="GtkTextView" id="commands">
-			      <property name="height_request">120</property>
-			      <property name="visible">True</property>
-			      <property name="can_focus">True</property>
-			      <property name="editable">True</property>
-			      <property name="overwrite">False</property>
-			      <property name="accepts_tab">True</property>
-			      <property name="justification">GTK_JUSTIFY_LEFT</property>
-			      <property name="wrap_mode">GTK_WRAP_NONE</property>
-			      <property name="cursor_visible">True</property>
-			      <property name="pixels_above_lines">0</property>
-			      <property name="pixels_below_lines">0</property>
-			      <property name="pixels_inside_wrap">0</property>
-			      <property name="left_margin">0</property>
-			      <property name="right_margin">0</property>
-			      <property name="indent">0</property>
-			      <property name="text" translatable="yes">cd $GEDIT_CURRENT_DOCUMENT_DIR
-make</property>
-			      <signal name="focus_out_event" handler="on_commands_focus_out" last_modification_time="Sun, 15 Jan 2006 10:06:22 GMT"/>
-			    </widget>
-			  </child>
+			  <property name="label" translatable="yes" context="yes">Co_mmand(s):</property>
+			  <property name="use_underline">True</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="mnemonic_widget">scrolledwindow3</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
 			</widget>
 			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">2</property>
+			  <property name="left_attach">0</property>
+			  <property name="right_attach">1</property>
 			  <property name="top_attach">2</property>
 			  <property name="bottom_attach">3</property>
 			  <property name="x_options">fill</property>
@@ -601,19 +520,19 @@ make</property>
 		      </child>
 
 		      <child>
-			<widget class="GtkLabel" id="label4">
+			<widget class="GtkLabel" id="label23">
 			  <property name="visible">True</property>
-			  <property name="label" translatable="yes" context="yes">Co_mmand(s):</property>
+			  <property name="label" translatable="yes">_Applicability:</property>
 			  <property name="use_underline">True</property>
 			  <property name="use_markup">False</property>
 			  <property name="justify">GTK_JUSTIFY_LEFT</property>
 			  <property name="wrap">False</property>
 			  <property name="selectable">False</property>
 			  <property name="xalign">0</property>
-			  <property name="yalign">0</property>
+			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
 			  <property name="ypad">0</property>
-			  <property name="mnemonic_widget">scrolledwindow3</property>
+			  <property name="mnemonic_widget">applicability</property>
 			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 			  <property name="width_chars">-1</property>
 			  <property name="single_line_mode">False</property>
@@ -622,10 +541,10 @@ make</property>
 			<packing>
 			  <property name="left_attach">0</property>
 			  <property name="right_attach">1</property>
-			  <property name="top_attach">2</property>
-			  <property name="bottom_attach">3</property>
+			  <property name="top_attach">6</property>
+			  <property name="bottom_attach">7</property>
 			  <property name="x_options">fill</property>
-			  <property name="y_options">fill</property>
+			  <property name="y_options"></property>
 			</packing>
 		      </child>
 
@@ -643,7 +562,7 @@ All documents</property>
 			  <property name="right_attach">2</property>
 			  <property name="top_attach">3</property>
 			  <property name="bottom_attach">4</property>
-			  <property name="x_options">fill</property>
+			  <property name="x_options">expand|shrink|fill</property>
 			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
@@ -661,37 +580,26 @@ All documents</property>
 			  <property name="right_attach">2</property>
 			  <property name="top_attach">4</property>
 			  <property name="bottom_attach">5</property>
-			  <property name="x_options">fill</property>
+			  <property name="x_options">expand|shrink|fill</property>
 			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
 
 		      <child>
-			<widget class="GtkLabel" id="label23">
+			<widget class="GtkComboBox" id="output">
 			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">_Applicability:</property>
-			  <property name="use_underline">True</property>
-			  <property name="use_markup">False</property>
-			  <property name="justify">GTK_JUSTIFY_LEFT</property>
-			  <property name="wrap">False</property>
-			  <property name="selectable">False</property>
-			  <property name="xalign">0</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			  <property name="mnemonic_widget">applicability</property>
-			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-			  <property name="width_chars">-1</property>
-			  <property name="single_line_mode">False</property>
-			  <property name="angle">0</property>
+			  <property name="items" translatable="yes"></property>
+			  <property name="add_tearoffs">False</property>
+			  <property name="focus_on_click">True</property>
+			  <signal name="focus_out_event" handler="on_output_focus_out" last_modification_time="Sun, 15 Jan 2006 12:52:08 GMT"/>
 			</widget>
 			<packing>
-			  <property name="left_attach">0</property>
-			  <property name="right_attach">1</property>
-			  <property name="top_attach">6</property>
-			  <property name="bottom_attach">7</property>
-			  <property name="x_options">fill</property>
-			  <property name="y_options"></property>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">5</property>
+			  <property name="bottom_attach">6</property>
+			  <property name="x_options">expand|shrink|fill</property>
+			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
 
@@ -708,8 +616,84 @@ All documents</property>
 			  <property name="right_attach">2</property>
 			  <property name="top_attach">6</property>
 			  <property name="bottom_attach">7</property>
-			  <property name="x_options">fill</property>
+			  <property name="x_options">expand|shrink|fill</property>
 			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkEntry" id="accelerator">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="editable">True</property>
+			  <property name="visibility">True</property>
+			  <property name="max_length">0</property>
+			  <property name="text" translatable="yes" context="yes">F7</property>
+			  <property name="has_frame">True</property>
+			  <property name="invisible_char">*</property>
+			  <property name="activates_default">False</property>
+			  <signal name="focus_out_event" handler="on_accelerator_focus_out" last_modification_time="Mon, 16 Jan 2006 00:02:25 GMT"/>
+			  <signal name="focus_in_event" handler="on_accelerator_focus_in" last_modification_time="Mon, 16 Jan 2006 00:02:39 GMT"/>
+			  <signal name="key_press_event" handler="on_accelerator_key_press" last_modification_time="Mon, 16 Jan 2006 00:02:58 GMT"/>
+			</widget>
+			<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="x_options">expand|shrink|fill</property>
+			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkEntry" id="description">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="editable">True</property>
+			  <property name="visibility">True</property>
+			  <property name="max_length">0</property>
+			  <property name="text" translatable="yes" context="yes">Run “make” in the document dir</property>
+			  <property name="has_frame">True</property>
+			  <property name="invisible_char">*</property>
+			  <property name="activates_default">False</property>
+			  <signal name="focus_out_event" handler="on_description_focus_out" last_modification_time="Fri, 13 Jan 2006 17:37:56 GMT"/>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">0</property>
+			  <property name="bottom_attach">1</property>
+			  <property name="x_options">expand|shrink|fill</property>
+			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkScrolledWindow" id="scrolledwindow3">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+			  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+			  <property name="shadow_type">GTK_SHADOW_IN</property>
+			  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+			  <child>
+			    <widget class="Custom" id="commands">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="creation_function">create_commands</property>
+			      <property name="int1">0</property>
+			      <property name="int2">0</property>
+			      <property name="last_modification_time">Thu, 23 Feb 2006 00:29:56 GMT</property>
+			    </widget>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">2</property>
+			  <property name="bottom_attach">3</property>
 			</packing>
 		      </child>
 		    </widget>
