def on_open_item_activate(self, menuitem): """ Shows a dialog to open media """ def on_uris_selected(dialog, uris): uris.reverse() if len(uris) > 0: self.controller.open_uri(uris.pop(), play=True) for uri in uris: self.controller.open_uri(uri, play=False) dialog = dialogs.MediaOpenDialog(self.window) dialog.connect('uris-selected', on_uris_selected) dialog.show()
def open_cb(*args): dialog = dialogs.MediaOpenDialog(get_main().window) dialog.connect('uris-selected', lambda d, uris: get_main().controller.open_uris(uris)) dialog.show()