mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-29 04:42:51 +02:00
IDE: messages: started load/save options
git-svn-id: trunk@45320 -
This commit is contained in:
parent
9ad149a4c9
commit
5dc16e0b9f
@ -35,13 +35,12 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Math, strutils, Classes, SysUtils, UTF8Process, FileProcs, LazFileCache,
|
Math, strutils, Classes, SysUtils, UTF8Process, FileProcs, LazFileCache,
|
||||||
LazUTF8Classes, LazFileUtils, LazUTF8, AvgLvlTree, SynEdit, SynEditMarks,
|
LazUTF8Classes, LazFileUtils, LazUTF8, AvgLvlTree, LazConfigStorage, SynEdit,
|
||||||
LResources, Forms, Buttons, ExtCtrls, Controls, LMessages, LCLType, Graphics,
|
SynEditMarks, LResources, Forms, Buttons, ExtCtrls, Controls, LMessages,
|
||||||
LCLIntf, Themes, ImgList, GraphType, Menus, Clipbrd, Dialogs, StdCtrls,
|
LCLType, Graphics, LCLIntf, Themes, ImgList, GraphType, Menus, Clipbrd,
|
||||||
IDEExternToolIntf, IDEImagesIntf, MenuIntf, PackageIntf, IDECommands,
|
Dialogs, StdCtrls, IDEExternToolIntf, IDEImagesIntf, MenuIntf, PackageIntf,
|
||||||
SrcEditorIntf,
|
IDECommands, SrcEditorIntf, LazarusIDEStrConsts, EnvironmentOpts,
|
||||||
LazarusIDEStrConsts, EnvironmentOpts, HelpFPCMessages,
|
HelpFPCMessages, etSrcEditMarks, etQuickFixes, ExtTools;
|
||||||
etSrcEditMarks, etQuickFixes, ExtTools;
|
|
||||||
|
|
||||||
const
|
const
|
||||||
CustomViewCaption = '------------------------------';
|
CustomViewCaption = '------------------------------';
|
||||||
@ -70,7 +69,10 @@ type
|
|||||||
property Index: integer read FIndex;
|
property Index: integer read FIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TLMsgViewFilter - read/write by main thread, read by worker thread }
|
{ TLMsgViewFilter
|
||||||
|
Note: The View.Filter is protected by View.Enter/LeaveCriticalSection,
|
||||||
|
read/write by main thread, read by worker thread.
|
||||||
|
}
|
||||||
|
|
||||||
TLMsgViewFilter = class
|
TLMsgViewFilter = class
|
||||||
private
|
private
|
||||||
@ -282,6 +284,8 @@ type
|
|||||||
procedure EndUpdate;
|
procedure EndUpdate;
|
||||||
procedure EraseBackground({%H-}DC: HDC); override;
|
procedure EraseBackground({%H-}DC: HDC); override;
|
||||||
procedure ApplyEnvironmentOptions;
|
procedure ApplyEnvironmentOptions;
|
||||||
|
procedure LoadFromConfig(Cfg: TConfigStorage; FileVersion: integer);
|
||||||
|
procedure SaveToConfig(Cfg: TConfigStorage);
|
||||||
|
|
||||||
// views
|
// views
|
||||||
function ViewCount: integer; inline;
|
function ViewCount: integer; inline;
|
||||||
@ -420,6 +424,8 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
procedure ApplyIDEOptions;
|
procedure ApplyIDEOptions;
|
||||||
|
procedure LoadFromConfig(Cfg: TConfigStorage; FileVersion: integer);
|
||||||
|
procedure SaveToConfig(Cfg: TConfigStorage);
|
||||||
|
|
||||||
// Views
|
// Views
|
||||||
function ViewCount: integer;
|
function ViewCount: integer;
|
||||||
@ -2804,6 +2810,17 @@ begin
|
|||||||
FilenameStyle:=EnvironmentOptions.MsgViewFilenameStyle;
|
FilenameStyle:=EnvironmentOptions.MsgViewFilenameStyle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMessagesCtrl.LoadFromConfig(Cfg: TConfigStorage; FileVersion: integer
|
||||||
|
);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMessagesCtrl.SaveToConfig(Cfg: TConfigStorage);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
function TMessagesCtrl.IndexOfView(View: TLMsgWndView): integer;
|
function TMessagesCtrl.IndexOfView(View: TLMsgWndView): integer;
|
||||||
begin
|
begin
|
||||||
Result:=FViews.IndexOf(View);
|
Result:=FViews.IndexOf(View);
|
||||||
@ -3677,6 +3694,17 @@ begin
|
|||||||
MessagesCtrl.ApplyEnvironmentOptions;
|
MessagesCtrl.ApplyEnvironmentOptions;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMessagesFrame.LoadFromConfig(Cfg: TConfigStorage;
|
||||||
|
FileVersion: integer);
|
||||||
|
begin
|
||||||
|
MessagesCtrl.LoadFromConfig(Cfg,FileVersion);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMessagesFrame.SaveToConfig(Cfg: TConfigStorage);
|
||||||
|
begin
|
||||||
|
MessagesCtrl.SaveToConfig(Cfg);
|
||||||
|
end;
|
||||||
|
|
||||||
function TMessagesFrame.ViewCount: integer;
|
function TMessagesFrame.ViewCount: integer;
|
||||||
begin
|
begin
|
||||||
Result:=MessagesCtrl.ViewCount;
|
Result:=MessagesCtrl.ViewCount;
|
||||||
|
@ -3,6 +3,7 @@ object MessagesView: TMessagesView
|
|||||||
Height = 128
|
Height = 128
|
||||||
Top = 586
|
Top = 586
|
||||||
Width = 639
|
Width = 639
|
||||||
|
BorderStyle = bsSizeToolWin
|
||||||
Caption = 'MessagesView'
|
Caption = 'MessagesView'
|
||||||
ClientHeight = 128
|
ClientHeight = 128
|
||||||
ClientWidth = 639
|
ClientWidth = 639
|
||||||
|
@ -32,10 +32,14 @@ unit etMessagesWnd;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, IDEMsgIntf, IDEImagesIntf, IDEExternToolIntf,
|
Classes, SysUtils, FileUtil, LazConfigStorage, IDEMsgIntf, IDEImagesIntf,
|
||||||
LazIDEIntf, SrcEditorIntf, SynEditMarks, Forms, Controls, Graphics, Dialogs,
|
IDEExternToolIntf, LazIDEIntf, SrcEditorIntf, BaseIDEIntf, SynEditMarks,
|
||||||
LCLProc, etMessageFrame, etSrcEditMarks, etQuickFixes;
|
Forms, Controls, Graphics, Dialogs, LCLProc, etMessageFrame, etSrcEditMarks,
|
||||||
|
etQuickFixes;
|
||||||
|
|
||||||
|
const
|
||||||
|
MsgWndOptionsFileVersion = 1;
|
||||||
|
MsgWndOptionsFilename = 'messagesoptions.xml';
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TMessagesView }
|
{ TMessagesView }
|
||||||
@ -79,6 +83,8 @@ type
|
|||||||
procedure SourceEditorPopup(MarkLine: TSynEditMarkLine);
|
procedure SourceEditorPopup(MarkLine: TSynEditMarkLine);
|
||||||
|
|
||||||
// options
|
// options
|
||||||
|
procedure LoadOptions;
|
||||||
|
procedure SaveOptions;
|
||||||
procedure ApplyIDEOptions;
|
procedure ApplyIDEOptions;
|
||||||
property DblClickJumps: boolean read GetDblClickJumps write SetDblClickJumps;
|
property DblClickJumps: boolean read GetDblClickJumps write SetDblClickJumps;
|
||||||
property HideMessagesIcons: boolean read GetHideMessagesIcons write SetHideMessagesIcons;
|
property HideMessagesIcons: boolean read GetHideMessagesIcons write SetHideMessagesIcons;
|
||||||
@ -101,6 +107,8 @@ begin
|
|||||||
MessagesFrame1.MessagesCtrl.OnOpenMessage:=@OnOpenMessage;
|
MessagesFrame1.MessagesCtrl.OnOpenMessage:=@OnOpenMessage;
|
||||||
|
|
||||||
ActiveControl:=MessagesFrame1.MessagesCtrl;
|
ActiveControl:=MessagesFrame1.MessagesCtrl;
|
||||||
|
|
||||||
|
LoadOptions;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMessagesView.FormDestroy(Sender: TObject);
|
procedure TMessagesView.FormDestroy(Sender: TObject);
|
||||||
@ -161,6 +169,33 @@ begin
|
|||||||
MessagesFrame1.SourceEditorPopup(MarkLine);
|
MessagesFrame1.SourceEditorPopup(MarkLine);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMessagesView.LoadOptions;
|
||||||
|
var
|
||||||
|
Cfg: TConfigStorage;
|
||||||
|
FileVersion: Integer;
|
||||||
|
begin
|
||||||
|
Cfg:=GetIDEConfigStorage(MsgWndOptionsFilename,true);
|
||||||
|
try
|
||||||
|
FileVersion:=Cfg.GetValue('Version',0);
|
||||||
|
MessagesFrame1.LoadFromConfig(Cfg,FileVersion);
|
||||||
|
finally
|
||||||
|
Cfg.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMessagesView.SaveOptions;
|
||||||
|
var
|
||||||
|
Cfg: TConfigStorage;
|
||||||
|
begin
|
||||||
|
Cfg:=GetIDEConfigStorage(MsgWndOptionsFilename,false);
|
||||||
|
try
|
||||||
|
MessagesFrame1.SaveToConfig(Cfg);
|
||||||
|
Cfg.SetValue('Version',MsgWndOptionsFileVersion);
|
||||||
|
finally
|
||||||
|
Cfg.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMessagesView.Clear;
|
procedure TMessagesView.Clear;
|
||||||
begin
|
begin
|
||||||
MessagesFrame1.ClearViews(true);
|
MessagesFrame1.ClearViews(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user