Skip to content

Commit

Permalink
Notify about changes to project management and required action
Browse files Browse the repository at this point in the history
References #460
  • Loading branch information
Gert-dev committed Jun 4, 2019
1 parent fa04f4a commit 2e18a4f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/AtomConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class AtomConfig extends Config
'core.memoryLimit',
'core.additionalDockerVolumes',
'general.doNotAskForSupport',
'general.doNotShowProjectChangeMessage',
'general.projectOpenCount',
'annotations.enable',
'refactoring.enable',
Expand Down
5 changes: 3 additions & 2 deletions lib/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class Config {
'core.memoryLimit' : 2048,
'core.additionalDockerVolumes' : [],

'general.doNotAskForSupport' : false,
'general.projectOpenCount' : 0,
'general.doNotAskForSupport' : false,
'general.doNotShowProjectChangeMessage' : false,
'general.projectOpenCount' : 0,

'annotations.enable' : true,
'refactoring.enable' : true,
Expand Down
32 changes: 32 additions & 0 deletions lib/SerenataClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,41 @@ class SerenataClient extends AutoLanguageClient

this.projectManager.tryLoad(projectPaths[0]);

this.notifyAboutProjectFormatChange();
this.notifyAboutSponsoringUnobtrusively();
}

notifyAboutProjectFormatChange() {
if (this.config.get('general.doNotShowProjectChangeMessage') === true) {
return;
}

const message =
'Serenata has updated to a new major version. Large changes have taken place, and you no longer need ' +
'_project-manager_ to run.\n \n' +

'A necessary switch to a new project format has happened, so a one-time action to **set up your ' +
'projects again** is required. You can do this in the usual way, via the _Set up current project_ action.'

const me = this;

const notification = atom.notifications.addWarning('Serenata - Project Changes', {
description : message,
dismissable : true,

buttons: [
{
text: 'Got it',
onDidClick() {
me.config.set('general.doNotShowProjectChangeMessage', true);

notification.dismiss();
}
},
]
});
}

notifyAboutSponsoringUnobtrusively() {
if (this.config.get('general.doNotAskForSupport') === true) {
return;
Expand Down

0 comments on commit 2e18a4f

Please sign in to comment.