Prompt user when switching to a locked workspace in Eclipse#3518
Prompt user when switching to a locked workspace in Eclipse#3518SougandhS wants to merge 4 commits intoeclipse-platform:masterfrom
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.
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
Outdated
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
e2ca711 to
fc83bc2
Compare
|
@iloveeclipse Could u please re-check this ? |
iloveeclipse
left a comment
There was a problem hiding this comment.
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.
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
fc83bc2 to
54146c5
Compare
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
ed5958e to
51a81db
Compare
51a81db to
41c3dfe
Compare
41c3dfe to
aa4ad7a
Compare
|
I've moved messages to the right bundle & rebased on master. TODO (for me)
@SougandhS : would it be OK if I would squash everything to one commit (except bundle version updates)? |
We must do that, the API tools sees "touched" code which was reverted and complains about missing version bump. There is no reason to bump that version for not really changed code. |
`org.eclipse.ui.ide.application` needs latest API from `org.eclipse.ui.workbench`, `org.eclipse.ui` is the bundle that re-exports it, because `org.eclipse.ui.workbench` has bumped minor version segment, `org.eclipse.ui` must bump minor version segment too. See eclipse-platform#3518
Prompts user on attempting to switch to a workspace that is currently locked by another Eclipse instance. Prompt dialog is now shown informing the user about the lock details and preventing Eclipse from exiting. - Refactored code to use common WorkspaceLock class - Moved related messages to the workbench bundle Also-by: Andrey Loskutov <[email protected]>
Please go ahead 👍 |
iloveeclipse
left a comment
There was a problem hiding this comment.
I've fixed version constraints needed, refactored WorkspaceLock and started to look into Workbench code changes needed. Unfortunately be51d14 changes were not consistent, we have to understand how that can be fixed in context of the required changes here.
I will push updated PR now, but I plan to continue looking into Workbench changes needed.
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/WorkspaceLock.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/WorkspaceLock.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/WorkspaceLock.java
Outdated
Show resolved
Hide resolved
| return null; | ||
| } | ||
| } catch (MalformedURLException e) { | ||
| return null; |
There was a problem hiding this comment.
this return null here is wrong, because we simply can't get workspace URL, but have no idea if workspace is locked or not. Probably exception should be propagated.
| * @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> if workspace is locked |
There was a problem hiding this comment.
Unfortunately code doesn't match the javadoc, see retrurn null at line 2708 after be51d14.
This all needs careful rework.
TODO: Workbench.setRestartArguments() null handling is wrong ATM because of the be51d14 changes. See eclipse-platform#3518
ca496e0 to
682fb77
Compare


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