[meld] newdifftab: Move to non-vendored Template usage
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] newdifftab: Move to non-vendored Template usage
- Date: Sat, 31 Aug 2019 02:06:25 +0000 (UTC)
commit 31a66b1df290246e6baa6ea7527443d28e4b35bb
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Aug 31 11:50:50 2019 +1000
newdifftab: Move to non-vendored Template usage
meld/newdifftab.py | 49 ++++++++++++++++++++++++-------------------------
1 file changed, 24 insertions(+), 25 deletions(-)
---
diff --git a/meld/newdifftab.py b/meld/newdifftab.py
index 6ef8ac1f..89659c31 100644
--- a/meld/newdifftab.py
+++ b/meld/newdifftab.py
@@ -23,7 +23,6 @@ from gi.repository import Gtk
from meld.conf import _
from meld.melddoc import LabeledObjectMixin, MeldDoc
from meld.recent import recent_comparisons
-from meld.ui._gtktemplate import Template
from meld.ui.util import map_widgets_into_lists
@@ -38,7 +37,7 @@ class DiffType(enum.IntEnum):
return self in (self.File, self.Folder)
-@Template(resource_path='/org/gnome/meld/ui/new-diff-tab.ui')
+@Gtk.Template(resource_path='/org/gnome/meld/ui/new-diff-tab.ui')
class NewDiffTab(Gtk.Alignment, LabeledObjectMixin):
__gtype_name__ = "NewDiffTab"
@@ -52,24 +51,24 @@ class NewDiffTab(Gtk.Alignment, LabeledObjectMixin):
label_text = _("New comparison")
- button_compare = Template.Child()
- button_new_blank = Template.Child()
- button_type_dir = Template.Child()
- button_type_file = Template.Child()
- button_type_vc = Template.Child()
- choosers_notebook = Template.Child()
- dir_chooser0 = Template.Child()
- dir_chooser1 = Template.Child()
- dir_chooser2 = Template.Child()
- dir_three_way_checkbutton = Template.Child()
- file_chooser0 = Template.Child()
- file_chooser1 = Template.Child()
- file_chooser2 = Template.Child()
- file_three_way_checkbutton = Template.Child()
- filechooserdialog0 = Template.Child()
- filechooserdialog1 = Template.Child()
- filechooserdialog2 = Template.Child()
- vc_chooser0 = Template.Child()
+ button_compare = Gtk.Template.Child()
+ button_new_blank = Gtk.Template.Child()
+ button_type_dir = Gtk.Template.Child()
+ button_type_file = Gtk.Template.Child()
+ button_type_vc = Gtk.Template.Child()
+ choosers_notebook = Gtk.Template.Child()
+ dir_chooser0 = Gtk.Template.Child()
+ dir_chooser1 = Gtk.Template.Child()
+ dir_chooser2 = Gtk.Template.Child()
+ dir_three_way_checkbutton = Gtk.Template.Child()
+ file_chooser0 = Gtk.Template.Child()
+ file_chooser1 = Gtk.Template.Child()
+ file_chooser2 = Gtk.Template.Child()
+ file_three_way_checkbutton = Gtk.Template.Child()
+ filechooserdialog0 = Gtk.Template.Child()
+ filechooserdialog1 = Gtk.Template.Child()
+ filechooserdialog2 = Gtk.Template.Child()
+ vc_chooser0 = Gtk.Template.Child()
def __init__(self, parentapp):
super().__init__()
@@ -95,7 +94,7 @@ class NewDiffTab(Gtk.Alignment, LabeledObjectMixin):
self.show()
- @Template.Callback()
+ @Gtk.Template.Callback()
def on_button_type_toggled(self, button, *args):
if not button.get_active():
if not any([b.get_active() for b in self.button_types]):
@@ -113,14 +112,14 @@ class NewDiffTab(Gtk.Alignment, LabeledObjectMixin):
self.diff_type.supports_blank())
self.button_compare.set_sensitive(True)
- @Template.Callback()
+ @Gtk.Template.Callback()
def on_three_way_checkbutton_toggled(self, button, *args):
if button is self.file_three_way_checkbutton:
self.file_chooser2.set_sensitive(button.get_active())
else: # button is self.dir_three_way_checkbutton
self.dir_chooser2.set_sensitive(button.get_active())
- @Template.Callback()
+ @Gtk.Template.Callback()
def on_file_set(self, filechooser, *args):
gfile = filechooser.get_file()
if not gfile:
@@ -152,7 +151,7 @@ class NewDiffTab(Gtk.Alignment, LabeledObjectMixin):
num_paths = 1
return num_paths
- @Template.Callback()
+ @Gtk.Template.Callback()
def on_button_compare_clicked(self, *args):
type_choosers = (self.file_chooser, self.dir_chooser, self.vc_chooser)
choosers = type_choosers[self.diff_type][:self._get_num_paths()]
@@ -169,7 +168,7 @@ class NewDiffTab(Gtk.Alignment, LabeledObjectMixin):
recent_comparisons.add(tab)
self.emit('diff-created', tab)
- @Template.Callback()
+ @Gtk.Template.Callback()
def on_button_new_blank_clicked(self, *args):
# TODO: This doesn't work the way I'd like for DirDiff and VCView.
# It should do something similar to FileDiff; give a tab with empty
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]