mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Persist save file location throughout a session (#772)
* persist save file location throughout a session * added path logic to serializer instead of pathUtilities
This commit is contained in:
@@ -29,6 +29,8 @@ import * as pretty from 'pretty-data';
|
|||||||
import { ISlickRange } from 'angular2-slickgrid';
|
import { ISlickRange } from 'angular2-slickgrid';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
|
let prevSavePath: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles save results request from the context menu of slickGrid
|
* Handles save results request from the context menu of slickGrid
|
||||||
*/
|
*/
|
||||||
@@ -139,13 +141,14 @@ export class ResultSerializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private promptForFilepath(saveRequest: ISaveRequest): string {
|
private promptForFilepath(saveRequest: ISaveRequest): string {
|
||||||
let filepathPlaceHolder = PathUtilities.resolveCurrentDirectory(this._uri, this.rootPath);
|
let filepathPlaceHolder = (prevSavePath) ? prevSavePath : PathUtilities.resolveCurrentDirectory(this._uri, this.rootPath);
|
||||||
filepathPlaceHolder = path.join(filepathPlaceHolder, this.getResultsDefaultFilename(saveRequest));
|
filepathPlaceHolder = path.join(filepathPlaceHolder, this.getResultsDefaultFilename(saveRequest));
|
||||||
|
|
||||||
let filePath: string = this._windowService.showSaveDialog({
|
let filePath: string = this._windowService.showSaveDialog({
|
||||||
title: nls.localize('resultsSerializer.saveAsFileTitle', 'Choose Results File'),
|
title: nls.localize('resultsSerializer.saveAsFileTitle', 'Choose Results File'),
|
||||||
defaultPath: paths.normalize(filepathPlaceHolder, true)
|
defaultPath: paths.normalize(filepathPlaceHolder, true)
|
||||||
});
|
});
|
||||||
|
prevSavePath = filePath;
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user