Commit b1beee54 authored by Edward Hervey's avatar Edward Hervey

* pitivi/playground.py:

Added "error" signal
* pitivi/ui/mainwindow.py:
Show Error dialog box on playground bus errors.
* pitivi/ui/viewer.py:
slight bug


git-svn-id: svn+ssh://svn.gnome.org/svn/pitivi/trunk@749 d3729300-e425-0410-8a4c-d956edccc248
parent 3475a3cc
2006-04-10 Edward Hervey <edward@fluendo.com>
* pitivi/playground.py:
Added "error" signal
* pitivi/ui/mainwindow.py:
Show Error dialog box on playground bus errors.
* pitivi/ui/viewer.py:
slight bug
2006-04-10 Edward Hervey <edward@fluendo.com>
* pitivi/playground.py:
......
......@@ -54,7 +54,10 @@ class PlayGround(gobject.GObject):
( gobject.TYPE_PYOBJECT, )),
"bin-removed" : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
( gobject.TYPE_PYOBJECT, ))
( gobject.TYPE_PYOBJECT, )),
"error" : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
( gobject.TYPE_STRING, gobject.TYPE_STRING ))
}
def __init__(self):
......@@ -236,6 +239,9 @@ class PlayGround(gobject.GObject):
self.emit("current-state", newstate)
elif message.type in [ gst.MESSAGE_ERROR, gst.MESSAGE_WARNING ]:
self.current.warning("%s" % message.structure.to_string())
if message.type == gst.MESSAGE_ERROR:
error, detail = message.parse_error()
self.emit("error", str(error), str(detail))
#
......
......@@ -55,6 +55,7 @@ class PitiviMainWindow(gtk.Window):
instance.PiTiVi.connect("new-project", self._newProjectCb)
instance.PiTiVi.connect("closing-project", self._closingProjectCb)
instance.PiTiVi.connect("not-project", self._notProjectCb)
instance.PiTiVi.playground.connect("error", self._playGroundErrorCb)
self.show_all()
def _setActions(self):
......@@ -147,6 +148,19 @@ class PitiviMainWindow(gtk.Window):
self.viewer.window.unfullscreen()
self.isFullScreen = False
## PlayGround callback
def _playGroundErrorCb(self, unused_playground, error, detail):
dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL,
gtk.MESSAGE_ERROR,
gtk.BUTTONS_OK,
None)
dialog.set_markup("<b>%s</b>" % error)
if detail:
dialog.format_secondary_text(detail)
dialog.show()
## UI Callbacks
def _destroyCb(self, unused_widget, data=None):
......
......@@ -229,7 +229,8 @@ class PitiviViewer(gtk.VBox):
def _showErrorDialog(self, mainreason, subreason=None):
dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL,
gtk.MESSAGE_ERROR, None)
gtk.MESSAGE_ERROR,
gtk.BUTTONS_OK, None)
dialog.set_markup("<b>%s</b>" % mainreason)
if subreason:
dialog.format_secondary_text(subreason)
......
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