Manually repaint db tree after user fired a USE <db> command, so the icons show the right db as active.

This commit is contained in:
Ansgar Becker
2010-11-26 23:42:07 +00:00
parent bae412a80c
commit 8fe2fb7b84

View File

@ -871,6 +871,7 @@ type
function ConfirmTabClose(PageIndex: Integer): Boolean;
procedure UpdateFilterPanel(Sender: TObject);
procedure DBObjectsCleared(Connection: TMySQLConnection; Database: String);
procedure DatabaseChanged(Connection: TMySQLConnection; Database: String);
procedure DoSearchReplace;
procedure UpdateLineCharPanel;
procedure PaintColorBar(Value, Max: Extended; TargetCanvas: TCanvas; CellRect: TRect);
@ -2770,6 +2771,7 @@ begin
Connection := TMySQLConnection.Create(Self);
Connection.OnLog := LogSQL;
Connection.OnDBObjectsCleared := DBObjectsCleared;
Connection.OnDatabaseChanged := DatabaseChanged;
Connection.ObjectNamesInSelectedDB := SynSQLSyn1.TableNames;
Connection.SessionName := Session;
Connection.Parameters := Params;
@ -6881,6 +6883,13 @@ begin
end;
procedure TMainForm.DatabaseChanged(Connection: TMySQLConnection; Database: String);
begin
// Immediately force db icons to repaint, so the user sees the active db state
DBtree.Repaint;
end;
procedure TMainForm.DBtreeDblClick(Sender: TObject);
var
DBObj: PDBObject;