Display small overlay icons for lntTable items with some special table engines like federated, csv, aria and performance_schema. Fixes issue #3014.

This commit is contained in:
Ansgar Becker
2012-12-09 12:00:17 +00:00
parent 6edbd326c7
commit ff7cddbd99
8 changed files with 213 additions and 47 deletions

View File

@ -23,6 +23,7 @@ type
FConnection: TDBConnection;
function GetObjType: String;
function GetImageIndex: Integer;
function GetOverlayImageIndex: Integer;
function GetCreateCode: String;
procedure SetCreateCode(Value: String);
public
@ -38,6 +39,7 @@ type
function QuotedColumn(AlwaysQuote: Boolean=True): String;
property ObjType: String read GetObjType;
property ImageIndex: Integer read GetImageIndex;
property OverlayImageIndex: Integer read GetOverlayImageIndex;
property CreateCode: String read GetCreateCode write SetCreateCode;
property Connection: TDBConnection read FConnection;
end;
@ -4882,6 +4884,41 @@ begin
end;
function TDBObject.GetOverlayImageIndex: Integer;
var
EngineUpper: String;
begin
// Detect small overlay icon index for specified table engine
Result := -1;
case NodeType of
lntNone: begin
if not Connection.Active then
Result := 158;
end;
lntDb: begin
if Database = Connection.Database then
Result := ICONINDEX_HIGHLIGHTMARKER;
end;
lntTable: begin
EngineUpper := UpperCase(Engine);
if EngineUpper = 'FEDERATED' then
Result := 177
else if EngineUpper = 'MEMORY' then
Result := 178
else if EngineUpper = 'ARIA' then
Result := 179
else if EngineUpper = 'CSV' then
Result := 180
else if EngineUpper = 'PERFORMANCE_SCHEMA' then
Result := 181;
end;
end;
end;
function TDBObject.GetCreateCode: String;
begin
if not FCreateCodeFetched then try