.. introduce concept of configChanged(what) to
pass details of what config has been changed
.. fixed zones changes to re-read after write
to correct the save twice to get changes to
zones bug.
.. next parts need to spot changes (part 2) and
then action appropriately (part 3)
... the .toUTF8() conversion used with QT5.3.x to handle special
characters (e.g. german Umlaute) in column chooser does not work for QT
4.8.6 (at least not for the Windows) - as a result (Drag&Drop from those
fields into Columns or Search Field is not working)
... following the approach other places, changed approach to
"serialization" of the info for "Drag&Drop" - so work independent on any
QT conversions (which seem to depend on other conditions - change over
time)
... have the same consistent handling for (TM) at all visible places
... do not allow Translation of BikeScore (since it's a TM and might
cause unexpected behavior)
... Have (TM) sign everwhere visible - only in Searches just use
"BikeScore" as Symbol
... allow/use only internal field names (delivered by Column Chooser) in
Data Filter expressions
... multipe tr()
(cherry picked from commit bc4164adab74dd82c0a0307d7d0fbb736f95ef0d)
Split the views in MainWindow into separate classes;
* Tab is a collection of the 4 main views
* TabView is a base class for all of the 4 view types
* {Analysis,Train,Diary,Home}View are all derived from
TabView and deal with specifics of those views (e.g.
Diary/Home worry about date ranges).
We should be ready to move to tabbed athletes soon.
There are a few nits left for this part of the refactor
that will need to be resolved in some fixups over the
next few days;
* tile mode segment selector has wrong segment selected
when the view is in tile mode.
* Minimum height/width of MainWindow is large for some
reason
* the Train view controls (play, ffwd etc) have nowhere
to go at present -- need to fix that !!!
* When you resize the mainwindow width the sidebars expand
and should remain a fixed width
* not sure if it will build on Windows or Mac!
Moving the code intertwined into MainWindow for
the analysis view sidebar; activity list, intervals
and calendar into a new AnalysisSidebar class.
WARNING!
This is a work in progress checkpoint commit
as the sidebar menus and context menus have
not yet been migrated out -- this will be done
in the next commit or two.
.. Minor oopsie with references to context->mainWindow->athlete
instead of simply context->athlete.
The MainWindow refactor will be complete when references to
the mainWindow class is for gui reasons only.
Decoupled classes from MainWindow to reference Context
and Athlete (and introduced a couple of new headers).
We no longer pass around a MainWindow pointer to children
but pass a context instead.
There are still a few pieces left in MainWindow that need
to move to a better place;
* Setting/clearing filter selection
* Working with Intervals
* Adding/Deleting Rides
* Save on Exit
As mentioned previously there are lots of other parts to
this refactor left to do;
* break MainWindow Gui elements into Toolbar and Views
* migrate from RideItem and Ridelist to ActivityCollection
and Activity classes that are not tied into gui elements.
* introduce Application Context and AthleteCollection
Breaking the MainWindow 'god object' into
separate classes for Athlete and Context.
Further updates will need to;
- break MainWindow Gui elements into Toolbar and Views
- migrate from RideItem and Ridelist to ActivityCollection
and Activity classes that are not tied into gui elements.
- introduce Application Context and AthleteCollection
Once these are done we will be in a position to decouple
most classes from mainwindow and also introduce tabbed
athletes.
Because the chart settings are modal its a really bad
idea to open up a column chooser from there. So, by
default, we don't have a column chooser option on the
search/filter box -- it must be explicitly requested.
We therefore explicity set the column chooser from the
mainwindow and also from the ride navigator window.
.. by highlighting chart title too if a filter is
being applied.
This is important to warn users that the data being plotted
is adjusted to the search/filter (either globally or in the
chart settings).
Search box gets a focus and the calendar highlighting uses
the default palette highlight -- only good for new installs
or if the user resets their colors but at least it now does
the right thing.
Need to test and fixup on Mac and Windows.
When the user free text searches or applies a data filter in
the top right toolbar search box it gets applied to any charts
that plot data from many rides, including;
- CP curve
- Calendar
- Histogram
- LTM
- TreeMap
- Summary
I need to update on a Mac to no longer use a Mac text search box
but now use a search filter box on the top right.
.. akin to the Mac look and feel
.. still needs a bit of cosmetic work, but basically sound
.. also added in fixes to native file imports
Fixes#404Fixes#504
Use the wrong stylesheet and are hard to read. This adjusts
tooltip and menu to make them more readable but may not be
ideal for those with heavily customised setups.
The named search dialog box uses the same style sheet as
the search box, which looks odd in a dialog box.
This patch ensures the stylesheet is only applied to the
search box and not any children.
The sidebar elements all get a blue focus rectangle on
Mac OSX. This is a platform specific setting. This patch
removes the focus rectangle for sidebar components only.
Last part of the search/filter functionality;
* SearchBox now incorporates filter and search
with a new widget. We can update this widget
to include more fancy UI/Interactions without
having to change the ride list or charts etc.
* Added search/filter widget to the relevant charts
and screens; Metrics, TreeMap, CP, Histogram,
Activity Log, Ride list (refactored out of MainWindow)
* Added namedsearches.xml and adding/selecting them
from a drop down menu on the search box.
* Fixed some performance bugs related to duplicate
signals and redraw/reprocessing. Also ensured that
CLucene remains optional -- but means no search or
filter functionality unless it is available.
Added evaluation of filters and integrated with the ride list, this
means the user can filter the rides listed.
Additionally the search box will highlight the filter in red if
it doesn't parse correctly, and a tooltip describes the errors.
Part 1 of Data filtering, this patch adds the ability
to enter and parse filter statements in the search box
(by clicking on the magnifying glass it becomes a filter
box).
The statements can reference metrics and metadata fields
allowing the user to define boolean expressions to filter
data. An example of the syntax;
Average_Power > 200 and Duration > 3600
This references the metric Average_Power and ride Duration. But
will also support operations on metadata fields, for example;
Workout_Code endsWith "SST"
The operators are;
= <> > >= < <= matches contains endswith beginswith
( ) && and || or
Filters are syntactically and semantically validated. But at
this point the resulting tree is not evaluated, i.e. we can
parse the filters, but do not execute them.
Two further updates are pending (once written and tested):
- Part 2 of 3 : Execute filters and apply to the ride list
- Part 3 of 3 : Allow named filters and apply to LTM charts
Further updates will support a visual editor and allowing filters
to be applied to CP and Histogram charts and affect the PMC stress
calculators.
1. Use the whitespace analyzer so its easier to search for
tokens that are a mix of letters and numbers e.g. workout
codes and TT route names.
2. Search as you type. Since we have very small collections
to search across (typically no more than a couple of thousand)
there is no major overhead in searching as you type.
3. Search all texts by default not just the Notes field. This is
a more appropriate default and is less likely to confuse new
users. In addition, it is most likely what most users want to
do anyway.