def __init__(self, widget, notebook, page): FileDialog.__init__(self, widget, _('Save Copy'), Gtk.FileChooserAction.SAVE) # T: Dialog title of file save dialog self.page = page self.filechooser.set_current_name(page.name + '.txt') self.add_shortcut(notebook, page)
def __init__(self, widget, navigation, notebook, page=None): FileDialog.__init__(self, widget, _('Import Page')) # T: Dialog title self.navigation = navigation self.notebook = notebook self.add_filter(_('Text Files'), '*.txt') # T: File filter for '*.txt' if page is not None: self.add_shortcut(notebook, page)
def __init__(self, widget, notebook, path): assert path, 'Need a page here' FileDialog.__init__(self, widget, _('Attach File'), multiple=True) # T: Dialog title self.notebook = notebook self.path = path self.add_shortcut(notebook, path) self.load_last_folder() dir = notebook.get_attachments_dir(path) if dir is None: ErrorDialog(_('Page "%s" does not have a folder for attachments') % self.path) # T: Error dialog - %s is the full page name raise Exception('Page "%s" does not have a folder for attachments' % self.path)