quit if 'shell' dialog is closed at start

This commit is contained in:
Massimo Melina 2020-05-25 15:23:27 +02:00
parent fdef1fe319
commit f1f5446b0d

View File

@ -5105,7 +5105,6 @@ var
FAILED = 'Login failed'; FAILED = 'Login failed';
var var
m: TStringDynArray; m: TStringDynArray;
fTemp: Tfile;
begin begin
result:=FALSE; result:=FALSE;
if assigned(forceFile) then f:=forceFile; if assigned(forceFile) then f:=forceFile;
@ -7974,12 +7973,15 @@ var
if userIcsBuffer > 0 then if userIcsBuffer > 0 then
data.conn.sock.bufSize:=userIcsBuffer; data.conn.sock.bufSize:=userIcsBuffer;
size:=minmax(8192, MEGA, round(data.averageSpeed));
if userSocketBuffer > 0 then if userSocketBuffer > 0 then
data.conn.sndBuf:=userSocketBuffer data.conn.sndBuf:=userSocketBuffer
else if highSpeedChk.checked and (safeDiv(0.0+size, data.conn.sndbuf, 2) > 2) then else
begin
size:=minmax(8192, MEGA, round(data.averageSpeed));
if highSpeedChk.checked and (safeDiv(0.0+size, data.conn.sndbuf, 2) > 2) then
data.conn.sndBuf:=size; data.conn.sndBuf:=size;
end; end;
end;
// connection inactivity timeout // connection inactivity timeout
if (connectionsInactivityTimeout > 0) if (connectionsInactivityTimeout > 0)
@ -10602,9 +10604,12 @@ begin VFSmodified:=TRUE end;
procedure TmainFrm.FormClose(Sender: TObject; var Action: TCloseAction); procedure TmainFrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin begin
quitting:=TRUE; quitting:=TRUE;
runEventScript('quit'); if applicationFullyInitialized then
timer.enabled:=FALSE; begin
if autosaveOptionsChk.checked then saveCFG(); runEventScript('quit');
timer.enabled:=FALSE;
if autosaveOptionsChk.checked then saveCFG();
end;
// we disconnectAll() before srv.free, so we can purgeConnections() // we disconnectAll() before srv.free, so we can purgeConnections()
if assigned(srv) then srv.disconnectAll(TRUE); if assigned(srv) then srv.disconnectAll(TRUE);
purgeConnections(); purgeConnections();
@ -11945,9 +11950,17 @@ if not quitASAP then
if not isIntegratedInShell() then if not isIntegratedInShell() then
with TshellExtFrm.create(mainfrm) do with TshellExtFrm.create(mainfrm) do
try try
if showModal() = mrYes then case showModal() of
mrYes:
if not integrateInShell() then if not integrateInShell() then
msgDlg(MSG_ERROR_REGISTRY, MB_ICONERROR); msgDlg(MSG_ERROR_REGISTRY, MB_ICONERROR);
mrNo:;
else
begin
application.terminate();
exit;
end;
end;
finally free end; finally free end;
end; end;