From ed486ddf2e8497418acb0c176d48755c3ed824bd Mon Sep 17 00:00:00 2001 From: einarr Date: Mon, 7 Mar 2011 16:19:45 +0000 Subject: [PATCH] Changed default directories for: * Load dataset * Import annotations * Export annotations to the correct directories in the current project. --- bin/laydi | 4 +++- laydi/navigator.py | 2 +- laydi/projectview.py | 4 ++-- laydi/selections.py | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/laydi b/bin/laydi index a659747..04882b9 100755 --- a/bin/laydi +++ b/bin/laydi @@ -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() diff --git a/laydi/navigator.py b/laydi/navigator.py index 1f52f0d..b1f7626 100644 --- a/laydi/navigator.py +++ b/laydi/navigator.py @@ -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]: diff --git a/laydi/projectview.py b/laydi/projectview.py index 024ce21..76acb52 100644 --- a/laydi/projectview.py +++ b/laydi/projectview.py @@ -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 = [] diff --git a/laydi/selections.py b/laydi/selections.py index f592e0a..6e5eb2f 100644 --- a/laydi/selections.py +++ b/laydi/selections.py @@ -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)