Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
6027927d
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6027927d
编写于
1月 06, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adopt browser window and dialog
上级
d6c4086d
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
89 addition
and
90 deletion
+89
-90
build/gulpfile.vscode.js
build/gulpfile.vscode.js
+2
-2
src/typings/electron.d.ts
src/typings/electron.d.ts
+50
-41
src/vs/workbench/electron-browser/index.html
src/vs/workbench/electron-browser/index.html
+4
-3
src/vs/workbench/electron-browser/integration.ts
src/vs/workbench/electron-browser/integration.ts
+1
-1
src/vs/workbench/electron-browser/window.ts
src/vs/workbench/electron-browser/window.ts
+6
-9
src/vs/workbench/electron-main/menus.ts
src/vs/workbench/electron-main/menus.ts
+4
-5
src/vs/workbench/electron-main/window.ts
src/vs/workbench/electron-main/window.ts
+4
-5
src/vs/workbench/electron-main/windows.ts
src/vs/workbench/electron-main/windows.ts
+7
-9
src/vs/workbench/parts/files/electron-browser/textFileServices.ts
...orkbench/parts/files/electron-browser/textFileServices.ts
+7
-9
src/vs/workbench/parts/git/electron-main/askpassService.ts
src/vs/workbench/parts/git/electron-main/askpassService.ts
+2
-3
src/vs/workbench/parts/git/electron-main/index.ts
src/vs/workbench/parts/git/electron-main/index.ts
+2
-3
未找到文件。
build/gulpfile.vscode.js
浏览文件 @
6027927d
...
...
@@ -29,8 +29,8 @@ var build = path.join(root, '.build');
var
commit
=
util
.
getVersion
(
root
);
var
baseModules
=
[
'
applicationinsights
'
,
'
assert
'
,
'
browser-window
'
,
'
child_process
'
,
'
chokidar
'
,
'
crypto
'
,
'
dialog
'
,
'
emmet
'
,
'
applicationinsights
'
,
'
assert
'
,
'
child_process
'
,
'
chokidar
'
,
'
crypto
'
,
'
emmet
'
,
'
events
'
,
'
fs
'
,
'
getmac
'
,
'
glob
'
,
'
graceful-fs
'
,
'
http
'
,
'
http-proxy-agent
'
,
'
https
'
,
'
https-proxy-agent
'
,
'
iconv-lite
'
,
'
electron
'
,
'
menu
'
,
'
menu-item
'
,
'
net
'
,
'
os
'
,
'
path
'
,
'
readline
'
,
'
remote
'
,
'
sax
'
,
'
semver
'
,
...
...
src/typings/electron.d.ts
浏览文件 @
6027927d
...
...
@@ -3,9 +3,11 @@
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Copied from https://github.com/DefinitelyTyped/DefinitelyTyped/commit/eddede55bd6b42c154eb8e44336d0fa44ca79965
/// <reference path="./node.d.ts" />
declare
module
GitHub
Electron
{
declare
module
Electron
{
/**
* This class is used to represent an image.
*/
...
...
@@ -750,6 +752,10 @@ declare module GitHubElectron {
* Returns whether the developer tools are opened.
*/
isDevToolsOpened
():
boolean
;
/**
* Returns whether the developer tools are focussed.
*/
isDevToolsFocused
():
boolean
;
/**
* Toggle the developer tools.
*/
...
...
@@ -1181,14 +1187,7 @@ declare module GitHubElectron {
properties
?:
string
|
string
[];
}
/**
* @param browserWindow
* @param options
* @param callback If supplied, the API call will be asynchronous.
* @returns On success, returns the path of file chosen by the user, otherwise
* returns undefined.
*/
export
function
showSaveDialog
(
browserWindow
?:
BrowserWindow
,
options
?:
{
interface
SaveDialogOptions
{
title
?:
string
;
defaultPath
?:
string
;
/**
...
...
@@ -1199,7 +1198,16 @@ declare module GitHubElectron {
name
:
string
;
extensions
:
string
[];
}[]
},
callback
?:
(
fileName
:
string
)
=>
void
):
string
;
}
/**
* @param browserWindow
* @param options
* @param callback If supplied, the API call will be asynchronous.
* @returns On success, returns the path of file chosen by the user, otherwise
* returns undefined.
*/
export
function
showSaveDialog
(
browserWindow
?:
BrowserWindow
,
options
?:
SaveDialogOptions
,
callback
?:
(
fileName
:
string
)
=>
void
):
string
;
/**
* Shows a message box. It will block until the message box is closed. It returns .
...
...
@@ -1239,6 +1247,7 @@ declare module GitHubElectron {
detail
?:
string
;
icon
?:
NativeImage
;
noLink
?:
boolean
;
cancelId
?:
number
;
}
}
...
...
@@ -1310,11 +1319,11 @@ declare module GitHubElectron {
/**
* @returns The contents of the clipboard as a NativeImage.
*/
readImage
:
typeof
GitHub
Electron
.
Clipboard
.
readImage
;
readImage
:
typeof
Electron
.
Clipboard
.
readImage
;
/**
* Writes the image into the clipboard.
*/
writeImage
:
typeof
GitHub
Electron
.
Clipboard
.
writeImage
;
writeImage
:
typeof
Electron
.
Clipboard
.
writeImage
;
/**
* Clears everything in clipboard.
*/
...
...
@@ -1633,19 +1642,19 @@ declare module GitHubElectron {
* @returns On success, returns an array of file paths chosen by the user,
* otherwise returns undefined.
*/
showOpenDialog
:
typeof
GitHub
Electron
.
Dialog
.
showOpenDialog
;
showOpenDialog
:
typeof
Electron
.
Dialog
.
showOpenDialog
;
/**
* @param callback If supplied, the API call will be asynchronous.
* @returns On success, returns the path of file chosen by the user, otherwise
* returns undefined.
*/
showSaveDialog
:
typeof
GitHub
Electron
.
Dialog
.
showSaveDialog
;
showSaveDialog
:
typeof
Electron
.
Dialog
.
showSaveDialog
;
/**
* Shows a message box. It will block until the message box is closed. It returns .
* @param callback If supplied, the API call will be asynchronous.
* @returns The index of the clicked button.
*/
showMessageBox
:
typeof
GitHub
Electron
.
Dialog
.
showMessageBox
;
showMessageBox
:
typeof
Electron
.
Dialog
.
showMessageBox
;
/**
* Runs a modal dialog that shows an error message. This API can be called safely
...
...
@@ -1775,26 +1784,26 @@ declare module GitHubElectron {
}
interface
CommonElectron
{
clipboard
:
GitHub
Electron
.
Clipboard
;
crashReporter
:
GitHub
Electron
.
CrashReporter
;
nativeImage
:
typeof
GitHub
Electron
.
NativeImage
;
shell
:
GitHub
Electron
.
Shell
;
clipboard
:
Electron
.
Clipboard
;
crashReporter
:
Electron
.
CrashReporter
;
nativeImage
:
typeof
Electron
.
NativeImage
;
shell
:
Electron
.
Shell
;
app
:
GitHub
Electron
.
App
;
autoUpdater
:
GitHub
Electron
.
AutoUpdater
;
BrowserWindow
:
typeof
GitHub
Electron
.
BrowserWindow
;
contentTracing
:
GitHub
Electron
.
ContentTracing
;
dialog
:
GitHub
Electron
.
Dialog
;
ipcMain
:
GitHub
Electron
.
IPCMain
;
globalShortcut
:
GitHub
Electron
.
GlobalShortcut
;
Menu
:
typeof
GitHub
Electron
.
Menu
;
MenuItem
:
typeof
GitHub
Electron
.
MenuItem
;
app
:
Electron
.
App
;
autoUpdater
:
Electron
.
AutoUpdater
;
BrowserWindow
:
typeof
Electron
.
BrowserWindow
;
contentTracing
:
Electron
.
ContentTracing
;
dialog
:
Electron
.
Dialog
;
ipcMain
:
Electron
.
IPCMain
;
globalShortcut
:
Electron
.
GlobalShortcut
;
Menu
:
typeof
Electron
.
Menu
;
MenuItem
:
typeof
Electron
.
MenuItem
;
powerMonitor
:
NodeJS
.
EventEmitter
;
powerSaveBlocker
:
GitHub
Electron
.
PowerSaveBlocker
;
protocol
:
GitHub
Electron
.
Protocol
;
screen
:
GitHub
Electron
.
Screen
;
session
:
GitHub
Electron
.
Session
;
Tray
:
typeof
GitHub
Electron
.
Tray
;
powerSaveBlocker
:
Electron
.
PowerSaveBlocker
;
protocol
:
Electron
.
Protocol
;
screen
:
Electron
.
Screen
;
session
:
Electron
.
Session
;
Tray
:
typeof
Electron
.
Tray
;
hideInternalModules
():
void
;
}
...
...
@@ -1816,11 +1825,11 @@ declare module GitHubElectron {
getSources
(
options
:
any
,
callback
:
(
error
:
Error
,
sources
:
DesktopCapturerSource
[])
=>
any
):
void
;
}
interface
Electron
extends
CommonElectron
{
desktopCapturer
:
GitHub
Electron
.
DesktopCapturer
;
ipcRenderer
:
GitHub
Electron
.
IpcRenderer
;
remote
:
GitHub
Electron
.
Remote
;
webFrame
:
GitHub
Electron
.
WebFrame
;
interface
Electron
MainAndRenderer
extends
CommonElectron
{
desktopCapturer
:
Electron
.
DesktopCapturer
;
ipcRenderer
:
Electron
.
IpcRenderer
;
remote
:
Electron
.
Remote
;
webFrame
:
Electron
.
WebFrame
;
}
}
...
...
@@ -1829,7 +1838,7 @@ interface Window {
* Creates a new window.
* @returns An instance of BrowserWindowProxy class.
*/
open
(
url
:
string
,
frameName
?:
string
,
features
?:
string
):
GitHub
Electron
.
BrowserWindowProxy
;
open
(
url
:
string
,
frameName
?:
string
,
features
?:
string
):
Electron
.
BrowserWindowProxy
;
}
interface
File
{
...
...
@@ -1840,10 +1849,10 @@ interface File {
}
declare
module
'
electron
'
{
var
electron
:
GitHubElectron
.
Electron
;
var
electron
:
Electron
.
ElectronMainAndRenderer
;
export
=
electron
;
}
// interface NodeRequireFunction {
// (moduleName: 'electron'):
GitHub
Electron.Electron;
// (moduleName: 'electron'): Electron.Electron;
// }
\ No newline at end of file
src/vs/workbench/electron-browser/index.html
浏览文件 @
6027927d
...
...
@@ -12,12 +12,13 @@
<!-- Helpers -->
<script
type=
"text/javascript"
>
var
path
=
require
(
'
path
'
);
var
remote
=
require
(
'
remote
'
);
var
ipc
=
require
(
'
electron
'
).
ipcRenderer
;
var
electron
=
require
(
'
electron
'
);
var
remote
=
electron
.
remote
;
var
ipc
=
electron
.
ipcRenderer
;
function
onError
(
error
,
enableDeveloperTools
)
{
if
(
enableDeveloperTools
)
{
remote
.
getCurrentWindow
().
openDevTools
();
remote
.
getCurrentWindow
().
webContents
.
openDevTools
();
remote
.
getCurrentWindow
().
show
();
}
...
...
src/vs/workbench/electron-browser/integration.ts
浏览文件 @
6027927d
...
...
@@ -45,7 +45,7 @@ export class ElectronIntegration {
public
integrate
(
shellContainer
:
HTMLElement
):
void
{
// Register the active window
let
activeWindow
=
this
.
instantiationService
.
createInstance
(
win
.
ElectronWindow
,
remote
.
getCurrentWindow
(),
shellContainer
);
let
activeWindow
:
any
=
this
.
instantiationService
.
createInstance
(
<
any
>
win
.
ElectronWindow
,
remote
.
getCurrentWindow
(),
shellContainer
);
this
.
windowService
.
registerWindow
(
activeWindow
);
// Support runAction event
...
...
src/vs/workbench/electron-browser/window.ts
浏览文件 @
6027927d
...
...
@@ -18,10 +18,7 @@ import {IStorageService} from 'vs/platform/storage/common/storage';
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
remote
=
require
(
'
remote
'
);
import
{
ipcRenderer
as
ipc
,
shell
}
from
'
electron
'
;
const
Dialog
=
remote
.
require
(
'
dialog
'
);
import
{
ipcRenderer
as
ipc
,
shell
,
remote
}
from
'
electron
'
;
export
interface
IWindowConfiguration
{
window
:
{
...
...
@@ -32,10 +29,10 @@ export interface IWindowConfiguration {
}
export
class
ElectronWindow
{
private
win
:
remote
.
BrowserWindow
;
private
win
:
Electron
.
BrowserWindow
;
constructor
(
win
:
remote
.
BrowserWindow
,
win
:
Electron
.
BrowserWindow
,
shellContainer
:
HTMLElement
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
IEventService
private
eventService
:
IEventService
,
...
...
@@ -157,8 +154,8 @@ export class ElectronWindow {
this
.
win
.
close
();
}
public
showMessageBox
(
options
:
remote
.
I
MessageBoxOptions
):
number
{
return
D
ialog
.
showMessageBox
(
this
.
win
,
options
);
public
showMessageBox
(
options
:
Electron
.
Dialog
.
Show
MessageBoxOptions
):
number
{
return
remote
.
d
ialog
.
showMessageBox
(
this
.
win
,
options
);
}
public
setFullScreen
(
fullscreen
:
boolean
):
void
{
...
...
@@ -166,7 +163,7 @@ export class ElectronWindow {
}
public
openDevTools
():
void
{
this
.
win
.
openDevTools
();
this
.
win
.
webContents
.
openDevTools
();
}
public
isFullScreen
():
boolean
{
...
...
src/vs/workbench/electron-main/menus.ts
浏览文件 @
6027927d
...
...
@@ -8,8 +8,7 @@
import
Menu
=
require
(
'
menu
'
);
import
MenuItem
=
require
(
'
menu-item
'
);
import
Dialog
=
require
(
'
dialog
'
);
import
{
ipcMain
as
ipc
,
app
,
shell
}
from
'
electron
'
;
import
{
ipcMain
as
ipc
,
app
,
shell
,
dialog
}
from
'
electron
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
platform
=
require
(
'
vs/base/common/platform
'
);
...
...
@@ -657,7 +656,7 @@ export class VSCodeMenu {
return
;
}
if
(
windowInFocus
.
win
.
isDevToolsFocused
())
{
if
(
windowInFocus
.
win
.
webContents
.
isDevToolsFocused
())
{
devToolsFocusedFn
(
windowInFocus
.
win
.
devToolsWebContents
);
}
else
{
windows
.
manager
.
sendToFocused
(
'
vscode:runAction
'
,
actionId
);
...
...
@@ -689,7 +688,7 @@ export class VSCodeMenu {
function
openAboutDialog
():
void
{
let
lastActiveWindow
=
windows
.
manager
.
getFocusedWindow
()
||
windows
.
manager
.
getLastActiveWindow
();
D
ialog
.
showMessageBox
(
lastActiveWindow
&&
lastActiveWindow
.
win
,
{
d
ialog
.
showMessageBox
(
lastActiveWindow
&&
lastActiveWindow
.
win
,
{
title
:
env
.
product
.
nameLong
,
type
:
'
info
'
,
message
:
env
.
product
.
nameLong
,
...
...
@@ -717,7 +716,7 @@ function openUrl(url: string, id: string): void {
function
toggleDevTools
():
void
{
let
w
=
windows
.
manager
.
getFocusedWindow
();
if
(
w
&&
w
.
win
)
{
w
.
win
.
toggleDevTools
();
w
.
win
.
webContents
.
toggleDevTools
();
}
}
...
...
src/vs/workbench/electron-main/window.ts
浏览文件 @
6027927d
...
...
@@ -8,8 +8,7 @@
import
path
=
require
(
'
path
'
);
import
os
=
require
(
'
os
'
);
import
{
shell
,
screen
}
from
'
electron
'
;
import
BrowserWindow
=
require
(
'
browser-window
'
);
import
{
shell
,
screen
,
BrowserWindow
}
from
'
electron
'
;
import
{
TPromise
,
TValueCallback
}
from
'
vs/base/common/winjs.base
'
;
import
platform
=
require
(
'
vs/base/common/platform
'
);
...
...
@@ -138,7 +137,7 @@ export class VSCodeWindow {
private
static
MIN_HEIGHT
=
120
;
private
showTimeoutHandle
:
any
;
private
_win
:
BrowserWindow
;
private
_win
:
Electron
.
BrowserWindow
;
private
_lastFocusTime
:
number
;
private
_readyState
:
ReadyState
;
private
_isPluginDevelopmentHost
:
boolean
;
...
...
@@ -212,7 +211,7 @@ export class VSCodeWindow {
return
this
.
currentConfig
;
}
public
get
win
():
BrowserWindow
{
public
get
win
():
Electron
.
BrowserWindow
{
return
this
.
_win
;
}
...
...
@@ -370,7 +369,7 @@ export class VSCodeWindow {
if
(
this
.
_win
&&
!
this
.
_win
.
isVisible
()
&&
!
this
.
_win
.
isMinimized
())
{
this
.
_win
.
show
();
this
.
_win
.
focus
();
this
.
_win
.
openDevTools
();
this
.
_win
.
webContents
.
openDevTools
();
}
},
10000
);
}
...
...
src/vs/workbench/electron-main/windows.ts
浏览文件 @
6027927d
...
...
@@ -10,9 +10,7 @@ import events = require('events');
import
path
=
require
(
'
path
'
);
import
fs
=
require
(
'
fs
'
);
import
BrowserWindow
=
require
(
'
browser-window
'
);
import
Dialog
=
require
(
'
dialog
'
);
import
{
ipcMain
as
ipc
,
app
,
screen
,
crashReporter
}
from
'
electron
'
;
import
{
ipcMain
as
ipc
,
app
,
screen
,
crashReporter
,
BrowserWindow
,
dialog
}
from
'
electron
'
;
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
env
=
require
(
'
vs/workbench/electron-main/env
'
);
...
...
@@ -408,9 +406,9 @@ export class WindowsManager {
let
activeWindow
=
BrowserWindow
.
getFocusedWindow
();
if
(
activeWindow
)
{
D
ialog
.
showMessageBox
(
activeWindow
,
options
);
d
ialog
.
showMessageBox
(
activeWindow
,
options
);
}
else
{
D
ialog
.
showMessageBox
(
options
);
d
ialog
.
showMessageBox
(
options
);
}
}
...
...
@@ -874,7 +872,7 @@ export class WindowsManager {
pickerProperties
=
[
'
multiSelections
'
,
isFolder
?
'
openDirectory
'
:
'
openFile
'
,
'
createDirectory
'
];
}
D
ialog
.
showOpenDialog
(
focussedWindow
&&
focussedWindow
.
win
,
{
d
ialog
.
showOpenDialog
(
focussedWindow
&&
focussedWindow
.
win
,
{
defaultPath
:
workingDir
,
properties
:
pickerProperties
},
(
paths
)
=>
{
...
...
@@ -1004,12 +1002,12 @@ export class WindowsManager {
return
WindowsManager
.
WINDOWS
.
length
;
}
private
onWindowError
(
win
:
BrowserWindow
,
error
:
WindowError
):
void
{
private
onWindowError
(
win
:
Electron
.
BrowserWindow
,
error
:
WindowError
):
void
{
console
.
error
(
error
===
WindowError
.
CRASHED
?
'
[VS Code]: render process crashed!
'
:
'
[VS Code]: detected unresponsive
'
);
// Unresponsive
if
(
error
===
WindowError
.
UNRESPONSIVE
)
{
D
ialog
.
showMessageBox
(
win
,
{
d
ialog
.
showMessageBox
(
win
,
{
title
:
env
.
product
.
nameLong
,
type
:
'
warning
'
,
buttons
:
[
nls
.
localize
(
'
exit
'
,
"
Exit
"
),
nls
.
localize
(
'
wait
'
,
"
Keep Waiting
"
)],
...
...
@@ -1026,7 +1024,7 @@ export class WindowsManager {
// Crashed
else
{
D
ialog
.
showMessageBox
(
win
,
{
d
ialog
.
showMessageBox
(
win
,
{
title
:
env
.
product
.
nameLong
,
type
:
'
warning
'
,
buttons
:
[
nls
.
localize
(
'
exit
'
,
"
Exit
"
)],
...
...
src/vs/workbench/parts/files/electron-browser/textFileServices.ts
浏览文件 @
6027927d
...
...
@@ -29,9 +29,7 @@ import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle';
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IConfigurationService
,
IConfigurationServiceEvent
,
ConfigurationServiceEventTypes
}
from
'
vs/platform/configuration/common/configuration
'
;
import
remote
=
require
(
'
remote
'
);
const
Dialog
=
remote
.
require
(
'
dialog
'
);
import
{
remote
}
from
'
electron
'
;
export
class
TextFileService
extends
AbstractTextFileService
{
...
...
@@ -182,7 +180,7 @@ export class TextFileService extends AbstractTextFileService {
buttons
.
push
(
cancel
,
dontSave
);
}
let
opts
:
remote
.
I
MessageBoxOptions
=
{
let
opts
:
Electron
.
Dialog
.
Show
MessageBoxOptions
=
{
title
:
this
.
contextService
.
getConfiguration
().
env
.
appName
,
message
:
message
.
join
(
'
\n
'
),
type
:
'
warning
'
,
...
...
@@ -192,7 +190,7 @@ export class TextFileService extends AbstractTextFileService {
cancelId
:
buttons
.
indexOf
(
cancel
)
};
const
choice
=
D
ialog
.
showMessageBox
(
remote
.
getCurrentWindow
(),
opts
);
const
choice
=
remote
.
d
ialog
.
showMessageBox
(
remote
.
getCurrentWindow
(),
opts
);
return
buttons
[
choice
].
result
;
}
...
...
@@ -365,18 +363,18 @@ export class TextFileService extends AbstractTextFileService {
private
promptForPathAsync
(
defaultPath
?:
string
):
TPromise
<
string
>
{
return
new
TPromise
<
string
>
((
c
,
e
)
=>
{
D
ialog
.
showSaveDialog
(
remote
.
getCurrentWindow
(),
this
.
getSaveDialogOptions
(
defaultPath
?
paths
.
normalize
(
defaultPath
,
true
)
:
void
0
),
(
path
)
=>
{
remote
.
d
ialog
.
showSaveDialog
(
remote
.
getCurrentWindow
(),
this
.
getSaveDialogOptions
(
defaultPath
?
paths
.
normalize
(
defaultPath
,
true
)
:
void
0
),
(
path
)
=>
{
c
(
path
);
});
});
}
private
promptForPathSync
(
defaultPath
?:
string
):
string
{
return
D
ialog
.
showSaveDialog
(
remote
.
getCurrentWindow
(),
this
.
getSaveDialogOptions
(
defaultPath
?
paths
.
normalize
(
defaultPath
,
true
)
:
void
0
));
return
remote
.
d
ialog
.
showSaveDialog
(
remote
.
getCurrentWindow
(),
this
.
getSaveDialogOptions
(
defaultPath
?
paths
.
normalize
(
defaultPath
,
true
)
:
void
0
));
}
private
getSaveDialogOptions
(
defaultPath
?:
string
):
remote
.
I
SaveDialogOptions
{
let
options
:
remote
.
I
SaveDialogOptions
=
{
private
getSaveDialogOptions
(
defaultPath
?:
string
):
Electron
.
Dialog
.
SaveDialogOptions
{
let
options
:
Electron
.
Dialog
.
SaveDialogOptions
=
{
defaultPath
:
defaultPath
};
...
...
src/vs/workbench/parts/git/electron-main/askpassService.ts
浏览文件 @
6027927d
...
...
@@ -4,10 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
{
ipcMain
as
ipc
}
from
'
electron
'
;
import
{
ipcMain
as
ipc
,
BrowserWindow
}
from
'
electron
'
;
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
BrowserWindow
=
require
(
'
browser-window
'
);
export
interface
ICredentials
{
username
:
string
;
...
...
@@ -21,7 +20,7 @@ interface ICredentialsResult {
interface
IContext
{
credentials
:
ICredentials
;
window
:
BrowserWindow
;
window
:
Electron
.
BrowserWindow
;
}
export
class
GitAskpassService
{
...
...
src/vs/workbench/parts/git/electron-main/index.ts
浏览文件 @
6027927d
...
...
@@ -10,8 +10,7 @@ import env = require('vs/workbench/electron-main/env');
import
events
=
require
(
'
vs/base/common/eventEmitter
'
);
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
BrowserWindow
=
require
(
'
browser-window
'
);
import
{
ipcMain
as
ipc
}
from
'
electron
'
;
import
{
ipcMain
as
ipc
,
BrowserWindow
}
from
'
electron
'
;
interface
ICredentialsContext
{
id
:
number
;
...
...
@@ -31,7 +30,7 @@ interface ICredentialsResult {
interface
IContext
{
credentials
:
ICredentials
;
window
:
BrowserWindow
;
window
:
Electron
.
BrowserWindow
;
}
export
function
configure
(
bus
:
events
.
EventEmitter
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录