Commit Graph

62 Commits

Author SHA1 Message Date
Andreas Buhr
7be3df19eb move from screen()[0] to primaryScreen() 2021-07-26 13:17:11 +02:00
Andreas Buhr
85ab8211b0 Qt6: remove QDesktopWidget usage 2021-07-26 13:11:44 +02:00
Andreas Buhr
7abac2678b Usage of QDesktopWidget is deprecated. Adapt code
This patch adapts the code to not use QDesktopWidget but to
use QGuiApplication::screens instead. It defaults to screen number 0.
2021-07-26 13:11:30 +02:00
Mark Liversedge
d83041282d User Charts and the Configured Colors - Part 2 of 2
.. themes are now either light or dark, which selects the default
   color set used to set the standard colors.

.. users can of course maintain them, but when applying a theme
   there is no need to adjust now (some of the default colors looked
   poor on a light background).

.. there is a line of code in main.cpp to dump the current colors to
   stderr so it can be cut and paste into colors.cpp -- this makes it
   much easier to use the UI to maintain colors and update the code.
   this is obviously just for developers.

.. letting users define their own themes could be done later, but feels
   like overkill at this point.
2021-05-22 15:11:20 +01:00
Michel Dagenais
c474dae4b6 Facility to trace all the USB communications (#3855)
A new logging category is added gc.usb, inactive by default, to log all the USB transfers between GC and the USB trainers. It can be activated by changing the logging filter with the --debug-rules option.
2021-04-14 21:01:44 -03:00
Michel Dagenais
58617cb165 Add debugging options to select the log file, format and rules, and redirect stderr (#3837)
* Add debugging options to select the log file, format and rules, and redirect stderr even on Windows
* unistd.h does not exist on Windows use io.h instead
* STDERR_FILENO does not exist on Windows
* Different strategies and much error checking to redirect stderr on Windows
* Synchronize cerr and stderr with filedes 2 and STD_ERROR_HANDLE
* Some functions like write in Linux and Win32 have slightly different signatures
* Code cleanup, final test to check that fd=2, stderr, qDebug and cerr are redirected
* Remove the file and line number from the default logging format in release mode
2021-03-30 13:17:18 -03:00
Ale Martinez
61b5fee924 Added Start with last opened Athlete option to config
Default is checked to preserve current behavior, when cleared
the choose athlete dialog will be presented at start.
Workout library setting was moved to Train preferences
page to reduce clutter in General settings page.
[publish binaries]
2020-12-24 11:14:32 -03:00
Mark Liversedge
fc3de5f84a No --newgui as MainWindow refactored
.. the concept of a new gui as a replacement for MainWindow was dropped
   in preference for gradually adjusting MainWindow to the new design.

.. this is still in progress, but the 'newgui' concept is dead.
2020-09-08 09:40:17 +01:00
Mark Liversedge
8b651b50dc OpenGL rendering
.. Fetch the version of OpenGL available at startup and use it in
   ChartSpace to decide if we want to enable openGL rendering.

.. some fixups for X11 builds, which are not needed on the main
   OS combinations we use (Linux, Mac, Windows) but may prove
   useful when building for X11 vs Wayland in the future
2020-09-01 15:29:37 +01:00
Ale Martinez
1a184f925d Fix Qt message handler used when API Web Service is enabled
This has been reported to produce garbled output on Windows and,
according to https://doc.qt.io/qt-5/qtglobal.html#qPrintable,
it is dangerous since the array returned by QString::toLocal8Bit()
will fall out of scope, so lets use a safer version to avoid
the risk of crashes hard to debug.
[publish binaries]
2020-08-25 14:17:30 -03:00
Ale Martinez
2a43f11c72 Revert "Windows builds log to goldencheetah.log when not debugging (#3485)"
This reverts commit 6bc48200e7.
It is crashing on Windows 8, I can't debug on that version
and it is not that useful feature, --debug gives more information.
[publish binaries]
2020-08-15 19:36:16 -03:00
Alejandro Martinez
6bc48200e7 Windows builds log to goldencheetah.log when not debugging (#3485)
Similar to Linux/macOS builds, messages are redirected to goldencheetah.log
when not output to console is requested, but instead of relying on low level
stderr redirection a message handler logging directly to the file is installed.
[publish binaries]
2020-08-10 21:21:34 -03:00
Alejandro Martinez
365848b79e On Windows attach to parent's console when no console is available
This gives a more Unix-like behavior when GC is launched from
cmd or PowerShell, including --debug output, on release builds.
Fixed #3481
[skip travis]
[publish binaries]
2020-06-05 17:59:33 -03:00
Mark Liversedge
a8473441ae GNU Scientific Library (GSL) Mandatory Dependency
.. making GSL mandatory, so we can rely on the modelling functions
   being available, amongst a few other things.

[publish binaries]
2020-05-29 15:51:58 +01:00
Alejandro Martinez
f51a6a6cb1 Remove Conditional Compilation for Qt < 5.9 (#3464)
This is a clean up to remove conditional compilation for all Qt versions
older than the last known to work: Qt 5.9 with Qt WebEngine and Qt Charts.
Includes an update note to INSTALL documents.
2020-05-27 09:26:25 -03:00
Mark Liversedge
f4fcc93693 Deprecate WebKit Support
.. The NOWEBKIT define is no longer required to build.
   We now only support building with Chromium QWebEngine
2020-05-25 09:00:36 +01:00
Mark Liversedge
c973328779 Introduce GNU Scientific Library (GSL) as an optional dependency
.. will become a first class dependency, but for now, whilst we
   update the build systems it is optional.

.. to enable update gcconfig.pri with
   DEFINES += GC_WANT_GSL  ## switch GSL support on
   GSL_INCLUDES =          ## the include path (no -I)
   GCL_LIBS =              ## -Lpath and -lgsl -lgslcblas -lm or others

.. see gcconfig.pri.in for examples, Linux has been tested.

.. to install this new depdendency:
   Linux: sudo apt-get install libgsl-dev
   MacOS: brew install gsl
   Windows: vcpkg install gsl
2020-05-06 18:32:16 +01:00
Ale Martinez
29fcc6aafe Add detailed version information to --version command line option
Similar to About > Version, used to provide more information after ci builds
Also --usage is added as synonimous for --help for completeness
2020-04-18 15:32:22 -03:00
Mark Liversedge
102b5dff15 NewMainWindow Protoyping
.. prototyping a new qmainwindow layout, will only be shown
   if you pass --newgui on the command line.

.. there will be lots of commits as this develops across
   different platforms and building blocks are put into
   place.

.. this is likely to take 2 months or more before it becomes
   something usable.

.. the --newgui is for developers only, since there will not
   be any usable functionality for quite some time.
2020-03-29 12:25:53 +01:00
riccioclista
9f1187390f Python data processors (#2951)
* Initial implementation of Python data processors
* Add RideEditor to PyFIx script editor
* Enable write-access to activity data for python fixes
* Add GC.deleteActivitySample method
* Add GC.deleteSeries method
* Check for python fix for changes before close
* Build python fixes menu dynamically
* Make python fixes first class data processors
* Add GC.postProcess method
* Check GC_WANT_PYTHON and "Enable Python" setting for python fixes
* Add GC.createXDataSeries method
* Clean up ScriptContext ctor mess
* Support editing xdata series
* PDP: Implement xdata append/remove methods
2019-12-19 22:05:51 -03:00
Ale Martinez
a9bbe5dc5a Use double division to compute dpi factors
Fixes #2628
2019-08-25 14:21:18 -03:00
Mark Liversedge
f60e28e801 CP Plot Power Profile Lines (watts only)
.. need a follow up for w/kg
2018-11-13 17:49:49 +00:00
Mark Liversedge
954570fe16 Python Embedding is optional and check install
.. make python embedding optional, if it's not installed then
   disable in preferences (new checkbox similar to R).
2018-02-05 16:27:00 +00:00
Mark Liversedge
0a8d803233 Add --no-python command line option
.. just in case.
2017-12-19 10:59:02 +00:00
Mark Liversedge
0a2ac3aa6b Start Python Embedding
.. just bootstrapping, so Python is loaded and version
   number made available in the about box.

.. see gcconfig.pri.in and src.pro for settings needed

.. not considering threading etc at this point
2017-11-22 15:50:22 +00:00
Mark Liversedge
0faf4aa617 Unset QT_SCALE_FACTOR on Linux
.. there are so many QT bugs related to this with opengl and
   other aspects of scaling we should just unset it. This is
   because we now have native support for Hi-DPI so this setting
   should not be needed anyway.
2017-06-25 12:05:47 +01:00
Mark Liversedge
8153d5a5b2 Merge pull request #2152 from antoniusriha/handle_log_redirect_properly
Close and free log file object after duplicating it
2017-04-01 22:06:58 +01:00
Keith Reynolds
cebcd9a73a Move variable into scope in which it is used. 2017-03-31 00:03:54 -06:00
Mark Liversedge
0f0f1edd02 Cloud Refactor - Add Account Wizard WIP
.. further updates, closer to being complete.
2017-03-30 19:45:48 +01:00
Mark Liversedge
787d22da5c Cloud Refactor - Factory for TodaysPlan, Google et al
.. a CloudServiceFactory now has all full cloud services
   registered for service we currently support for sync
   including; Local File Store, Dropbox, Google Drive,
   Todays Plan and SixCycle.

.. need to now refactors all the other cloud services
   to use the CloudService base class: Strava, Cycling
   Analytics, Ride With GPS, Withings, Web Calendar,
   Training Stage Buch, Selfloops, Velo hero and Sports
   Plus Health.
2017-03-25 13:12:52 +00:00
Mark Liversedge
122132e85c Hi-DPI Support - Configure Font and Scale
.. just let the user choose a font and a scale.
.. we work out the base font for the display resolution
2017-03-20 20:17:56 +00:00
Mark Liversedge
81a7c6292c Hi-DPI Support - Default Font Pointsize fixup
.. should use device independent pixels !

.. VirtualBox, Windows and Linux all use different ratios
   of device pixels to device independent pixels so its
   important we stay device independent.
2017-03-14 20:44:06 +00:00
Mark Liversedge
fbbffe83fe Hi-DPI Support - Size/Space tweaking
.. various updates to make sizing more comfortable.
2017-03-14 19:33:39 +00:00
Mark Liversedge
b92bbcfd69 Hi-DPI Support - Default font use pt
.. since we re-use it in other places.
2017-03-14 16:48:28 +00:00
Mark Liversedge
24703a1546 Hi-DPI Support - Pushbuttons and Combos
.. the padding around pushbuttons and combo boxes is not scaled
   for hidpi displays, so we fix up with a global style sheet
   in main.cpp

.. it is only applied in hi-dpi for Windows and Linux.
2017-03-13 17:00:16 +00:00
Mark Liversedge
74b4b87ba9 Hi-DPI Support - Requires QT5
.. but still compiles on QT4.8
2017-03-13 13:42:08 +00:00
Mark Liversedge
ab2a0050c3 Hi-DPI Support - Overview
.. need to check on windows where font scaling seems to have
   a number of issues.
2017-03-12 22:27:07 +00:00
Mark Liversedge
5bd31561d0 Hi-DPI Support - Use Pixel Size for Font Selection
.. when selecting a font from screen dimensions in pixels.
2017-03-12 21:36:18 +00:00
Mark Liversedge
785c8a6164 Hi-DPI Support - Startup
.. choose cyclist dialog
.. load progress
2017-03-12 18:10:30 +00:00
Mark Liversedge
e53b5279fb Hi-DPI support - set ratio and default font
.. Start of support for hi-dpi displays; only relevant if you
   are running on a hi-dpi display and have not chosen to set
   any 'auto' scaling.

.. it just sets a dialog box ratio (which is unused at this
   point) and sets the default font to something reasonable for
   the display size.

.. next steps are to check impact across Linux, Windows and
   MacOS hi-dpi displays and then work through and correct code
   that works with dialog boxes and sets widget sizes.

.. this will be a bit of a slog, but worth it for crisper
   rendering on those expensive 4k panels
2017-03-12 14:54:53 +00:00
Mark Liversedge
6271d51257 Fixup to enable build on QT 5.8 and Xcode 8.1
.. remove all custom widgets and prepare for next commit that
   replaces use of QTKit with AV Foundation on MacOS
2016-11-20 14:52:34 +00:00
Antonius Riha
993a7312ea Close log file descriptor after duplicating it 2016-10-26 20:00:40 +02:00
Antonius Riha
5e26607b7c Free application object before returning from main 2016-10-25 18:48:43 +02:00
Mark Liversedge
2872c82f22 REST API disabled by default
.. if the setting has not been made in options/prefs we
   set the API web services to be disabled.

.. this is to stop warning messages about windows firewall
   that will appear, and also to reflect the fact that
   the majority of users will likely not require the
   web services anyway.
2016-09-27 08:18:49 +01:00
Mark Liversedge
035da9cd7a Hack in main.cpp for metric documentation
.. disabled by default, but can run to get a list
   of metrics and their descriptions to update the wiki
2016-07-23 10:37:07 +01:00
Mark Liversedge
8bfcfbd64b R R_HOME configuration improvements
.. Add option to disable embedded R in preferences

.. Better diagnostics if load fails

.. If we find it in the usual place we load and set R_HOME
   automatically without requiring R_HOME or config

.. The config option overrides R_HOME not the other way around
2016-05-16 11:32:11 +01:00
Mark Liversedge
0620b42866 R Command Line Option --no-r
.. to disable embedded R - useful if startup is causing
   issues or crashes.
2016-04-29 20:44:19 +01:00
Mark Liversedge
b78e3a7b7c R argv/verbose clean up
.. didn't use argc/argv in R initialisation
.. accidentally enabled verbosity
2016-04-28 19:20:43 +01:00
Mark Liversedge
76686d8128 R OSX fixups for no RInside/Rcpp
.. mostly startup issues when R_HOME is not known

.. need to think carefully about how we get the user to
   register the R home. We could let them select the R
   binary so we can run `R RHOME` and apply that (?)
2016-04-27 20:55:02 +01:00
Mark Liversedge
cc3a449d2a R Preferences set R_HOME
.. allow the user to browse and set the home directory for
   the R install -- in preparation for replacing Rinside with
   our own code to embed R
2016-04-27 12:31:23 +01:00