Comment 1 for bug 625377

Revision history for this message
onox (onox) wrote :

Mounting could be something like this:

def mount_result(volume2, result):
    try:
        if volume2.mount_finish(result):
            uri = volume2.get_mount().get_root().get_uri()
            self.open_uri(uri)
    except glib.GError, e:
        error_dialog = self.UnableToMountErrorDialog(self.applet, volume2.get_name(), e)
        error_dialog.show_all()
volume.mount(gio.MountOperation(), mount_result)

This mounts a volume. For uris, not sure what should be used, perhaps gio.File.mount_enclosing_volume.

One could decide to remove the try-except block and just let the glib.GError propagate to higher levels. If lda shows an error dialog, it would be nice if it looks like the one from nautilus or yama.