Skip to content

Commit a9fad29

Browse files
authored
Merge pull request #205 from github0null/dev
v3.10.10 revision
2 parents 024c0c6 + d24a093 commit a9fad29

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

src/ResManager.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export class ResManager extends events.EventEmitter {
229229

230230
getAppUsrData(): { [key: string]: any } | undefined {
231231

232-
const dataFile = File.fromArray([this.GetAppDataDir().path, 'data.yaml']);
232+
const dataFile = File.fromArray([this.getEideHomeFolder().path, 'usr-data.yaml']);
233233

234234
if (dataFile.IsFile()) {
235235
try {
@@ -246,8 +246,9 @@ export class ResManager extends events.EventEmitter {
246246

247247
data[key] = val;
248248

249-
File.fromArray([this.GetAppDataDir().path, 'data.yaml'])
250-
.Write(yaml.stringify(data));
249+
this.getEideHomeFolder().CreateDir(false);
250+
251+
File.fromArray([this.getEideHomeFolder().path, 'usr-data.yaml']).Write(yaml.stringify(data));
251252
}
252253

253254
//=====================

src/StringTable.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,18 @@ export const view_str$prompt$project_is_opened_by_another = [
592592
`Can't lock project: '{path}', maybe this project has been opened by another EIDE instance !`
593593
][langIndex];
594594

595+
export const view_str$prompt$feedback = [
596+
`已经过去了一段时间,Embedded IDE 这款插件有帮到你吗?您可以在插件商店给予一个评分以帮助我们了解您的感受!`,
597+
`A few days passed, has this plugin(Embedded IDE) helped you ? You can help us know how you feel by giving us a rating in the plugin store !`
598+
][langIndex];
599+
595600
//---------------Select string------------------
596601

602+
export const rating_text = [
603+
'打分',
604+
'Rating'
605+
][langIndex];
606+
597607
export const later_text = [
598608
'稍后',
599609
'Later on'

src/extension.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { ResInstaller } from './ResInstaller';
4040
import {
4141
ERROR, WARNING, INFORMATION,
4242
view_str$operation$serialport, view_str$operation$baudrate, view_str$operation$serialport_name,
43-
txt_install_now, txt_yes
43+
txt_install_now, txt_yes, view_str$prompt$feedback, rating_text, later_text
4444
} from './StringTable';
4545
import { LogDumper } from './LogDumper';
4646
import { StatusBarManager } from './StatusBarManager';
@@ -294,6 +294,23 @@ function postLaunchHook(extensionCtx: vscode.ExtensionContext) {
294294
}
295295
}
296296

297+
// not first launch
298+
else {
299+
300+
// A few days ago, show feedback message
301+
const some_days = 7 * (24 * 3600 * 1000);
302+
if (!appUsrData['Feedbacked'] &&
303+
Date.now() - appUsrData['InstallTime'] > some_days) {
304+
resManager.setAppUsrData('Feedbacked', true);
305+
const msg = view_str$prompt$feedback;
306+
vscode.window.showInformationMessage(msg, rating_text).then((ans) => {
307+
if (ans == rating_text) {
308+
utility.openUrl(`https://marketplace.visualstudio.com/items?itemName=CL.eide&ssr=false#review-details`);
309+
}
310+
});
311+
}
312+
}
313+
297314
// refresh external tools now
298315
ResInstaller.instance().refreshExternalToolsIndex().catch(err => {
299316
GlobalEvent.emit('globalLog', ExceptionToMessage(err, 'Warning'));

0 commit comments

Comments
 (0)