Repository navigation
Exit dialog window - #9652
Exit dialog window#9652TheProjectDark wants to merge 1 commit into
Conversation
neilcsmith-net
left a comment
There was a problem hiding this comment.
Thanks for looking at this. I hit this issue sometimes with a dual monitor setup when the close icon is right next to something I'm trying to click on the other screen! 😄
Couple of changes that are not related need looking at, and I'm not sure why we need the Save All option?
|
|
||
| # Exit confirmation shown when there are no open files with unsaved changes | ||
| TTL_ExitConfirmation=Exit NetBeans | ||
| MSG_ExitConfirmation=Do you want to exit NetBeans? |
There was a problem hiding this comment.
Let's leave the word "NetBeans" out of these and keep the messages generic. Less surprising for platform applications, and we can always brand them later in the nb cluster if need be.
There was a problem hiding this comment.
I had considered something even more generic than "IDE" (eg. ".. application" or just "Do you want to exit?") given that not all platform applications are IDEs. Although, as mine is, I won't complain too much if other people are happy with that? 😄
|
Thanks. Principle looks good to me, but not tested yet. Triggered CI and a dev build. Will wait for feedback from others. Everything will need squashing into a single commit and force pushing before it could be merged. But hold fire on that in case there's other feedback first. |
|
LGTM to me. Author in commit expect 2 parts. |
|
tested a scenario which would open both exit popups in sequence. run project with static void main() throws InterruptedException {
System.out.println("sleeping");
Thread.sleep(Duration.ofMinutes(2));
}try to exit IDE. this worked, but the visually confusing aspect is that it looks like the new dialog has the cancel button selected, but focus is on exit. Probably would have to play with the |
5cd3c2b to
7917ec0
Compare
|
@mbien This scenario might be a little more complicated to get right. We have the various The dialog is also showing up strangely for me at times, not like the screenshot, but with the buttons vertically stacked to the right of the label. That might be issues we sometimes see with chaining multiple dialogs in the EDT. Sorry, @TheProjectDark now we've got to testing this we might be facing more edge cases than envisaged. I would still like us to get this feature in if we can work out how. |





Description
I was reviewing code in NetBeans and often miss-clicked cmd+q instead of pressing cmd+a, and it was so annoying to wait until the IDE re-launches so I just implemented exit dialog window like in Firefox or JetBrains.
Implementation
The exit flow is centralized in ExitDialog.showDialog(), which is already called during shutdown. It checks for open unsaved files first: if there are any, NetBeans shows its existing save/discard dialog. If there are none, it checks the new preference and, when enabled, shows Exit, Save All and Exit, and Cancel. Choosing Save All calls LifecycleManager.saveAll() before allowing shutdown; Cancel keeps the IDE open.
The checkbox is in Tools > Options > General. The panel loads its value when the options page opens, detects changes so Apply is enabled when appropriate, and saves the preference when settings are applied. The preference is stored with NetBeans’ user settings and defaults to enabled. Cmd+Q and Ctrl+F4 reach the same shutdown flow through their respective platform handlers/keymap bindings.
Screenshots
Assisted by: GitHub Copilot to navigate through project's structure
^Add meaningful description above
Click to collapse/expand PR instructions
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
LLMs, Commit messages and PR description:
git log) that all commits have a valid name and email address for you in the Author field.Assisted-by: MODEL_NAME MODEL_VERSIONline appended to the commit message.Assisted-byline from above)If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)