Skip to content

Conversation

@chandrath
Copy link
Contributor

Added a new setting "Disable live clipboard update" that prevents the preview and filename fields from automatically updating when the clipboard changes while the dialog is open. This allows users to safely edit filenames or copy text to use as filenames without the dialog being overwritten by new clipboard content.

Changes:

  • Added disableLiveClipboardUpdate setting (default: false) to Settings.settings
  • Added property accessor in Settings.Designer.cs
  • Added menu item to settings context menu in Wizard.Designer.cs
  • Added handler menuDisableLiveClipboardUpdate_CheckedChanged in Wizard.cs
  • Modified ClipboardChanged in Dialog.cs to check setting and return early if enabled
  • Added resource strings str_disable_live_clipboard_update and tooltip

The setting is accessible via the settings menu (gear icon) in the Wizard dialog. When enabled, clipboard changes are ignored while the preview/rename dialog is open, preventing the preview and filename fields from being overwritten.

This PR ...

  • ...

Closes #...

Testing

...

Before After
... ...

My contribution follows "inbound=outbound" licensing as defined by the GitHub Terms of Service.

Added a new setting "Disable live clipboard update" that prevents the preview
and filename fields from automatically updating when the clipboard changes while
the dialog is open. This allows users to safely edit filenames or copy text to
use as filenames without the dialog being overwritten by new clipboard content.

Changes:
- Added disableLiveClipboardUpdate setting (default: false) to Settings.settings
- Added property accessor in Settings.Designer.cs
- Added menu item to settings context menu in Wizard.Designer.cs
- Added handler menuDisableLiveClipboardUpdate_CheckedChanged in Wizard.cs
- Modified ClipboardChanged in Dialog.cs to check setting and return early if enabled
- Added resource strings str_disable_live_clipboard_update and tooltip

The setting is accessible via the settings menu (gear icon) in the Wizard dialog.
When enabled, clipboard changes are ignored while the preview/rename dialog is open,
preventing the preview and filename fields from being overwritten.
@eltos
Copy link
Owner

eltos commented Nov 27, 2025

Thank you, this sounds like a useful feature!

First two general questions:

  • How does this feature interact with batch mode? At the moment it seems enabling this makes using batch mode impossible
  • Do you think it's something people would frequently want to change? I'm wondering if maybe it would better be exposed as a checkbox in the dialog, but not sure. What was your rationale hiding it in the wizard settings?

- Checkbox now only appears in main Dialog interface for better
  discoverability and immediate access

- Removed duplicate setting from Wizard settings menu (gear icon)
  to avoid confusion and keep settings menu clean

- Added logic to disable checkbox when batch mode is active, since
  live updates are required for batch mode to function properly

- Setting remains persistent across sessions to respect user preference
  (defaults to unchecked/enabled)

Files modified:
- Dialog.cs: Added batch mode check to disable checkbox when appropriate
- Wizard.cs: Removed menu item handler
- Wizard.Designer.cs: Removed menu item UI component
@chandrath
Copy link
Contributor Author

Thanks for reviewing my PR!

My original thinking was to hide it in the settings menu just to keep the main interface clean. I mainly built this because I kept trying to copy text to use as a filename, and the dialog would instantly overwrite what I was doing.

The batch-mode issue from my last PR is fixed: the option now automatically disables when batch mode is active (batch mode requires live updates).

Why move it to the main dialog:

Since you mentioned it, I rethought placement users need this toggle while actively using the dialog.
It’s easier to find and use when visible, no need to going through the Settings.

So I've updated the PR:

  • Removed it from the settings menu entirely (no duplication).
  • It's just the checkbox in the main dialog now.
  • It remembers your preference (saves if you check it), but defaults to unchecked (enabled) for new users.
  • Added logic to disable checkbox when batch mode is active, since
    live updates are required for batch mode to function properly

@eltos
Copy link
Owner

eltos commented Nov 29, 2025

Hi @chandrath
sounds good, but did you actually test this? Looking at the code I don't think it works the way you say, as readClipboard is now always called.
Also, can you please post a screenshot of the new layout?

- Move readClipboard() calls inside conditional blocks
- Only read clipboard in batch mode or when live updates are enabled
- Prevents unnecessary clipboard reads when user disables live updates
- Fixes issue where readClipboard() was always called regardless of checkbox state
@chandrath
Copy link
Contributor Author

Hello, The fix correctly addresses
the issue where readClipboard() was being called unconditionally in the
previous version (d83c5f3).

What changed:

  • Before: readClipboard() was always called at the start of
    ClipboardChanged(), ignoring the "disable live updates" checkbox
  • After: readClipboard() is now only called when:
    1. In batch mode (continuous mode enabled), OR
    2. Live updates are enabled (checkbox unchecked)

Here's the screenshot of the build featuring the new 'Disable Live Clipboard Update' option.

SS-48f4a24-build

- Changed "Disable live clipboard update" to "Live clipboard update" checkbox
- Removed all boolean negations for cleaner, direct logic
- Eliminated code duplication in ClipboardChanged handler
- Added comments clarifying batch mode behavior

Addresses all review feedback from @eltos
@chandrath
Copy link
Contributor Author

Thank you for the detailed feedback!

Initially, I added this feature myself and used it locally for a while. However, the changes I made were not committed; I simply downloaded a local copy and made alterations. Once I was confident the feature was working, I rewrote the code since the original was lost. I then committed the new changes to the PR. Rewriting the feature from scratch after losing my original local implementation led to some initial oversight.

I've incorporated your feedback and improved the implementation.

  1. Removed redundant updateContentPreview()
    It is now called only once via readClipboard() within the conditional logic.

  2. Eliminated code duplication
    I refactored ClipboardChanged to use a flag-based approach.
    readClipboard is called once, and shouldUpdateUI / shouldSave flags determine the behavior for both batch and normal modes.

  3. Fixed inverse logic
    I've renamed everything to "Live clipboard update" (positive naming) across the checkbox, settings, and resource strings to avoid double negatives.

  4. Fixed tooltip mismatch
    I noticed the tooltip promised that unchecking would "prevent the dialog from being overwritten," but the previous code updated the preview anyway. I've fixed this so the preview now strictly respects the checkbox state.

I hope this meets the project's standards. I'm happy to make further adjustments if needed to help improve this excellent tool.

@eltos eltos merged commit 92932f0 into eltos:main Dec 2, 2025
8 checks passed
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.

2 participants