提交 0335cba0 编写于 作者: A Alex Dima

Add More information button

上级 f92b910d
...@@ -15,6 +15,7 @@ import URI from 'vs/base/common/uri'; ...@@ -15,6 +15,7 @@ import URI from 'vs/base/common/uri';
import Severity from 'vs/base/common/severity'; import Severity from 'vs/base/common/severity';
import {Action} from 'vs/base/common/actions'; import {Action} from 'vs/base/common/actions';
import {IStorageService, StorageScope} from 'vs/platform/storage/common/storage'; import {IStorageService, StorageScope} from 'vs/platform/storage/common/storage';
import {IOpenerService} from 'vs/platform/opener/common/opener';
interface ILoaderChecksums { interface ILoaderChecksums {
[scriptSrc:string]: string; [scriptSrc:string]: string;
...@@ -64,15 +65,18 @@ export class IntegrityServiceImpl implements IIntegrityService { ...@@ -64,15 +65,18 @@ export class IntegrityServiceImpl implements IIntegrityService {
public _serviceBrand: any; public _serviceBrand: any;
private _messageService: IMessageService; private _messageService: IMessageService;
private _openerService: IOpenerService;
private _storage:IntegrityStorage; private _storage:IntegrityStorage;
private _loaderChecksums: ILoaderChecksums; private _loaderChecksums: ILoaderChecksums;
private _isPurePromise: TPromise<IntegrityTestResult>; private _isPurePromise: TPromise<IntegrityTestResult>;
constructor( constructor(
@IMessageService messageService: IMessageService, @IMessageService messageService: IMessageService,
@IStorageService storageService: IStorageService @IStorageService storageService: IStorageService,
@IOpenerService openerService: IOpenerService
) { ) {
this._messageService = messageService; this._messageService = messageService;
this._openerService = openerService;
this._storage = new IntegrityStorage(storageService); this._storage = new IntegrityStorage(storageService);
// Fetch checksums from loader // Fetch checksums from loader
...@@ -122,10 +126,21 @@ export class IntegrityServiceImpl implements IIntegrityService { ...@@ -122,10 +126,21 @@ export class IntegrityServiceImpl implements IIntegrityService {
return TPromise.as(true); return TPromise.as(true);
} }
); );
const MoreInfoAction = new Action(
'integrity.moreInfo',
nls.localize('integrity.moreInfo', "More information"),
null,
true,
() => {
const uri = URI.parse(product.checksumFailMoreInfoUrl);
this._openerService.open(uri);
return TPromise.as(true);
}
);
this._messageService.show(Severity.Warning, { this._messageService.show(Severity.Warning, {
message: nls.localize('integrity.prompt', "Your {0} installation appears to be corrupt. Please reinstall.", product.nameShort), message: nls.localize('integrity.prompt', "Your {0} installation appears to be corrupt. Please reinstall.", product.nameShort),
actions: [OkAction, DontShowAgainAction] actions: [OkAction, MoreInfoAction, DontShowAgainAction]
}); });
} }
......
...@@ -46,6 +46,7 @@ export interface IProductConfiguration { ...@@ -46,6 +46,7 @@ export interface IProductConfiguration {
privacyStatementUrl: string; privacyStatementUrl: string;
npsSurveyUrl: string; npsSurveyUrl: string;
checksums: {[path:string]:string;}; checksums: {[path:string]:string;};
checksumFailMoreInfoUrl: string;
} }
const rootPath = path.dirname(uri.parse(require.toUrl('')).fsPath); const rootPath = path.dirname(uri.parse(require.toUrl('')).fsPath);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册