Comments (4)
I started to try to fix this in wip-issue34
branch on my fork but the rabbit hole goes deeper than the missing arguments. It seems that I don't really know what the restore-data
is supposed to be. I passed (send tc get-restore-data)
but this returns #f
which causes issues down the line.
from activitylog2.
My work until now is in: pmatos@f8ec5e0
from activitylog2.
Well, this is embarrassing, I didn't create a test trend chart as part of a refactoring task.
Try the patch below. restore-data
is not needed for new charts, and I simply omitted the restore-from
in the trends chart initialization. Each trends chart saves its parameters so they can be re-edited, and these parameters are in the restore-data
. The contents of the restore data is trends chart specific, so the rest of the code treats it as "almost" opaque, but it is a hash containing the parameters in the dialog box.
rkt/trend-charts/view-trends.rkt | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/rkt/trend-charts/view-trends.rkt b/rkt/trend-charts/view-trends.rkt
index 5c90b19..1b6f961 100644
--- a/rkt/trend-charts/view-trends.rkt
+++ b/rkt/trend-charts/view-trends.rkt
@@ -184,7 +184,7 @@
(define trend-chart-pane%
(class panel%
- (init-field parent info-tag trend-chart-class database restore-data)
+ (init-field parent info-tag trend-chart-class database [restore-data #f])
(super-new [parent parent] [style '(deleted)])
(define trend-chart #f)
@@ -194,7 +194,8 @@
(define (maybe-initialize)
(unless trend-chart
(set! trend-chart (new trend-chart-class [database database]))
- (send trend-chart restore-from restore-data)
+ (when restore-data
+ (send trend-chart restore-from restore-data))
(set! graph-pb (new snip-canvas% [parent this]))))
(define/public (get-name)
@@ -340,11 +341,12 @@
(define (on-new-chart)
(let ((ct (send (new new-trend-chart-dialog%) show-dialog parent)))
(when ct
- (let ((pane (let ((tc (new (tdecl-class ct) [database database])))
- (new trend-chart-pane%
- [parent trend-charts-panel]
- [info-tag (tdecl-tag ct)]
- [trend-chart tc]))))
+ (let ((pane (new trend-chart-pane%
+ [parent trend-charts-panel]
+ [info-tag (tdecl-tag ct)]
+ [trend-chart-class (tdecl-class ct)]
+ [database database]
+ [restore-data #f])))
(when (send pane interactive-setup parent)
(set! trend-charts (append trend-charts (list pane)))
(send trend-charts-panel append (send pane get-name))
from activitylog2.
I think I am going to fix this on a release-1.5-fixes
branch and release a 1.5.1 version....
from activitylog2.
Related Issues (20)
- Map widget opens too many connections ins internet. HOT 2
- User defined plot scales HOT 1
- error on activity deletion HOT 9
- In Linux, when creating a new database, an incorrect dialog (open) appears instead of correct one (save). HOT 3
- division by zero HOT 1
- Lap swimming: TRACKPOINTS are linked to wrong LENGTHS HOT 19
- bug: "bsearch: unbound identifier" HOT 2
- Contract violation in edit-lab-swim.rkt HOT 3
- Heart rate data is lost after joining or splitting a swim lap. HOT 3
- HR data is missing in Lap Summary HOT 4
- Linux: ActivityLog2 freezes HOT 6
- Error in Edit Swim lap HOT 2
- Workout files don't appear anymore on the watch after copying to Newfiles HOT 2
- Humindex HOT 2
- Make a linux build HOT 3
- crashing in charts for open water swimming activity HOT 7
- Add Garmin devices HOT 1
- Wishlist: Open water swimming data series HOT 3
- gdi32.dll on win 7 HOT 2
- CombinedPedalSmoothness XDATA Howto HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activitylog2.