[pitivi] Remove the extra HPaned when bringing cliproperties in a new window
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Remove the extra HPaned when bringing cliproperties in a new window
- Date: Wed, 22 Sep 2010 13:43:37 +0000 (UTC)
commit bcaac99c9471631f32212c1f9a5e16563c6c3b68
Author: Thibault Saunier <tsaunier gnome org>
Date: Tue Jul 27 15:55:41 2010 +0200
Remove the extra HPaned when bringing cliproperties in a new window
pitivi/ui/basetabs.py | 26 +++++++++++++++++++++++++-
pitivi/ui/mainwindow.py | 31 ++++++++++++++++---------------
2 files changed, 41 insertions(+), 16 deletions(-)
---
diff --git a/pitivi/ui/basetabs.py b/pitivi/ui/basetabs.py
index 97f337a..6cfcf0e 100644
--- a/pitivi/ui/basetabs.py
+++ b/pitivi/ui/basetabs.py
@@ -23,12 +23,14 @@ import gtk
from pitivi.ui.common import SPACING
class BaseTabs(gtk.Notebook):
- def __init__(self):
+ def __init__(self, app, hide_hpaned=False):
""" initialize """
gtk.Notebook.__init__(self)
self.set_border_width(SPACING)
self.connect("create-window", self._createWindowCb)
+ self._hide_hpaned = hide_hpaned
+ self.app = app
self._createUi()
def _createUi(self):
@@ -59,6 +61,9 @@ class BaseTabs(gtk.Notebook):
self._set_child_properties(child, label)
self.child_set_property(child, "detachable", True)
+ if self._hide_hpaned:
+ self._showSecondHpanedInMainWindow()
+
def _createWindowCb(self, from_notebook, child, x, y):
original_position = self.child_get_property(child, "position")
label = self.child_get_property(child, "tab-label")
@@ -75,4 +80,23 @@ class BaseTabs(gtk.Notebook):
# set_uposition is deprecated but what should I use instead?
window.set_uposition(x, y)
+ if self._hide_hpaned:
+ self._hideSecondHpanedInMainWindow()
+
return notebook
+
+ def _hideSecondHpanedInMainWindow(self):
+ self.app.gui.mainhpaned.remove(self.app.gui.secondhpaned)
+ self.app.gui.secondhpaned.remove(self.app.gui.projecttabs)
+ self.app.gui.secondhpaned.remove(self.app.gui.propertiestabs)
+ self.app.gui.mainhpaned.pack1(self.app.gui.projecttabs, resize= True,
+ shrink=False)
+
+ def _showSecondHpanedInMainWindow(self):
+ self.app.gui.mainhpaned.remove(self.app.gui.projecttabs)
+ self.app.gui.secondhpaned.pack1(self.app.gui.projecttabs,
+ resize= True, shrink=False)
+ self.app.gui.secondhpaned.pack2(self.app.gui.propertiestabs,
+ resize= True, shrink=False)
+ self.app.gui.mainhpaned.pack1(self.app.gui.secondhpaned,
+ resize= True, shrink=False)
diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index f987cc1..c29f969 100644
--- a/pitivi/ui/mainwindow.py
+++ b/pitivi/ui/mainwindow.py
@@ -403,35 +403,36 @@ class PitiviMainWindow(gtk.Window, Loggable):
vpaned.pack2(self.timeline, resize=True, shrink=False)
self.timeline.show()
- mainhpaned = gtk.HPaned()
- vpaned.pack1(mainhpaned, resize=True, shrink=False)
+ self.mainhpaned = gtk.HPaned()
+ vpaned.pack1(self.mainhpaned, resize=True, shrink=False)
- hpaned = gtk.HPaned()
- mainhpaned.pack1(hpaned, resize=True, shrink=False)
- hpaned.show()
- mainhpaned.show()
+ self.secondhpaned = gtk.HPaned()
+ self.mainhpaned.pack1(self.secondhpaned, resize=True, shrink=False)
+ self.secondhpaned.show()
+ self.mainhpaned.show()
- self.projecttabs = BaseTabs()
+ self.projecttabs = BaseTabs(instance)
self.sourcelist = SourceList(instance, self.uimanager)
- self.effectlist = EffectList(instance, self.uimanager)
self.projecttabs.append_page(self.sourcelist, gtk.Label(_("Media Library")))
- self.projecttabs.append_page(self.effectlist, gtk.Label(_("Effect Library")))
self._connectToSourceList()
self.sourcelist.show()
+
+ self.effectlist = EffectList(instance, self.uimanager)
+ self.projecttabs.append_page(self.effectlist, gtk.Label(_("Effect Library")))
self.effectlist.show()
- hpaned.pack1(self.projecttabs, resize=True, shrink=False)
+ self.secondhpaned.pack1(self.projecttabs, resize=True, shrink=False)
self.projecttabs.show()
#Clips properties
- self.propertiestabs = BaseTabs()
+ self.propertiestabs = BaseTabs(instance, True)
self.clipconfig = ClipProperties(instance, self.uimanager)
self.clipconfig.project = self.project
self.propertiestabs.append_page(self.clipconfig, gtk.Label(_("Clip Properties")))
self.clipconfig.show()
- hpaned.pack2(self.propertiestabs, resize= True, shrink=False)
+ self.secondhpaned.pack2(self.propertiestabs, resize= True, shrink=False)
self.propertiestabs.show()
# Viewer
@@ -441,13 +442,13 @@ class PitiviMainWindow(gtk.Window, Loggable):
[dnd.FILESOURCE_TUPLE, dnd.URI_TUPLE],
gtk.gdk.ACTION_COPY)
self.viewer.connect("drag_data_received", self._viewerDndDataReceivedCb)
- mainhpaned.pack2(self.viewer, resize=False, shrink=False)
+ self.mainhpaned.pack2(self.viewer, resize=False, shrink=False)
self.viewer.show()
self.viewer.connect("expose-event", self._exposeEventCb)
# window and pane position defaults
- self.mainhpaned = mainhpaned
- self.hpaned = hpaned
+ self.mainhpaned = self.mainhpaned
+ self.hpaned = self.secondhpaned
self.vpaned = vpaned
height = -1
width = -1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]