mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-08-16 14:40:23 +03:00
WIP: Improve "Project does not exists" popup with a Remove all button to clean up the unreachable projects
This commit is contained in:
parent
7d2d876cf2
commit
733bf61c5f
@ -764,7 +764,12 @@ describe('AtomEnvironment', () => {
|
||||
expect(atom.notifications.addWarning).toHaveBeenCalledWith(
|
||||
'Unable to open project folders',
|
||||
{
|
||||
description: `The directories \`${nonExistent}\` and \`${existingFile}\` do not exist.`
|
||||
description: `The directories \`${nonExistent}\` and \`${existingFile}\` do not exist.`,
|
||||
dismissable: true,
|
||||
buttons: [
|
||||
{ text: 'Remove all', onDidClick: jasmine.any(Function) },
|
||||
{ text: 'Skip for now', onDidClick: jasmine.any(Function) }
|
||||
]
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -1739,7 +1739,36 @@ or use Pane::saveItemAs for programmatic saving.`);
|
||||
'` do not exist.';
|
||||
}
|
||||
|
||||
this.notifications.addWarning(message, { description });
|
||||
let notification;
|
||||
|
||||
let removeMissingPaths = async () => {
|
||||
this.applicationDelegate.setProjectRoots(this.project.getPaths());
|
||||
|
||||
for (const missingFolder of missingFolders) {
|
||||
const { pathToOpen } = missingFolder;
|
||||
|
||||
this.notifications.addWarning(`Removed ${pathToOpen}`);
|
||||
}
|
||||
|
||||
if (notification) {
|
||||
notification.dismiss();
|
||||
}
|
||||
};
|
||||
|
||||
let skipRemove = () => {
|
||||
if (notification) {
|
||||
notification.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
notification = this.notifications.addWarning(message, {
|
||||
description,
|
||||
dismissable: true,
|
||||
buttons: [
|
||||
{ text: 'Remove all', onDidClick: removeMissingPaths },
|
||||
{ text: 'Skip for now', onDidClick: skipRemove }
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
ipcRenderer.send('window-command', 'window:locations-opened');
|
||||
|
Loading…
Reference in New Issue
Block a user