Fix bug #614 window title shows session name, but not session number

This commit is contained in:
Ansgar Becker
2008-07-14 22:43:09 +00:00
parent 118cd13473
commit 19533a23f9

View File

@ -477,6 +477,7 @@ type
dsShowEngines, dsShowEngines,
dsHaveEngines : TDataSet; dsHaveEngines : TDataSet;
FilterPanelManuallyOpened : Boolean; FilterPanelManuallyOpened : Boolean;
winName : String;
function GetQueryRunning: Boolean; function GetQueryRunning: Boolean;
procedure SetQueryRunning(running: Boolean); procedure SetQueryRunning(running: Boolean);
@ -692,7 +693,6 @@ end;
procedure TMDIChild.Init(AConn : POpenConnProf; AMysqlConn : TMysqlConn); procedure TMDIChild.Init(AConn : POpenConnProf; AMysqlConn : TMysqlConn);
var var
AutoReconnect : Boolean; AutoReconnect : Boolean;
winName : String;
i, j : Integer; i, j : Integer;
miGroup, miGroup,
miFilterGroup, miFilterGroup,
@ -742,7 +742,6 @@ begin
end; end;
SessionName := FMysqlConn.SessionName; SessionName := FMysqlConn.SessionName;
Caption := SessionName;
DatabasesWanted := explode( ';', FConn.DatabaseList ); DatabasesWanted := explode( ';', FConn.DatabaseList );
if ( FConn.DatabaseListSort ) then if ( FConn.DatabaseListSort ) then
begin begin
@ -773,6 +772,7 @@ begin
winName := winName + Format( ' (%d)', [i] ); winName := winName + Format( ' (%d)', [i] );
end; end;
Application.Title := winName + ' - ' + APPNAME; Application.Title := winName + ' - ' + APPNAME;
Caption := winName;
// Reselect last used database // Reselect last used database
if MainForm.GetRegValue( REGNAME_RESTORELASTUSEDDB, DEFAULT_RESTORELASTUSEDDB ) and ( lastUsedDB <> '' ) then if MainForm.GetRegValue( REGNAME_RESTORELASTUSEDDB, DEFAULT_RESTORELASTUSEDDB ) and ( lastUsedDB <> '' ) then
@ -1130,7 +1130,7 @@ begin
tabTable.TabVisible := false; tabTable.TabVisible := false;
tabData.TabVisible := false; tabData.TabVisible := false;
Caption := SessionName; Caption := winName;
pcChange( Self ); pcChange( Self );
end; end;
@ -1147,7 +1147,7 @@ begin
tabTable.TabVisible := false; tabTable.TabVisible := false;
tabData.TabVisible := false; tabData.TabVisible := false;
Caption := SessionName + ' - /' + db; Caption := winName + ' - /' + db;
ShowDBProperties( db ); ShowDBProperties( db );
end; end;
@ -1160,7 +1160,7 @@ begin
if tab = nil then tab := tabTable; // Alternative default: tabData if tab = nil then tab := tabTable; // Alternative default: tabData
if tab = tabTable then ShowTableProperties( table ); if tab = tabTable then ShowTableProperties( table );
if tab = tabData then ShowTableData( table ); if tab = tabData then ShowTableData( table );
Caption := SessionName + ' - /' + ActiveDatabase + '/' + SelectedTable; Caption := winName + ' - /' + ActiveDatabase + '/' + SelectedTable;
end; end;
procedure TMDIChild.viewdata(Sender: TObject); procedure TMDIChild.viewdata(Sender: TObject);