Respect message settings (#2614)

* add results view stating

* working through the bugs

* handle various resizing bugs

* gnale resizing better

* add configuration to state

* address comments
This commit is contained in:
Anthony Dresser
2018-09-17 17:55:38 -07:00
committed by Karl Burtram
parent 4d9cc604b9
commit c8c6d072f6
3 changed files with 29 additions and 15 deletions

View File

@@ -14,16 +14,21 @@ import { GridPanelState } from 'sql/parts/query/editor/gridPanel';
import { MessagePanelState } from 'sql/parts/query/editor/messagePanel';
import { QueryPlanState } from 'sql/parts/queryPlan/queryPlan';
import { ChartState } from 'sql/parts/query/editor/charting/chartView';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export class ResultsViewState {
public gridPanelState: GridPanelState = new GridPanelState();
public messagePanelState: MessagePanelState = new MessagePanelState();
public messagePanelState: MessagePanelState = new MessagePanelState(this.configurationService);
public chartState: ChartState = new ChartState();
public queryPlanState: QueryPlanState = new QueryPlanState();
public gridPanelSize: number;
public messagePanelSize: number;
public activeTab: string;
public visibleTabs: Set<string> = new Set<string>();
constructor(@IConfigurationService private configurationService: IConfigurationService) {
}
}
/**
@@ -45,9 +50,11 @@ export class QueryResultsInput extends EditorInput {
public readonly onRestoreViewStateEmitter = new Emitter<void>();
public readonly onSaveViewStateEmitter = new Emitter<void>();
public readonly state = new ResultsViewState();
public readonly state = new ResultsViewState(this.configurationService);
constructor(private _uri: string) {
constructor(private _uri: string,
@IConfigurationService private configurationService: IConfigurationService
) {
super();
this._visible = false;
this._hasBootstrapped = false;

View File

@@ -25,7 +25,7 @@ import { OpenMode, ClickBehavior, ICancelableEvent, IControllerOptions } from 'v
import { WorkbenchTreeController } from 'vs/platform/list/browser/listService';
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import { $ } from 'vs/base/browser/builder';
import { isArray } from 'vs/base/common/types';
import { isArray, isUndefinedOrNull } from 'vs/base/common/types';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditor } from 'vs/editor/common/editorCommon';
@@ -62,6 +62,13 @@ const TemplateIds = {
export class MessagePanelState {
public scrollPosition: number;
public collapsed = false;
constructor(@IConfigurationService configurationService: IConfigurationService) {
let messagesOpenedSettings = configurationService.getValue<boolean>('sql.messagesDefaultOpen');
if (!isUndefinedOrNull(messagesOpenedSettings)) {
this.collapsed = !messagesOpenedSettings;
}
}
}
export class MessagePanel extends ViewletPanel {