[meld/deprecation-cleanup] Rename state-changed signal to avoid name clash and move to Signal
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/deprecation-cleanup] Rename state-changed signal to avoid name clash and move to Signal
- Date: Sun, 9 Dec 2018 21:31:50 +0000 (UTC)
commit 708bae3bf7eedb22ab74d97999a99603a487648b
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 9 06:46:41 2018 +1000
Rename state-changed signal to avoid name clash and move to Signal
meld/melddoc.py | 7 +++++--
meld/meldwindow.py | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/meld/melddoc.py b/meld/melddoc.py
index cbe21754..723d8ec9 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -82,13 +82,16 @@ class MeldDoc(LabeledObjectMixin, GObject.GObject):
()),
'next-diff-changed': (GObject.SignalFlags.RUN_FIRST, None,
(bool, bool)),
- 'state-changed': (GObject.SignalFlags.RUN_FIRST, None, (int, int)),
}
@GObject.Signal(name='close')
def close_signal(self, exit_code: int) -> None:
...
+ @GObject.Signal
+ def tab_state_changed(self, old_state: int, new_state: int) -> None:
+ ...
+
def __init__(self):
super().__init__()
self.scheduler = FifoScheduler()
@@ -104,7 +107,7 @@ class MeldDoc(LabeledObjectMixin, GObject.GObject):
def state(self, value):
if value == self._state:
return
- self.emit('state-changed', self._state, value)
+ self.tab_state_changed.emit(self._state, value)
self._state = value
def get_comparison(self) -> RecentType:
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index 24c43c97..bcc91c89 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -530,7 +530,7 @@ class MeldWindow(Gtk.ApplicationWindow):
page.connect("file-changed", self.on_file_changed)
page.connect("create-diff", lambda obj, arg, kwargs:
self.append_diff(arg, **kwargs))
- page.connect("state-changed", self.on_page_state_changed)
+ page.tab_state_changed.connect(self.on_page_state_changed)
page.close_signal.connect(self.page_removed)
self.notebook.set_tab_reorderable(tab_widget(page), True)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]