Skip to content

Prevent opening the same module twice - #439

Open
plopaur wants to merge 1 commit into
csete:masterfrom
plopaur:fix/duplicate-modules
Open

plopaur wants to merge 1 commit into
csete:masterfrom
plopaur:fix/duplicate-modules

Conversation

@plopaur

@plopaur plopaur commented Oct 30, 2026

Copy link
Copy Markdown

Opening a module that is already open created a second copy that shared the same .mod file. Both copies wrote their settings on exit, so the last one saved won, and both names were stored in OPEN_MODULES in the gpredict.cfg file. The duplicate was then restored on every start.

Two copies of a module also meant two map views, which is how the crash when closing one of several map views was found. That crash is fixed separately by #438 "Fix crash when closing one of several map views".

When a module that is already open is selected in File > Open, bring it to the front instead of opening a second copy. When restoring the open modules on startup, skip names that appear more than once, so existing configs with duplicates are repaired.

Opening a module that is already open created a second copy that
shared the same .mod file. Both copies wrote their settings on exit,
so the last one saved won, and both names were stored in OPEN_MODULES.
The duplicate was then restored on every start.

Two copies of a module also meant two map views, which is how the
crash when closing one of several map views was found. That crash is
fixed separately by "Fix crash when closing one of several map views".

When a module that is already open is selected in File > Open, bring
it to the front instead of opening a second copy. When restoring the
open modules on startup, skip names that appear more than once, so
existing configs with duplicates are repaired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant