Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ImageViewerActivity.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ImageViewerActivity.py b/ImageViewerActivity.py
index bf73163..83940b8 100644
--- a/ImageViewerActivity.py
+++ b/ImageViewerActivity.py
@@ -26,7 +26,6 @@ from gettext import gettext as _
import time
import os
-import math
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
@@ -174,7 +173,7 @@ class ImageViewerActivity(activity.Activity):
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
- if self._object_id is None:
+ if self._object_id is None and handle.uri is None:
empty_widgets = Gtk.EventBox()
empty_widgets.modify_bg(Gtk.StateType.NORMAL,
style.COLOR_WHITE.get_gdk_color())
@@ -210,6 +209,10 @@ class ImageViewerActivity(activity.Activity):
empty_widgets.add(vbox)
empty_widgets.show_all()
self.set_canvas(empty_widgets)
+ elif handle.uri:
+ self.read_file(handle.uri)
+ self.set_canvas(self.scrolled_window)
+ self.scrolled_window.show()
else:
self.set_canvas(self.scrolled_window)
self.scrolled_window.show()
@@ -391,7 +394,7 @@ class ImageViewerActivity(activity.Activity):
del chooser
def read_file(self, file_path):
- if self._object_id is None or self.shared_activity:
+ if os.stat(file_path).st_size == 0:
# read_file is call because the canvas is visible
# but we need check if is not the case of empty file
return