mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Ensure ListSessionFocusChanged is called after deletion. Fixes issue #1314
This commit is contained in:
@ -291,6 +291,7 @@ end;
|
|||||||
procedure Tconnform.btnDeleteClick(Sender: TObject);
|
procedure Tconnform.btnDeleteClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
SessionKey: String;
|
SessionKey: String;
|
||||||
|
Node: PVirtualNode;
|
||||||
begin
|
begin
|
||||||
if MessageDlg('Delete session "' + SelectedSession + '" ?', mtConfirmation, [mbYes, mbCancel], 0) = mrYes then
|
if MessageDlg('Delete session "' + SelectedSession + '" ?', mtConfirmation, [mbYes, mbCancel], 0) = mrYes then
|
||||||
begin
|
begin
|
||||||
@ -300,7 +301,12 @@ begin
|
|||||||
FSessionNames.Delete(FSessionNames.IndexOf(SelectedSession));
|
FSessionNames.Delete(FSessionNames.IndexOf(SelectedSession));
|
||||||
RefreshSessionList(False);
|
RefreshSessionList(False);
|
||||||
if (not Assigned(ListSessions.FocusedNode)) and (ListSessions.RootNodeCount > 0) then
|
if (not Assigned(ListSessions.FocusedNode)) and (ListSessions.RootNodeCount > 0) then
|
||||||
SelectNode(ListSessions, ListSessions.RootNodeCount-1);
|
SelectNode(ListSessions, ListSessions.RootNodeCount-1)
|
||||||
|
else begin
|
||||||
|
Node := ListSessions.FocusedNode;
|
||||||
|
ListSessions.FocusedNode := nil;
|
||||||
|
ListSessions.FocusedNode := Node;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user