Skip to content

448 allow only 1 instance setting does nothing#500

Merged
Hirogen merged 15 commits intoDevelopmentfrom
448-allow-only-1-instance-setting-does-nothing
Nov 30, 2025
Merged

448 allow only 1 instance setting does nothing#500
Hirogen merged 15 commits intoDevelopmentfrom
448-allow-only-1-instance-setting-does-nothing

Conversation

@Hirogen
Copy link
Copy Markdown
Collaborator

@Hirogen Hirogen commented Nov 28, 2025

This pull request introduces improvements to the "Allow Only One Instance" feature, focusing on better handling of file loading and active window tracking, as well as enhancing test coverage for IPC and window management logic. The changes ensure that when only one instance is allowed, files are loaded into the most recently activated window, and locked windows take priority. Several new unit tests have been added to verify these behaviors and document the intended logic.

Active Window Tracking and File Loading Improvements:

  • The system now tracks the most recently activated log window using the new _mostRecentActiveWindow field in LogExpertProxy. When loading files with "Allow Only One Instance" enabled, files are loaded into this window, falling back to the most recently created window if no activation has occurred. [1] [2]
  • The NotifyWindowActivated method is added to ILogExpertProxy and implemented in LogExpertProxy, allowing UI code to inform the proxy when a window is activated. This ensures correct window selection for file loading. [1] [2]
  • The UI now calls NotifyWindowActivated in the OnLogTabWindowActivated event, enabling the new tracking mechanism.

"Allow Only One Instance" and Locked Window Logic:

  • In NewWindowOrLockedWindow, if a locked window exists, it receives the files; otherwise, files are loaded in the most recent active window instead of always creating a new window. This fixes previous issues where new windows were created unnecessarily.

Testing Enhancements:

  • New unit tests have been added for active window tracking, lock instance priority, and IPC message serialization. These tests verify correct window selection, fallback behavior, and message handling for the "Allow Only One Instance" feature. [1] [2]

Other Improvements and Maintenance:

  • The obsolete ShowErrorMessageAllowOnlyOneInstances property in Preferences is now marked as [Obsolete] and ignored by JSON serializers, as it is no longer used or saved.
  • Minor code cleanup and improved variable naming for clarity in the program entry point. [1] [2] [3]

@Hirogen Hirogen merged commit 337cac1 into Development Nov 30, 2025
1 check passed
@Hirogen Hirogen deleted the 448-allow-only-1-instance-setting-does-nothing branch November 30, 2025 19:00
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.

All Settings Lost When Moving Installation Directory (While in Portable Mode), and Settings Import Seems Broken

1 participant