[meld] Remove pygtk version checks, now that we require 2.14+
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Remove pygtk version checks, now that we require 2.14+
- Date: Sat, 2 Oct 2010 20:48:22 +0000 (UTC)
commit 196290fb2066a2b3a90b3ebde5a088f4aa18a36d
Author: Kai Willadsen <kai willadsen gmail com>
Date: Mon Sep 6 09:21:47 2010 +1000
Remove pygtk version checks, now that we require 2.14+
meld/misc.py | 10 +---------
meld/preferences.py | 15 +++++++--------
meld/ui/notebooklabel.py | 9 +++------
meld/vcview.py | 3 +--
4 files changed, 12 insertions(+), 25 deletions(-)
---
diff --git a/meld/misc.py b/meld/misc.py
index 2139452..be51d3c 100644
--- a/meld/misc.py
+++ b/meld/misc.py
@@ -78,15 +78,7 @@ def run_dialog( text, parent=None, messagetype=gtk.MESSAGE_WARNING, buttonstype=
return ret
def open_uri(uri, timestamp=0):
- # TODO: should be 2.14 when released
- if gtk.pygtk_version >= (2, 13, 0):
- gtk.show_uri(gtk.gdk.screen_get_default(), uri, timestamp)
- else:
- try:
- import gnome
- gnome.url_show(uri)
- except ImportError:
- pass
+ gtk.show_uri(gtk.gdk.screen_get_default(), uri, timestamp)
# Taken from epiphany
def position_menu_under_widget(menu, widget):
diff --git a/meld/preferences.py b/meld/preferences.py
index 0d9dddb..658cc97 100644
--- a/meld/preferences.py
+++ b/meld/preferences.py
@@ -136,14 +136,13 @@ class PreferencesDialog(gnomeglade.Component):
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)
- if gtk.pygtk_version >= (2, 12, 0):
- no_sourceview_text = _("Only available if you have gnome-python-desktop installed")
- self.checkbutton_spaces_instead_of_tabs.set_tooltip_text(no_sourceview_text)
- self.checkbutton_show_line_numbers.set_tooltip_text(no_sourceview_text)
- self.checkbutton_use_syntax_highlighting.set_tooltip_text(no_sourceview_text)
+ no_sourceview_text = \
+ _("Only available if you have gnome-python-desktop installed")
+ for w in (self.checkbutton_spaces_instead_of_tabs,
+ self.checkbutton_show_line_numbers,
+ self.checkbutton_use_syntax_highlighting):
+ w.set_sensitive(False)
+ w.set_tooltip_text(no_sourceview_text)
# TODO: This doesn't restore the state of character wrapping when word
# wrapping is disabled, but this is hard with our existing gconf keys
if self.prefs.edit_wrap_lines != gtk.WRAP_NONE:
diff --git a/meld/ui/notebooklabel.py b/meld/ui/notebooklabel.py
index 4b6c0a9..c78827f 100644
--- a/meld/ui/notebooklabel.py
+++ b/meld/ui/notebooklabel.py
@@ -57,8 +57,7 @@ class NotebookLabel(gtk.HBox):
button.set_relief(gtk.RELIEF_NONE)
button.set_focus_on_click(False)
image = gtk.image_new_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU)
- if gtk.pygtk_version >= (2, 12, 0):
- image.set_tooltip_text(_("Close tab"))
+ image.set_tooltip_text(_("Close tab"))
button.add(image)
button.set_name("meld-tab-close-button")
button.set_size_request(w + 2, h + 2)
@@ -75,8 +74,7 @@ class NotebookLabel(gtk.HBox):
self.pack_start(icon, expand=False)
self.pack_start(label_box)
self.pack_start(button, expand=False)
- if gtk.pygtk_version >= (2, 12, 0):
- self.set_tooltip_text(text)
+ self.set_tooltip_text(text)
self.show_all()
self.__label = label
@@ -91,6 +89,5 @@ class NotebookLabel(gtk.HBox):
def set_label_text(self, text):
self.__label.set_text(text)
- if gtk.pygtk_version >= (2, 12, 0):
- self.set_tooltip_text(text)
+ self.set_tooltip_text(text)
diff --git a/meld/vcview.py b/meld/vcview.py
index 104856a..4b47797 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -262,8 +262,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
if valid_vcs and default_active == -1:
default_active = min(valid_vcs)
- if gtk.pygtk_version >= (2, 12, 0):
- self.combobox_vcs.set_tooltip_text(tooltip_texts[len(vcs) == 1])
+ self.combobox_vcs.set_tooltip_text(tooltip_texts[len(vcs) == 1])
self.combobox_vcs.set_sensitive(len(vcs) > 1)
self.combobox_vcs.lock = False
self.combobox_vcs.set_active(default_active)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]