meld r1053 - in trunk: . glade2
- From: stevek svn gnome org
- To: svn-commits-list gnome org
- Subject: meld r1053 - in trunk: . glade2
- Date: Thu, 25 Sep 2008 22:32:05 +0000 (UTC)
Author: stevek
Date: Thu Sep 25 22:32:05 2008
New Revision: 1053
URL: http://svn.gnome.org/viewvc/meld?rev=1053&view=rev
Log:
Bug 542817 â Insert spaces instead of tabs (Yaniv Kamay)
Modified:
trunk/filediff.py
trunk/glade2/meldapp.glade
trunk/meldapp.py
Modified: trunk/filediff.py
==============================================================================
--- trunk/filediff.py (original)
+++ trunk/filediff.py Thu Sep 25 22:32:05 2008
@@ -96,6 +96,8 @@
for v in self.textview:
v.set_buffer( gsv.SourceBuffer() )
v.set_show_line_numbers(self.prefs.show_line_numbers)
+ v.set_insert_spaces_instead_of_tabs(self.prefs.spaces_instead_of_tabs)
+ v.set_tabs_width(self.prefs.tab_size)
self.keymask = 0
self.load_font()
self.deleted_lines_pending = -1
@@ -297,6 +299,9 @@
tabs.set_tab(i, pango.TAB_LEFT, i*value*self.pango_char_width)
for i in range(3):
self.textview[i].set_tabs(tabs)
+ if sourceview_available:
+ for t in self.textview:
+ t.set_tabs_width(value)
elif key == "use_custom_font" or key == "custom_font":
self.load_font()
elif key == "show_line_numbers":
@@ -314,6 +319,10 @@
self._update_regexes()
elif key == "edit_wrap_lines":
[t.set_wrap_mode( self.prefs.edit_wrap_lines ) for t in self.textview]
+ elif key == "spaces_instead_of_tabs":
+ if sourceview_available:
+ for t in self.textview:
+ t.set_insert_spaces_instead_of_tabs(value)
def on_key_press_event(self, object, event):
x = self.keylookup.get(event.keyval, 0)
Modified: trunk/glade2/meldapp.glade
==============================================================================
--- trunk/glade2/meldapp.glade (original)
+++ trunk/glade2/meldapp.glade Thu Sep 25 22:32:05 2008
@@ -891,6 +891,22 @@
</packing>
</child>
<child>
+ <widget class="GtkCheckButton" id="checkbutton_spaces_instead_of_tabs">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Insert spaces instead of tabs</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_checkbutton_spaces_instead_of_tabs_toggled"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkHBox" id="hbox38">
<property name="visible">True</property>
<child>
@@ -920,7 +936,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -936,7 +952,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -952,7 +968,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -968,7 +984,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</widget>
Modified: trunk/meldapp.py
==============================================================================
--- trunk/meldapp.py (original)
+++ trunk/meldapp.py Thu Sep 25 22:32:05 2008
@@ -236,10 +236,16 @@
self.radiobutton_gnome_font.set_active(1)
self.fontpicker.set_font_name( self.prefs.custom_font )
self.spinbutton_tabsize.set_value( self.prefs.tab_size )
+ if sourceview_available:
+ self.checkbutton_spaces_instead_of_tabs.set_active( self.prefs.spaces_instead_of_tabs )
+ self.checkbutton_show_line_numbers.set_active( self.prefs.show_line_numbers )
+ self.checkbutton_use_syntax_highlighting.set_active( self.prefs.use_syntax_highlighting )
+ else:
+ self.checkbutton_spaces_instead_of_tabs.set_sensitive(False)
+ self.checkbutton_show_line_numbers.set_sensitive(False)
+ self.checkbutton_use_syntax_highlighting.set_sensitive(False)
self.option_wrap_lines.set_history( self.prefs.edit_wrap_lines )
self.checkbutton_supply_newline.set_active( self.prefs.supply_newline )
- self.checkbutton_show_line_numbers.set_active( self.prefs.show_line_numbers )
- self.checkbutton_use_syntax_highlighting.set_active( self.prefs.use_syntax_highlighting )
self.editor_command[ self.editor_radio_values.get(self.prefs.edit_command_type, "internal") ].set_active(1)
self.gnome_default_editor_label.set_text( "(%s)" % " ".join(self.prefs.get_gnome_editor_command([])) )
self.custom_edit_command_entry.set_text( " ".join(self.prefs.get_custom_editor_command([])) )
@@ -281,6 +287,10 @@
self.prefs.use_custom_font = custom
def on_spinbutton_tabsize_changed(self, spin):
self.prefs.tab_size = int(spin.get_value())
+ def on_checkbutton_spaces_instead_of_tabs_toggled(self, check):
+ self.prefs.spaces_instead_of_tabs = check.get_active()
+ if check.get_active() and not sourceview_available:
+ misc.run_dialog(_("Spaces instead of_tab is only available if you have gnome-python-desktop installed.") )
def on_option_wrap_lines_changed(self, option):
self.prefs.edit_wrap_lines = option.get_history()
def on_checkbutton_supply_newline_toggled(self, check):
@@ -417,6 +427,7 @@
"use_custom_font": prefs.Value(prefs.BOOL,0),
"custom_font": prefs.Value(prefs.STRING,"monospace, 14"),
"tab_size": prefs.Value(prefs.INT, 4),
+ "spaces_instead_of_tabs": prefs.Value(prefs.BOOL, False),
"show_line_numbers": prefs.Value(prefs.BOOL, 0),
"use_syntax_highlighting": prefs.Value(prefs.BOOL, 0),
"edit_wrap_lines" : prefs.Value(prefs.INT, 0),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]