Commit 7679f5c8 authored by Edward Hervey's avatar Edward Hervey

* pitivi/ui/actions.xml:

* pitivi/ui/mainwindow.py:
* pitivi/ui/timeline.py:
* pitivi/ui/viewer.py:
Remove gtk.Frame from useless places.
Made the timeline advanced view switcher a ToolAction and add it to the
menu and the toolbar.


git-svn-id: svn+ssh://svn.gnome.org/svn/pitivi/trunk@767 d3729300-e425-0410-8a4c-d956edccc248
parent 604fd1dc
2006-04-24 Edward Hervey <edward@fluendo.com>
* pitivi/ui/actions.xml:
* pitivi/ui/mainwindow.py:
* pitivi/ui/timeline.py:
* pitivi/ui/viewer.py:
Remove gtk.Frame from useless places.
Made the timeline advanced view switcher a ToolAction and add it to the
menu and the toolbar.
2006-04-24 Edward Hervey <edward@fluendo.com>
* pitivi/pitivi.py:
......
......@@ -13,6 +13,7 @@
</menu>
<menu action="View">
<menuitem action="FullScreen" />
<menuitem action="AdvancedView" />
</menu>
<menu action="Help">
<menuitem action="About" />
......@@ -27,5 +28,6 @@
<toolitem action="ImportSources" />
<separator />
<toolitem action="FullScreen" />
<toolitem action="AdvancedView" />
</toolbar>
</ui>
......@@ -75,15 +75,20 @@ class PitiviMainWindow(gtk.Window):
("View", None, "_View"),
("Help", None, "_Help")
]
self.toggleactions = [
("AdvancedView", None, "Advanced Vie_w", None, "Switch to advanced view", self._advancedViewCb)
]
self.actiongroup = gtk.ActionGroup("mainwindow")
self.actiongroup.add_actions(self.actions)
self.actiongroup.add_toggle_actions(self.toggleactions)
# deactivating non-functional actions
# FIXME : reactivate them
for action in self.actiongroup.list_actions():
if action.get_name() in ["ProjectSettings", "Quit", "File", "Help",
"About", "View", "FullScreen", "ImportSources"]:
"About", "View", "FullScreen", "ImportSources",
"AdvancedView"]:
action.set_sensitive(True)
else:
action.set_sensitive(False)
......@@ -110,12 +115,15 @@ class PitiviMainWindow(gtk.Window):
self.toolbar = self.uimanager.get_widget("/MainToolBar")
self.toolbar.set_style(gtk.TOOLBAR_ICONS)
vbox.pack_start(self.toolbar, expand=False)
vpaned = gtk.VPaned()
vbox.pack_start(vpaned)
self.timeline = TimelineWidget()
self.timeline.showSimpleView()
timelineframe = gtk.Frame()
timelineframe.add(self.timeline)
vpaned.pack2(timelineframe, resize=False, shrink=False)
......@@ -128,14 +136,12 @@ class PitiviMainWindow(gtk.Window):
# Viewer
self.viewer = PitiviViewer()
viewerframe = gtk.Frame()
viewerframe.add(self.viewer)
# connect viewer's timeline position callback to the timeline widget
self.viewer.addTimelinePositionCallback(self.timeline.timelinePositionChanged)
hpaned.pack1(self.sourcefactories, resize=False, shrink=False)
hpaned.pack2(viewerframe, resize=True, shrink=False)
hpaned.pack2(self.viewer, resize=True, shrink=False)
#application icon
self.set_icon_from_file(configure.get_global_pixmap_dir() + "/pitivi.png")
......@@ -204,6 +210,12 @@ class PitiviMainWindow(gtk.Window):
def _fullScreenCb(self, unused_action):
self.toggleFullScreen()
def _advancedViewCb(self, action):
if action.get_active():
self.timeline.showComplexView()
else:
self.timeline.showSimpleView()
def _aboutCb(self, unused_action):
abt = gtk.AboutDialog()
abt.set_name("PiTiVi")
......
......@@ -43,7 +43,6 @@ class TimelineWidget(gtk.VBox):
""" draw the GUI """
self.hadjustment = gtk.Adjustment()
self.vadjustment = gtk.Adjustment()
self.leftsizegroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
self.simpleview = SimpleTimelineContentWidget(self)
self.complexview = ComplexTimelineWidget(self)
......@@ -51,43 +50,19 @@ class TimelineWidget(gtk.VBox):
self.simpleview.connect("scroll-event", self._simpleScrollCb)
self.complexview.connect("scroll-event", self._simpleScrollCb)
hbox = gtk.HBox()
liststore = gtk.ListStore(gobject.TYPE_STRING)
combobox = gtk.ComboBox(liststore)
cell = gtk.CellRendererText()
combobox.pack_start(cell, True)
combobox.add_attribute(cell, 'text', 0)
liststore.append(["Simple View"])
liststore.append(["Complex View"])
combobox.set_active(0)
combobox.connect("changed", self._comboboxChangedCb)
self.leftsizegroup.add_widget(combobox)
hbox.pack_start(combobox, expand=False)
self.hscroll = gtk.HScrollbar(self.hadjustment)
hbox.pack_start(self.hscroll)
self.pack_end(self.hscroll, expand=False)
self.pack_end(hbox, expand=False)
self._showSimpleView()
#self._showComplexView()
def _comboboxChangedCb(self, cbox):
gst.debug("switching view")
if cbox.get_active():
self._showComplexView()
else:
self._showSimpleView()
def _showSimpleView(self):
def showSimpleView(self):
""" Show the simple timeline """
if self.complexview in self.get_children():
self.remove(self.complexview)
self.complexview.hide()
self.pack_start(self.simpleview, expand=True)
self.simpleview.show_all()
def _showComplexView(self):
def showComplexView(self):
""" Show the advanced timeline """
if self.simpleview in self.get_children():
self.remove(self.simpleview)
self.simpleview.hide()
......@@ -117,4 +92,3 @@ class SimpleTimelineContentWidget(gtk.HBox):
layoutframe = gtk.Frame()
layoutframe.add(self.timeline)
self.pack_start(layoutframe)
......@@ -142,7 +142,6 @@ class PitiviViewer(gtk.VBox):
self.pack_start(infohbox, expand=False)
# available sources combobox
infoframe = gtk.Frame()
self.sourcelist = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)
self.sourcecombobox = gtk.ComboBox(self.sourcelist)
cell = gtk.CellRendererText()
......@@ -150,17 +149,14 @@ class PitiviViewer(gtk.VBox):
self.sourcecombobox.add_attribute(cell, "text", 0)
self.sourcecombobox.set_sensitive(False)
self.sourcecombobox.connect("changed", self._comboboxChangedCb)
infoframe.add(self.sourcecombobox)
# current time
timeframe = gtk.Frame()
self.timelabel = gtk.Label()
self.timelabel.set_markup("<tt>00m00s000 / --m--s---</tt>")
self.timelabel.set_alignment(1.0, 0.5)
self.timelabel.set_padding(5, 5)
timeframe.add(self.timelabel)
infohbox.pack_start(infoframe, expand=True)
infohbox.pack_end(timeframe, expand=False)
infohbox.pack_start(self.sourcecombobox, expand=True)
infohbox.pack_end(self.timelabel, expand=False)
# drag and drop
self.drag_dest_set(gtk.DEST_DEFAULT_DROP | gtk.DEST_DEFAULT_MOTION,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment