Skip to content

Feature/ui improvements #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Aug 27, 2018
Merged

Feature/ui improvements #83

merged 20 commits into from
Aug 27, 2018

Conversation

bradyzp
Copy link
Member

@bradyzp bradyzp commented Aug 24, 2018

UI Improvements Branch

The UI Improvements branch addresses various quality-of-life improvements in the user interface.

  • Adds support for storing user settings, better tracking of recent projects, restores main-window state to last known state when launching.
  • Implements more intuitive plotting controls for the segment selection plot
  • Redesigns the workspace/tab-interface to be more extensible in the future, also adds state save/restore functionality so that individual tabs can load to their last state (i.e. plot what the user had plotted when the tab was closed)
  • Adds new Icons and cleans up the resource file. New icons are sourced from Material.io which provides open-source icon files with a uniform appearance.
  • Adds a documentation launcher action to the application, taking user directly to the DGP docs page on read-the-docs.
  • Add initial support to link gravimeter/sensor configuration to specific data-set, w/ visual display in the project tree.

Related Issues

Closes #82

bradyzp added 17 commits August 13, 2018 10:13
Rewrite the application splash widget to use QSettings to track/display recent projects. Also simplified much of the splash screen logic.
Refactor create_project_dialog sigProjectCreated signal signature.
Rename splash.py dialog to RecentProjectDialog, the project loading screen will no longer be shown by default (before the MainWindow), instead it will be displayed only if no recent projects is defined (based on user local settings).
Enhanced utility script to find/load projects from a directory location. The 'load_project_from_path' function will now iterate any JSON file in the specified path, and check for a _type property, which is then used to select the appropriate Project class to load the file.
Add simple splash screen (with placeholder image) which displays on launch.
Change application window display ordering, the old 'splash' dialog (now RecentProjectsDialog) is not displayed unless there is no saved project for the user in their local settings, and it is spawned from the MainWindow (just before the MainWindow is set to visible)
Application settings (QSettings) methods and classes moved into their own module (gui/settings.py), while some of the objects are re-exported via gui/__init__.
Add QSettings integration to MainWindow, window state/geometry is now loaded/saved on open/exit.
Update MainWindow compatibility with new RecentProjectsDialog.
Allow MainWindow to be instantiated without defining a root project. Projects are added to the window via the add_project method.
Add ability for user to open project in a new window (if there is already a project in the base MainWindow) via dialog input.
Refactor new_project_dialog/open_project_dialog methods of MainWindow to uniformly use the open_project method instead of using custom inner functions.
Add 'Recent Projects' sub-menu to the File menu, allowing users to directly open up other recent projects once the MainWindow is loaded.
Add signal to project tree-model to notify when a project is closed via the tree view.
Use new icons from material design library (Apache 2 License), uniform icon theme across application.
Update Icons enumeration, add method to automatically create new QIcon instance.
Refactor Icon Enumeration to reduce duplicated path definitions; Icon.icon() method now constructs the Qt Resource path, using the Enum value as the name/alias. The prefix can be overridden in cases where the icon comes from a separate QRC prefix.
Rename channel_select_widget -> channel_control_widgets
Complete re-write of what was ChannelSelectWidget to ChannelController. The ChannelController widget now takes ownership of a supplied plotter, and handles all user interaction (adding/removing/updating plot lines).
Merge QSettings state features into current UI working branch.
DataSets are now directly associated with their own independent tab
(instead of relying on the selected flights 'active child')
Rewrite and refactor workspace tab handling to support multiple different
'workspaces' for different objects, e.g. DataSets, Flights, and Projects.
Each controller object can have its own display tab class, enabling us to
present different workspaces depending on the context.
For example each DataSet can be opened in its own tab, allowing the user to
view/modify independent datasets from the same flight concurrently.
In future the idea will be to add controller specific features to the tabs,
the flight tab for example should have the ability to display a map with an
overlay of the flights path.
Add launcher action to help menu to load DGP documentation on read-the-docs.
Add simple about dialog to the help menu.
Enable linking (referencing) of Gravimeters to a DataSet/Controller
Add simple ComboBox dialog action on DataSetController to allow linking
Refactor add_flight_dialog to remove references to sensor linkage,
as flights do not directly associate with a sensor any longer.

Fix Dataset controller sensor linking behavior.

Change logo on recent project dialog.
Implemented a simple state save/load mechanism utilizing QSettings
enabling the application to automatically load/plot whichever
channels were active in the plot when the tab or application was
closed.
This will pave the way for a standard interface for all workspace
tabs to implement similar persistent state tracking mechanisms.
Move WorkspaceTab into workspaces/bases.py
Add SubTab base class for nested tabs in the workspace.
Define basic interface for saving/restoring persistent state of tabs
Refactor project_treemodel to simplify item_activated logic
Refactor ChannelController so that series may be added after
initialization.
Add logic to Dataset SegmentSelectTab to use a QThread to load the
dataset's DataFrame, making the launching of tabs more responsive.
Add toolbar action to LSP toolbar to toggle the visibility of data
segment selections on the plot.
Fix documentation build errors due to refactored sources
yield self.model.item(i).data(RefRole)

def last_project_path(self) -> MaybePath:
path = Path(self._settings.value(SettingsKey.LastProjectPath(), None))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path doesn't take None as an argument. Testing without any prior projects raises an exception.

@cbertinato
Copy link
Collaborator

Also, a couple of issues that came up in QA testing:

  • The new splash screen does not disappear for me when the recent project dialog comes up.

screen shot 2018-08-26 at 10 07 30 am

  • In the project tree, if no datasets have been loaded for a flight, and if I double-click 'No Data', then an exception is raised:
Traceback (most recent call last):
  File "/Users/cbertinato/Documents/Git/DGP/dgp/gui/views/project_tree_view.py", line 78, in _on_double_click
    self.model().item_activated(index)
  File "/Users/cbertinato/Documents/Git/DGP/dgp/core/controllers/project_treemodel.py", line 127, in item_activated
    self.tabOpenRequested.emit(item.uid, item)
  File "/Users/cbertinato/Documents/Git/DGP/dgp/core/controllers/datafile_controller.py", line 32, in uid
    return self._datafile.uid
AttributeError: 'NoneType' object has no attribute 'uid'

screen shot 2018-08-26 at 10 11 23 am

@cbertinato
Copy link
Collaborator

Before adding a data to a dataset I had changed the name of the dataset from the default value. Then proceeded to add a trajectory. The old name of the dataset appeared in the dialog. The import still went through with no issue.
screen shot 2018-08-26 at 10 28 59 am

@cbertinato
Copy link
Collaborator

cbertinato commented Aug 26, 2018

When I minimize the windows (in Mac OSX), and then maximize, then the project tree side bar is toggled off closed. I can bring it back with the toggle button on top. Not sure if this is an issue in Windows.

@cbertinato
Copy link
Collaborator

Also, I can't seem to get the fields from the gravity data to appear in channels boxes on the right of the plots. The issue appears also to happen for trajectory, but at some point the lat, lon, and height fields did appear, though I don't recall what series of actions I made for that to happen.

Re-order splash screen finish trigger and main window visibility so
that the splash screen correctly disappears when the UI controls
have loaded.
…tion

Datafile uid property will now return None when there is no
underlying datafile (i.e. we have a placeholder controller).
Project model signal signature changed to permit None values as uid.
main.py _tab_open_requested updated to ignore requests where UID is
None.
This may (should) be changed in future to remove the confusion of
having 'empty' DataFileControllers. Perhaps by introducing a new
type of QStandardItem subclass to be used as a placeholder, which
can be replaced by a complete DFC when the data has been loaded.

Fix invalid attempt to construct a pathlib.Path object from a None
value in settings.py. Will now correctly check that the retrieved
path is not None before constructing a Path object, which otherwise
results in a TypeError.
Unsure of the root cause of this issue, but it occurs on
Linux/Windows/OSX all the same.
Using the toggleViewAction() method of QDockWidget to construct the
QAction seems to fix the issue where the DockWidget is hidden after
the Main Window has been minimized then restored.
@bradyzp
Copy link
Member Author

bradyzp commented Aug 26, 2018

Hey Chris, thanks for doing some QC and reviewing!

I've pushed up a change set which should resolve the Path issue in settings.py, the exception caused by trying to activate/double-click empty DataFiles, and the issue where the project tree/dock is being hidden after minimizing the window. Also the splash screen visibility issue should have been resolved.

The issue you point out where the DataSet name is not being updated in the import dialog, and the issue where you're not seeing the data channels appear are sort of related I think.

  • The DataSet name isn't being updated correctly because the DataSetController is being cloned for display in the import dialog. (And the clone isn't being updated yet)
  • Currently if you have a DataSet tab (with the plots) open, and then import a datafile into that dataset, there is no notification to the tab that new data has become available. If you close and reopen the tab you should see the channels.

Both of these issues are sort of related, in that there needs to be some sort of communication between the controllers and 1. any clones that they have, and 2. any UI items such as Tabs that their state has changed.
I've started working on this in a separate branch as I didn't want to pollute this one with too many changes, but basically my plan is to create a standard interface for all controllers which enables them to track (by weak-reference) any clones or references to themselves, and can then notify any referent objects of a state change.

@bradyzp bradyzp merged commit ab15bd6 into develop Aug 27, 2018
@bradyzp bradyzp deleted the feature/ui-improvements branch August 27, 2018 01:56
@bradyzp bradyzp restored the feature/ui-improvements branch August 28, 2018 21:29
@bradyzp bradyzp deleted the feature/ui-improvements branch August 28, 2018 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking: feature/ui-improvements
2 participants