[pitivi] widgets: Fix methods that block/unblock signals of NumericWidget
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] widgets: Fix methods that block/unblock signals of NumericWidget
- Date: Wed, 4 Oct 2017 05:35:24 +0000 (UTC)
commit dbc2ea39e0d30fdcde721b4bd455a63e08c25cbf
Author: Suhas Nayak <suhas2go gmail com>
Date: Mon Sep 25 01:04:18 2017 +0530
widgets: Fix methods that block/unblock signals of NumericWidget
If an adjustment has not been connected yet, then the handler_id
is None. handler_block/unblock shouldn't be called in such cases.
Differential Revision: https://phabricator.freedesktop.org/D1865
pitivi/utils/widgets.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index 039006f..2f84888 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -266,10 +266,12 @@ class NumericWidget(Gtk.Box, DynamicWidget):
disable_scroll(self.spinner)
def block_signals(self):
- self.adjustment.handler_block(self.handler_id)
+ if self.handler_id:
+ self.adjustment.handler_block(self.handler_id)
def unblock_signals(self):
- self.adjustment.handler_unblock(self.handler_id)
+ if self.handler_id:
+ self.adjustment.handler_unblock(self.handler_id)
def connectValueChanged(self, callback, *args):
self.handler_id = self.adjustment.connect("value-changed", callback, *args)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]