I’m getting some ideas together for an SMTK Project menu to consolidate the separate copies of menu code found in several plugins. The current thinking is outlined below and subject to change.
The SMTK project menu has 5 top-level items:
Project
Open Project
Recent Projects =>
New Project...
Save Project
Close Project
Applications and plugins will register their project type
The function to register a project with the menu will include arguments for:
- The project type string (e.g., “ace3p”, “truchas”, “wavetank”), which must be unique.
- A public label (“ACE3P”, “Truchas”, “OpenFOAM Wave Tank”)
- The name of the project’s “create” operation (string)
- Optional name of the project’s “read” operation (string). Default smtk::project::Read
- Optional name of the project’s “write” operation (string). Default smtk::project::Write
Future: Include the “unregister project” function. Not needed for present use cases.
Menu visibility and title depend on the number of registered projects
- If no projects are registered, the menu is not displayed.
- If one project is registered, the menu’s title is the project’s label.
- If more than one project are registered, the title reverts back to “Project”. Also the “New” item switches to a submenu with one item for each project type.
The underlying QMenu item will be accessible to application/plugin code.
This is for customization. For example, the ACE3P menu includes additional menu items “Add Stage”, “Login to NERSC”, “Submit Analysis Job”, and “Launch Remote ParaView Server”. Let’s hope everyone uses this feature with caution.
The “New Project…” item will bring up a standard dialog for setting the project directory.
It will have 3 fields for the project name, the “workspace” directory (full path), and the project directory itself (full path).
- Future: projects should be able to substitute their own dialog
- Future: if the project create dialog requires additional input besides the directory, maybe we can/should embed the operation view below the directory fields?
The SMTK project menu will enforce the “one project only” paradigm.
- The project plugin will include a static object to store the current project (publicly accessible).
- Future: add an option to relax the one-project constraint?
The SMTK project menu will replace the current “File” ==> “New Project…” menu item.
In case anyone knew that even existed…
Future: The “Recent Projects” menu should be updated to sort by project type
Because registering multiple project types is a developer use case, we can defer.