diff --git a/client/src/extension.ts b/client/src/extension.ts index 709f41d7..9c5f9097 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -65,8 +65,9 @@ export async function activate (context: vscode.ExtensionContext): Promise context.subscriptions.push(bitbakeStatusBar.statusBarItem) // Handle settings change for bitbake driver - context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((event) => { + context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async (event) => { if (event.affectsConfiguration('bitbake')) { + await clientNotificationManager.resetNeverShowAgain('custom/bitbakeSettingsError') bitbakeDriver.loadSettings(vscode.workspace.getConfiguration('bitbake'), vscode.workspace.workspaceFolders?.[0].uri.fsPath) logger.debug('Bitbake settings changed') void vscode.commands.executeCommand('bitbake.rescan-project') diff --git a/client/src/ui/ClientNotificationManager.ts b/client/src/ui/ClientNotificationManager.ts index acb6a51a..f23cc8dd 100644 --- a/client/src/ui/ClientNotificationManager.ts +++ b/client/src/ui/ClientNotificationManager.ts @@ -13,17 +13,17 @@ export class ClientNotificationManager { } showBitbakeError (message?: string): void { - if (this.checkIsNeverShowAgain('custom/bitbakeSettingsError')) { + if (!this.checkIsNeverShowAgain('custom/bitbakeSettingsError')) { void window.showErrorMessage( - 'BitBake could not be configured and started. To enable advanced Bitbake features, please configure the Bitbake extension.\n\n' + message, + 'BitBake could not be configured and started. To enable advanced Bitbake features, please configure the Bitbake extension.', + { detail: message, modal: true }, 'Open Settings', - 'Close', - 'Never Show Again' + 'Don\'t show again' ) .then((item) => { if (item === 'Open Settings') { void commands.executeCommand('workbench.action.openWorkspaceSettings', '@ext:yocto-project.yocto-bitbake') - } else if (item === 'Never Show Again') { + } else if (item === 'Don\'t show again') { void this.neverShowAgain('custom/bitbakeSettingsError') } }) @@ -43,6 +43,13 @@ export class ClientNotificationManager { } return this._memento.get(`neverShowAgain/${method}`, false) } + + async resetNeverShowAgain (method: string): Promise { + if (this._memento === undefined) { + throw new Error('ClientNotificationManager Memento not set') + } + await this._memento.update(`neverShowAgain/${method}`, false) + } } export const clientNotificationManager: ClientNotificationManager = new ClientNotificationManager()