Commit de1ffdbb authored by Edward Hervey's avatar Edward Hervey

* pitivi/ui/sourcefactories.py:

Only make the remove button sensitive when there's at least one source
in the list.
* pitivi/ui/viewer.py:
Properly end drag-and-drop. This should fix some hangs after DnD.


git-svn-id: svn+ssh://svn.gnome.org/svn/pitivi/trunk@763 d3729300-e425-0410-8a4c-d956edccc248
parent 9cb02b96
2006-04-22 Edward Hervey <edward@fluendo.com>
* pitivi/ui/sourcefactories.py:
Only make the remove button sensitive when there's at least one source
in the list.
* pitivi/ui/viewer.py:
Properly end drag-and-drop. This should fix some hangs after DnD.
2006-04-21 Edward Hervey <edward@fluendo.com>
* configure.ac:
......
......@@ -153,11 +153,12 @@ class SourceListWidget(gtk.VBox):
# buttons (list/icon view, add, remove)
button = gtk.Button(stock=gtk.STOCK_ADD)
button.connect("clicked", self._addButtonClickedCb)
rbut = gtk.Button(stock=gtk.STOCK_REMOVE)
rbut.connect("clicked", self._removeButtonClickedCb)
self.rbut = gtk.Button(stock=gtk.STOCK_REMOVE)
self.rbut.connect("clicked", self._removeButtonClickedCb)
self.rbut.set_sensitive(False)
bothbox = gtk.HBox()
bothbox.pack_start(button, expand=False)
bothbox.pack_start(rbut, expand=False)
bothbox.pack_start(self.rbut, expand=False)
self.pack_start(bothbox, expand=False)
# Start up with tree view
......@@ -247,6 +248,7 @@ class SourceListWidget(gtk.VBox):
factory,
factory.name,
"<b>%s</b>" % beautify_length(factory.length)])
self.rbut.set_sensitive(True)
def _fileRemovedCb(self, unused_sourcelist, uri):
""" the given uri was removed from the sourcelist """
......@@ -257,6 +259,8 @@ class SourceListWidget(gtk.VBox):
self.storemodel.remove(piter)
break
piter = self.storemodel.iter_next(piter)
if not len(self.storemodel):
self.rbut.set_sensitive(False)
def _notMediaFileCb(self, unused_sourcelist, uri, reason):
""" The given uri isn't a media file """
......
......@@ -373,19 +373,21 @@ class PitiviViewer(gtk.VBox):
self.timelabel.set_markup("<tt>%s / %s</tt>" % (time_to_string(self.current_time), time_to_string(instance.PiTiVi.playground.current.length)))
def _dndDataReceivedCb(self, unused_widget, context, unused_x, unused_y,
selection, targetType, unused_time):
selection, targetType, ctime):
gst.info("context:%s, targetType:%s" % (context, targetType))
if targetType == dnd.TYPE_URI_LIST:
uri = selection.data.strip().split("\n")[0].strip()
elif targetType == dnd.TYPE_PITIVI_FILESOURCE:
uri = selection.data
else:
context.finish(False, False, ctime)
return
gst.info("got file:%s" % uri)
if uri in instance.PiTiVi.current.sources:
instance.PiTiVi.playground.playTemporaryFilesourcefactory(instance.PiTiVi.current.sources[uri])
else:
instance.PiTiVi.current.sources.addTmpUri(uri)
context.finish(True, False, ctime)
gst.info("end")
def _tmpIsReadyCb(self, unused_sourcelist, factory):
......
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