Beispiel #1
0
 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)
Beispiel #2
0
    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)
Beispiel #3
0
	def popup_dialog(self, widget):
		'''Run a dialog to browse for a file or folder.
        Used by the 'browse' button in input forms.
        '''
		window = self.chooseFolderBttn.get_toplevel()
		title = _('Select Folder')  # T: dialog title

		dialog = FileDialog(window, title, self.chooseFolderBttn.action)
		file = dialog.run()
		if not file is None:
			self.find_widget('folderLocation').set_text(file.path)
Beispiel #4
0
	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)