Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 16273 - [Workbench] prompt before exiting workspace?
Summary: [Workbench] prompt before exiting workspace?
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P2 major (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: Simon Arsenault CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 26622 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-17 12:07 EDT by DJ Houghton CLA
Modified: 2003-02-13 14:40 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2002-05-17 12:07:27 EDT
 
Comment 1 DJ Houghton CLA 2002-05-17 12:08:40 EDT
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.
Comment 2 Nick Edgar CLA 2002-05-17 13:13:11 EDT
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?
Comment 3 DJ Houghton CLA 2002-05-17 14:01:25 EDT
I run single window with 2 perspectives:
- customized java perspective with almost every view as a fast view
- debug perspective
Comment 4 DJ Houghton CLA 2003-02-07 16:09:10 EST
*** Bug 26622 has been marked as a duplicate of this bug. ***
Comment 5 Nick Edgar CLA 2003-02-11 16:58:08 EST
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?
Comment 6 Simon Arsenault CLA 2003-02-11 17:13:17 EST
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?
Comment 7 Nick Edgar CLA 2003-02-12 14:23:13 EST
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.
Comment 8 Simon Arsenault CLA 2003-02-12 15:05:17 EST
Will start to work on it today
Comment 9 Simon Arsenault CLA 2003-02-13 14:28:04 EST
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.
Comment 10 Nick Edgar CLA 2003-02-13 14:39:40 EST
Can't change APIs in ApplicationWindow since these are public JFace APIs.
Comment 11 Nick Edgar CLA 2003-02-13 14:40:46 EST
Never mind.  I see that this is actually an addition, not a change, despite 
how it looks in the sync view.