Merge pull request #854 from Microsoft/ben/electron-v0.34.5

Adopt latest Electron build (#826)
This commit is contained in:
Benjamin Pasero 2015-12-01 16:52:41 +01:00
commit 45cf858677
4 changed files with 11 additions and 14 deletions

View file

@ -1,7 +1,7 @@
{
"name": "Code",
"version": "0.10.3",
"electronVersion": "0.34.1",
"electronVersion": "0.34.5",
"author": {
"name": "Microsoft Corporation"
},

View file

@ -15,6 +15,7 @@ if not exist out node .\node_modules\gulp\bin\gulp.js compile
:: Configuration
set NODE_ENV=development
set VSCODE_DEV=1
set ELECTRON_DEFAULT_ERROR_MODE=1
set ELECTRON_ENABLE_LOGGING=1
set ELECTRON_ENABLE_STACK_DUMPING=1

View file

@ -77,7 +77,7 @@ export class UntitledEditorInput extends EditorInput implements IResourceEditorI
public suggestFileName(): string {
if (!this.hasAssociatedFilePath) {
let mime = this.getMime();
if (mime) {
if (mime && mime !== MIME_TEXT /* do not suggest when the mime type is simple plain text */) {
return suggestFilename(mime, this.getName());
}
}

View file

@ -348,22 +348,13 @@ export class TextFileService extends BrowserTextFileService {
private promptForPathAsync(defaultPath?: string): TPromise<string> {
return new TPromise<string>((c, e) => {
Dialog.showSaveDialog(remote.getCurrentWindow(), this.getSaveDialogOptions(defaultPath ? paths.normalize(defaultPath, true) : void 0), (path) => {
if (path && isWindows) {
path = strings.rtrim(path, '.*'); // Bug on Windows: When "All Files" is picked, the path gets an extra ".*"
}
c(path);
});
});
}
private promptForPathSync(defaultPath?: string): string {
let path = Dialog.showSaveDialog(remote.getCurrentWindow(), this.getSaveDialogOptions(defaultPath ? paths.normalize(defaultPath, true) : void 0));
if (path && isWindows) {
path = strings.rtrim(path, '.*'); // Bug on Windows: When "All Files" is picked, the path gets an extra ".*"
}
return path;
return Dialog.showSaveDialog(remote.getCurrentWindow(), this.getSaveDialogOptions(defaultPath ? paths.normalize(defaultPath, true) : void 0));
}
private getSaveDialogOptions(defaultPath?: string): remote.ISaveDialogOptions {
@ -371,8 +362,13 @@ export class TextFileService extends BrowserTextFileService {
defaultPath: defaultPath
};
// Filters are only working well on Windows it seems
if (!isWindows) {
// Filters are working flaky in Electron and there are bugs. On Windows they are working
// somewhat but we see issues:
// - https://github.com/atom/electron/issues/3556
// - https://github.com/Microsoft/vscode/issues/451
// - Bug on Windows: When "All Files" is picked, the path gets an extra ".*"
// Until these issues are resolved, we disable the dialog file extension filtering.
if (true) {
return options;
}