Skip to content

Prompt to save changes when closing Organize Favorites dialog - #2825

Open
SougandhS wants to merge 1 commit into
eclipse-platform:masterfrom
SougandhS:AddClosingPrompt
Open

Prompt to save changes when closing Organize Favorites dialog#2825
SougandhS wants to merge 1 commit into
eclipse-platform:masterfrom
SougandhS:AddClosingPrompt

Conversation

@SougandhS

Copy link
Copy Markdown
Contributor

Prompt users to save changes before closing the Organize Favorites dialog when the favorites list has been modified. This prevents accidentally losing changes made to the favorites list when the dialog is closed without pressing OK.

Screenshot 2026-07-25 at 6 36 34 PM

@iloveeclipse

Copy link
Copy Markdown
Member

Why not simply save on OK, without dialog?

@SougandhS

SougandhS commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Why not simply save on OK, without dialog?

it saves on clicking Ok but on accidental ESC press or Cancel click it simply closes without saving, so added for those cases.

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   59m 12s ⏱️ + 3m 9s
 4 702 tests ±0   4 680 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 000 runs  ±0  11 847 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit 96dae57. ± Comparison against base commit 29df77f.

♻️ This comment has been updated with latest results.

Prompt users to save changes before closing the Organize Favorites
dialog when the favorites list has been modified. This prevents
accidentally losing changes made to the favorites list when the dialog
is closed without pressing OK.
@SougandhS

Copy link
Copy Markdown
Contributor Author

Hi @iloveeclipse,
build looks good, can this be merged ?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a save-confirmation flow to the Debug UI “Organize Favorites” dialog so users are prompted to save when closing the dialog with unsaved changes, reducing accidental loss of edits to the favorites list.

Changes:

  • Added new externalized UI strings for a “save changes before closing” prompt.
  • Added “dirty” detection and close-interception logic in FavoritesDialog (Cancel and window-close paths).
  • Minor refactor in favorites-saving code (iterator → enhanced for-loop).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties Adds externalized strings for the new close/save prompt.
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java Declares new NLS message fields for the added prompt strings.
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java Implements dirty tracking and prompts on Cancel / shell-close; minor loop refactor in saving logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +195 to +210
MessageDialog dialog = new MessageDialog(getShell(),
LaunchConfigurationsMessages.FavoritesDialogPromptOnCloseTitle, null,
LaunchConfigurationsMessages.FavoritesDialogPromptOnClose, MessageDialog.QUESTION,
new String[] { LaunchConfigurationsMessages.FavoritesDialogPromptOnCloseSaveButton,
IDialogConstants.CANCEL_LABEL },
0);

int option = dialog.open();
if (option == Window.OK) {
saveFavorites();
return true;
}
if (option == Window.CANCEL) {
return true;
}
return false;
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.

3 participants