Remove redundant code since Gtk 3.10 required

This commit is contained in:
Nick Hall 2015-07-15 19:53:48 +01:00
parent 27e6d9b2a9
commit 3e6fd00286
6 changed files with 5 additions and 26 deletions

View File

@ -160,8 +160,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
label = Gtk.Label(label=self.get_intro_text())
label.set_line_wrap(True)
label.set_use_markup(True)
if (Gtk.get_major_version(), Gtk.get_minor_version()) >= (3, 10):
label.set_max_width_chars(60)
label.set_max_width_chars(60)
image = Gtk.Image()
image.set_from_file(SPLASH)

View File

@ -633,7 +633,7 @@ class ListView(NavigationView):
if same_col:
# activate when https://bugzilla.gnome.org/show_bug.cgi?id=684558
# is resolved
if False and (Gtk.get_major_version(), Gtk.get_minor_version()) >= (3,8):
if False:
self.model.reverse_order()
else:
## GTK 3.6 rows_reordered not exposed by gi, we need to reconnect

View File

@ -736,7 +736,6 @@ class TreeBaseModel(GObject.GObject, Gtk.TreeModel):
rows_reordered, so to propagate the change to the view, you need to
reattach the model to the view.
"""
self.GTK38PLUS = (Gtk.get_major_version(), Gtk.get_minor_version()) >= (3,8)
self.__reverse = not self.__reverse
top_node = self.tree[None]
self._reverse_level(top_node)
@ -758,8 +757,7 @@ class TreeBaseModel(GObject.GObject, Gtk.TreeModel):
path = self.do_get_path(iternode)
# activate when https://bugzilla.gnome.org/show_bug.cgi?id=684558
# is resolved
if False and self.GTK38PLUS:
##rows_reordered is only exposed in gi starting GTK 3.8
if False:
self.rows_reordered(path, iter, rows)
if self.nrgroups > 1:
for child in node.children:

View File

@ -162,11 +162,7 @@ class InteractiveSearchBox():
vbox.set_border_width(3)
""" add entry """
# To be change by Gtk 3.10 SearchEntry when agreed
if (Gtk.get_major_version(), Gtk.get_minor_version()) >= (3, 6):
self._search_entry = Gtk.SearchEntry()
else:
self._search_entry = Gtk.Entry()
self._search_entry = Gtk.SearchEntry()
self._search_entry.show()
self._search_entry.connect("populate-popup", self._disable_popdown)
self._search_entry.connect("activate", self._activate)

View File

@ -43,19 +43,6 @@ class MultiTreeView(Gtk.TreeView):
self.connect('key_press_event', self.key_press_event)
self.defer_select = False
if (Gtk.get_major_version(), Gtk.get_minor_version()) < (3, 8):
__grid_lines_remove_vertical = {
Gtk.TreeViewGridLines.NONE : Gtk.TreeViewGridLines.NONE,
Gtk.TreeViewGridLines.HORIZONTAL : Gtk.TreeViewGridLines.HORIZONTAL,
Gtk.TreeViewGridLines.VERTICAL : Gtk.TreeViewGridLines.NONE,
Gtk.TreeViewGridLines.BOTH : Gtk.TreeViewGridLines.HORIZONTAL
}
def set_grid_lines(self, grid_lines):
if self.get_direction() == Gtk.TextDirection.RTL:
# Work around a gtk RTL bug, see #6871
grid_lines = MultiTreeView.__grid_lines_remove_vertical[grid_lines]
super(MultiTreeView, self).set_grid_lines(grid_lines)
def key_press_event(self, widget, event):
if event.type == Gdk.EventType.KEY_PRESS:
if event.keyval == Gdk.KEY_Delete:

View File

@ -208,8 +208,7 @@ class IntroductionPage(Gtk.Box):
label = Gtk.Label(label=self.__get_intro_text())
label.set_line_wrap(True)
label.set_use_markup(True)
if (Gtk.get_major_version(), Gtk.get_minor_version()) >= (3, 10):
label.set_max_width_chars(60)
label.set_max_width_chars(60)
self.pack_start(image, False, False, 0)
self.pack_start(label, False, False, 5)