mpogue2 / SquareDesk

Fully-featured music player and sequence designer, designed for square dance callers
10 stars 4 forks source link

Bug: Dance Program checkboxes are not persistent, because session_id not set properly at load time #1195

Open pkbott opened 2 weeks ago

pkbott commented 2 weeks ago

Although I can add and move between session names, NO data is saved after being checked off in check boxes.

mpogue2 commented 2 weeks ago

@pkbott The only checkboxes are in the Dance Programs tab, and that tab is not "session-aware". So, the checkboxes will not depend on the "session" you're in (as setup in the Sessions tab of Preferences).

But, having said that, the Dance Programs items (checkboxes for individual calls, and when they were taught) were supposed to be persistent at least, and they are not right now, which is a bug.

So, changing this one to a bug for now.... Thanks for the report!

mpogue2 commented 2 weeks ago

@pkbott Oh wait! The code suggests that the checkboxes ARE supposed to be session-aware already. So, you are right that they are not session-aware, but they are also not being saved or restored properly AT ALL (which might be the root of the problem). Working on it.

mpogue2 commented 2 weeks ago

OK, so the problem is this:

So, the root of the problem seems to be that the session_id is zero, until later in the startup sequence, when it switches to 9. Changing to a different dance program and back again refreshes the list, which then allows the checkboxes to display properly.

mpogue2 commented 2 weeks ago

No, actually:

mpogue2 commented 2 weeks ago

OK, the root of the problem was actually two things that I had done:

@pkbott Thanks for reporting this!

Both problems were fixed by commit: a2ec9fe25c8f2cb21aa5cd32eb9032cba6b0ee36

pkbott commented 2 weeks ago

Awesome. Looking forward to trying this feature when the next version comes out.

On Thu, Oct 10, 2024 at 9:20 PM Mike Pogue @.***> wrote:

OK, the root of the problem was actually two things that I had done:

  • When I added the "dynamic session awareness" a long time ago, I didn't set the session ID until AFTER the initial load of the Dance Program's checklist boxes. So, it used an uninitialized value of ZERO (which didn't correspond to any real Session. You could go to a different Dance Program and back again to force a refresh (and the checkboxes would show up!), but that was really non-obvious (and still a bug).
  • When I got rid of the Dance Program checklist (because nobody was using it), I had commented out some code that refreshed the checkbox list when the user makes manual changes to the Session. When I put back the Dance Program checklist, I forgot to put back those 2 lines that I had commented out. So, when the user changed Sessions manually (using the Sessions menu), no changes would be seen in the checklist.

@pkbott https://github.com/pkbott Thanks for reporting this!

Both problems were fixed by commit: a2ec9fe https://github.com/mpogue2/SquareDesk/commit/a2ec9fe25c8f2cb21aa5cd32eb9032cba6b0ee36

— Reply to this email directly, view it on GitHub https://github.com/mpogue2/SquareDesk/issues/1195#issuecomment-2406343400, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANJ7Z2WRXRU3RSB2UNQ5263Z24RWTAVCNFSM6AAAAABPV2HK2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBWGM2DGNBQGA . You are receiving this because you were mentioned.Message ID: @.***>