FIX: Bug [2920077]

This commit is contained in:
Alexander Koblov 2011-02-06 16:32:17 +00:00
commit 172fdf5999
3 changed files with 11 additions and 16 deletions

View file

@ -3615,8 +3615,8 @@ begin
ToggleConsole;
// Log window
seLogWindow.Visible := gLogWindow or (not miLogHide.Enabled);
LogSplitter.Visible := gLogWindow or (not miLogHide.Enabled);
seLogWindow.Visible := gLogWindow;
LogSplitter.Visible := gLogWindow;
FontOptionsToFont(gFonts[dcfLog], seLogWindow.Font);
ToggleFileSystemWatcher;

View file

@ -164,7 +164,6 @@ var
sMsg: UTF8String;
LogMsgType: TLogMsgType = lmtInfo;
bLogFile: Boolean;
bLock: Boolean = True;
sName: UTF8String;
CallbackDataClass: TCallbackDataClass;
Begin
@ -181,7 +180,7 @@ Begin
AddNetworkConnection(sName, CallbackDataClass.FileSource);
end;
sMsg:= sMsg + '[' + IntToStr(MsgType) + ']';
ShowLogWindow(True, @bLock);
ShowLogWindow(True);
end;
msgtype_disconnect:
begin
@ -205,7 +204,7 @@ Begin
end;
end;
// write log info
logWrite(sMsg + ', ' + logString, LogMsgType, False, bLogFile);
logWrite(sMsg + ', ' + logString, LogMsgType, True, bLogFile);
//DebugLn('MainLogProc ('+ sMsg + ',' + logString + ')');
end;
@ -765,4 +764,4 @@ finalization
if Assigned(WfxOperationList) then
FreeAndNil(WfxOperationList);
end.
end.

View file

@ -3,7 +3,7 @@
-------------------------------------------------------------------------
This unit contains log write functions.
Copyright (C) 2008-2010 Koblov Alexander (Alexx2000@mail.ru)
Copyright (C) 2008-2011 Koblov Alexander (Alexx2000@mail.ru)
contributors:
@ -54,7 +54,7 @@ type
procedure WriteLog(const sText: String; LogMsgType: TLogMsgType; bForce, bLogFile: Boolean);
end;
procedure ShowLogWindow(bShow: Boolean; bLock: PBoolean = nil);
procedure ShowLogWindow(bShow: Boolean);
procedure logWrite(const sText: String; LogMsgType: TLogMsgType = lmtInfo; bForce: Boolean = False; bLogFile: Boolean = True); overload;
procedure logWrite(Thread: TThread; const sText: String; LogMsgType: TLogMsgType = lmtInfo; bForce: Boolean = False; bLogFile: Boolean = True); overload;
@ -63,15 +63,13 @@ implementation
uses
SysUtils, LCLProc, Forms, fMain, uGlobs, uFileProcs, uOSUtils;
procedure ShowLogWindow(bShow: Boolean; bLock: PBoolean);
procedure ShowLogWindow(bShow: Boolean);
begin
if Assigned(fMain.frmMain) then
with fMain.frmMain do
begin
LogSplitter.Visible:= bShow;
seLogWindow.Visible:= bShow;
if Assigned(bLock) then
miLogHide.Enabled:= not bLock^;
Application.ProcessMessages;
end;
end;
@ -97,19 +95,17 @@ end;
procedure TLogWriteThread.LogWriteInTheThread;
var
hLogFile: Integer;
hLogFile: THandle;
LogMsgTypeObject: TObject;
bLock: Boolean;
begin
LogMsgTypeObject:= TObject(PtrInt(FLogMsgType));
if Assigned(fMain.frmMain) then
with fMain.frmMain do
begin
if (not (gLogWindow and seLogWindow.Visible)) and FForce then
if FForce and (not seLogWindow.Visible) then
ShowLogWindow(True);
bLock:= not miLogHide.Enabled;
if (gLogWindow or FForce or bLock) then // if write log to window
if (gLogWindow or FForce) then // if write log to window
seLogWindow.CaretY:= seLogWindow.Lines.AddObject(FMsg, LogMsgTypeObject) + 1;
end;