Reputation: 2402
I've recently trimmed the UI of my Eclipse RCP Workbench-style app to remove some irrelevant default actions using hiddenMenuItem
.
For users to get the benefits of this clean up, they need to run "Reset Perspective".
Is there a best-practice (or trick) that I can use that will result in users being prompted to run "Reset Perspective" following this large UI update?
I've considered putting a hidden .resetPerspective file in the root_installs
folder. Then, at startup, checking if it's present. If it is, invite the user to reset the perspective, then delete the file.
But, clearly that will be annoying if the user happens to have root_installs in a read-only folder - since the message will popup at each time the app opens. It will unfortunately also trigger the message for fresh installs.
Any other suggestions?
Upvotes: 1
Views: 404
Reputation: 4212
I'd just be honest to your users. Give them a onetime popup, telling them that they have to reset the perspective if they want to use the new and improved feature xyz. If they don't want to do that right away, add a hint where they can find an option to do that themselves.
If they want to reset, here's a link how to do it in e4.
edit: if your main problem is, where to hide the users decision, so he just gets a one-time popup, there's various ways to achieve that. It depends on what you got already.
1) If you already have a preference page for your project, you can add an option there (like suggested in the other answer). The user can then decide if they want to see that popup again or not. That's pretty much the Eclipse way of doing things.
2) If you don't have/want that, you can also use a config file with a key/value pair (has.seen.popup = false) and check for that key. Again you could leave the user the option to have the dialog shown again next time, if he doesn't want to decide at that moment.
3) A third option would be to use IMemento. But that technology is mostly around storing view changes.
Upvotes: 1
Reputation: 1506
I would use IEclipsePreferences obtained either from an InstanceScope (stored in a workspace under .metadata/.plugins/{bundleName}) or a ConfigurationScope (for the Eclipse installation, stored in the eclipse/configuration/.settings directory). I believe Eclipse creates a configuration directory in the user's home if the one in the Eclipse installation directory cannot be written to. And I think a workspace must always be writable.
Your bundle activator (or something else) could check a flag from IEclipsePreferences to determine if 'Reset Perspective' should be offered and set the same flag afterwards. I cannot think of a good way to not show a 'Reset Perspective' message in a new installation, but that should only happen once.
Upvotes: 2
Reputation: 2402
Hmm, this post discusses how to remove an annoying "do you want to reset" message:
Eclipse RCP: Get rid of "reset perspective" message
I guess my solution could involve trying to reproduce the above problem. In the above posting, the message is triggered by programatically installing a bundle, but I'm not doing that.
Upvotes: 0