Changeset 418 for trunk/Packages/Common


Ignore:
Timestamp:
Nov 17, 2021, 11:31:18 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Sort key bindings alphabetically in the settings dialog.
  • Modified: Use update locking for filling a list of languages and key bindings.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UTranslator.pas

    r416 r418  
    316316begin
    317317  with Strings do begin
    318     Clear;
    319     for I := 0 to Languages.Count - 1 do
    320     with TLanguage(Languages[I]) do
    321       if Available then begin
    322         ItemName := Name;
    323         if WithCode and (Code <> '') then ItemName := ItemName + ' (' + Code + ')';
    324         AddObject(ItemName, Languages[I]);
    325       end;
     318    BeginUpdate;
     319    try
     320      Clear;
     321      for I := 0 to Languages.Count - 1 do
     322      with Languages[I] do
     323        if Available then begin
     324          ItemName := Name;
     325          if WithCode and (Code <> '') then ItemName := ItemName + ' (' + Code + ')';
     326          AddObject(ItemName, Languages[I]);
     327        end;
     328    finally
     329      EndUpdate;
     330    end;
    326331  end;
    327332end;
     
    375380
    376381  for I := 1 to Languages.Count - 1 do
    377   with TLanguage(Languages[I]) do begin
     382  with Languages[I] do begin
    378383    Available := FileExists(LangDir + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) +
    379384      '.' + Code + ExtensionSeparator + 'po') or (Code = 'en');
Note: See TracChangeset for help on using the changeset viewer.