提交 88825231 编写于 作者: B Benjamin Pasero

no more workbench readonly option

上级 5cd6e6ed
......@@ -101,7 +101,6 @@ export abstract class BaseTextEditor extends BaseEditor {
protected getCodeEditorOptions(): IEditorOptions {
let baseOptions: IEditorOptions = {
overviewRulerLanes: 3,
readOnly: this.contextService.getOptions().readOnly,
glyphMargin: true,
lineNumbersMinChars: 3,
theme: this._themeService.getTheme()
......
......@@ -718,11 +718,6 @@ export class Workbench implements IPartService {
this.workbench.addClass('nosidebar');
}
// Apply readonly state as CSS class
if (this.workbenchParams.options.readOnly) {
this.workbench.addClass('readonly');
}
// Apply no-workspace state as CSS class
if (!this.workbenchParams.workspace) {
this.workbench.addClass('no-workspace');
......
......@@ -41,11 +41,6 @@ export interface IOptions {
*/
singleFileMode?: boolean;
/**
* A flag turning the workbench into readonly mode preventing file modifications.
*/
readOnly?: boolean;
/**
* Editor options to be used for any editor in the workbench.
*/
......
......@@ -64,7 +64,6 @@ export interface IFileViewletState {
export class BaseFileAction extends Action {
private _element: FileStat;
private listenerToUnbind: IDisposable;
constructor(
id: string,
......@@ -79,9 +78,6 @@ export class BaseFileAction extends Action {
super(id, label);
this.enabled = false;
// update enablement when options change
this.listenerToUnbind = this._eventService.addListener2(WorkbenchEventType.WORKBENCH_OPTIONS_CHANGED, () => this._updateEnablement());
}
public get contextService() {
......@@ -121,7 +117,7 @@ export class BaseFileAction extends Action {
}
_updateEnablement(): void {
this.enabled = !!(this._contextService && this._fileService && this._editorService && !this._contextService.getOptions().readOnly && this._isEnabled());
this.enabled = !!(this._contextService && this._fileService && this._editorService && this._isEnabled());
}
protected onError(error: any): void {
......@@ -166,12 +162,6 @@ export class BaseFileAction extends Action {
return TPromise.as(false);
}
public dispose(): void {
this.listenerToUnbind.dispose();
super.dispose();
}
}
export class TriggerRenameFileAction extends BaseFileAction {
......
......@@ -723,10 +723,6 @@ export class FileDragAndDrop implements IDragAndDrop {
let isCopy = originalEvent && ((originalEvent.ctrlKey && !platform.isMacintosh) || (originalEvent.altKey && platform.isMacintosh));
let fromDesktop = data instanceof DesktopDragAndDropData;
if (this.contextService.getOptions().readOnly) {
return DRAG_OVER_REJECT;
}
// Desktop DND
if (fromDesktop) {
let dragData = (<DesktopDragAndDropData>data).getData();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册