Code Monkey home page Code Monkey logo

Comments (4)

pmatos avatar pmatos commented on June 15, 2024

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.

pmatos avatar pmatos commented on June 15, 2024

My work until now is in: pmatos@f8ec5e0

from activitylog2.

alex-hhh avatar alex-hhh commented on June 15, 2024

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.

alex-hhh avatar alex-hhh commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.