[meld/deprecation-cleanup] melddoc: Move next-diff-changed to Signal
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/deprecation-cleanup] melddoc: Move next-diff-changed to Signal
- Date: Sun, 9 Dec 2018 21:32:15 +0000 (UTC)
commit f2887a2f17ebb0c54ffe74b9b8e861938b2b4951
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 9 07:25:58 2018 +1000
melddoc: Move next-diff-changed to Signal
meld/dirdiff.py | 4 ++--
meld/filediff.py | 4 ++--
meld/melddoc.py | 10 +++++-----
meld/meldwindow.py | 4 ++--
meld/vcview.py | 4 ++--
5 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 88ced436..c3e58d66 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -1121,7 +1121,7 @@ class DirDiff(tree.TreeviewCommon, MeldDoc, Component):
cursor_path, cursor_col = self.treeview[pane].get_cursor()
if not cursor_path:
- self.emit("next-diff-changed", False, False)
+ self.next_diff_changed_signal.emit(False, False)
self.current_path = cursor_path
return
@@ -1158,7 +1158,7 @@ class DirDiff(tree.TreeviewCommon, MeldDoc, Component):
prev, next = self.model._find_next_prev_diff(cursor_path)
self.prev_path, self.next_path = prev, next
have_next_diffs = (prev is not None, next is not None)
- self.emit("next-diff-changed", *have_next_diffs)
+ self.next_diff_changed_signal.emit(*have_next_diffs)
self.current_path = cursor_path
def on_treeview_key_press_event(self, view, event):
diff --git a/meld/filediff.py b/meld/filediff.py
index 76ace42f..c0cd67da 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -379,8 +379,8 @@ class FileDiff(MeldDoc, Component):
self.cursor.chunk = chunk
self.on_current_diff_changed()
if prev != self.cursor.prev or next_ != self.cursor.next or force:
- self.emit(
- "next-diff-changed", prev is not None, next_ is not None)
+ self.next_diff_changed_signal.emit(
+ prev is not None, next_ is not None)
prev_conflict, next_conflict = None, None
for conflict in self.linediffer.conflicts:
diff --git a/meld/melddoc.py b/meld/melddoc.py
index b3953359..4268f10d 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -72,11 +72,6 @@ class MeldDoc(LabeledObjectMixin, GObject.GObject):
"""Base class for documents in the meld application.
"""
- __gsignals__ = {
- 'next-diff-changed': (GObject.SignalFlags.RUN_FIRST, None,
- (bool, bool)),
- }
-
@GObject.Signal(name='close')
def close_signal(self, exit_code: int) -> None:
...
@@ -90,6 +85,11 @@ class MeldDoc(LabeledObjectMixin, GObject.GObject):
def file_changed_signal(self, path: str) -> None:
...
+ @GObject.Signal('next-diff-changed')
+ def next_diff_changed_signal(
+ self, have_prev: bool, have_next: bool) -> None:
+ ...
+
@GObject.Signal
def tab_state_changed(self, old_state: int, new_state: int) -> None:
...
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index eac820dd..0ca68345 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -354,8 +354,8 @@ class MeldWindow(Gtk.ApplicationWindow):
self.set_title("Meld")
if isinstance(newdoc, MeldDoc):
- self.diff_handler = newdoc.connect("next-diff-changed",
- self.on_next_diff_changed)
+ self.diff_handler = newdoc.next_diff_changed_signal.connect(
+ self.on_next_diff_changed)
else:
self.diff_handler = None
if hasattr(newdoc, 'scheduler'):
diff --git a/meld/vcview.py b/meld/vcview.py
index e7255177..957ac3b5 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -763,7 +763,7 @@ class VcView(tree.TreeviewCommon, MeldDoc, Component):
def on_treeview_cursor_changed(self, *args):
cursor_path, cursor_col = self.treeview.get_cursor()
if not cursor_path:
- self.emit("next-diff-changed", False, False)
+ self.next_diff_changed_signal.emit(False, False)
self.current_path = cursor_path
return
@@ -796,7 +796,7 @@ class VcView(tree.TreeviewCommon, MeldDoc, Component):
prev, next = self.model._find_next_prev_diff(cursor_path)
self.prev_path, self.next_path = prev, next
have_next_diffs = (prev is not None, next is not None)
- self.emit("next-diff-changed", *have_next_diffs)
+ self.next_diff_changed_signal.emit(*have_next_diffs)
self.current_path = cursor_path
def next_diff(self, direction):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]