def _on_append_file_activate(self, *args): """Append subtitles from file to the current project.""" gaupol.util.set_cursor_busy(self.window) dialog = gaupol.AppendDialog(self.window) gaupol.util.set_cursor_normal(self.window) response = gaupol.util.run_dialog(dialog) paths = dialog.get_filenames() encoding = dialog.get_encoding() dialog.destroy() if response != Gtk.ResponseType.OK: return if not paths: return gaupol.util.iterate_main() self.append_file(paths[0], encoding)
def setup_method(self, method): gaupol.conf.file.directory = os.getcwd() self.dialog = gaupol.AppendDialog(Gtk.Window()) self.dialog.show()