1
0
Fork 0

Checklists: Fix bug where first checklist has multiple pages

The change introduced in commit 8c7fc119 to go to the last checklist
on open causes a problem when the first checklist has multiple pages.
If the last opened checklist did not have multiple pages, the previous
and next page buttons are still shown.

This commit runs the same binding as used by the combo box to reset
the visibility of these buttons immediately before the page is
displayed.
This commit is contained in:
Richard Senior 2015-04-24 15:17:27 +01:00
parent 5d78ffa668
commit e177cf535a

View file

@ -214,6 +214,12 @@
}
}
}
var s = getprop("/sim/gui/dialogs/checklist/selected-checklist");
setprop("/sim/gui/dialogs/checklist/selected-checklist-max-pages", checklist_size[s]);
setprop("/sim/gui/dialogs/checklist/selected-page", 0);
setprop("/sim/gui/dialogs/checklist/next-available", 1);
setprop("/sim/gui/dialogs/checklist/selected-page-text", "1 / " ~ checklist_size[s]);
} else {
var group = gui.findElementByName(dlgRoot, "checklist-table-group");