* src/Report.py: change from gtk.FILE_CHOOSER_CREATE_FOLDER to

gtl.FILE_CHOOSER_SELECT_FOLDER. GTK documentation error.


svn: r5499
This commit is contained in:
Don Allingham 2005-12-07 18:37:24 +00:00
parent ee63ee0204
commit f357f5e607
2 changed files with 17 additions and 3 deletions

View File

@ -7,6 +7,8 @@
slashes to prevent collision with the ISO format.
2005-12-07 Don Allingham <don@gramps-project.org>
* src/Report.py: change from gtk.FILE_CHOOSER_CREATE_FOLDER to
gtl.FILE_CHOOSER_SELECT_FOLDER. GTK documentation error.
* src/plugins/NavWebPage.py: restore .tar.gz archive option
2005-12-07 Jérôme Rapinat <romjerome@yahoo.fr>

View File

@ -62,14 +62,26 @@ class FileEntry(gtk.HBox):
self.pack_end(self.button,False,False)
def select_file(self,obj):
if self.dir:
my_action = gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER
else:
my_action = gtk.FILE_CHOOSER_ACTION_SAVE
f = gtk.FileChooserDialog(self.title,
action=gtk.FILE_CHOOSER_ACTION_SAVE,
action=my_action,
buttons=(gtk.STOCK_CANCEL,
gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN,
gtk.RESPONSE_OK))
f.set_current_name(os.path.basename(self.entry.get_text()))
name = os.path.basename(self.entry.get_text())
if self.dir:
if os.path.isdir(name):
f.set_current_name(name)
elif os.path.isdir(os.path.basename(name)):
f.set_current_name(os.path.basename(name))
else:
f.set_current_name(name)
f.set_current_folder(self.spath)
status = f.run()
if status == gtk.RESPONSE_OK:
@ -93,7 +105,7 @@ class FileEntry(gtk.HBox):
return self.entry.get_text()
def set_directory_entry(self,opt):
self.dir = False
self.dir = opt