-
Notifications
You must be signed in to change notification settings - Fork 227
Prompt user when switching to a locked workspace in Eclipse #3518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Hi @iloveeclipse, could you please check this PR when you get some time ? |
iloveeclipse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can check on Monday. The idea itself is good.
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java
Outdated
Show resolved
Hide resolved
243aaf8 to
279a4ef
Compare
|
would it be possible to bring up the exact same dialog (with the same information) in both situations? |
Sure 👍 |
279a4ef to
954cc49
Compare
Updated as suggested My.Movie.mp4 |
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java
Show resolved
Hide resolved
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java
Outdated
Show resolved
Hide resolved
b3e89f9 to
a7c8013
Compare
9691ac5 to
e2ca711
Compare
Prompts user on attempting to switch to a workspace that is currently locked by another Eclipse instance, a prompt dialog is now shown informing the user about the lock details and preventing Eclipse from exiting
e2ca711 to
fc83bc2
Compare
|
@iloveeclipse Could u please re-check this ? |
iloveeclipse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe M3 is the bad time for changing workspace locking code. Take time, test the change also please with the workspace selection dialog that is shown on Eclipse startup, and if everything will work, it could land in the next release.
| String wsLockedError = lockMessage + System.lineSeparator() + System.lineSeparator() | ||
| + NLS.bind(WorkbenchSWTMessages.IDEApplication_workspaceLockMessage, workspaceLock); | ||
|
|
||
| MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've already commented before, if the workspace selection dialog is opened, there is NO active workbench window, not a single window is opened!
I would recommend to move all this workspace locking code to extra class and add a bold statement on the class javadoc that it is used in both workbench / window - free and workbench - created use cases.
| * @param workspacePath the new workspace location | ||
| * @return {@link IApplication#EXIT_OK} or {@link IApplication#EXIT_RELAUNCH} | ||
| * @return {@link IApplication#EXIT_OK} or {@link IApplication#EXIT_RELAUNCH} or | ||
| * <code>null</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the returning constants is self explanatory, what does "return null" mean for the caller? NO exit? Don't care? Leave me alone with my problems?
Just imagine you would see this javadoc and not see the implementation. What you would think about this API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add few more details then
This change prompts the user when attempting to switch to a workspace in Eclipse that is currently locked by another instance, preventing Eclipse from restarting into the locked workspace. Previously, if Eclipse restarted with a locked workspace, the workspace lock prompt would appear, and clicking “OK” would exit the application, requiring the user to reopen Eclipse to select an active workspace. With this update, the user is warned before switching, informed about the lock via a dialog, and prevented from restarting into the locked workspace, improving workflow and avoiding unnecessary restarts.
Before :
before.mp4
After :
(commented out the initial development mode check for this video)
after.mp4