Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
543dc0df
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,发现更多精彩内容 >>
提交
543dc0df
编写于
4月 05, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
settings - prompt for restart for some
上级
846d59aa
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
131 addition
and
0 deletion
+131
-0
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+2
-0
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+6
-0
src/vs/platform/windows/electron-browser/windowService.ts
src/vs/platform/windows/electron-browser/windowService.ts
+4
-0
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+10
-0
src/vs/workbench/electron-browser/workbench.main.ts
src/vs/workbench/electron-browser/workbench.main.ts
+2
-0
src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts
...ts/relauncher/electron-browser/relauncher.contribution.ts
+99
-0
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+8
-0
未找到文件。
src/vs/platform/windows/common/windows.ts
浏览文件 @
543dc0df
...
...
@@ -33,6 +33,7 @@ export interface IWindowsService {
clearRecentPathsList
():
TPromise
<
void
>
;
getRecentlyOpen
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
focusWindow
(
windowId
:
number
):
TPromise
<
void
>
;
isFocused
(
windowId
:
number
):
TPromise
<
boolean
>
;
isMaximized
(
windowId
:
number
):
TPromise
<
boolean
>
;
maximizeWindow
(
windowId
:
number
):
TPromise
<
void
>
;
unmaximizeWindow
(
windowId
:
number
):
TPromise
<
void
>
;
...
...
@@ -83,6 +84,7 @@ export interface IWindowService {
removeFromRecentlyOpen
(
paths
:
string
[]):
TPromise
<
void
>
;
getRecentlyOpen
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
focusWindow
():
TPromise
<
void
>
;
isFocused
():
TPromise
<
boolean
>
;
setDocumentEdited
(
flag
:
boolean
):
TPromise
<
void
>
;
isMaximized
():
TPromise
<
boolean
>
;
maximizeWindow
():
TPromise
<
void
>
;
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
543dc0df
...
...
@@ -27,6 +27,7 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
clearRecentPathsList
'
):
TPromise
<
void
>
;
call
(
command
:
'
getRecentlyOpen
'
,
arg
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
call
(
command
:
'
focusWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
isFocused
'
,
arg
:
number
):
TPromise
<
boolean
>
;
call
(
command
:
'
isMaximized
'
,
arg
:
number
):
TPromise
<
boolean
>
;
call
(
command
:
'
maximizeWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
unmaximizeWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
...
...
@@ -76,6 +77,7 @@ export class WindowsChannel implements IWindowsChannel {
case
'
clearRecentPathsList
'
:
return
this
.
service
.
clearRecentPathsList
();
case
'
getRecentlyOpen
'
:
return
this
.
service
.
getRecentlyOpen
(
arg
);
case
'
focusWindow
'
:
return
this
.
service
.
focusWindow
(
arg
);
case
'
isFocused
'
:
return
this
.
service
.
isFocused
(
arg
);
case
'
isMaximized
'
:
return
this
.
service
.
isMaximized
(
arg
);
case
'
maximizeWindow
'
:
return
this
.
service
.
maximizeWindow
(
arg
);
case
'
unmaximizeWindow
'
:
return
this
.
service
.
unmaximizeWindow
(
arg
);
...
...
@@ -167,6 +169,10 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
focusWindow
'
,
windowId
);
}
isFocused
(
windowId
:
number
):
TPromise
<
boolean
>
{
return
this
.
channel
.
call
(
'
isFocused
'
,
windowId
);
}
isMaximized
(
windowId
:
number
):
TPromise
<
boolean
>
{
return
this
.
channel
.
call
(
'
isMaximized
'
,
windowId
);
}
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
543dc0df
...
...
@@ -74,6 +74,10 @@ export class WindowService implements IWindowService {
return
this
.
windowsService
.
focusWindow
(
this
.
windowId
);
}
isFocused
():
TPromise
<
boolean
>
{
return
this
.
windowsService
.
isFocused
(
this
.
windowId
);
}
isMaximized
():
TPromise
<
boolean
>
{
return
this
.
windowsService
.
isMaximized
(
this
.
windowId
);
}
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
543dc0df
...
...
@@ -166,6 +166,16 @@ export class WindowsService implements IWindowsService, IDisposable {
return
TPromise
.
as
(
null
);
}
isFocused
(
windowId
:
number
):
TPromise
<
boolean
>
{
const
vscodeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
if
(
vscodeWindow
)
{
return
TPromise
.
as
(
vscodeWindow
.
win
.
isFocused
());
}
return
TPromise
.
as
(
null
);
}
isMaximized
(
windowId
:
number
):
TPromise
<
boolean
>
{
const
vscodeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
...
...
src/vs/workbench/electron-browser/workbench.main.ts
浏览文件 @
543dc0df
...
...
@@ -82,6 +82,8 @@ import 'vs/workbench/electron-browser/workbench';
import
'
vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution
'
;
import
'
vs/workbench/parts/relauncher/electron-browser/relauncher.contribution
'
;
import
'
vs/workbench/parts/tasks/electron-browser/task.contribution
'
;
import
'
vs/workbench/parts/emmet/browser/emmet.browser.contribution
'
;
...
...
src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts
0 → 100644
浏览文件 @
543dc0df
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IWorkbenchContributionsRegistry
,
IWorkbenchContribution
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
IWindowsService
,
IWindowService
}
from
"
vs/platform/windows/common/windows
"
;
import
{
IConfigurationService
}
from
"
vs/platform/configuration/common/configuration
"
;
import
{
IWindowConfiguration
}
from
"
vs/workbench/electron-browser/common
"
;
import
{
localize
}
from
"
vs/nls
"
;
import
{
IEnvironmentService
}
from
"
vs/platform/environment/common/environment
"
;
interface
IConfiguration
extends
IWindowConfiguration
{
update
:
{
channel
:
string
;
};
telemetry
:
{
enableCrashReporter
:
boolean
};
}
export
class
SettingsChangeRelauncher
implements
IWorkbenchContribution
{
private
toDispose
:
IDisposable
[]
=
[];
private
titleBarStyle
:
'
native
'
|
'
custom
'
;
private
updateChannel
:
string
;
private
enableCrashReporter
:
boolean
;
constructor
(
@
IWindowsService
private
windowsService
:
IWindowsService
,
@
IWindowService
private
windowService
:
IWindowService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IPreferencesService
private
preferencesService
:
IPreferencesService
,
@
IEnvironmentService
private
envService
:
IEnvironmentService
,
@
IMessageService
private
messageService
:
IMessageService
)
{
this
.
onConfigurationChange
(
configurationService
.
getConfiguration
<
IConfiguration
>
(),
false
);
this
.
registerListeners
();
}
private
registerListeners
():
void
{
this
.
toDispose
.
push
(
this
.
configurationService
.
onDidUpdateConfiguration
(
e
=>
this
.
onConfigurationChange
(
e
.
config
,
true
)));
}
private
onConfigurationChange
(
config
:
IConfiguration
,
notify
:
boolean
):
void
{
let
changed
=
false
;
// Titlebar style
if
(
config
.
window
&&
config
.
window
.
titleBarStyle
!==
this
.
titleBarStyle
&&
(
config
.
window
.
titleBarStyle
===
'
native
'
||
config
.
window
.
titleBarStyle
===
'
custom
'
))
{
this
.
titleBarStyle
=
config
.
window
.
titleBarStyle
;
changed
=
true
;
}
// Update channel
if
(
config
.
update
&&
config
.
update
.
channel
!==
this
.
updateChannel
)
{
this
.
updateChannel
=
config
.
update
.
channel
;
changed
=
true
;
}
// Crash reporter
if
(
config
.
telemetry
&&
config
.
telemetry
.
enableCrashReporter
!==
this
.
enableCrashReporter
)
{
this
.
enableCrashReporter
=
config
.
telemetry
.
enableCrashReporter
;
changed
=
true
;
}
// Notify only when changed and we are the focused window (avoids notification spam across windows)
if
(
notify
&&
changed
)
{
this
.
windowService
.
isFocused
().
then
(
focused
=>
{
if
(
focused
)
{
const
relaunch
=
this
.
messageService
.
confirm
({
type
:
'
info
'
,
message
:
localize
(
'
relaunchMessage
'
,
"
A setting has changed that requires a restart to take effect.
"
),
detail
:
localize
(
'
relaunchDetail
'
,
"
Press the restart button to restart {0} and enable the setting.
"
,
this
.
envService
.
appNameLong
),
primaryButton
:
localize
(
'
restart
'
,
"
Restart
"
)
});
if
(
relaunch
)
{
this
.
windowsService
.
relaunch
(
Object
.
create
(
null
));
}
}
});
}
}
getId
():
string
{
return
'
workbench.relauncher
'
;
}
public
dispose
():
void
{
this
.
toDispose
=
dispose
(
this
.
toDispose
);
}
}
const
workbenchRegistry
=
<
IWorkbenchContributionsRegistry
>
Registry
.
as
(
WorkbenchExtensions
.
Workbench
);
workbenchRegistry
.
registerWorkbenchContribution
(
SettingsChangeRelauncher
);
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
543dc0df
...
...
@@ -775,6 +775,10 @@ export class TestWindowService implements IWindowService {
public
_serviceBrand
:
any
;
isFocused
():
TPromise
<
boolean
>
{
return
TPromise
.
as
(
false
);
}
getCurrentWindowId
():
number
{
return
0
;
}
...
...
@@ -886,6 +890,10 @@ export class TestWindowsService implements IWindowsService {
onWindowOpen
:
Event
<
number
>
;
onWindowFocus
:
Event
<
number
>
;
isFocused
(
windowId
:
number
):
TPromise
<
boolean
>
{
return
TPromise
.
as
(
false
);
}
openFileFolderPicker
(
windowId
:
number
,
forceNewWindow
?:
boolean
):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录