From 3e6fd0028612154aee4bac043dce938b67c0e4be Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Wed, 15 Jul 2015 19:53:48 +0100 Subject: [PATCH] Remove redundant code since Gtk 3.10 required --- gramps/gui/plug/export/_exportassistant.py | 3 +-- gramps/gui/views/listview.py | 2 +- gramps/gui/views/treemodels/treebasemodel.py | 4 +--- gramps/gui/widgets/interactivesearchbox.py | 6 +----- gramps/gui/widgets/multitreeview.py | 13 ------------- gramps/plugins/tool/mediamanager.py | 3 +-- 6 files changed, 5 insertions(+), 26 deletions(-) diff --git a/gramps/gui/plug/export/_exportassistant.py b/gramps/gui/plug/export/_exportassistant.py index f85e6291f..4125b5b05 100644 --- a/gramps/gui/plug/export/_exportassistant.py +++ b/gramps/gui/plug/export/_exportassistant.py @@ -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) diff --git a/gramps/gui/views/listview.py b/gramps/gui/views/listview.py index 856692b28..fd08bfa32 100644 --- a/gramps/gui/views/listview.py +++ b/gramps/gui/views/listview.py @@ -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 diff --git a/gramps/gui/views/treemodels/treebasemodel.py b/gramps/gui/views/treemodels/treebasemodel.py index 25d6d0502..8abfbae35 100644 --- a/gramps/gui/views/treemodels/treebasemodel.py +++ b/gramps/gui/views/treemodels/treebasemodel.py @@ -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: diff --git a/gramps/gui/widgets/interactivesearchbox.py b/gramps/gui/widgets/interactivesearchbox.py index 8b7014aeb..920ef8862 100644 --- a/gramps/gui/widgets/interactivesearchbox.py +++ b/gramps/gui/widgets/interactivesearchbox.py @@ -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) diff --git a/gramps/gui/widgets/multitreeview.py b/gramps/gui/widgets/multitreeview.py index b9f657ff4..e3e8221fa 100644 --- a/gramps/gui/widgets/multitreeview.py +++ b/gramps/gui/widgets/multitreeview.py @@ -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: diff --git a/gramps/plugins/tool/mediamanager.py b/gramps/plugins/tool/mediamanager.py index 58acf27c3..5355ce16b 100644 --- a/gramps/plugins/tool/mediamanager.py +++ b/gramps/plugins/tool/mediamanager.py @@ -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)