-
Notifications
You must be signed in to change notification settings - Fork 5
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
Idle timer #59
Comments
Great idea, I will work on it! |
I actually don't have the time to implement this right now. If anyone wants to submit a PR, here are my advices. Add corresponding preferencesIn order to let the user customize its experience, the following preferences should be added:
That requires:
The preferences pages can be updated by modifying:
Disable the Rich Presence when Eclipse IDE is minimizedDetermine when Eclipse IDE is minimizedThis can be achieved by implementing an IWindowListener. I would advise to do register it in the Activator as done here. Actually hide / show the Rich Presence on minimize / maximizeHere is a naive implementation of the listener: public class ShutdownDiscordOnMinimize implements IWindowListener {
private final UserPreferences preferences;
private final DiscordRpcLifecycle discord;
private final FileChangeListener fileChangeListener;
@Override
public void windowActivated(IWorkbenchWindow window) {
if (preferences.shouldHideDiscordOnMinimize()) {
discord.initialize();
// Shows info about current file on Discord
fileChangeListener.notifyDiscordWithActivePart();
}
}
@Override
public void windowDeactivated(IWorkbenchWindow window) {
if (preferences.shouldHideDiscordOnMinimize()) {
discord.shutdown();
}
}
} Hide the Rich Presence when no edition has been done during a given delayListen for editionFirst of all, we have to know when the user is typing. Here are some clues:
The FileChangeListener.selectionChanged method is called each time a new file is selected by the user, so it may be the best place to put the listener. Update the Rich PresenceCalling discord.initialize();
fileChangeListener.updateDiscord(); should allow to show the Rich Presence again. Update the behavior when preferences changeWhen the user changes its preferences from the UI they should be taken into account immediately. It requires the following changes:
TestUnit tests must ensure the good behavior of core features. UI features should at least be manually tested. Contributing guideAlso see the contributing guide. |
The option to remove rich presence if you stopped editing the code or were tabbed out of eclipse for 5-10 minutes and have it re-enabled when you're actively working on the file again would be a great feature to add.
The text was updated successfully, but these errors were encountered: