How to use the paperwork.frontend.util.actions.SimpleAction.do function in paperwork

To help you get started, we’ve selected a few paperwork examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openpaperwork / paperwork / paperwork-gtk / src / paperwork / frontend / mainwindow / docs.py View on Github external
def do(self):
        SimpleAction.do(self)

        # Open the russian dolls to retrieve the selected label.
        label_list = self.__doc_properties.lists['labels']['gui']
        selected_row = label_list.get_selected_row()
        if selected_row is None:
            logger.warning("No label selected")
            return True
        label_box = selected_row.get_children()[0]
        label_name = label_box.get_children()[2].get_text()
        label_color = label_box.get_children()[1].get_rgba().to_string()
        label = Label(label_name, label_color)

        new_label = copy(label)
        self._dialog = editor = LabelEditor(new_label)
        reply = editor.edit(self.__main_win.window)
        if reply != "ok":
github openpaperwork / paperwork / src / paperwork / frontend / mainwindow / __init__.py View on Github external
def do(self):
        SimpleAction.do(self)
        if os.name == 'nt':
            os.startfile(self.__main_win.doc.path)
            return
        Gtk.show_uri(
            self.__main_win.window.get_window().get_screen(),
            GLib.filename_to_uri(self.__main_win.doc.path),
            Gdk.CURRENT_TIME
        )
github openpaperwork / paperwork / src / paperwork / frontend / mainwindow / __init__.py View on Github external
def do(self):
        SimpleAction.do(self)
        self.__main_win.window.destroy()
github openpaperwork / paperwork / paperwork-gtk / src / paperwork / frontend / multiscan / __init__.py View on Github external
def do(self):
        SimpleAction.do(self)
        selection = self.__dialog.lists['docs']['gui'].get_selection()
        if selection is None:
            logger.warning("No doc selected")
            return
        (model, selection_iter) = selection.get_selected()
        if selection_iter is None:
            logger.warning("No doc selected")
            return
        val = model.get_value(selection_iter, 5)
        self.__dialog.removeDocButton.set_sensitive(val)
github openpaperwork / paperwork / src / paperwork / frontend / mainwindow / __init__.py View on Github external
def do(self):
        SimpleAction.do(self)
        self.__main_win.refresh_boxes()
github openpaperwork / paperwork / src / paperwork / frontend / mainwindow / __init__.py View on Github external
def do(self):
        SimpleAction.do(self)
        self.__main_win.set_layout('paged')
github openpaperwork / paperwork / src / paperwork / frontend / mainwindow / __init__.py View on Github external
def do(self):
        SimpleAction.do(self)
        self.__main_win.refresh_doc_list()

        if self.__refresh_pages:
            self.__main_win.refresh_boxes()