Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Changed default directories for:

* Load dataset
 * Import annotations
 * Export annotations
to the correct directories in the current project.
This commit is contained in:
Einar Ryeng 2011-03-07 16:19:45 +00:00
parent ec71cbd7d7
commit ed486ddf2e
4 changed files with 8 additions and 4 deletions

View File

@ -132,9 +132,11 @@ if __name__ == '__main__':
print "error: project directory not found: %s" % prjroot
print "notice: use the -n option to make a new project"
sys.exit(2)
proj = project.Project(prjroot)
main.project = proj
main.set_application(app)
main.set_projectview(projectview.ProjectView(prjroot))
main.set_projectview(projectview.ProjectView(proj))
app.set_projectview(main.projectview)
app.show()

View File

@ -304,7 +304,7 @@ class NavigatorMenu(gtk.Menu):
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN, gtk.RESPONSE_OK)
dialog.set_select_multiple(True)
dialog.set_current_folder(main.options.datadir)
dialog.set_current_folder(main.project.datadir)
retval = dialog.run()
if retval in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:

View File

@ -13,7 +13,7 @@ class ProjectView:
navigator.
"""
def __init__(self, project_dir):
def __init__(self, proj):
self.data_tree = gtk.TreeStore(str,
str,
object,
@ -22,7 +22,7 @@ class ProjectView:
gobject.TYPE_OBJECT,
float)
self.project = project.Project(project_dir)
self.project = proj
self.dim_names = []
self._selection_observers = []
self._dataset_observers = []

View File

@ -176,6 +176,7 @@ class IdListController:
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN, gtk.RESPONSE_OK)
dialog.set_select_multiple(True)
dialog.set_current_folder(main.project.anndir)
retval = dialog.run()
if retval in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
pass
@ -192,6 +193,7 @@ class IdListController:
"""
dialog = gtk.FileChooserDialog('Load annotations')
dialog.set_current_folder(main.project.exportdir)
dialog.set_action(gtk.FILE_CHOOSER_ACTION_SAVE)
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_SAVE, gtk.RESPONSE_OK)