pitivi r1415 - trunk/pitivi/ui



Author: edwardrv
Date: Fri Nov 28 17:36:29 2008
New Revision: 1415
URL: http://svn.gnome.org/viewvc/pitivi?rev=1415&view=rev

Log:
adding code which detaches/reattaches viewer, but it is inactive for now since doing this crashes pitivi

Modified:
   trunk/pitivi/ui/mainwindow.py
   trunk/pitivi/ui/projecttabs.py
   trunk/pitivi/ui/viewer.py

Modified: trunk/pitivi/ui/mainwindow.py
==============================================================================
--- trunk/pitivi/ui/mainwindow.py	(original)
+++ trunk/pitivi/ui/mainwindow.py	Fri Nov 28 17:36:29 2008
@@ -237,42 +237,38 @@
         """ Create the graphical interface """
         self.set_title("%s v%s" % (APPNAME, pitivi_version))
         self.set_geometry_hints(min_width=800, min_height=480)
-
         self.connect("destroy", self._destroyCb)
 
+        # main menu & toolbar
         vbox = gtk.VBox(False)
         self.add(vbox)
-
         self.menu = self.uimanager.get_widget("/MainMenuBar")
         vbox.pack_start(self.menu, expand=False)
-
         self.toolbar = self.uimanager.get_widget("/MainToolBar")
-
         vbox.pack_start(self.toolbar, expand=False)
 
-
+        # timeline and project tabs
         vpaned = gtk.VPaned()
         vbox.pack_start(vpaned)
-
         self.timeline = Timeline()
-
         vpaned.pack2(self.timeline, resize=True, shrink=False)
-
         hpaned = gtk.HPaned()
         vpaned.pack1(hpaned, resize=False, shrink=True)
-
-        # source-and-effects list
         self.projecttabs = ProjectTabs()
+        hpaned.pack1(self.projecttabs, resize=True, shrink=False)
 
         # Viewer
         self.viewer = PitiviViewer()
-
         self.pitivi.playground.connect("current-changed", 
             self._currentPlaygroundChangedCb)
-
-        hpaned.pack1(self.projecttabs, resize=True, shrink=False)
         hpaned.pack2(self.viewer, resize=False, shrink=False)
+        #self.viewer.detach_button.connect("clicked", self.__windowizeViewer, 
+        #    hpaned)
+
+        # set a reasonable default
         vpaned.set_position(200)
+
+        # timeline toolbar
         # FIXME: remove toolbar padding and shadow. In fullscreen mode, the
         # toolbar buttons should be clickable with the mouse cursor at the
         # very bottom of the screen.
@@ -294,6 +290,20 @@
 
 ## PlayGround callback
 
+    def __windowizeViewer(self, button, pane):
+        # FIXME: the viewer can't seem to handle being unparented/reparented
+        pane.remove(self.viewer)
+        window = gtk.Window()
+        window.add(self.viewer)
+        window.connect("destroy", self.__reparentViewer, pane)
+        window.resize(200, 200)
+        window.show_all()
+
+    def __reparentViewer(self, window, pane):
+        window.remove(self.viewer)
+        pane.pack2(self.viewer, resize=False, shrink=False)
+        self.viewer.show()
+
     def _errorMessageResponseCb(self, dialogbox, unused_response):
         dialogbox.hide()
         dialogbox.destroy()

Modified: trunk/pitivi/ui/projecttabs.py
==============================================================================
--- trunk/pitivi/ui/projecttabs.py	(original)
+++ trunk/pitivi/ui/projecttabs.py	Fri Nov 28 17:36:29 2008
@@ -92,4 +92,3 @@
         window.remove(component)
         self.set_current_page(self.insert_page(component, label, 
             self.__full_list.index(component)))
-        self.show()

Modified: trunk/pitivi/ui/viewer.py
==============================================================================
--- trunk/pitivi/ui/viewer.py	(original)
+++ trunk/pitivi/ui/viewer.py	Fri Nov 28 17:36:29 2008
@@ -140,6 +140,12 @@
         self.timelabel.set_padding(5, 5)
         bbox.pack_start(self.timelabel, expand=False, padding=10)
 
+        # self.detach_button = gtk.Button()
+        # image = gtk.Image()
+        # image.set_from_stock(gtk.STOCK_LEAVE_FULLSCREEN,
+        #     gtk.ICON_SIZE_SMALL_TOOLBAR)
+        # self.detach_button.set_image(image)
+        # bbox.pack_end(self.detach_button, expand=False, fill=False)
 
         # drag and drop
         self.drag_dest_set(gtk.DEST_DEFAULT_DROP | gtk.DEST_DEFAULT_MOTION,
@@ -369,7 +375,6 @@
     def _forwardCb(self, unused_button):
         pass
 
-
     ## Playground callbacks
 
     def _playgroundPositionCb(self, unused_playground, unused_smartbin, pos):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]