Add 'Replace' action to File menu#1274
Merged
danielhrisca merged 1 commit intodanielhrisca:developmentfrom Feb 20, 2026
Merged
Conversation
Owner
|
Hello Patrick, thanks for the PR. I wish I had the patience and discipline to write PR descriptions such as yours. |
danielhrisca
approved these changes
Feb 16, 2026
84bd1de to
acfb3e7
Compare
Author
haha, thanks, I try to make things easy to review. I think I've fixed the failed tests (had to do with the unsaved-config popup). I'm not sure how to re-trigger the CI checks on the PR. Could you re-trigger those by chance? |
acfb3e7 to
d32e719
Compare
…ed display config When working with multiple MDF files that share the same signal layout, switching files while keeping the current display configuration (plot windows, selected channels, etc.) previously required multiple manual steps. The new File > Replace action (Ctrl+Shift+O) captures the current display config via to_config(), closes the old tab, and opens the selected file with display_file=config to restore the layout automatically.
d32e719 to
dfffd00
Compare
Owner
|
thanks ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ctrl+Shift+O) that swaps the current MDF file while preserving the display configuration (plot windows, selected channels, window geometry, etc.)Implementation
src/asammdf/gui/widgets/main.py:replace_file()method that:FileWidget.to_config()display_file=configto restore the layoutGuard clauses handle edge cases: no file open, not in single-file mode, user cancels dialog.
Test coverage
test/asammdf/gui/widgets/Shortcuts/test_MainWindow_Shortcuts.py— 4 new test cases inTestReplaceFile:test_replace_file_preserves_tab_positiontest_replace_file_preserves_display_configtest_replace_file_no_op_when_no_file_opentest_replace_file_no_op_when_dialog_cancelledAll 4 tests pass.
Test plan
Ctrl+Shift+O), pick a different MDF with same signal names