Bugfix: Clicking 'Retry' in the lost connection dialog caused the session manager to pop up, because FormShow() did a lot of stuff. Move everything from FormShow() to FormCreate().

This commit is contained in:
rosenfield.albert
2009-03-04 19:54:18 +00:00
parent 614b8c4851
commit 6b49c31dc0

View File

@ -1280,6 +1280,18 @@ var
fontname, datafontname : String;
fontsize, datafontsize : Integer;
DisableProcessWindowsGhostingProc: procedure;
curParam : Byte;
sValue,
parHost, parPort, parUser, parPass, parDatabase,
parTimeout, parCompress, parSortDatabases, parDescription : String;
LastUpdatecheck : TDateTime;
UpdatecheckInterval : Integer;
DefaultLastrunDate, LastSession: String;
frm : TfrmUpdateCheck;
dlgResult: Integer;
Connected, CommandLineMode: Boolean;
ConnForm: TConnForm;
begin
caption := APPNAME;
setLocales;
@ -1472,26 +1484,10 @@ begin
'DisableProcessWindowsGhosting');
if Assigned(DisableProcessWindowsGhostingProc) then
DisableProcessWindowsGhostingProc;
end;
{**
Check for connection parameters on commandline or show connections form.
}
procedure TMainForm.FormShow(Sender: TObject);
var
curParam : Byte;
sValue,
parHost, parPort, parUser, parPass, parDatabase,
parTimeout, parCompress, parSortDatabases, parDescription : String;
LastUpdatecheck : TDateTime;
UpdatecheckInterval : Integer;
DefaultLastrunDate, LastSession: String;
frm : TfrmUpdateCheck;
dlgResult: Integer;
Connected, CommandLineMode: Boolean;
ConnForm: TConnForm;
begin
// Do an updatecheck if checked in settings
if GetRegValue(REGNAME_DO_UPDATECHECK, DEFAULT_DO_UPDATECHECK) then begin
DefaultLastrunDate := '2000-01-01';
@ -1593,8 +1589,6 @@ begin
end;
end;
DoAfterConnect;
if (not CommandLineMode) and (ParamStr(1) <> '') then begin
// Loading SQL file by command line. Mutually exclusive to connect by command line.
QueryLoad(ParamStr(1));
@ -1603,6 +1597,12 @@ begin
end;
procedure TMainForm.FormShow(Sender: TObject);
begin
DoAfterConnect;
end;
procedure TMainForm.actSessionManagerExecute(Sender: TObject);
var
ConnForm: TConnForm;
@ -5826,6 +5826,7 @@ begin
TimerHostUptimeTimer(self);
FQueryRunning := false;
try
FMysqlConn.Connection.Disconnect;
connected := True;
try
// CheckConnected() doesn't really check anything, it