Changed default directories for:
* Load dataset * Import annotations * Export annotations to the correct directories in the current project.
This commit is contained in:
parent
ec71cbd7d7
commit
ed486ddf2e
|
@ -132,9 +132,11 @@ if __name__ == '__main__':
|
||||||
print "error: project directory not found: %s" % prjroot
|
print "error: project directory not found: %s" % prjroot
|
||||||
print "notice: use the -n option to make a new project"
|
print "notice: use the -n option to make a new project"
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
proj = project.Project(prjroot)
|
||||||
|
main.project = proj
|
||||||
|
|
||||||
main.set_application(app)
|
main.set_application(app)
|
||||||
main.set_projectview(projectview.ProjectView(prjroot))
|
main.set_projectview(projectview.ProjectView(proj))
|
||||||
|
|
||||||
app.set_projectview(main.projectview)
|
app.set_projectview(main.projectview)
|
||||||
app.show()
|
app.show()
|
||||||
|
|
|
@ -304,7 +304,7 @@ class NavigatorMenu(gtk.Menu):
|
||||||
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
|
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
|
||||||
gtk.STOCK_OPEN, gtk.RESPONSE_OK)
|
gtk.STOCK_OPEN, gtk.RESPONSE_OK)
|
||||||
dialog.set_select_multiple(True)
|
dialog.set_select_multiple(True)
|
||||||
dialog.set_current_folder(main.options.datadir)
|
dialog.set_current_folder(main.project.datadir)
|
||||||
|
|
||||||
retval = dialog.run()
|
retval = dialog.run()
|
||||||
if retval in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
|
if retval in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
|
||||||
|
|
|
@ -13,7 +13,7 @@ class ProjectView:
|
||||||
navigator.
|
navigator.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, project_dir):
|
def __init__(self, proj):
|
||||||
self.data_tree = gtk.TreeStore(str,
|
self.data_tree = gtk.TreeStore(str,
|
||||||
str,
|
str,
|
||||||
object,
|
object,
|
||||||
|
@ -22,7 +22,7 @@ class ProjectView:
|
||||||
gobject.TYPE_OBJECT,
|
gobject.TYPE_OBJECT,
|
||||||
float)
|
float)
|
||||||
|
|
||||||
self.project = project.Project(project_dir)
|
self.project = proj
|
||||||
self.dim_names = []
|
self.dim_names = []
|
||||||
self._selection_observers = []
|
self._selection_observers = []
|
||||||
self._dataset_observers = []
|
self._dataset_observers = []
|
||||||
|
|
|
@ -176,6 +176,7 @@ class IdListController:
|
||||||
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
|
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
|
||||||
gtk.STOCK_OPEN, gtk.RESPONSE_OK)
|
gtk.STOCK_OPEN, gtk.RESPONSE_OK)
|
||||||
dialog.set_select_multiple(True)
|
dialog.set_select_multiple(True)
|
||||||
|
dialog.set_current_folder(main.project.anndir)
|
||||||
retval = dialog.run()
|
retval = dialog.run()
|
||||||
if retval in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
|
if retval in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
|
||||||
pass
|
pass
|
||||||
|
@ -192,6 +193,7 @@ class IdListController:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
dialog = gtk.FileChooserDialog('Load annotations')
|
dialog = gtk.FileChooserDialog('Load annotations')
|
||||||
|
dialog.set_current_folder(main.project.exportdir)
|
||||||
dialog.set_action(gtk.FILE_CHOOSER_ACTION_SAVE)
|
dialog.set_action(gtk.FILE_CHOOSER_ACTION_SAVE)
|
||||||
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
|
dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
|
||||||
gtk.STOCK_SAVE, gtk.RESPONSE_OK)
|
gtk.STOCK_SAVE, gtk.RESPONSE_OK)
|
||||||
|
|
Reference in New Issue