Community
Participate
Working Groups
build 2002-05-16 (test build) on WinXP. IBM JRE 1.3.1 Is it possible to catch the alt-f4 keypress and prompt "are you sure"? I sometimes mix it up with ctrl-f4 and it sucks to have to exit and come back. Especially when I am running tests, etc in my session.
We should handle closing the last window specially and prompt for confirmation. Should work for the close button as well as Alt+F4. Out of curiosity, are you running in a single window or multiple?
I run single window with 2 perspectives: - customized java perspective with almost every view as a fast view - debug perspective
*** Bug 26622 has been marked as a duplicate of this bug. ***
This is on the "hot list" of PRs to address for 2.1 based on input from the other teams. Simon, is this an issue for you since you typically work in multiple windows? Or do you always have a certain number and never get down to 1?
I usually have at least 4 windows open at a time so I've never run into this problem. Once in a while, I will accidently close a window, so I would find being prompted each time I close a window way more annoying than having to reopen the window. As for closing the application, prompting the user would be a good idea to look at if I close the last window. However, if I choose File > Exit from the menu, I rather not get prompted. Did you want me to add this feature or are you going to assign it to Eduardo?
Eduardo is still ahead of you in number of RC1 PRs, so you get this one <g>. I wasn't imagining that it would prompt on closing each window, just when actually exitting Eclipse. We need to handle it for both the window close button (on last window only) and also for Alt+F4 (DJ's case of accidentally using Alt+F4 instead of Ctrl+F4, which I've done as well). I don't see a need to handle it for File / Exit. The only case I can think of where this might occur accidentally is if you hit Alt+F, X expecting to Export (user gets the mnemonic wrong). I also think it's important to allow the user to disable the dialog since it could be an annoyance. Here are my thoughts on how it should work. When closing the last window using Alt+F4 or the close button, but not File/Exit, open a dialog: Title: "Confirm Exit" Message: "Exit {product name}?" i.e. "Exit Eclipse Platform?" where "Eclipse Platform is obtained in the same way we do for the window title. Toggle button: [ ] Always exit without prompt. Buttons: OK / Cancel OK exits and saves the toggle button state as a pref (this will also allow product overrides on the pref). Cancel, Esc or close box on the dialog cancels the exit and -does not save- the pref (it cancels everything). Add a preference to the Workbench pref page: [ ] Confirm exit when closing last window (checked by default) (I'm aware that this is phrased inversely from the dialog, but I think it's clearer this way.) Important point: Don't hardcode "Eclipse" in the strings since the product may have a different name.
Will start to work on it today
Closing the last window via the X button or shortcut key will cause a dialog to appear to confirm exiting the application. There is an option on the dialog and on the Workbench preference page to now show this dialog.
Can't change APIs in ApplicationWindow since these are public JFace APIs.
Never mind. I see that this is actually an addition, not a change, despite how it looks in the sync view.