Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8ebaeee5
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8ebaeee5
编写于
12月 20, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dialogs - add logging
上级
3aed2331
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
53 addition
and
9 deletion
+53
-9
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+27
-5
src/vs/platform/windows/electron-browser/windowService.ts
src/vs/platform/windows/electron-browser/windowService.ts
+26
-4
未找到文件。
src/vs/code/electron-main/windows.ts
浏览文件 @
8ebaeee5
...
...
@@ -148,7 +148,7 @@ export class WindowsManager implements IWindowsMainService {
this
.
windowsState
.
openedWindows
=
[];
}
this
.
dialogs
=
new
Dialogs
(
environmentService
,
telemetryService
,
stateService
,
this
);
this
.
dialogs
=
new
Dialogs
(
environmentService
,
telemetryService
,
stateService
,
this
,
this
.
logService
);
this
.
workspacesManager
=
new
WorkspacesManager
(
workspacesMainService
,
backupMainService
,
environmentService
,
this
);
}
...
...
@@ -1564,7 +1564,8 @@ class Dialogs {
private
environmentService
:
IEnvironmentService
,
private
telemetryService
:
ITelemetryService
,
private
stateService
:
IStateService
,
private
windowsMainService
:
IWindowsMainService
private
windowsMainService
:
IWindowsMainService
,
private
logService
:
ILogService
)
{
this
.
mapWindowToDialogQueue
=
new
Map
<
number
,
Queue
<
any
>>
();
this
.
noWindowDialogQueue
=
new
Queue
<
any
>
();
...
...
@@ -1644,22 +1645,33 @@ class Dialogs {
private
getDialogQueue
(
window
?:
ICodeWindow
):
Queue
<
any
>
{
if
(
!
window
)
{
this
.
logService
.
info
(
'
getDialogQueue: using NO WINDOW queue. size:
'
,
this
.
noWindowDialogQueue
.
size
);
return
this
.
noWindowDialogQueue
;
}
let
windowDialogQueue
=
this
.
mapWindowToDialogQueue
.
get
(
window
.
id
);
if
(
!
windowDialogQueue
)
{
this
.
logService
.
info
(
'
getDialogQueue: creating window dialog queue for window:
'
,
window
.
id
);
windowDialogQueue
=
new
Queue
<
any
>
();
this
.
mapWindowToDialogQueue
.
set
(
window
.
id
,
windowDialogQueue
);
}
else
{
this
.
logService
.
info
(
'
getDialogQueue: found existing window dialog queue for window:
'
,
window
.
id
);
}
this
.
logService
.
info
(
'
getDialogQueue: size:
'
,
windowDialogQueue
.
size
);
return
windowDialogQueue
;
}
public
showMessageBox
(
options
:
Electron
.
MessageBoxOptions
,
window
?:
ICodeWindow
):
TPromise
<
IMessageBoxResult
>
{
this
.
logService
.
info
(
'
showMessageBox begin:
'
,
options
,
window
?
window
.
id
:
'
No Window
'
);
return
this
.
getDialogQueue
(
window
).
queue
(()
=>
{
return
new
TPromise
((
c
,
e
)
=>
{
dialog
.
showMessageBox
(
window
?
window
.
win
:
void
0
,
options
,
(
response
:
number
,
checkboxChecked
:
boolean
)
=>
c
({
button
:
response
,
checkboxChecked
}));
this
.
logService
.
info
(
'
showMessageBox opening
'
);
dialog
.
showMessageBox
(
window
?
window
.
win
:
void
0
,
options
,
(
response
:
number
,
checkboxChecked
:
boolean
)
=>
{
this
.
logService
.
info
(
'
showMessageBox closed, response:
'
,
response
,
checkboxChecked
);
c
({
button
:
response
,
checkboxChecked
});
});
});
});
}
...
...
@@ -1673,9 +1685,14 @@ class Dialogs {
return
path
;
}
this
.
logService
.
info
(
'
showSaveDialog begin:
'
,
options
,
window
?
window
.
id
:
'
No Window
'
);
return
this
.
getDialogQueue
(
window
).
queue
(()
=>
{
return
new
TPromise
((
c
,
e
)
=>
{
dialog
.
showSaveDialog
(
window
?
window
.
win
:
void
0
,
options
,
path
=>
c
(
normalizePath
(
path
)));
this
.
logService
.
info
(
'
showSaveDialog opening
'
);
dialog
.
showSaveDialog
(
window
?
window
.
win
:
void
0
,
options
,
path
=>
{
this
.
logService
.
info
(
'
showSaveDialog closed, response:
'
,
path
);
c
(
normalizePath
(
path
));
});
});
});
}
...
...
@@ -1689,9 +1706,14 @@ class Dialogs {
return
paths
;
}
this
.
logService
.
info
(
'
showOpenDialog begin:
'
,
options
,
window
?
window
.
id
:
'
No Window
'
);
return
this
.
getDialogQueue
(
window
).
queue
(()
=>
{
return
new
TPromise
((
c
,
e
)
=>
{
dialog
.
showOpenDialog
(
window
?
window
.
win
:
void
0
,
options
,
paths
=>
c
(
normalizePaths
(
paths
)));
this
.
logService
.
info
(
'
showOpenDialog opening
'
);
dialog
.
showOpenDialog
(
window
?
window
.
win
:
void
0
,
options
,
paths
=>
{
this
.
logService
.
info
(
'
showOpenDialog closed, response:
'
,
paths
);
c
(
normalizePaths
(
paths
));
});
});
});
}
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
8ebaeee5
...
...
@@ -11,6 +11,7 @@ import { IWindowService, IWindowsService, INativeOpenDialogOptions, IEnterWorksp
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IWorkspaceFolderCreationData
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
export
class
WindowService
implements
IWindowService
{
...
...
@@ -21,7 +22,8 @@ export class WindowService implements IWindowService {
constructor
(
private
windowId
:
number
,
private
configuration
:
IWindowConfiguration
,
@
IWindowsService
private
windowsService
:
IWindowsService
@
IWindowsService
private
windowsService
:
IWindowsService
,
@
ILogService
private
logService
:
ILogService
)
{
const
onThisWindowFocus
=
mapEvent
(
filterEvent
(
windowsService
.
onWindowFocus
,
id
=>
id
===
windowId
),
_
=>
true
);
const
onThisWindowBlur
=
mapEvent
(
filterEvent
(
windowsService
.
onWindowBlur
,
id
=>
id
===
windowId
),
_
=>
false
);
...
...
@@ -39,24 +41,32 @@ export class WindowService implements IWindowService {
pickFileFolderAndOpen
(
options
:
INativeOpenDialogOptions
):
TPromise
<
void
>
{
options
.
windowId
=
this
.
windowId
;
this
.
logService
.
info
(
'
pickFileFolderAndOpen: begin
'
);
return
this
.
windowsService
.
pickFileFolderAndOpen
(
options
);
}
pickFileAndOpen
(
options
:
INativeOpenDialogOptions
):
TPromise
<
void
>
{
options
.
windowId
=
this
.
windowId
;
this
.
logService
.
info
(
'
pickFileAndOpen: begin
'
);
return
this
.
windowsService
.
pickFileAndOpen
(
options
);
}
pickFolderAndOpen
(
options
:
INativeOpenDialogOptions
):
TPromise
<
void
>
{
options
.
windowId
=
this
.
windowId
;
this
.
logService
.
info
(
'
pickFolderAndOpen: begin
'
);
return
this
.
windowsService
.
pickFolderAndOpen
(
options
);
}
pickWorkspaceAndOpen
(
options
:
INativeOpenDialogOptions
):
TPromise
<
void
>
{
options
.
windowId
=
this
.
windowId
;
this
.
logService
.
info
(
'
pickWorkspaceAndOpen: begin
'
);
return
this
.
windowsService
.
pickWorkspaceAndOpen
(
options
);
}
...
...
@@ -121,15 +131,27 @@ export class WindowService implements IWindowService {
}
showMessageBox
(
options
:
Electron
.
MessageBoxOptions
):
TPromise
<
IMessageBoxResult
>
{
return
this
.
windowsService
.
showMessageBox
(
this
.
windowId
,
options
);
this
.
logService
.
info
(
'
showMessageBox begin:
'
,
options
);
return
this
.
windowsService
.
showMessageBox
(
this
.
windowId
,
options
).
then
(
result
=>
{
this
.
logService
.
info
(
'
showMessageBox closed, response:
'
,
result
);
return
result
;
});
}
showSaveDialog
(
options
:
Electron
.
SaveDialogOptions
):
TPromise
<
string
>
{
return
this
.
windowsService
.
showSaveDialog
(
this
.
windowId
,
options
);
this
.
logService
.
info
(
'
showSaveDialog begin:
'
,
options
);
return
this
.
windowsService
.
showSaveDialog
(
this
.
windowId
,
options
).
then
(
result
=>
{
this
.
logService
.
info
(
'
showSaveDialog begin:
'
,
result
);
return
result
;
});
}
showOpenDialog
(
options
:
Electron
.
OpenDialogOptions
):
TPromise
<
string
[]
>
{
return
this
.
windowsService
.
showOpenDialog
(
this
.
windowId
,
options
);
this
.
logService
.
info
(
'
showOpenDialog begin:
'
,
options
);
return
this
.
windowsService
.
showOpenDialog
(
this
.
windowId
,
options
).
then
(
result
=>
{
this
.
logService
.
info
(
'
showOpenDialog closed:
'
,
result
);
return
result
;
});
}
updateTouchBar
(
items
:
ICommandAction
[][]):
TPromise
<
void
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录