Implemented full screen viewing of image versions.
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 13 Feb 2006 20:04:25 +0000 (20:04 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 13 Feb 2006 20:04:25 +0000 (20:04 +0000)
src/gkofoto/glade/gkofoto.glade
src/packages/kofoto/gkofoto/imageversionslist.py

index 6826811..14a8b01 100644 (file)
                  </child>
 
                  <child>
+                   <widget class="GtkMenuItem" id="menubarViewImageVersionsFullScreen">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">View in _full screen</property>
+                     <property name="use_underline">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
                    <widget class="GtkMenuItem" id="menubarCopyImageVersionLocations">
                      <property name="visible">True</property>
                      <property name="label" translatable="yes">_Copy image version location(s)</property>
index fcf8b2e..a9eac8f 100644 (file)
@@ -9,6 +9,7 @@ from kofoto.gkofoto.environment import env
 from kofoto.gkofoto.menuhandler import MenuGroup
 from kofoto.gkofoto.imageversionsdialog import ImageVersionsDialog
 from kofoto.gkofoto.duplicateandopenimagedialog import DuplicateAndOpenImageDialog
+from kofoto.gkofoto.fullscreenwindow import FullScreenWindow
 
 _imageVersionTypeToStringMap = {
     ImageVersionType.Important: "Important",
@@ -42,6 +43,7 @@ class ImageVersionsList(gtk.ScrolledWindow):
 
         callbacks = [
             ("menubarViewImageVersion", self.__view_cb),
+            ("menubarViewImageVersionsFullScreen", self.__view_full_screen_cb),
             ("menubarCopyImageVersionLocations", self.__copyImageLocation_cb),
             ("menubarOpenImageVersions", self.__open_cb),
             ("menubarDuplicateAndOpenImageVersion", self.__duplicateAndOpen_cb),
@@ -107,6 +109,9 @@ class ImageVersionsList(gtk.ScrolledWindow):
             "View",
             self.__view_cb)
         menugroup.addMenuItem(
+            "View in full screen mode",
+            self.__view_full_screen_cb)
+        menugroup.addMenuItem(
             "Copy image version location(s)",
             self.__copyImageLocation_cb)
         menugroup.addStockImageMenuItem(
@@ -151,6 +156,8 @@ class ImageVersionsList(gtk.ScrolledWindow):
 
         env.widgets["menubarViewImageVersion"].set_sensitive(
             oneSelected)
+        env.widgets["menubarViewImageVersionsFullScreen"].set_sensitive(
+            not zeroSelected)
         env.widgets["menubarCopyImageVersionLocations"].set_sensitive(
             not zeroSelected)
         env.widgets["menubarOpenImageVersions"].set_sensitive(
@@ -249,6 +256,21 @@ class ImageVersionsList(gtk.ScrolledWindow):
         location = imageVersion.getLocation()
         self.__singleObjectView._loadImageAtLocation(location)
 
+    def __view_full_screen_cb(self, *args):
+        assert len(self.__selectedImageWidgets) > 0
+        widgets = self.__getSelectedImageVersionsInOrder()
+        if len(widgets) > 1:
+            imageVersions = [
+                self.__imageWidgetToImageVersion[x] for x in widgets]
+            window = FullScreenWindow(imageVersions)
+        else:
+            imageVersions = [
+                self.__imageWidgetToImageVersion[x]
+                for x in self.__imageWidgetList]
+            index = self.__imageWidgetList.index(widgets[0])
+            window = FullScreenWindow(imageVersions, index)
+        window.show_all()
+
     def __copyImageLocation_cb(self, widget, param):
         assert len(self.__selectedImageWidgets) > 0
         clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD)