2018-05-18 13:47:22 +02:00
import {
window as Window
} from 'vscode' ;
2018-06-21 23:02:57 +02:00
const MESSAGES = {
INFO : {
2018-07-01 19:03:53 +02:00
message : 'Do you want to reload to apply Material Theme Icons to enjoy the full experience?' ,
2018-08-12 12:48:23 +02:00
options : { ok : 'Yeah, reload' , autoreload : 'Yes and enable auto-reload' , cancel : 'No, thank you' , nomore : 'Never show again' }
2018-06-21 23:02:57 +02:00
} ,
CHANGELOG : {
2018-07-01 19:03:53 +02:00
message : 'Material Theme was updated. Check the release notes for more details.' ,
options : { ok : 'Show me' , cancel : 'Maybe later' }
2018-08-12 11:52:58 +02:00
} ,
INSTALLATION : {
message : 'Thank you for installing Material Theme! Would you like to enable the auto-application (with window reload when needed) of the Material Theme icons?' ,
options : { ok : 'Sure!' , cancel : 'Nope :(' }
2018-06-21 23:02:57 +02:00
}
} ;
2018-05-18 13:47:22 +02:00
export const infoMessage = async ( ) = > {
2018-08-12 12:48:23 +02:00
const result = await Window . showInformationMessage (
2018-08-12 11:52:58 +02:00
MESSAGES . INFO . message ,
2018-08-12 12:48:23 +02:00
MESSAGES . INFO . options . ok ,
MESSAGES . INFO . options . autoreload ,
MESSAGES . INFO . options . cancel ,
MESSAGES . INFO . options . nomore
) ;
switch ( result ) {
case MESSAGES . INFO . options . ok :
return { reload : true } ;
case MESSAGES . INFO . options . autoreload :
return { reload : true , autoreload : true } ;
case MESSAGES . INFO . options . nomore :
return { nomore : true } ;
default :
return { } ;
2018-05-18 13:47:22 +02:00
}
} ;
2018-06-21 23:02:57 +02:00
export const changelogMessage = async ( ) = >
2018-08-12 11:52:58 +02:00
await Window . showInformationMessage (
MESSAGES . CHANGELOG . message ,
2018-08-12 12:48:23 +02:00
MESSAGES . CHANGELOG . options . ok ,
MESSAGES . CHANGELOG . options . cancel
2018-08-12 11:52:58 +02:00
) === MESSAGES . CHANGELOG . options . ok ;
export const installationMessage = async ( ) = >
await Window . showInformationMessage (
MESSAGES . INSTALLATION . message ,
2018-08-12 12:48:23 +02:00
MESSAGES . INSTALLATION . options . ok ,
MESSAGES . INSTALLATION . options . cancel ,
2018-08-12 11:52:58 +02:00
) === MESSAGES . INSTALLATION . options . ok ;