Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/OficinaActivity.py
diff options
context:
space:
mode:
Diffstat (limited to 'OficinaActivity.py')
-rw-r--r--OficinaActivity.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/OficinaActivity.py b/OficinaActivity.py
index 75e4791..6f8c104 100644
--- a/OficinaActivity.py
+++ b/OficinaActivity.py
@@ -120,11 +120,13 @@ class OficinaActivity(activity.Activity):
def map_cp(widget):
def size_allocate_cb(widget, allocation):
- self.disconnect(self._setup_handle)
- self._setup_handle = None
+ if self._setup_handle:
+ self.disconnect(self._setup_handle)
+ self._setup_handle = None
self.area.setup(allocation.width, allocation.height)
- self.disconnect(self._setup_handle)
+ if self._setup_handle:
+ self.disconnect(self._setup_handle)
self.canvas.add_with_viewport(self.fixed)
self._setup_handle = self.fixed.connect('size_allocate',
size_allocate_cb)
@@ -136,17 +138,17 @@ class OficinaActivity(activity.Activity):
logging.debug('reading file %s', file_path)
- if self._setup_handle:
- self.disconnect(self._setup_handle)
-
pixbuf = gtk.gdk.pixbuf_new_from_file(file_path)
def size_allocate_cb(widget, allocation):
- self.disconnect(self._setup_handle)
- self._setup_handle = None
+ if self._setup_handle:
+ self.disconnect(self._setup_handle)
+ self._setup_handle = None
self.area.setup(pixbuf.get_width(), pixbuf.get_height())
self.area.loadImageFromJournal(pixbuf)
+ if self._setup_handle:
+ self.disconnect(self._setup_handle)
self.canvas.add_with_viewport(self.fixed)
self._setup_handle = self.fixed.connect('size_allocate',
size_allocate_cb)