Added a singleton project in the project module, so that the current project is
easily accessible from anywhere in the code. As there is only one project at any given time this should not be a problem. The Gene Ontology browser needed this to be able to set the selection without passing the current project through several constructors. Added a context menu in the GO browser that allows the user to select all GO terms in the subgraph that starts on the current node.
This commit is contained in:
+6
-5
@@ -197,12 +197,13 @@ class FluentApp:
|
||||
tb = ViewFrameToolButton()
|
||||
self['toolbar'].add(tb)
|
||||
|
||||
def set_project(self, project):
|
||||
def set_project(self, proj):
|
||||
logger.log('notice', 'Creating a new project')
|
||||
self.project = project
|
||||
self.workflow.add_project(self.project)
|
||||
self.navigator_view.add_project(self.project)
|
||||
self.dimlistcontroller.set_project(project)
|
||||
self.project = proj
|
||||
project.project = proj
|
||||
self.workflow.add_project(proj)
|
||||
self.navigator_view.add_project(proj)
|
||||
self.dimlistcontroller.set_project(proj)
|
||||
|
||||
def set_workflow(self, workflow):
|
||||
self.workflow = workflow
|
||||
|
||||
@@ -135,3 +135,8 @@ class Project:
|
||||
def set_current_data(self, obj):
|
||||
self.current_data = obj
|
||||
|
||||
|
||||
## Singleton project.
|
||||
## This is the current and only project in the application.
|
||||
project = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user