Skip to content
Permalink
Browse files

Remove FHostTabCaptions list which had untranslated captions since re…

…cently. Use a regular expression instead. Closes #730.
  • Loading branch information...
ansgarbecker committed Aug 15, 2019
1 parent a513e77 commit 10c450bfc72895bd8d2cdb47f59ce9fe3341933b
Showing with 4 additions and 6 deletions.
  1. +4 −6 source/main.pas
@@ -1082,7 +1082,6 @@ TMainForm = class(TExtForm)

// Host subtabs backend structures
FHostListResults: TDBQueryList;
FHostTabCaptions: TStringList;
FStatusServerUptime: Integer;
FProcessListMaxTime: Int64;
FCommandStatsQueryCount: Int64;
@@ -1840,10 +1839,8 @@ procedure TMainForm.FormCreate(Sender: TObject);

// Populate generic results for "Host" subtabs
FHostListResults := TDBQueryList.Create(False);
FHostTabCaptions := TStringList.Create;
for i:=0 to PageControlHost.PageCount-1 do begin
FHostListResults.Add(nil);
FHostTabCaptions.Add(PageControlHost.Pages[i].Caption);
end;

// Enable auto completion in data tab, filter editor
@@ -9912,7 +9909,7 @@ procedure TMainForm.ListDatabasesBeforePaint(Sender: TBaseVirtualTree; TargetCan
end;
vt.RootNodeCount := Conn.AllDatabases.Count;
end;
tabDatabases.Caption := FHostTabCaptions[tabDatabases.PageIndex] + ' ('+FormatNumber(vt.RootNodeCount)+')';
tabDatabases.Caption := _('Databases') + ' ('+FormatNumber(vt.RootNodeCount)+')';
vt.Tag := VTREE_LOADED;
Screen.Cursor := crDefault;
end;
@@ -10034,7 +10031,7 @@ procedure TMainForm.HostListBeforePaint(Sender: TBaseVirtualTree; TargetCanvas:
IS_objects: TDBObjectList;
Obj: TDBObject;
ProcessColumns: TTableColumnList;
Columns, FocusedCaption: String;
Columns, FocusedCaption, CleanTabCaption: String;
Col: TVirtualTreeColumn;
begin
// Display server variables
@@ -10192,7 +10189,8 @@ procedure TMainForm.HostListBeforePaint(Sender: TBaseVirtualTree; TargetCanvas:
vt.EndUpdate;
vt.Tag := VTREE_LOADED;
// Display number of listed values on tab
Tab.Caption := FHostTabCaptions[Tab.PageIndex] + ' (' + IntToStr(vt.RootNodeCount) + ')';
CleanTabCaption := RegExprGetMatch('^(.+)(\s+\([^\)]*\))?$', Tab.Caption, 1);
Tab.Caption := CleanTabCaption + ' (' + IntToStr(vt.RootNodeCount) + ')';
// Restore selection
SetVTSelection(vt, SelectedCaptions, FocusedCaption);
end;

0 comments on commit 10c450b

Please sign in to comment.
You can’t perform that action at this time.