Changeset 85 for trunk/Packages


Ignore:
Timestamp:
Jun 7, 2024, 11:59:43 AM (7 months ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
Location:
trunk/Packages/Common
Files:
30 added
13 deleted
2 edited
1 copied
39 moved

Legend:

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

    r84 r85  
    1 unit UApplicationInfo;
    2 
    3 {$mode delphi}
     1unit ApplicationInfo;
    42
    53interface
    64
    75uses
    8   SysUtils, Classes, Forms, URegistry, Controls, Graphics, LCLType;
     6  SysUtils, Classes, Forms, RegistryEx, Controls, Graphics, LCLType;
    97
    108type
     
    5957procedure Register;
    6058
     59
    6160implementation
    6261
  • trunk/Packages/Common/Common.Delay.pas

    r84 r85  
    1 unit UDelay;
    2 
    3 {$mode delphi}
     1unit Common.Delay;
    42
    53interface
     
    7371
    7472end.
    75 
  • trunk/Packages/Common/Common.lpk

    r80 r85  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<CONFIG>
    3   <Package Version="4">
     3  <Package Version="5">
    44    <PathDelim Value="\"/>
    55    <Name Value="Common"/>
     
    1111      <PathDelim Value="\"/>
    1212      <SearchPaths>
     13        <OtherUnitFiles Value="Forms"/>
    1314        <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    1415      </SearchPaths>
     
    3334      <Other>
    3435        <CompilerMessages>
    35           <IgnoredMessages idx5024="True"/>
     36          <IgnoredMessages idx6058="True" idx5071="True" idx5024="True" idx3124="True" idx3123="True"/>
    3637        </CompilerMessages>
    3738      </Other>
    3839    </CompilerOptions>
    39     <Description Value="Various libraries"/>
    40     <License Value="GNU/GPL"/>
    41     <Version Minor="7"/>
    42     <Files Count="28">
     40    <Description Value="Common package with various useful units.
     41
     42Source: https://svn.zdechov.net/PascalClassLibrary/Common/"/>
     43    <License Value="Copy left."/>
     44    <Version Minor="12"/>
     45    <Files Count="36">
    4346      <Item1>
    4447        <Filename Value="StopWatch.pas"/>
     
    4649      </Item1>
    4750      <Item2>
    48         <Filename Value="UCommon.pas"/>
    49         <UnitName Value="UCommon"/>
     51        <Filename Value="Common.pas"/>
     52        <UnitName Value="Common"/>
    5053      </Item2>
    5154      <Item3>
    52         <Filename Value="UDebugLog.pas"/>
    53         <HasRegisterProc Value="True"/>
    54         <UnitName Value="UDebugLog"/>
     55        <Filename Value="DebugLog.pas"/>
     56        <HasRegisterProc Value="True"/>
     57        <UnitName Value="DebugLog"/>
    5558      </Item3>
    5659      <Item4>
    57         <Filename Value="UDelay.pas"/>
    58         <UnitName Value="UDelay"/>
     60        <Filename Value="Common.Delay.pas"/>
     61        <UnitName Value="Common.Delay"/>
    5962      </Item4>
    6063      <Item5>
    61         <Filename Value="UPrefixMultiplier.pas"/>
    62         <HasRegisterProc Value="True"/>
    63         <UnitName Value="UPrefixMultiplier"/>
     64        <Filename Value="PrefixMultiplier.pas"/>
     65        <HasRegisterProc Value="True"/>
     66        <UnitName Value="PrefixMultiplier"/>
    6467      </Item5>
    6568      <Item6>
    66         <Filename Value="UURI.pas"/>
    67         <UnitName Value="UURI"/>
     69        <Filename Value="URI.pas"/>
     70        <UnitName Value="URI"/>
    6871      </Item6>
    6972      <Item7>
    70         <Filename Value="UThreading.pas"/>
    71         <UnitName Value="UThreading"/>
     73        <Filename Value="Threading.pas"/>
     74        <UnitName Value="Threading"/>
    7275      </Item7>
    7376      <Item8>
    74         <Filename Value="UMemory.pas"/>
    75         <UnitName Value="UMemory"/>
     77        <Filename Value="Memory.pas"/>
     78        <UnitName Value="Memory"/>
    7679      </Item8>
    7780      <Item9>
    78         <Filename Value="UResetableThread.pas"/>
    79         <UnitName Value="UResetableThread"/>
     81        <Filename Value="ResetableThread.pas"/>
     82        <UnitName Value="ResetableThread"/>
    8083      </Item9>
    8184      <Item10>
    82         <Filename Value="UPool.pas"/>
    83         <UnitName Value="UPool"/>
     85        <Filename Value="Pool.pas"/>
     86        <UnitName Value="Pool"/>
    8487      </Item10>
    8588      <Item11>
    86         <Filename Value="ULastOpenedList.pas"/>
    87         <HasRegisterProc Value="True"/>
    88         <UnitName Value="ULastOpenedList"/>
     89        <Filename Value="LastOpenedList.pas"/>
     90        <HasRegisterProc Value="True"/>
     91        <UnitName Value="LastOpenedList"/>
    8992      </Item11>
    9093      <Item12>
    91         <Filename Value="URegistry.pas"/>
    92         <UnitName Value="URegistry"/>
     94        <Filename Value="RegistryEx.pas"/>
     95        <UnitName Value="RegistryEx"/>
    9396      </Item12>
    9497      <Item13>
    95         <Filename Value="UJobProgressView.pas"/>
    96         <HasRegisterProc Value="True"/>
    97         <UnitName Value="UJobProgressView"/>
     98        <Filename Value="JobProgressView.pas"/>
     99        <HasRegisterProc Value="True"/>
     100        <UnitName Value="JobProgressView"/>
    98101      </Item13>
    99102      <Item14>
    100         <Filename Value="UXMLUtils.pas"/>
    101         <UnitName Value="UXMLUtils"/>
     103        <Filename Value="XML.pas"/>
     104        <UnitName Value="XML"/>
    102105      </Item14>
    103106      <Item15>
    104         <Filename Value="UApplicationInfo.pas"/>
    105         <HasRegisterProc Value="True"/>
    106         <UnitName Value="UApplicationInfo"/>
     107        <Filename Value="ApplicationInfo.pas"/>
     108        <HasRegisterProc Value="True"/>
     109        <UnitName Value="ApplicationInfo"/>
    107110      </Item15>
    108111      <Item16>
    109         <Filename Value="USyncCounter.pas"/>
    110         <UnitName Value="USyncCounter"/>
     112        <Filename Value="SyncCounter.pas"/>
     113        <UnitName Value="SyncCounter"/>
    111114      </Item16>
    112115      <Item17>
    113         <Filename Value="UListViewSort.pas"/>
    114         <HasRegisterProc Value="True"/>
    115         <UnitName Value="UListViewSort"/>
     116        <Filename Value="ListViewSort.pas"/>
     117        <HasRegisterProc Value="True"/>
     118        <UnitName Value="ListViewSort"/>
    116119      </Item17>
    117120      <Item18>
    118         <Filename Value="UPersistentForm.pas"/>
    119         <HasRegisterProc Value="True"/>
    120         <UnitName Value="UPersistentForm"/>
     121        <Filename Value="PersistentForm.pas"/>
     122        <HasRegisterProc Value="True"/>
     123        <UnitName Value="PersistentForm"/>
    121124      </Item18>
    122125      <Item19>
    123         <Filename Value="UFindFile.pas"/>
    124         <HasRegisterProc Value="True"/>
    125         <UnitName Value="UFindFile"/>
     126        <Filename Value="FindFile.pas"/>
     127        <HasRegisterProc Value="True"/>
     128        <UnitName Value="FindFile"/>
    126129      </Item19>
    127130      <Item20>
    128         <Filename Value="UScaleDPI.pas"/>
    129         <HasRegisterProc Value="True"/>
    130         <UnitName Value="UScaleDPI"/>
     131        <Filename Value="ScaleDPI.pas"/>
     132        <HasRegisterProc Value="True"/>
     133        <UnitName Value="ScaleDPI"/>
    131134      </Item20>
    132135      <Item21>
    133         <Filename Value="UTheme.pas"/>
    134         <HasRegisterProc Value="True"/>
    135         <UnitName Value="UTheme"/>
     136        <Filename Value="Theme.pas"/>
     137        <HasRegisterProc Value="True"/>
     138        <UnitName Value="Theme"/>
    136139      </Item21>
    137140      <Item22>
    138         <Filename Value="UStringTable.pas"/>
    139         <UnitName Value="UStringTable"/>
     141        <Filename Value="StringTable.pas"/>
     142        <UnitName Value="StringTable"/>
    140143      </Item22>
    141144      <Item23>
    142         <Filename Value="UMetaCanvas.pas"/>
    143         <UnitName Value="UMetaCanvas"/>
     145        <Filename Value="MetaCanvas.pas"/>
     146        <UnitName Value="MetaCanvas"/>
    144147      </Item23>
    145148      <Item24>
    146         <Filename Value="UGeometric.pas"/>
    147         <UnitName Value="UGeometric"/>
     149        <Filename Value="Geometric.pas"/>
     150        <UnitName Value="Geometric"/>
    148151      </Item24>
    149152      <Item25>
    150         <Filename Value="UTranslator.pas"/>
    151         <HasRegisterProc Value="True"/>
    152         <UnitName Value="UTranslator"/>
     153        <Filename Value="Translator.pas"/>
     154        <HasRegisterProc Value="True"/>
     155        <UnitName Value="Translator"/>
    153156      </Item25>
    154157      <Item26>
    155         <Filename Value="ULanguages.pas"/>
    156         <UnitName Value="ULanguages"/>
     158        <Filename Value="Languages.pas"/>
     159        <UnitName Value="Languages"/>
    157160      </Item26>
    158161      <Item27>
    159         <Filename Value="UFormAbout.pas"/>
    160         <UnitName Value="UFormAbout"/>
     162        <Filename Value="PixelPointer.pas"/>
     163        <UnitName Value="PixelPointer"/>
    161164      </Item27>
    162165      <Item28>
    163         <Filename Value="UAboutDialog.pas"/>
    164         <HasRegisterProc Value="True"/>
    165         <UnitName Value="UAboutDialog"/>
     166        <Filename Value="DataFile.pas"/>
     167        <UnitName Value="DataFile"/>
    166168      </Item28>
     169      <Item29>
     170        <Filename Value="TestCase.pas"/>
     171        <UnitName Value="TestCase"/>
     172      </Item29>
     173      <Item30>
     174        <Filename Value="Generics.pas"/>
     175        <UnitName Value="Generics"/>
     176      </Item30>
     177      <Item31>
     178        <Filename Value="CommonPackage.pas"/>
     179        <Type Value="Main Unit"/>
     180        <UnitName Value="CommonPackage"/>
     181      </Item31>
     182      <Item32>
     183        <Filename Value="Table.pas"/>
     184        <UnitName Value="Table"/>
     185      </Item32>
     186      <Item33>
     187        <Filename Value="FormEx.pas"/>
     188        <HasRegisterProc Value="True"/>
     189        <UnitName Value="FormEx"/>
     190      </Item33>
     191      <Item34>
     192        <Filename Value="Forms\FormTests.pas"/>
     193        <UnitName Value="FormTests"/>
     194      </Item34>
     195      <Item35>
     196        <Filename Value="Forms\FormTest.pas"/>
     197        <UnitName Value="FormTest"/>
     198      </Item35>
     199      <Item36>
     200        <Filename Value="Forms\FormAbout.pas"/>
     201        <UnitName Value="FormAbout"/>
     202      </Item36>
    167203    </Files>
     204    <CompatibilityMode Value="True"/>
    168205    <i18n>
    169206      <EnableI18N Value="True"/>
  • trunk/Packages/Common/Common.pas

    r84 r85  
    1 unit UCommon;
    2 
    3 {$mode delphi}
     1unit Common;
    42
    53interface
    64
    75uses
    8   {$ifdef Windows}Windows,{$endif}
    9   {$ifdef Linux}baseunix,{$endif}
    10   Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf,
    11   FileUtil; //, ShFolder, ShellAPI;
     6  {$IFDEF WINDOWS}Windows,{$ENDIF}
     7  {$IFDEF UNIX}baseunix,{$ENDIF}
     8  Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, Graphics,
     9  FileUtil, Generics.Collections; //, ShFolder, ShellAPI;
    1210
    1311type
    1412  TArrayOfByte = array of Byte;
    15   TArrayOfString = array of string;
    1613  TExceptionEvent = procedure(Sender: TObject; E: Exception) of object;
    1714
     
    3532  DLLHandle1: HModule;
    3633
    37 {$IFDEF Windows}
    38   GetUserNameEx: procedure (NameFormat: DWORD;
    39     lpNameBuffer: LPSTR; nSize: PULONG); stdcall;
    40 {$ENDIF}
    41 
    42 function IntToBin(Data: Int64; Count: Byte): string;
     34  {$IFDEF WINDOWS}
     35    GetUserNameEx: procedure (NameFormat: DWORD;
     36      lpNameBuffer: LPSTR; nSize: PULONG); stdcall;
     37  {$ENDIF}
     38
     39const
     40  clLightBlue = TColor($FF8080);
     41  clLightGreen = TColor($80FF80);
     42  clLightRed = TColor($8080FF);
     43
     44function AddLeadingZeroes(const aNumber, Length : integer) : string;
    4345function BinToInt(BinStr: string): Int64;
    44 function TryHexToInt(Data: string; var Value: Integer): Boolean;
    45 function TryBinToInt(Data: string; var Value: Integer): Boolean;
    4646function BinToHexString(Source: AnsiString): string;
    4747//function DelTree(DirName : string): Boolean;
     
    4949function BCDToInt(Value: Byte): Byte;
    5050function CompareByteArray(Data1, Data2: TArrayOfByte): Boolean;
     51procedure CopyStringArray(Dest: TStringArray; Source: array of string);
     52function CombinePaths(Path1, Path2: string): string;
     53function ComputerName: string;
     54procedure DeleteFiles(APath, AFileSpec: string);
     55function Explode(Separator: Char; Data: string): TStringArray;
     56procedure ExecuteProgram(Executable: string; Parameters: array of string);
     57procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog);
     58procedure FreeThenNil(var Obj);
     59function GetDirCount(Dir: string): Integer;
    5160function GetUserName: string;
    52 function LoggedOnUserNameEx(Format: TUserNameFormat): string;
    53 function SplitString(var Text: string; Count: Word): string;
    5461function GetBitCount(Variable: QWord; MaxIndex: Integer): Integer;
    5562function GetBit(Variable: QWord; Index: Byte): Boolean;
     63function GetStringPart(var Text: string; Separator: string): string;
     64function GenerateNewName(OldName: string): string;
     65function GetFileFilterItemExt(Filter: string; Index: Integer): string;
     66function IntToBin(Data: Int64; Count: Byte): string;
     67function Implode(Separator: string; List: TList<string>): string;
     68function Implode(Separator: string; List: TStringList; Around: string = ''): string;
     69function LastPos(const SubStr: String; const S: String): Integer;
     70function LoadFileToStr(const FileName: TFileName): AnsiString;
     71function LoggedOnUserNameEx(Format: TUserNameFormat): string;
     72function MergeArray(A, B: array of string): TStringArray;
     73function OccurenceOfChar(What: Char; Where: string): Integer;
     74procedure OpenWebPage(URL: string);
     75procedure OpenEmail(Email: string);
     76procedure OpenFileInShell(FileName: string);
     77function PosFromIndex(SubStr: string; Text: string;
     78  StartIndex: Integer): Integer;
     79function PosFromIndexReverse(SubStr: string; Text: string;
     80  StartIndex: Integer): Integer;
     81function RemoveQuotes(Text: string): string;
     82procedure SaveStringToFile(S, FileName: string);
    5683procedure SetBit(var Variable: Int64; Index: Byte; State: Boolean); overload;
    5784procedure SetBit(var Variable: QWord; Index: Byte; State: Boolean); overload;
    5885procedure SetBit(var Variable: Cardinal; Index: Byte; State: Boolean); overload;
    5986procedure SetBit(var Variable: Word; Index: Byte; State: Boolean); overload;
    60 function AddLeadingZeroes(const aNumber, Length : integer) : string;
    61 function LastPos(const SubStr: String; const S: String): Integer;
    62 function GenerateNewName(OldName: string): string;
    63 function GetFileFilterItemExt(Filter: string; Index: Integer): string;
    64 procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog);
    65 procedure DeleteFiles(APath, AFileSpec: string);
    66 procedure OpenWebPage(URL: string);
    67 procedure OpenFileInShell(FileName: string);
    68 procedure ExecuteProgram(Executable: string; Parameters: array of string);
    69 procedure FreeThenNil(var Obj);
    70 function RemoveQuotes(Text: string): string;
    71 function ComputerName: string;
    72 function OccurenceOfChar(What: Char; Where: string): Integer;
    73 function GetDirCount(Dir: string): Integer;
    74 function MergeArray(A, B: array of string): TArrayOfString;
    75 function LoadFileToStr(const FileName: TFileName): AnsiString;
    76 procedure SaveStringToFile(S, FileName: string);
    7787procedure SearchFiles(AList: TStrings; Dir: string;
    7888  FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil);
    79 function GetStringPart(var Text: string; Separator: string): string;
     89function SplitString(var Text: string; Count: Word): string;
    8090function StripTags(const S: string): string;
    81 function PosFromIndex(SubStr: string; Text: string;
    82   StartIndex: Integer): Integer;
    83 function PosFromIndexReverse(SubStr: string; Text: string;
    84   StartIndex: Integer): Integer;
    85 procedure CopyStringArray(Dest: TStringArray; Source: array of string);
     91function TryHexToInt(Data: string; out Value: Integer): Boolean;
     92function TryBinToInt(Data: string; out Value: Integer): Boolean;
     93procedure SortStrings(Strings: TStrings);
    8694
    8795
     
    199207end;*)
    200208
     209function Implode(Separator: string; List: TStringList; Around: string = ''): string;
     210var
     211  I: Integer;
     212begin
     213  Result := '';
     214  for I := 0 to List.Count - 1 do begin
     215    Result := Result + Around + List[I] + Around;
     216    if I < List.Count - 1 then Result := Result + Separator;
     217  end;
     218end;
     219
    201220function LastPos(const SubStr: String; const S: String): Integer;
    202221begin
     
    244263end;
    245264
    246 function TryHexToInt(Data: string; var Value: Integer): Boolean;
     265function TryHexToInt(Data: string; out Value: Integer): Boolean;
    247266var
    248267  I: Integer;
     
    260279end;
    261280
    262 function TryBinToInt(Data: string; var Value: Integer): Boolean;
     281function TryBinToInt(Data: string; out Value: Integer): Boolean;
    263282var
    264283  I: Integer;
     
    288307end;
    289308
    290 function Explode(Separator: char; Data: string): TArrayOfString;
    291 begin
    292   SetLength(Result, 0);
    293   while Pos(Separator, Data) > 0 do begin
     309function Explode(Separator: Char; Data: string): TStringArray;
     310var
     311  Index: Integer;
     312begin
     313  Result := Default(TStringArray);
     314  repeat
     315    Index := Pos(Separator, Data);
     316    if Index > 0 then begin
     317      SetLength(Result, Length(Result) + 1);
     318      Result[High(Result)] := Copy(Data, 1, Index - 1);
     319      Delete(Data, 1, Index);
     320    end else Break;
     321  until False;
     322  if Data <> '' then begin
    294323    SetLength(Result, Length(Result) + 1);
    295     Result[High(Result)] := Copy(Data, 1, Pos(Separator, Data) - 1);
    296     Delete(Data, 1, Pos(Separator, Data));
    297   end;
    298   SetLength(Result, Length(Result) + 1);
    299   Result[High(Result)] := Data;
    300 end;
    301 
    302 {$IFDEF Windows}
     324    Result[High(Result)] := Data;
     325  end;
     326end;
     327
     328function Implode(Separator: string; List: TList<string>): string;
     329var
     330  I: Integer;
     331begin
     332  Result := '';
     333  for I := 0 to List.Count - 1 do begin
     334    Result := Result + List[I];
     335    if I < List.Count - 1 then Result := Result + Separator;
     336  end;
     337end;
     338
     339{$IFDEF WINDOWS}
    303340function GetUserName: string;
    304341const
     
    308345begin
    309346  L := MAX_USERNAME_LENGTH + 2;
     347  Result := Default(string);
    310348  SetLength(Result, L);
    311349  if Windows.GetUserName(PChar(Result), L) and (L > 0) then begin
     
    321359  end;
    322360end;
    323 {$endif}
     361{$ENDIF}
    324362
    325363function ComputerName: string;
    326 {$ifdef mswindows}
     364{$IFDEF WINDOWS}
    327365const
    328366 INFO_BUFFER_SIZE = 32767;
     
    339377  end;
    340378end;
    341 {$endif}
    342 {$ifdef unix}
     379{$ENDIF}
     380{$IFDEF UNIX}
    343381var
    344382  Name: UtsName;
    345383begin
     384  Name := Default(UtsName);
    346385  fpuname(Name);
    347386  Result := Name.Nodename;
    348387end;
    349 {$endif}
    350 
    351 {$ifdef windows}
     388{$ENDIF}
     389
     390{$IFDEF WINDOWS}
    352391function LoggedOnUserNameEx(Format: TUserNameFormat): string;
    353392const
     
    427466procedure LoadLibraries;
    428467begin
    429   {$IFDEF Windows}
     468  {$IFDEF WINDOWS}
    430469  DLLHandle1 := LoadLibrary('secur32.dll');
    431470  if DLLHandle1 <> 0 then
     
    438477procedure FreeLibraries;
    439478begin
    440   {$IFDEF Windows}
     479  {$IFDEF WINDOWS}
    441480  if DLLHandle1 <> 0 then FreeLibrary(DLLHandle1);
    442481  {$ENDIF}
     
    471510end;
    472511
     512procedure OpenEmail(Email: string);
     513begin
     514  OpenURL('mailto:' + Email);
     515end;
     516
    473517procedure OpenFileInShell(FileName: string);
    474518begin
     
    499543end;
    500544
    501 function MergeArray(A, B: array of string): TArrayOfString;
    502 var
    503   I: Integer;
    504 begin
     545function MergeArray(A, B: array of string): TStringArray;
     546var
     547  I: Integer;
     548begin
     549  Result := Default(TStringArray);
    505550  SetLength(Result, Length(A) + Length(B));
    506551  for I := 0 to Length(A) - 1 do
     
    669714end;
    670715
     716function CombinePaths(Path1, Path2: string): string;
     717begin
     718  Result := Path1;
     719  if Result <> '' then Result := Result + DirectorySeparator + Path2
     720    else Result := Path2;
     721end;
     722
     723procedure SortStrings(Strings: TStrings);
     724var
     725  Tmp: TStringList;
     726begin
     727  Strings.BeginUpdate;
     728  try
     729    if Strings is TStringList then begin
     730      TStringList(Strings).Sort;
     731    end else begin
     732      Tmp := TStringList.Create;
     733      try
     734        Tmp.Assign(Strings);
     735        Tmp.Sort;
     736        Strings.Assign(Tmp);
     737      finally
     738        Tmp.Free;
     739      end;
     740    end;
     741  finally
     742    Strings.EndUpdate;
     743  end;
     744end;
     745
    671746
    672747initialization
  • trunk/Packages/Common/CommonPackage.pas

    r84 r85  
    33 }
    44
    5 unit Common;
     5unit CommonPackage;
    66
    77{$warn 5023 off : no warning about unused units}
     
    99
    1010uses
    11   StopWatch, UCommon, UDebugLog, UDelay, UPrefixMultiplier, UURI, UThreading,
    12   UMemory, UResetableThread, UPool, ULastOpenedList, URegistry,
    13   UJobProgressView, UXMLUtils, UApplicationInfo, USyncCounter, UListViewSort,
    14   UPersistentForm, UFindFile, UScaleDPI, UTheme, UStringTable, UMetaCanvas,
    15   UGeometric, UTranslator, ULanguages, UFormAbout, UAboutDialog,
    16   LazarusPackageIntf;
     11  StopWatch, Common, DebugLog, Common.Delay, PrefixMultiplier, URI, Threading,
     12  Memory, ResetableThread, Pool, LastOpenedList, RegistryEx, JobProgressView,
     13  XML, ApplicationInfo, SyncCounter, ListViewSort, PersistentForm, FindFile,
     14  ScaleDPI, Theme, StringTable, MetaCanvas, Geometric, Translator, Languages,
     15  PixelPointer, DataFile, TestCase, Generics, Table, FormEx, FormTests,
     16  FormTest, FormAbout, LazarusPackageIntf;
    1717
    1818implementation
     
    2020procedure Register;
    2121begin
    22   RegisterUnit('UDebugLog', @UDebugLog.Register);
    23   RegisterUnit('UPrefixMultiplier', @UPrefixMultiplier.Register);
    24   RegisterUnit('ULastOpenedList', @ULastOpenedList.Register);
    25   RegisterUnit('UJobProgressView', @UJobProgressView.Register);
    26   RegisterUnit('UApplicationInfo', @UApplicationInfo.Register);
    27   RegisterUnit('UListViewSort', @UListViewSort.Register);
    28   RegisterUnit('UPersistentForm', @UPersistentForm.Register);
    29   RegisterUnit('UFindFile', @UFindFile.Register);
    30   RegisterUnit('UScaleDPI', @UScaleDPI.Register);
    31   RegisterUnit('UTheme', @UTheme.Register);
    32   RegisterUnit('UTranslator', @UTranslator.Register);
    33   RegisterUnit('UAboutDialog', @UAboutDialog.Register);
     22  RegisterUnit('DebugLog', @DebugLog.Register);
     23  RegisterUnit('PrefixMultiplier', @PrefixMultiplier.Register);
     24  RegisterUnit('LastOpenedList', @LastOpenedList.Register);
     25  RegisterUnit('JobProgressView', @JobProgressView.Register);
     26  RegisterUnit('ApplicationInfo', @ApplicationInfo.Register);
     27  RegisterUnit('ListViewSort', @ListViewSort.Register);
     28  RegisterUnit('PersistentForm', @PersistentForm.Register);
     29  RegisterUnit('FindFile', @FindFile.Register);
     30  RegisterUnit('ScaleDPI', @ScaleDPI.Register);
     31  RegisterUnit('Theme', @Theme.Register);
     32  RegisterUnit('Translator', @Translator.Register);
     33  RegisterUnit('FormEx', @FormEx.Register);
    3434end;
    3535
  • trunk/Packages/Common/DebugLog.pas

    r84 r85  
    1 unit UDebugLog;
    2 
    3 {$mode delphi}
     1unit DebugLog;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, FileUtil, fgl, SyncObjs;
     6  Classes, SysUtils, FileUtil, Generics.Collections, SyncObjs;
    97
    108type
     
    1513    Group: string;
    1614    Text: string;
     15  end;
     16
     17  TDebugLogItems = class(TObjectList<TDebugLogItem>)
    1718  end;
    1819
     
    2930    procedure SetMaxCount(const AValue: Integer);
    3031  public
    31     Items: TFPGObjectList<TDebugLogItem>;
     32    Items: TDebugLogItems;
    3233    Lock: TCriticalSection;
    3334    procedure Add(Text: string; Group: string = '');
     
    4445
    4546procedure Register;
     47
    4648
    4749implementation
     
    117119begin
    118120  inherited;
    119   Items := TFPGObjectList<TDebugLogItem>.Create;
     121  Items := TDebugLogItems.Create;
    120122  Lock := TCriticalSection.Create;
    121123  MaxCount := 100;
     
    126128destructor TDebugLog.Destroy;
    127129begin
    128   Items.Free;
    129   Lock.Free;
     130  FreeAndNil(Items);
     131  FreeAndNil(Lock);
    130132  inherited;
    131133end;
    132134
    133135end.
    134 
  • trunk/Packages/Common/FindFile.pas

    r84 r85  
    1919}
    2020
    21 unit UFindFile;
     21unit FindFile;
    2222
    2323interface
     
    3535  private
    3636    s : TStringList;
    37 
    3837    fSubFolder : boolean;
    3938    fAttr: TFileAttrib;
    4039    fPath : string;
    4140    fFileMask : string;
    42 
    4341    procedure SetPath(Value: string);
    4442    procedure FileSearch(const inPath : string);
     
    4644    constructor Create(AOwner: TComponent); override;
    4745    destructor Destroy; override;
    48 
    4946    function SearchForFiles: TStringList;
    5047  published
     
    5956  FilterAll = '*.*';
    6057{$ENDIF}
    61 {$IFDEF LINUX}
     58{$IFDEF UNIX}
    6259  FilterAll = '*';
    6360{$ENDIF}
    6461
    6562procedure Register;
     63
    6664
    6765implementation
     
    8785begin
    8886  s.Free;
    89   inherited Destroy;
     87  inherited;
    9088end;
    9189
     
    145143    SysUtils.FindClose(Rec);
    146144  end;
    147 end; 
     145end;
    148146
    149147end.
    150 
  • trunk/Packages/Common/Forms/FormAbout.lfm

    r84 r85  
    11object FormAbout: TFormAbout
    2   Left = 1014
     2  Left = 624
    33  Height = 402
    4   Top = 577
     4  Top = 622
    55  Width = 702
    66  Caption = 'About'
     
    88  ClientWidth = 702
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    1110  OnShow = FormShow
    1211  Position = poScreenCenter
    13   LCLVersion = '2.0.10.0'
     12  LCLVersion = '2.2.6.0'
    1413  object LabelDescription: TLabel
    1514    Left = 30
    16     Height = 24
     15    Height = 26
    1716    Top = 135
    1817    Width = 642
     
    2827  object LabelContent: TLabel
    2928    Left = 30
    30     Height = 24
    31     Top = 189
     29    Height = 26
     30    Top = 191
    3231    Width = 642
    3332    Align = alTop
     
    6766      Height = 74
    6867      Top = 30
    69       Width = 72
     68      Width = 71
    7069      Proportional = True
    7170      Stretch = True
     
    9493    end
    9594    object ButtonClose: TButton
    96       Left = 532
     95      Left = 531
    9796      Height = 38
    9897      Top = 24
    99       Width = 140
     98      Width = 141
    10099      Anchors = [akRight, akBottom]
    101100      Caption = 'Close'
  • trunk/Packages/Common/Forms/FormAbout.pas

    r84 r85  
    1 unit UFormAbout;
    2 
    3 {$mode delphi}
     1unit FormAbout;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   StdCtrls, ExtCtrls, UApplicationInfo, UCommon, UTranslator, UTheme;
     7  StdCtrls, ExtCtrls, ApplicationInfo, Common, FormEx;
    108
    119type
    1210  { TFormAbout }
    1311
    14   TFormAbout = class(TForm)
     12  TFormAbout = class(TFormEx)
    1513    ButtonClose: TButton;
    1614    ButtonHomePage: TButton;
     
    2220    PanelButtons: TPanel;
    2321    procedure ButtonHomePageClick(Sender: TObject);
    24     procedure FormCreate(Sender: TObject);
    2522    procedure FormShow(Sender: TObject);
    2623  private
    27     { private declarations }
     24    FApplicationInfo: TApplicationInfo;
    2825  public
    29     AboutDialog: TObject; //TAboutDialog
    3026    procedure UpdateInterface;
     27    property ApplicationInfo: TApplicationInfo read FApplicationInfo write
     28      FApplicationInfo;
    3129  end;
    3230
     
    3533
    3634{$R *.lfm}
    37 
    38 uses
    39   UAboutDialog;
    4035
    4136resourcestring
     
    4843procedure TFormAbout.FormShow(Sender: TObject);
    4944begin
    50   if Assigned(AboutDialog) then
    51   with TAboutDialog(AboutDialog) do begin
    52     if Assigned(CoolTranslator) then
    53       CoolTranslator.TranslateComponentRecursive(Self);
    54     if Assigned(ThemeManager) then
    55       ThemeManager.UseTheme(Self);
    56 
    57     if Assigned(ApplicationInfo) then
    58     with ApplicationInfo do begin
    59       LabelAppName.Caption := AppName;
    60       LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
    61         SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
    62         SLicense + ': ' + License;
    63       LabelDescription.Caption := Description;
    64       ImageLogo.Picture.Bitmap.Assign(Icon);
    65     end;
     45  if Assigned(ApplicationInfo) then
     46  with ApplicationInfo do begin
     47    LabelAppName.Caption := AppName;
     48    LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
     49      SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
     50      SLicense + ': ' + License;
     51    LabelDescription.Caption := Description;
     52    ImageLogo.Picture.Bitmap.Assign(Icon);
    6653  end;
    6754  UpdateInterface;
     
    7057procedure TFormAbout.UpdateInterface;
    7158begin
    72   ButtonHomePage.Enabled := Assigned(AboutDialog) and
    73     Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
     59  ButtonHomePage.Enabled := Assigned(ApplicationInfo);
    7460end;
    7561
    7662procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
    7763begin
    78   OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
    79 end;
    80 
    81 procedure TFormAbout.FormCreate(Sender: TObject);
    82 begin
     64  OpenWebPage(ApplicationInfo.HomePage);
    8365end;
    8466
    8567end.
    86 
  • trunk/Packages/Common/Geometric.pas

    r84 r85  
    1 unit UGeometric;
    2 
    3 {$mode delphi}
     1unit Geometric;
    42
    53interface
     
    108type
    119  TPointArray = array of TPoint;
     10
     11  { TVector }
     12
     13  TVector = record
     14    Position: TPoint;
     15    Direction: TPoint;
     16    function GetLength: Double;
     17    function GetAngle: Double;
     18    procedure SetLength(Value: Double);
     19    class function Create(P1, P2: TPoint): TVector; static;
     20  end;
    1221
    1322function Distance(P1, P2: TPoint): Integer;
     
    1524function AddPoint(const P1, P2: TPoint): TPoint;
    1625function SubPoint(const P1, P2: TPoint): TPoint;
    17 function PointToLineDistance(const P, V, W: TPoint): Integer;
     26function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer;
    1827function ComparePoint(P1, P2: TPoint): Boolean;
    1928function RotatePoint(Center, P: TPoint; Angle: Double): TPoint;
     
    2736function ShiftRect(ARect: TRect; Delta: TPoint): TRect;
    2837
     38
    2939implementation
    3040
     
    5161end;
    5262
    53 function PointToLineDistance(const P, V, W: TPoint): Integer;
     63function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer;
    5464var
    5565  l2, t: Double;
     
    6979  if T < 0 then begin
    7080    Result := Distance(P, V);       // Beyond the 'v' end of the segment
    71     exit;
     81    Intersect := V;
     82    Exit;
    7283  end
    7384  else if T > 1 then begin
    7485    Result := Distance(P, W);  // Beyond the 'w' end of the segment
     86    Intersect := W;
    7587    Exit;
    7688  end;
     
    7890  TT.Y := Trunc(V.Y + T * (W.Y - V.Y));
    7991  Result := Distance(P, TT);
     92  Intersect := TT;
    8093end;
    8194
     
    96109  I: Integer;
    97110begin
     111  Result := Default(TPointArray);
    98112  SetLength(Result, Length(P));
    99113  for I := 0 to High(P) do
     
    162176end;
    163177
     178{ TVector }
     179
     180function TVector.GetLength: Double;
     181begin
     182  Result := Sqrt(Sqr(Direction.X) + Sqr(Direction.Y));
     183end;
     184
     185function TVector.GetAngle: Double;
     186begin
     187  Result := ArcTan2(Direction.Y, Direction.X);
     188end;
     189
     190procedure TVector.SetLength(Value: Double);
     191var
     192  Angle: Double;
     193begin
     194  Angle := GetAngle;
     195  Direction := Point(Round(Cos(Angle) * Value),
     196    Round(Sin(Angle) * Value));
     197end;
     198
     199class function TVector.Create(P1, P2: TPoint): TVector;
     200begin
     201  Result.Position := P1;
     202  Result.Direction := Point(P2.X - P1.X, P2.Y - P1.Y);
     203end;
    164204
    165205end.
    166 
  • trunk/Packages/Common/JobProgressView.lfm

    r84 r85  
    11object FormJobProgressView: TFormJobProgressView
    22  Left = 467
    3   Height = 345
     3  Height = 414
    44  Top = 252
    5   Width = 539
     5  Width = 647
    66  BorderIcons = [biSystemMenu]
    7   ClientHeight = 345
    8   ClientWidth = 539
    9   DesignTimePPI = 120
     7  ClientHeight = 414
     8  ClientWidth = 647
     9  DesignTimePPI = 144
    1010  OnClose = FormClose
    1111  OnCloseQuery = FormCloseQuery
    1212  OnCreate = FormCreate
    13   OnDestroy = FormDestroy
    1413  OnHide = FormHide
    1514  OnShow = FormShow
    1615  Position = poScreenCenter
    17   LCLVersion = '2.0.2.0'
     16  LCLVersion = '2.2.0.4'
    1817  object PanelOperationsTitle: TPanel
    1918    Left = 0
    20     Height = 32
     19    Height = 38
    2120    Top = 0
    22     Width = 539
     21    Width = 647
    2322    Align = alTop
    2423    BevelOuter = bvNone
    25     ClientHeight = 32
    26     ClientWidth = 539
     24    ClientHeight = 38
     25    ClientWidth = 647
    2726    FullRepaint = False
    2827    TabOrder = 0
    2928    object LabelOperation: TLabel
    30       Left = 8
    31       Height = 20
    32       Top = 8
    33       Width = 76
     29      Left = 10
     30      Height = 26
     31      Top = 10
     32      Width = 99
    3433      Caption = 'Operations:'
    35       ParentColor = False
    3634      ParentFont = False
    3735    end
     
    3937  object PanelLog: TPanel
    4038    Left = 0
    41     Height = 133
    42     Top = 212
    43     Width = 539
     39    Height = 161
     40    Top = 253
     41    Width = 647
    4442    Align = alClient
    4543    BevelOuter = bvSpace
    46     ClientHeight = 133
    47     ClientWidth = 539
     44    ClientHeight = 161
     45    ClientWidth = 647
    4846    TabOrder = 1
    4947    object MemoLog: TMemo
    50       Left = 8
    51       Height = 117
    52       Top = 8
    53       Width = 523
     48      Left = 10
     49      Height = 141
     50      Top = 10
     51      Width = 627
    5452      Anchors = [akTop, akLeft, akRight, akBottom]
    5553      ReadOnly = True
     
    6058  object PanelProgress: TPanel
    6159    Left = 0
    62     Height = 54
    63     Top = 106
    64     Width = 539
     60    Height = 65
     61    Top = 126
     62    Width = 647
    6563    Align = alTop
    6664    BevelOuter = bvNone
    67     ClientHeight = 54
    68     ClientWidth = 539
     65    ClientHeight = 65
     66    ClientWidth = 647
    6967    TabOrder = 2
    7068    object ProgressBarPart: TProgressBar
    71       Left = 10
    72       Height = 24
    73       Top = 24
    74       Width = 523
     69      Left = 12
     70      Height = 29
     71      Top = 29
     72      Width = 628
    7573      Anchors = [akTop, akLeft, akRight]
    7674      TabOrder = 0
    7775    end
    7876    object LabelEstimatedTimePart: TLabel
    79       Left = 8
    80       Height = 20
     77      Left = 10
     78      Height = 26
    8179      Top = -2
    82       Width = 103
     80      Width = 132
    8381      Caption = 'Estimated time:'
    84       ParentColor = False
    8582    end
    8683  end
    8784  object PanelOperations: TPanel
    8885    Left = 0
    89     Height = 42
    90     Top = 64
    91     Width = 539
     86    Height = 50
     87    Top = 76
     88    Width = 647
    9289    Align = alTop
    9390    BevelOuter = bvNone
    94     ClientHeight = 42
    95     ClientWidth = 539
     91    ClientHeight = 50
     92    ClientWidth = 647
    9693    FullRepaint = False
    9794    TabOrder = 3
    9895    object ListViewJobs: TListView
    99       Left = 8
    100       Height = 32
    101       Top = 5
    102       Width = 523
     96      Left = 10
     97      Height = 38
     98      Top = 6
     99      Width = 627
    103100      Anchors = [akTop, akLeft, akRight, akBottom]
    104101      AutoWidthLastColumn = True
     
    107104      Columns = <     
    108105        item
    109           Width = 523
     106          Width = 614
    110107        end>
    111108      OwnerData = True
     
    120117  object PanelProgressTotal: TPanel
    121118    Left = 0
    122     Height = 52
    123     Top = 160
    124     Width = 539
     119    Height = 62
     120    Top = 191
     121    Width = 647
    125122    Align = alTop
    126123    BevelOuter = bvNone
    127     ClientHeight = 52
    128     ClientWidth = 539
     124    ClientHeight = 62
     125    ClientWidth = 647
    129126    TabOrder = 4
    130127    object LabelEstimatedTimeTotal: TLabel
    131       Left = 8
    132       Height = 20
     128      Left = 10
     129      Height = 26
    133130      Top = 0
    134       Width = 141
     131      Width = 178
    135132      Caption = 'Total estimated time:'
    136       ParentColor = False
    137133    end
    138134    object ProgressBarTotal: TProgressBar
    139       Left = 8
    140       Height = 24
    141       Top = 24
    142       Width = 523
     135      Left = 10
     136      Height = 29
     137      Top = 29
     138      Width = 627
    143139      Anchors = [akTop, akLeft, akRight]
    144140      TabOrder = 0
     
    147143  object PanelText: TPanel
    148144    Left = 0
    149     Height = 32
    150     Top = 32
    151     Width = 539
     145    Height = 38
     146    Top = 38
     147    Width = 647
    152148    Align = alTop
    153149    BevelOuter = bvNone
    154     ClientHeight = 32
    155     ClientWidth = 539
     150    ClientHeight = 38
     151    ClientWidth = 647
    156152    TabOrder = 5
    157153    object LabelText: TLabel
    158       Left = 8
    159       Height = 24
    160       Top = 8
    161       Width = 525
     154      Left = 10
     155      Height = 29
     156      Top = 10
     157      Width = 630
    162158      Anchors = [akTop, akLeft, akRight]
    163159      AutoSize = False
    164       ParentColor = False
    165160    end
    166161  end
    167162  object ImageList1: TImageList
    168     BkColor = clForeground
    169     left = 200
    170     top = 8
     163    Left = 240
     164    Top = 10
    171165    Bitmap = {
    172       4C69020000001000000010000000FF00FF00FF00FF00FF00FF00FF00FF00FF00
    173       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    174       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    175       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    176       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    177       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    178       FF00000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    179       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000000
    180       00FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    181       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF0000
    182       00FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    183       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF0000
    184       00FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    185       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000
    186       00FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FFFF00FF00FF00
    187       FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF000000FFFF00
    188       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FFFF00
    189       FF00FF00FF00FF00FF00000000FF000000FF000000FF000000FFFF00FF00FF00
    190       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000
    191       00FFFF00FF00000000FF000000FF000000FF000000FFFF00FF00FF00FF00FF00
    192       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF0000
    193       00FF000000FF000000FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00
    194       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF0000
    195       00FF000000FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00
    196       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000000
    197       00FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    198       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    199       FF00000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    200       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    201       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    202       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    203       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    204       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    205       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    206       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    207       FF00FF00FF00FF00FF00FF00FF00000000FFFF00FF00FF00FF00FF00FF00FF00
    208       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    209       FF00FF00FF00FF00FF00FF00FF00000000FF000000FFFF00FF00FF00FF00FF00
    210       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    211       FF00FF00FF00FF00FF00FF00FF00000000FF000084FF000000FFFF00FF00FF00
    212       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000
    213       00FF000000FF000000FF000000FF000000FF0000FFFF000084FF000000FFFF00
    214       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    215       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000084FF0000
    216       00FFFF00FF00FF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    217       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000
    218       84FF000000FFFF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    219       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000
    220       FFFF000084FF000000FFFF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    221       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000
    222       84FF000000FFFF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    223       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000084FF0000
    224       00FFFF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000
    225       00FF000000FF000000FF000000FF000000FF0000FFFF000084FF000000FFFF00
    226       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    227       FF00FF00FF00FF00FF00FF00FF00000000FF000084FF000000FFFF00FF00FF00
    228       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    229       FF00FF00FF00FF00FF00FF00FF00000000FF000000FFFF00FF00FF00FF00FF00
    230       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    231       FF00FF00FF00FF00FF00FF00FF00000000FFFF00FF00FF00FF00FF00FF00FF00
    232       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    233       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    234       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    235       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    236       FF00FF00FF00FF00FF00FF00FF00
     166      4C7A0200000010000000100000006A0000000000000078DAE593490E00100C45
     167      7B78F72E5684A63A1142C382BE4F0708F89C955117F4B016BE67B5FC6E96DB97
     168      B0D4B9F4CD949F36DED1DF922B0F1BD11FAB5AFC68DE5C44D40220A9FA779EC8
     169      6A349FD5A435E43CADA1E3678D73F773F1DBF3EFADFFEEFEBBF97F6696BE9D36
    237170    }
    238171  end
     
    241174    Interval = 100
    242175    OnTimer = TimerUpdateTimer
    243     left = 320
    244     top = 8
     176    Left = 384
     177    Top = 10
    245178  end
    246179end
  • trunk/Packages/Common/JobProgressView.pas

    r84 r85  
    1 unit UJobProgressView;
    2 
    3 {$MODE Delphi}
     1unit JobProgressView;
    42
    53interface
     
    75uses
    86  SysUtils, Variants, Classes, Graphics, Controls, Forms, Syncobjs,
    9   Dialogs, ComCtrls, StdCtrls, ExtCtrls, Contnrs, UThreading, Math,
     7  Dialogs, ComCtrls, StdCtrls, ExtCtrls, Generics.Collections, Threading, Math,
    108  DateUtils;
    119
     
    7169  end;
    7270
    73   TJobs = class(TObjectList)
     71  TJobs = class(TObjectList<TJob>)
    7472  end;
    7573
     
    105103    procedure ReloadJobList;
    106104    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    107     procedure FormDestroy(Sender: TObject);
    108105    procedure ListViewJobsData(Sender: TObject; Item: TListItem);
    109106    procedure TimerUpdateTimer(Sender: TObject);
     
    157154  end;
    158155
    159   //var
    160   //  FormJobProgressView: TFormJobProgressView;
    161 
    162156procedure Register;
    163157
    164158resourcestring
    165159  SExecuted = 'Executed';
     160
    166161
    167162implementation
     
    187182  try
    188183    try
    189       //raise Exception.Create('Exception in job');
    190184      ProgressView.CurrentJob.Method(Job);
    191185    except
     
    286280end;
    287281
    288 procedure TFormJobProgressView.FormDestroy(Sender:TObject);
    289 begin
    290 end;
    291 
    292282procedure TFormJobProgressView.ListViewJobsData(Sender: TObject; Item: TListItem);
    293283begin
    294284  if (Item.Index >= 0) and (Item.Index < JobProgressView.Jobs.Count) then
    295   with TJob(JobProgressView.Jobs[Item.Index]) do begin
     285  with JobProgressView.Jobs[Item.Index] do begin
    296286    Item.Caption := Title;
    297287    if Item.Index = JobProgressView.CurrentJobIndex then Item.ImageIndex := 1
     
    405395    I := 0;
    406396    while I < Jobs.Count do
    407     with TJob(Jobs[I]) do begin
     397    with Jobs[I] do begin
    408398      CurrentJobIndex := I;
    409       CurrentJob := TJob(Jobs[I]);
     399      CurrentJob := Jobs[I];
    410400      JobProgressChange(Self);
    411401      StartTime := Now;
     
    420410        Method(CurrentJob);
    421411      end else begin
     412        Thread := TJobThread.Create(True);
    422413        try
    423           Thread := TJobThread.Create(True);
    424414          with Thread do begin
    425415            FreeOnTerminate := False;
     
    494484  if AValue = FTerminate then Exit;
    495485  for I := 0 to Jobs.Count - 1 do
    496     TJob(Jobs[I]).Terminate := AValue;
     486    Jobs[I].Terminate := AValue;
    497487  FTerminate := AValue;
    498488end;
     
    620610procedure TProgress.Increment;
    621611begin
    622   try
    623     FLock.Acquire;
     612  FLock.Acquire;
     613  try
    624614    Value := Value + 1;
    625615  finally
     
    630620procedure TProgress.Reset;
    631621begin
    632   try
    633     FLock.Acquire;
     622  FLock.Acquire;
     623  try
    634624    FValue := 0;
    635625  finally
     
    647637begin
    648638  FLock.Free;
    649   inherited Destroy;
     639  inherited;
    650640end;
    651641
     
    678668destructor TJob.Destroy;
    679669begin
    680   Progress.Free;
     670  FreeAndNil(Progress);
    681671  inherited;
    682672end;
  • trunk/Packages/Common/Languages.pas

    r84 r85  
    1 unit ULanguages;
    2 
    3 {$mode objfpc}{$H+}
     1unit Languages;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Contnrs;
     6  Classes, SysUtils, Generics.Collections;
    97
    108type
     
    1513  end;
    1614
    17   { TLanguageList }
    18 
    19   TLanguageList = class(TObjectList)
     15  { TLanguages }
     16
     17  TLanguages = class(TObjectList<TLanguage>)
    2018    function SearchByCode(ACode: string): TLanguage;
    2119    procedure AddNew(Code: string; Name: string);
    22     constructor Create;
     20    constructor Create(FreeObjects: Boolean = True);
    2321  end;
    2422
     
    218216  SLang_za = 'Zhuang';
    219217  SLang_zh = 'Chinese';
     218  SLang_zh_Hans = 'Simplified Chinese';
     219  SLang_zh_Hant = 'Traditional Chinese';
    220220  SLang_zu = 'Zulu';
    221221
     222
    222223implementation
    223224
    224225
    225 { TLanguageList }
    226 
    227 function TLanguageList.SearchByCode(ACode: string): TLanguage;
     226{ TLanguages }
     227
     228function TLanguages.SearchByCode(ACode: string): TLanguage;
    228229var
    229230  I: Integer;
    230231begin
    231232  I := 0;
    232   while (I < Count) and (TLanguage(Items[I]).Code < ACode) do Inc(I);
    233   if I < Count then Result := TLanguage(Items[I])
     233  while (I < Count) and (Items[I].Code <> ACode) do Inc(I);
     234  if I < Count then Result := Items[I]
    234235    else Result := nil;
    235236end;
    236237
    237 procedure TLanguageList.AddNew(Code: string; Name: string);
     238procedure TLanguages.AddNew(Code: string; Name: string);
    238239var
    239240  NewItem: TLanguage;
     
    245246end;
    246247
    247 constructor TLanguageList.Create;
     248constructor TLanguages.Create(FreeObjects: Boolean);
    248249begin
    249   inherited Create;
     250  inherited;
    250251  AddNew('', SLangAuto);
    251252  AddNew('aa', SLang_aa);
     
    441442  AddNew('za', SLang_za);
    442443  AddNew('zh', SLang_zh);
     444  AddNew('zh-Hant', SLang_zh_Hant);
     445  AddNew('zh-Hans', SLang_zh_Hans);
    443446  AddNew('zu', SLang_zu);
    444447end;
    445448
    446449end.
    447 
  • trunk/Packages/Common/Languages/DebugLog.cs.po

    r84 r85  
    11msgid ""
    22msgstr ""
    3 "Content-Type: text/plain; charset=UTF-8\n"
    43"Project-Id-Version: \n"
    54"POT-Creation-Date: \n"
     
    76"Last-Translator: Jiří Hajda <robie@centrum.cz>\n"
    87"Language-Team: \n"
     8"Language: cs\n"
    99"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
     12"X-Generator: Poedit 3.0.1\n"
    1113
    12 #: udebuglog.sfilenamenotdefined
     14#: debuglog.sfilenamenotdefined
     15msgctxt "debuglog.sfilenamenotdefined"
    1316msgid "Filename not defined"
    1417msgstr "Neurčen soubor"
  • trunk/Packages/Common/Languages/FindFile.cs.po

    r84 r85  
    11msgid ""
    22msgstr ""
    3 "Content-Type: text/plain; charset=UTF-8\n"
    43"Project-Id-Version: \n"
    54"POT-Creation-Date: \n"
     
    76"Last-Translator: \n"
    87"Language-Team: \n"
     8"Language: cs\n"
    99"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
    11 "Language: cs\n"
    12 "X-Generator: Poedit 1.8.9\n"
     12"X-Generator: Poedit 3.0.1\n"
    1313
    14 #: ufindfile.sdirnotfound
     14#: findfile.sdirnotfound
     15msgctxt "findfile.sdirnotfound"
    1516msgid "Directory not found"
    1617msgstr "Adresář nenalezen"
  • trunk/Packages/Common/Languages/FormAbout.cs.po

    r84 r85  
    11msgid ""
    22msgstr ""
    3 "Content-Type: text/plain; charset=UTF-8\n"
    43"Project-Id-Version: \n"
    54"POT-Creation-Date: \n"
     
    76"Last-Translator: Chronos <robie@centrum.cz>\n"
    87"Language-Team: \n"
     8"Language: cs\n"
    99"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
    11 "Language: cs\n"
    12 "X-Generator: Poedit 2.4.1\n"
     12"X-Generator: Poedit 3.0.1\n"
    1313
    14 #: uformabout.slicense
     14#: formabout.slicense
     15msgctxt "formabout.slicense"
    1516msgid "License"
    1617msgstr "Licence"
    1718
    18 #: uformabout.sreleasedate
     19#: formabout.sreleasedate
     20msgctxt "formabout.sreleasedate"
    1921msgid "Release date"
    2022msgstr "Datum uvolnění"
    2123
    22 #: uformabout.sversion
     24#: formabout.sversion
     25msgctxt "formabout.sversion"
    2326msgid "Version"
    2427msgstr "Verze"
  • trunk/Packages/Common/Languages/JobProgressView.cs.po

    r84 r85  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 2.2\n"
     12"X-Generator: Poedit 3.0.1\n"
    1313
    14 #: ujobprogressview.sestimatedtime
     14#: jobprogressview.sestimatedtime
     15#, object-pascal-format
     16msgctxt "jobprogressview.sestimatedtime"
    1517msgid "Estimated time: %s"
    1618msgstr "Odhadovaný čas: %s"
    1719
    18 #: ujobprogressview.sexecuted
     20#: jobprogressview.sexecuted
     21msgctxt "jobprogressview.sexecuted"
    1922msgid "Executed"
    2023msgstr "Vykonané"
    2124
    22 #: ujobprogressview.sfinished
     25#: jobprogressview.sfinished
     26msgctxt "jobprogressview.sfinished"
    2327msgid "Finished"
    2428msgstr "Dokončené"
    2529
    26 #: ujobprogressview.spleasewait
     30#: jobprogressview.spleasewait
     31msgctxt "jobprogressview.spleasewait"
    2732msgid "Please wait..."
    2833msgstr "Prosím čekejte..."
    2934
    30 #: ujobprogressview.sterminate
     35#: jobprogressview.sterminate
     36msgctxt "jobprogressview.sterminate"
    3137msgid "Termination"
    3238msgstr "Přerušení"
    3339
    34 #: ujobprogressview.stotalestimatedtime
     40#: jobprogressview.stotalestimatedtime
     41#, object-pascal-format
     42msgctxt "jobprogressview.stotalestimatedtime"
    3543msgid "Total estimated time: %s"
    3644msgstr "Celkový odhadovaný čas: %s"
  • trunk/Packages/Common/Languages/Languages.cs.po

    r84 r85  
    11msgid ""
    22msgstr ""
    3 "Content-Type: text/plain; charset=UTF-8\n"
    43"Project-Id-Version: \n"
    54"POT-Creation-Date: \n"
     
    76"Last-Translator: Jiří Hajda <software@mezservis.cz>\n"
    87"Language-Team: \n"
     8"Language: cs\n"
    99"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
    11 
    12 #: ulanguages.slangauto
     12"X-Generator: Poedit 3.0.1\n"
     13
     14#: languages.slangauto
     15msgctxt "languages.slangauto"
    1316msgid "Automatic"
    1417msgstr "Automaticky"
    1518
    16 #: ulanguages.slang_aa
     19#: languages.slang_aa
     20msgctxt "languages.slang_aa"
    1721msgid "Afar"
    1822msgstr ""
    1923
    20 #: ulanguages.slang_ab
     24#: languages.slang_ab
     25msgctxt "languages.slang_ab"
    2126msgid "Abkhazian"
    2227msgstr "Abcházština"
    2328
    24 #: ulanguages.slang_ae
     29#: languages.slang_ae
     30msgctxt "languages.slang_ae"
    2531msgid "Avestan"
    2632msgstr ""
    2733
    28 #: ulanguages.slang_af
     34#: languages.slang_af
     35msgctxt "languages.slang_af"
    2936msgid "Afrikaans"
    3037msgstr "Afrikánština"
    3138
    32 #: ulanguages.slang_ak
     39#: languages.slang_ak
     40msgctxt "languages.slang_ak"
    3341msgid "Akan"
    3442msgstr ""
    3543
    36 #: ulanguages.slang_am
     44#: languages.slang_am
     45msgctxt "languages.slang_am"
    3746msgid "Amharic"
    3847msgstr ""
    3948
    40 #: ulanguages.slang_an
     49#: languages.slang_an
     50msgctxt "languages.slang_an"
    4151msgid "Aragonese"
    4252msgstr ""
    4353
    44 #: ulanguages.slang_ar
     54#: languages.slang_ar
     55msgctxt "languages.slang_ar"
    4556msgid "Arabic"
    4657msgstr "Arabština"
    4758
    48 #: ulanguages.slang_as
     59#: languages.slang_as
     60msgctxt "languages.slang_as"
    4961msgid "Assamese"
    5062msgstr ""
    5163
    52 #: ulanguages.slang_av
     64#: languages.slang_av
     65msgctxt "languages.slang_av"
    5366msgid "Avaric"
    5467msgstr ""
    5568
    56 #: ulanguages.slang_ay
     69#: languages.slang_ay
     70msgctxt "languages.slang_ay"
    5771msgid "Aymara"
    5872msgstr ""
    5973
    60 #: ulanguages.slang_az
     74#: languages.slang_az
     75msgctxt "languages.slang_az"
    6176msgid "Azerbaijani"
    6277msgstr ""
    6378
    64 #: ulanguages.slang_ba
     79#: languages.slang_ba
     80msgctxt "languages.slang_ba"
    6581msgid "Bashkir"
    6682msgstr ""
    6783
    68 #: ulanguages.slang_be
     84#: languages.slang_be
     85msgctxt "languages.slang_be"
    6986msgid "Belarusian"
    7087msgstr ""
    7188
    72 #: ulanguages.slang_bg
     89#: languages.slang_bg
     90msgctxt "languages.slang_bg"
    7391msgid "Bulgarian"
    7492msgstr "Maďarština"
    7593
    76 #: ulanguages.slang_bh
     94#: languages.slang_bh
     95msgctxt "languages.slang_bh"
    7796msgid "Bihari"
    7897msgstr ""
    7998
    80 #: ulanguages.slang_bi
     99#: languages.slang_bi
     100msgctxt "languages.slang_bi"
    81101msgid "Bislama"
    82102msgstr ""
    83103
    84 #: ulanguages.slang_bm
     104#: languages.slang_bm
     105msgctxt "languages.slang_bm"
    85106msgid "Bambara"
    86107msgstr ""
    87108
    88 #: ulanguages.slang_bn
     109#: languages.slang_bn
     110msgctxt "languages.slang_bn"
    89111msgid "Bengali"
    90112msgstr ""
    91113
    92 #: ulanguages.slang_bo
     114#: languages.slang_bo
     115msgctxt "languages.slang_bo"
    93116msgid "Tibetan"
    94117msgstr "Tibetština"
    95118
    96 #: ulanguages.slang_br
     119#: languages.slang_br
     120msgctxt "languages.slang_br"
    97121msgid "Breton"
    98122msgstr ""
    99123
    100 #: ulanguages.slang_bs
     124#: languages.slang_bs
     125msgctxt "languages.slang_bs"
    101126msgid "Bosnian"
    102127msgstr ""
    103128
    104 #: ulanguages.slang_ca
     129#: languages.slang_ca
     130msgctxt "languages.slang_ca"
    105131msgid "Catalan"
    106132msgstr "Katalánština"
    107133
    108 #: ulanguages.slang_ce
     134#: languages.slang_ce
     135msgctxt "languages.slang_ce"
    109136msgid "Chechen"
    110137msgstr ""
    111138
    112 #: ulanguages.slang_ch
     139#: languages.slang_ch
     140msgctxt "languages.slang_ch"
    113141msgid "Chamorro"
    114142msgstr ""
    115143
    116 #: ulanguages.slang_co
     144#: languages.slang_co
     145msgctxt "languages.slang_co"
    117146msgid "Corsican"
    118147msgstr ""
    119148
    120 #: ulanguages.slang_cr
     149#: languages.slang_cr
     150msgctxt "languages.slang_cr"
    121151msgid "Cree"
    122152msgstr "Kríjština"
    123153
    124 #: ulanguages.slang_cs
     154#: languages.slang_cs
     155msgctxt "languages.slang_cs"
    125156msgid "Czech"
    126157msgstr "Čeština"
    127158
    128 #: ulanguages.slang_cv
     159#: languages.slang_cv
     160msgctxt "languages.slang_cv"
    129161msgid "Chuvash"
    130162msgstr ""
    131163
    132 #: ulanguages.slang_cy
     164#: languages.slang_cy
     165msgctxt "languages.slang_cy"
    133166msgid "Welsh"
    134167msgstr ""
    135168
    136 #: ulanguages.slang_da
     169#: languages.slang_da
     170msgctxt "languages.slang_da"
    137171msgid "Danish"
    138172msgstr "Dánština"
    139173
    140 #: ulanguages.slang_de
     174#: languages.slang_de
     175msgctxt "languages.slang_de"
    141176msgid "German"
    142177msgstr "Němčina"
    143178
    144 #: ulanguages.slang_de_at
     179#: languages.slang_de_at
     180msgctxt "languages.slang_de_at"
    145181msgid "Austrian German"
    146182msgstr "Australská němčina"
    147183
    148 #: ulanguages.slang_de_ch
     184#: languages.slang_de_ch
     185msgctxt "languages.slang_de_ch"
    149186msgid "Swiss German"
    150187msgstr "Švédská němčina"
    151188
    152 #: ulanguages.slang_dv
     189#: languages.slang_dv
     190msgctxt "languages.slang_dv"
    153191msgid "Divehi"
    154192msgstr ""
    155193
    156 #: ulanguages.slang_dz
     194#: languages.slang_dz
     195msgctxt "languages.slang_dz"
    157196msgid "Dzongkha"
    158197msgstr ""
    159198
    160 #: ulanguages.slang_ee
     199#: languages.slang_ee
     200msgctxt "languages.slang_ee"
    161201msgid "Ewe"
    162202msgstr ""
    163203
    164 #: ulanguages.slang_el
     204#: languages.slang_el
     205msgctxt "languages.slang_el"
    165206msgid "Greek"
    166207msgstr "Řečtina"
    167208
    168 #: ulanguages.slang_en
     209#: languages.slang_en
     210msgctxt "languages.slang_en"
    169211msgid "English"
    170212msgstr "Angličtina"
    171213
    172 #: ulanguages.slang_en_au
     214#: languages.slang_en_au
     215msgctxt "languages.slang_en_au"
    173216msgid "Australian English"
    174217msgstr "Australská angličtina"
    175218
    176 #: ulanguages.slang_en_ca
     219#: languages.slang_en_ca
     220msgctxt "languages.slang_en_ca"
    177221msgid "Canadian English"
    178222msgstr "Kanadská angličtina"
    179223
    180 #: ulanguages.slang_en_gb
     224#: languages.slang_en_gb
     225msgctxt "languages.slang_en_gb"
    181226msgid "British English"
    182227msgstr "Britská angličtina"
    183228
    184 #: ulanguages.slang_en_us
     229#: languages.slang_en_us
     230msgctxt "languages.slang_en_us"
    185231msgid "American English"
    186232msgstr "Americká angličtina"
    187233
    188 #: ulanguages.slang_eo
     234#: languages.slang_eo
     235msgctxt "languages.slang_eo"
    189236msgid "Esperanto"
    190237msgstr "Esperanto"
    191238
    192 #: ulanguages.slang_es
     239#: languages.slang_es
     240msgctxt "languages.slang_es"
    193241msgid "Spanish"
    194242msgstr "Španělština"
    195243
    196 #: ulanguages.slang_et
     244#: languages.slang_et
     245msgctxt "languages.slang_et"
    197246msgid "Estonian"
    198247msgstr "Estonština"
    199248
    200 #: ulanguages.slang_eu
     249#: languages.slang_eu
     250msgctxt "languages.slang_eu"
    201251msgid "Basque"
    202252msgstr ""
    203253
    204 #: ulanguages.slang_fa
     254#: languages.slang_fa
     255msgctxt "languages.slang_fa"
    205256msgid "Persian"
    206257msgstr "Perština"
    207258
    208 #: ulanguages.slang_ff
     259#: languages.slang_ff
     260msgctxt "languages.slang_ff"
    209261msgid "Fulah"
    210262msgstr ""
    211263
    212 #: ulanguages.slang_fi
     264#: languages.slang_fi
     265msgctxt "languages.slang_fi"
    213266msgid "Finnish"
    214267msgstr "Finština"
    215268
    216 #: ulanguages.slang_fj
     269#: languages.slang_fj
     270msgctxt "languages.slang_fj"
    217271msgid "Fijian"
    218272msgstr ""
    219273
    220 #: ulanguages.slang_fo
     274#: languages.slang_fo
     275msgctxt "languages.slang_fo"
    221276msgid "Faroese"
    222277msgstr ""
    223278
    224 #: ulanguages.slang_fr
     279#: languages.slang_fr
     280msgctxt "languages.slang_fr"
    225281msgid "French"
    226282msgstr "Francouzština"
    227283
    228 #: ulanguages.slang_fr_be
    229 msgctxt "ulanguages.slang_fr_be"
     284#: languages.slang_fr_be
     285msgctxt "languages.slang_fr_be"
    230286msgid "Walloon"
    231287msgstr ""
    232288
    233 #: ulanguages.slang_fy
     289#: languages.slang_fy
     290msgctxt "languages.slang_fy"
    234291msgid "Frisian"
    235292msgstr ""
    236293
    237 #: ulanguages.slang_ga
     294#: languages.slang_ga
     295msgctxt "languages.slang_ga"
    238296msgid "Irish"
    239297msgstr "Irština"
    240298
    241 #: ulanguages.slang_gd
     299#: languages.slang_gd
     300msgctxt "languages.slang_gd"
    242301msgid "Gaelic"
    243302msgstr ""
    244303
    245 #: ulanguages.slang_gl
     304#: languages.slang_gl
     305msgctxt "languages.slang_gl"
    246306msgid "Gallegan"
    247307msgstr ""
    248308
    249 #: ulanguages.slang_gn
     309#: languages.slang_gn
     310msgctxt "languages.slang_gn"
    250311msgid "Guarani"
    251312msgstr ""
    252313
    253 #: ulanguages.slang_gu
     314#: languages.slang_gu
     315msgctxt "languages.slang_gu"
    254316msgid "Gujarati"
    255317msgstr ""
    256318
    257 #: ulanguages.slang_gv
     319#: languages.slang_gv
     320msgctxt "languages.slang_gv"
    258321msgid "Manx"
    259322msgstr ""
    260323
    261 #: ulanguages.slang_ha
     324#: languages.slang_ha
     325msgctxt "languages.slang_ha"
    262326msgid "Hausa"
    263327msgstr ""
    264328
    265 #: ulanguages.slang_he
     329#: languages.slang_he
     330msgctxt "languages.slang_he"
    266331msgid "Hebrew"
    267332msgstr "Hebrejština"
    268333
    269 #: ulanguages.slang_hi
     334#: languages.slang_hi
     335msgctxt "languages.slang_hi"
    270336msgid "Hindi"
    271337msgstr ""
    272338
    273 #: ulanguages.slang_ho
     339#: languages.slang_ho
     340msgctxt "languages.slang_ho"
    274341msgid "Hiri Motu"
    275342msgstr ""
    276343
    277 #: ulanguages.slang_hr
     344#: languages.slang_hr
     345msgctxt "languages.slang_hr"
    278346msgid "Croatian"
    279347msgstr "Chorvatština"
    280348
    281 #: ulanguages.slang_ht
     349#: languages.slang_ht
     350msgctxt "languages.slang_ht"
    282351msgid "Haitian"
    283352msgstr ""
    284353
    285 #: ulanguages.slang_hu
     354#: languages.slang_hu
     355msgctxt "languages.slang_hu"
    286356msgid "Hungarian"
    287357msgstr "Maďarština"
    288358
    289 #: ulanguages.slang_hy
     359#: languages.slang_hy
     360msgctxt "languages.slang_hy"
    290361msgid "Armenian"
    291362msgstr "Arménština"
    292363
    293 #: ulanguages.slang_hz
     364#: languages.slang_hz
     365msgctxt "languages.slang_hz"
    294366msgid "Herero"
    295367msgstr ""
    296368
    297 #: ulanguages.slang_ia
     369#: languages.slang_ia
     370msgctxt "languages.slang_ia"
    298371msgid "Interlingua"
    299372msgstr ""
    300373
    301 #: ulanguages.slang_id
     374#: languages.slang_id
     375msgctxt "languages.slang_id"
    302376msgid "Indonesian"
    303377msgstr ""
    304378
    305 #: ulanguages.slang_ie
     379#: languages.slang_ie
     380msgctxt "languages.slang_ie"
    306381msgid "Interlingue"
    307382msgstr ""
    308383
    309 #: ulanguages.slang_ig
     384#: languages.slang_ig
     385msgctxt "languages.slang_ig"
    310386msgid "Igbo"
    311387msgstr ""
    312388
    313 #: ulanguages.slang_ii
     389#: languages.slang_ii
     390msgctxt "languages.slang_ii"
    314391msgid "Sichuan Yi"
    315392msgstr ""
    316393
    317 #: ulanguages.slang_ik
     394#: languages.slang_ik
     395msgctxt "languages.slang_ik"
    318396msgid "Inupiaq"
    319397msgstr ""
    320398
    321 #: ulanguages.slang_io
     399#: languages.slang_io
     400msgctxt "languages.slang_io"
    322401msgid "Ido"
    323402msgstr ""
    324403
    325 #: ulanguages.slang_is
     404#: languages.slang_is
     405msgctxt "languages.slang_is"
    326406msgid "Icelandic"
    327407msgstr "Islandština"
    328408
    329 #: ulanguages.slang_it
     409#: languages.slang_it
     410msgctxt "languages.slang_it"
    330411msgid "Italian"
    331412msgstr "Italština"
    332413
    333 #: ulanguages.slang_iu
     414#: languages.slang_iu
     415msgctxt "languages.slang_iu"
    334416msgid "Inuktitut"
    335417msgstr ""
    336418
    337 #: ulanguages.slang_ja
     419#: languages.slang_ja
     420msgctxt "languages.slang_ja"
    338421msgid "Japanese"
    339422msgstr "Japonština"
    340423
    341 #: ulanguages.slang_jv
     424#: languages.slang_jv
     425msgctxt "languages.slang_jv"
    342426msgid "Javanese"
    343427msgstr ""
    344428
    345 #: ulanguages.slang_ka
     429#: languages.slang_ka
     430msgctxt "languages.slang_ka"
    346431msgid "Georgian"
    347432msgstr "Gruzínština"
    348433
    349 #: ulanguages.slang_kg
     434#: languages.slang_kg
     435msgctxt "languages.slang_kg"
    350436msgid "Kongo"
    351437msgstr "Konžština"
    352438
    353 #: ulanguages.slang_ki
     439#: languages.slang_ki
     440msgctxt "languages.slang_ki"
    354441msgid "Kikuyu"
    355442msgstr ""
    356443
    357 #: ulanguages.slang_kj
     444#: languages.slang_kj
     445msgctxt "languages.slang_kj"
    358446msgid "Kuanyama"
    359447msgstr ""
    360448
    361 #: ulanguages.slang_kk
     449#: languages.slang_kk
     450msgctxt "languages.slang_kk"
    362451msgid "Kazakh"
    363452msgstr ""
    364453
    365 #: ulanguages.slang_kl
     454#: languages.slang_kl
     455msgctxt "languages.slang_kl"
    366456msgid "Greenlandic"
    367457msgstr "Grónština"
    368458
    369 #: ulanguages.slang_km
     459#: languages.slang_km
     460msgctxt "languages.slang_km"
    370461msgid "Khmer"
    371462msgstr ""
    372463
    373 #: ulanguages.slang_kn
     464#: languages.slang_kn
     465msgctxt "languages.slang_kn"
    374466msgid "Kannada"
    375467msgstr "Kannadština"
    376468
    377 #: ulanguages.slang_ko
     469#: languages.slang_ko
     470msgctxt "languages.slang_ko"
    378471msgid "Korean"
    379472msgstr "Korejština"
    380473
    381 #: ulanguages.slang_kr
     474#: languages.slang_kr
     475msgctxt "languages.slang_kr"
    382476msgid "Kanuri"
    383477msgstr ""
    384478
    385 #: ulanguages.slang_ks
     479#: languages.slang_ks
     480msgctxt "languages.slang_ks"
    386481msgid "Kashmiri"
    387482msgstr ""
    388483
    389 #: ulanguages.slang_ku
     484#: languages.slang_ku
     485msgctxt "languages.slang_ku"
    390486msgid "Kurdish"
    391487msgstr ""
    392488
    393 #: ulanguages.slang_kv
     489#: languages.slang_kv
     490msgctxt "languages.slang_kv"
    394491msgid "Komi"
    395492msgstr ""
    396493
    397 #: ulanguages.slang_kw
     494#: languages.slang_kw
     495msgctxt "languages.slang_kw"
    398496msgid "Cornish"
    399497msgstr "Kornština"
    400498
    401 #: ulanguages.slang_ky
     499#: languages.slang_ky
     500msgctxt "languages.slang_ky"
    402501msgid "Kirghiz"
    403502msgstr ""
    404503
    405 #: ulanguages.slang_la
     504#: languages.slang_la
     505msgctxt "languages.slang_la"
    406506msgid "Latin"
    407507msgstr "Latina"
    408508
    409 #: ulanguages.slang_lb
     509#: languages.slang_lb
     510msgctxt "languages.slang_lb"
    410511msgid "Luxembourgish"
    411512msgstr "Lucemburština"
    412513
    413 #: ulanguages.slang_lg
     514#: languages.slang_lg
     515msgctxt "languages.slang_lg"
    414516msgid "Ganda"
    415517msgstr ""
    416518
    417 #: ulanguages.slang_li
     519#: languages.slang_li
     520msgctxt "languages.slang_li"
    418521msgid "Limburgan"
    419522msgstr ""
    420523
    421 #: ulanguages.slang_ln
     524#: languages.slang_ln
     525msgctxt "languages.slang_ln"
    422526msgid "Lingala"
    423527msgstr ""
    424528
    425 #: ulanguages.slang_lo
     529#: languages.slang_lo
     530msgctxt "languages.slang_lo"
    426531msgid "Lao"
    427532msgstr "Laoština"
    428533
    429 #: ulanguages.slang_lt
     534#: languages.slang_lt
     535msgctxt "languages.slang_lt"
    430536msgid "Lithuanian"
    431537msgstr "Litevština"
    432538
    433 #: ulanguages.slang_lu
     539#: languages.slang_lu
     540msgctxt "languages.slang_lu"
    434541msgid "Luba-Katanga"
    435542msgstr ""
    436543
    437 #: ulanguages.slang_lv
     544#: languages.slang_lv
     545msgctxt "languages.slang_lv"
    438546msgid "Latvian"
    439547msgstr "Lotyština"
    440548
    441 #: ulanguages.slang_mg
     549#: languages.slang_mg
     550msgctxt "languages.slang_mg"
    442551msgid "Malagasy"
    443552msgstr ""
    444553
    445 #: ulanguages.slang_mh
     554#: languages.slang_mh
     555msgctxt "languages.slang_mh"
    446556msgid "Marshallese"
    447557msgstr ""
    448558
    449 #: ulanguages.slang_mi
     559#: languages.slang_mi
     560msgctxt "languages.slang_mi"
    450561msgid "Maori"
    451562msgstr ""
    452563
    453 #: ulanguages.slang_mk
     564#: languages.slang_mk
     565msgctxt "languages.slang_mk"
    454566msgid "Macedonian"
    455567msgstr "Makedonština"
    456568
    457 #: ulanguages.slang_ml
     569#: languages.slang_ml
     570msgctxt "languages.slang_ml"
    458571msgid "Malayalam"
    459572msgstr ""
    460573
    461 #: ulanguages.slang_mn
     574#: languages.slang_mn
     575msgctxt "languages.slang_mn"
    462576msgid "Mongolian"
    463577msgstr "Mongolština"
    464578
    465 #: ulanguages.slang_mo
     579#: languages.slang_mo
     580msgctxt "languages.slang_mo"
    466581msgid "Moldavian"
    467582msgstr "Moldavština"
    468583
    469 #: ulanguages.slang_mr
     584#: languages.slang_mr
     585msgctxt "languages.slang_mr"
    470586msgid "Marathi"
    471587msgstr ""
    472588
    473 #: ulanguages.slang_ms
     589#: languages.slang_ms
     590msgctxt "languages.slang_ms"
    474591msgid "Malay"
    475592msgstr ""
    476593
    477 #: ulanguages.slang_mt
     594#: languages.slang_mt
     595msgctxt "languages.slang_mt"
    478596msgid "Maltese"
    479597msgstr ""
    480598
    481 #: ulanguages.slang_my
     599#: languages.slang_my
     600msgctxt "languages.slang_my"
    482601msgid "Burmese"
    483602msgstr ""
    484603
    485 #: ulanguages.slang_na
     604#: languages.slang_na
     605msgctxt "languages.slang_na"
    486606msgid "Nauru"
    487607msgstr ""
    488608
    489 #: ulanguages.slang_nb
     609#: languages.slang_nb
     610msgctxt "languages.slang_nb"
    490611msgid "Norwegian Bokmaal"
    491612msgstr ""
    492613
    493 #: ulanguages.slang_nd
     614#: languages.slang_nd
     615msgctxt "languages.slang_nd"
    494616msgid "Ndebele, North"
    495617msgstr ""
    496618
    497 #: ulanguages.slang_ne
     619#: languages.slang_ne
     620msgctxt "languages.slang_ne"
    498621msgid "Nepali"
    499622msgstr ""
    500623
    501 #: ulanguages.slang_ng
     624#: languages.slang_ng
     625msgctxt "languages.slang_ng"
    502626msgid "Ndonga"
    503627msgstr ""
    504628
    505 #: ulanguages.slang_nl
     629#: languages.slang_nl
     630msgctxt "languages.slang_nl"
    506631msgid "Dutch"
    507632msgstr "Němčina"
    508633
    509 #: ulanguages.slang_nl_be
     634#: languages.slang_nl_be
     635msgctxt "languages.slang_nl_be"
    510636msgid "Flemish"
    511637msgstr ""
    512638
    513 #: ulanguages.slang_nn
     639#: languages.slang_nn
     640msgctxt "languages.slang_nn"
    514641msgid "Norwegian Nynorsk"
    515642msgstr ""
    516643
    517 #: ulanguages.slang_no
     644#: languages.slang_no
     645msgctxt "languages.slang_no"
    518646msgid "Norwegian"
    519647msgstr "Norština"
    520648
    521 #: ulanguages.slang_nr
     649#: languages.slang_nr
     650msgctxt "languages.slang_nr"
    522651msgid "Ndebele, South"
    523652msgstr ""
    524653
    525 #: ulanguages.slang_nv
     654#: languages.slang_nv
     655msgctxt "languages.slang_nv"
    526656msgid "Navajo"
    527657msgstr "Navažština"
    528658
    529 #: ulanguages.slang_ny
     659#: languages.slang_ny
     660msgctxt "languages.slang_ny"
    530661msgid "Chichewa"
    531662msgstr ""
    532663
    533 #: ulanguages.slang_oc
     664#: languages.slang_oc
     665msgctxt "languages.slang_oc"
    534666msgid "Occitan"
    535667msgstr ""
    536668
    537 #: ulanguages.slang_oj
     669#: languages.slang_oj
     670msgctxt "languages.slang_oj"
    538671msgid "Ojibwa"
    539672msgstr ""
    540673
    541 #: ulanguages.slang_om
     674#: languages.slang_om
     675msgctxt "languages.slang_om"
    542676msgid "Oromo"
    543677msgstr ""
    544678
    545 #: ulanguages.slang_or
     679#: languages.slang_or
     680msgctxt "languages.slang_or"
    546681msgid "Oriya"
    547682msgstr ""
    548683
    549 #: ulanguages.slang_os
     684#: languages.slang_os
     685msgctxt "languages.slang_os"
    550686msgid "Ossetian"
    551687msgstr ""
    552688
    553 #: ulanguages.slang_pa
     689#: languages.slang_pa
     690msgctxt "languages.slang_pa"
    554691msgid "Panjabi"
    555692msgstr ""
    556693
    557 #: ulanguages.slang_pi
     694#: languages.slang_pi
     695msgctxt "languages.slang_pi"
    558696msgid "Pali"
    559697msgstr ""
    560698
    561 #: ulanguages.slang_pl
     699#: languages.slang_pl
     700msgctxt "languages.slang_pl"
    562701msgid "Polish"
    563702msgstr "Polština"
    564703
    565 #: ulanguages.slang_ps
     704#: languages.slang_ps
     705msgctxt "languages.slang_ps"
    566706msgid "Pushto"
    567707msgstr ""
    568708
    569 #: ulanguages.slang_pt
     709#: languages.slang_pt
     710msgctxt "languages.slang_pt"
    570711msgid "Portuguese"
    571712msgstr "Portugalština"
    572713
    573 #: ulanguages.slang_pt_br
     714#: languages.slang_pt_br
     715msgctxt "languages.slang_pt_br"
    574716msgid "Brazilian Portuguese"
    575717msgstr "Brazislká portugalština"
    576718
    577 #: ulanguages.slang_qu
     719#: languages.slang_qu
     720msgctxt "languages.slang_qu"
    578721msgid "Quechua"
    579722msgstr ""
    580723
    581 #: ulanguages.slang_rm
     724#: languages.slang_rm
     725msgctxt "languages.slang_rm"
    582726msgid "Raeto-Romance"
    583727msgstr ""
    584728
    585 #: ulanguages.slang_rn
     729#: languages.slang_rn
     730msgctxt "languages.slang_rn"
    586731msgid "Rundi"
    587732msgstr ""
    588733
    589 #: ulanguages.slang_ro
     734#: languages.slang_ro
     735msgctxt "languages.slang_ro"
    590736msgid "Romanian"
    591737msgstr "Romština"
    592738
    593 #: ulanguages.slang_ru
     739#: languages.slang_ru
     740msgctxt "languages.slang_ru"
    594741msgid "Russian"
    595742msgstr "Ruština"
    596743
    597 #: ulanguages.slang_rw
     744#: languages.slang_rw
     745msgctxt "languages.slang_rw"
    598746msgid "Kinyarwanda"
    599747msgstr ""
    600748
    601 #: ulanguages.slang_sa
     749#: languages.slang_sa
     750msgctxt "languages.slang_sa"
    602751msgid "Sanskrit"
    603752msgstr ""
    604753
    605 #: ulanguages.slang_sc
     754#: languages.slang_sc
     755msgctxt "languages.slang_sc"
    606756msgid "Sardinian"
    607757msgstr ""
    608758
    609 #: ulanguages.slang_sd
     759#: languages.slang_sd
     760msgctxt "languages.slang_sd"
    610761msgid "Sindhi"
    611762msgstr ""
    612763
    613 #: ulanguages.slang_se
     764#: languages.slang_se
     765msgctxt "languages.slang_se"
    614766msgid "Northern Sami"
    615767msgstr ""
    616768
    617 #: ulanguages.slang_sg
     769#: languages.slang_sg
     770msgctxt "languages.slang_sg"
    618771msgid "Sango"
    619772msgstr ""
    620773
    621 #: ulanguages.slang_si
     774#: languages.slang_si
     775msgctxt "languages.slang_si"
    622776msgid "Sinhalese"
    623777msgstr ""
    624778
    625 #: ulanguages.slang_sk
     779#: languages.slang_sk
     780msgctxt "languages.slang_sk"
    626781msgid "Slovak"
    627782msgstr "Slovenština"
    628783
    629 #: ulanguages.slang_sl
     784#: languages.slang_sl
     785msgctxt "languages.slang_sl"
    630786msgid "Slovenian"
    631787msgstr "Slovinština"
    632788
    633 #: ulanguages.slang_sm
     789#: languages.slang_sm
     790msgctxt "languages.slang_sm"
    634791msgid "Samoan"
    635792msgstr ""
    636793
    637 #: ulanguages.slang_sn
     794#: languages.slang_sn
     795msgctxt "languages.slang_sn"
    638796msgid "Shona"
    639797msgstr ""
    640798
    641 #: ulanguages.slang_so
     799#: languages.slang_so
     800msgctxt "languages.slang_so"
    642801msgid "Somali"
    643802msgstr ""
    644803
    645 #: ulanguages.slang_sq
     804#: languages.slang_sq
     805msgctxt "languages.slang_sq"
    646806msgid "Albanian"
    647807msgstr "Albánština"
    648808
    649 #: ulanguages.slang_sr
     809#: languages.slang_sr
     810msgctxt "languages.slang_sr"
    650811msgid "Serbian"
    651812msgstr ""
    652813
    653 #: ulanguages.slang_ss
     814#: languages.slang_ss
     815msgctxt "languages.slang_ss"
    654816msgid "Swati"
    655817msgstr ""
    656818
    657 #: ulanguages.slang_st
     819#: languages.slang_st
     820msgctxt "languages.slang_st"
    658821msgid "Sotho, Southern"
    659822msgstr ""
    660823
    661 #: ulanguages.slang_su
     824#: languages.slang_su
     825msgctxt "languages.slang_su"
    662826msgid "Sundanese"
    663827msgstr "Sundština"
    664828
    665 #: ulanguages.slang_sv
     829#: languages.slang_sv
     830msgctxt "languages.slang_sv"
    666831msgid "Swedish"
    667832msgstr "Švédština"
    668833
    669 #: ulanguages.slang_sw
     834#: languages.slang_sw
     835msgctxt "languages.slang_sw"
    670836msgid "Swahili"
    671837msgstr ""
    672838
    673 #: ulanguages.slang_ta
     839#: languages.slang_ta
     840msgctxt "languages.slang_ta"
    674841msgid "Tamil"
    675842msgstr ""
    676843
    677 #: ulanguages.slang_te
     844#: languages.slang_te
     845msgctxt "languages.slang_te"
    678846msgid "Telugu"
    679847msgstr ""
    680848
    681 #: ulanguages.slang_tg
     849#: languages.slang_tg
     850msgctxt "languages.slang_tg"
    682851msgid "Tajik"
    683852msgstr ""
    684853
    685 #: ulanguages.slang_th
     854#: languages.slang_th
     855msgctxt "languages.slang_th"
    686856msgid "Thai"
    687857msgstr ""
    688858
    689 #: ulanguages.slang_ti
     859#: languages.slang_ti
     860msgctxt "languages.slang_ti"
    690861msgid "Tigrinya"
    691862msgstr ""
    692863
    693 #: ulanguages.slang_tk
     864#: languages.slang_tk
     865msgctxt "languages.slang_tk"
    694866msgid "Turkmen"
    695867msgstr ""
    696868
    697 #: ulanguages.slang_tl
     869#: languages.slang_tl
     870msgctxt "languages.slang_tl"
    698871msgid "Tagalog"
    699872msgstr ""
    700873
    701 #: ulanguages.slang_tn
     874#: languages.slang_tn
     875msgctxt "languages.slang_tn"
    702876msgid "Tswana"
    703877msgstr ""
    704878
    705 #: ulanguages.slang_to
     879#: languages.slang_to
     880msgctxt "languages.slang_to"
    706881msgid "Tonga"
    707882msgstr ""
    708883
    709 #: ulanguages.slang_tr
     884#: languages.slang_tr
     885msgctxt "languages.slang_tr"
    710886msgid "Turkish"
    711887msgstr "Turečtina"
    712888
    713 #: ulanguages.slang_ts
     889#: languages.slang_ts
     890msgctxt "languages.slang_ts"
    714891msgid "Tsonga"
    715892msgstr ""
    716893
    717 #: ulanguages.slang_tt
     894#: languages.slang_tt
     895msgctxt "languages.slang_tt"
    718896msgid "Tatar"
    719897msgstr "Tatarština"
    720898
    721 #: ulanguages.slang_tw
     899#: languages.slang_tw
     900msgctxt "languages.slang_tw"
    722901msgid "Twi"
    723902msgstr ""
    724903
    725 #: ulanguages.slang_ty
     904#: languages.slang_ty
     905msgctxt "languages.slang_ty"
    726906msgid "Tahitian"
    727907msgstr ""
    728908
    729 #: ulanguages.slang_ug
     909#: languages.slang_ug
     910msgctxt "languages.slang_ug"
    730911msgid "Uighur"
    731912msgstr ""
    732913
    733 #: ulanguages.slang_uk
     914#: languages.slang_uk
     915msgctxt "languages.slang_uk"
    734916msgid "Ukrainian"
    735917msgstr "Ukrajinština"
    736918
    737 #: ulanguages.slang_ur
     919#: languages.slang_ur
     920msgctxt "languages.slang_ur"
    738921msgid "Urdu"
    739922msgstr ""
    740923
    741 #: ulanguages.slang_uz
     924#: languages.slang_uz
     925msgctxt "languages.slang_uz"
    742926msgid "Uzbek"
    743927msgstr ""
    744928
    745 #: ulanguages.slang_ve
     929#: languages.slang_ve
     930msgctxt "languages.slang_ve"
    746931msgid "Venda"
    747932msgstr ""
    748933
    749 #: ulanguages.slang_vi
     934#: languages.slang_vi
     935msgctxt "languages.slang_vi"
    750936msgid "Vietnamese"
    751937msgstr "Vietnamština"
    752938
    753 #: ulanguages.slang_vo
     939#: languages.slang_vo
     940msgctxt "languages.slang_vo"
    754941msgid "Volapuk"
    755942msgstr ""
    756943
    757 #: ulanguages.slang_wa
    758 msgctxt "ulanguages.slang_wa"
     944#: languages.slang_wa
     945msgctxt "languages.slang_wa"
    759946msgid "Walloon"
    760947msgstr ""
    761948
    762 #: ulanguages.slang_wo
     949#: languages.slang_wo
     950msgctxt "languages.slang_wo"
    763951msgid "Wolof"
    764952msgstr ""
    765953
    766 #: ulanguages.slang_xh
     954#: languages.slang_xh
     955msgctxt "languages.slang_xh"
    767956msgid "Xhosa"
    768957msgstr ""
    769958
    770 #: ulanguages.slang_yi
     959#: languages.slang_yi
     960msgctxt "languages.slang_yi"
    771961msgid "Yiddish"
    772962msgstr ""
    773963
    774 #: ulanguages.slang_yo
     964#: languages.slang_yo
     965msgctxt "languages.slang_yo"
    775966msgid "Yoruba"
    776967msgstr ""
    777968
    778 #: ulanguages.slang_za
     969#: languages.slang_za
     970msgctxt "languages.slang_za"
    779971msgid "Zhuang"
    780972msgstr ""
    781973
    782 #: ulanguages.slang_zh
     974#: languages.slang_zh
     975msgctxt "languages.slang_zh"
    783976msgid "Chinese"
    784977msgstr "Čínština"
    785978
    786 #: ulanguages.slang_zu
     979#: languages.slang_zh_hans
     980msgid "Simplified Chinese"
     981msgstr ""
     982
     983#: languages.slang_zh_hant
     984msgid "Traditional Chinese"
     985msgstr ""
     986
     987#: languages.slang_zu
     988msgctxt "languages.slang_zu"
    787989msgid "Zulu"
    788990msgstr "Zuluština"
  • trunk/Packages/Common/Languages/Pool.cs.po

    r84 r85  
    11msgid ""
    22msgstr ""
    3 "Content-Type: text/plain; charset=UTF-8\n"
    43"Project-Id-Version: \n"
    54"POT-Creation-Date: \n"
     
    76"Last-Translator: Chronos <robie@centrum.cz>\n"
    87"Language-Team: \n"
     8"Language: cs\n"
    99"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
     12"X-Generator: Poedit 3.0.1\n"
    1113
    12 #: upool.sobjectpoolempty
     14#: pool.sobjectpoolempty
     15msgctxt "pool.sobjectpoolempty"
    1316msgid "Object pool is empty"
    1417msgstr "Zásobník objektů je prázdný"
    1518
    16 #: upool.sreleaseerror
     19#: pool.sreleaseerror
     20msgctxt "pool.sreleaseerror"
    1721msgid "Unknown object for release from pool"
    1822msgstr "Neznýmý objekt pro uvolnění ze zásobníku"
  • trunk/Packages/Common/Languages/ResetableThread.cs.po

    r84 r85  
    11msgid ""
    22msgstr ""
    3 "Content-Type: text/plain; charset=UTF-8\n"
    43"Project-Id-Version: \n"
    54"POT-Creation-Date: \n"
     
    76"Last-Translator: Chronos <robie@centrum.cz>\n"
    87"Language-Team: \n"
     8"Language: cs\n"
    99"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
     12"X-Generator: Poedit 3.0.1\n"
    1113
    12 #: uresetablethread.swaiterror
     14#: resetablethread.swaiterror
     15msgctxt "resetablethread.swaiterror"
    1316msgid "WaitFor error"
    1417msgstr "Chyba WaitFor"
  • trunk/Packages/Common/Languages/ScaleDPI.cs.po

    r84 r85  
    11msgid ""
    22msgstr ""
    3 "Content-Type: text/plain; charset=UTF-8\n"
    43"Project-Id-Version: \n"
    54"POT-Creation-Date: \n"
     
    76"Last-Translator: \n"
    87"Language-Team: \n"
     8"Language: cs\n"
    99"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
    11 "Language: cs\n"
    12 "X-Generator: Poedit 1.8.9\n"
     12"X-Generator: Poedit 3.0.1\n"
    1313
    14 #: uscaledpi.swrongdpi
     14#: scaledpi.swrongdpi
     15#, object-pascal-format
     16msgctxt "scaledpi.swrongdpi"
    1517msgid "Wrong DPI [%d,%d]"
    1618msgstr "Chybné DPI [%d,%d]"
  • trunk/Packages/Common/Languages/Threading.cs.po

    r84 r85  
    11msgid ""
    22msgstr ""
    3 "Content-Type: text/plain; charset=UTF-8\n"
    43"Project-Id-Version: \n"
    54"POT-Creation-Date: \n"
     
    76"Last-Translator: Chronos <robie@centrum.cz>\n"
    87"Language-Team: \n"
     8"Language: cs\n"
    99"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
    1011"Content-Transfer-Encoding: 8bit\n"
     12"X-Generator: Poedit 3.0.1\n"
    1113
    12 #: uthreading.scurrentthreadnotfound
     14#: threading.scurrentthreadnotfound
     15#, object-pascal-format
     16msgctxt "threading.scurrentthreadnotfound"
    1317msgid "Current thread ID %d not found in virtual thread list."
    1418msgstr "Aktuální vlákno ID %d nenalezeno v seznamu virtuálních vláken."
  • trunk/Packages/Common/LastOpenedList.pas

    r84 r85  
    1 unit ULastOpenedList;
    2 
    3 {$mode delphi}
     1unit LastOpenedList;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Registry, URegistry, Menus, XMLConf, DOM;
     6  Classes, SysUtils, Registry, RegistryEx, Menus, XMLConf, DOM;
    97
    108type
     
    8482destructor TLastOpenedList.Destroy;
    8583begin
    86   Items.Free;
     84  FreeAndNil(Items);
    8785  inherited;
    8886end;
     
    9492begin
    9593  if Assigned(MenuItem) then begin
    96     MenuItem.Clear;
     94    while MenuItem.Count > Items.Count do
     95      MenuItem.Delete(MenuItem.Count - 1);
     96    while MenuItem.Count < Items.Count do begin
     97      NewMenuItem := TMenuItem.Create(MenuItem);
     98      MenuItem.Add(NewMenuItem);
     99    end;
    97100    for I := 0 to Items.Count - 1 do begin
    98       NewMenuItem := TMenuItem.Create(MenuItem);
    99       NewMenuItem.Caption := Items[I];
    100       NewMenuItem.OnClick := ClickAction;
    101       MenuItem.Add(NewMenuItem);
     101      MenuItem.Items[I].Caption := Items[I];
     102      MenuItem.Items[I].OnClick := ClickAction;
    102103    end;
    103104  end;
     
    193194
    194195end.
    195 
  • trunk/Packages/Common/ListViewSort.pas

    r84 r85  
    1 unit UListViewSort;
     1unit ListViewSort;
    22
    33// Date: 2019-05-17
    4 
    5 {$mode delphi}
    64
    75interface
     
    97uses
    108  {$IFDEF Windows}Windows, CommCtrl, LMessages, {$ENDIF}Classes, Graphics, ComCtrls, SysUtils,
    11   Controls, DateUtils, Dialogs, fgl, Forms, Grids, StdCtrls, ExtCtrls,
    12   LclIntf, LclType, LResources;
     9  Controls, DateUtils, Dialogs, Forms, Grids, StdCtrls, ExtCtrls,
     10  LclIntf, LclType, LResources, Generics.Collections, Generics.Defaults;
    1311
    1412type
     
    1917  TCompareEvent = function (Item1, Item2: TObject): Integer of object;
    2018  TListFilterEvent = procedure (ListViewSort: TListViewSort) of object;
     19
     20  TObjects = TObjectList<TObject>;
    2121
    2222  { TListViewSort }
     
    5252    {$ENDIF}
    5353  public
    54     List: TFPGObjectList<TObject>;
    55     Source: TFPGObjectList<TObject>;
     54    Source: TObjects;
     55    List: TObjects;
    5656    constructor Create(AOwner: TComponent); override;
    5757    destructor Destroy; override;
     
    8181    FOnChange: TNotifyEvent;
    8282    FStringGrid1: TStringGrid;
     83    procedure DoOnChange;
    8384    procedure GridDoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    8485    procedure GridDoOnResize(Sender: TObject);
     
    9091    function TextEnteredColumn(Index: Integer): Boolean;
    9192    function GetColValue(Index: Integer): string;
     93    procedure Reset;
    9294    property StringGrid: TStringGrid read FStringGrid1 write FStringGrid1;
    9395  published
     
    147149destructor TListViewEx.Destroy;
    148150begin
    149   inherited Destroy;
     151  inherited;
    150152end;
    151153
    152154{ TListViewFilter }
     155
     156procedure TListViewFilter.DoOnChange;
     157begin
     158  if Assigned(FOnChange) then FOnChange(Self);
     159end;
    153160
    154161procedure TListViewFilter.GridDoOnKeyUp(Sender: TObject; var Key: Word;
    155162  Shift: TShiftState);
    156163begin
    157   if Assigned(FOnChange) then
    158     FOnChange(Self);
     164  DoOnChange;
    159165end;
    160166
     
    229235end;
    230236
     237procedure TListViewFilter.Reset;
     238var
     239  I: Integer;
     240begin
     241  with StringGrid do
     242  for I := 0 to ColCount - 1 do
     243    Cells[I, 0] := '';
     244  DoOnChange;
     245end;
     246
    231247{ TListViewSort }
    232248
     
    322338  ListViewSortCompare: TCompareEvent;
    323339
    324 function ListViewCompare(const Item1, Item2: TObject): Integer;
     340function ListViewCompare(constref Item1, Item2: TObject): Integer;
    325341begin
    326342  Result := ListViewSortCompare(Item1, Item2);
     
    333349  ListViewSortCompare := Compare;
    334350  if (List.Count > 0) then
    335     List.Sort(ListViewCompare);
     351    List.Sort(TComparer<TObject>.Construct(ListViewCompare));
    336352end;
    337353
     
    339355begin
    340356  if Assigned(FOnFilter) then FOnFilter(Self)
    341   else if Assigned(Source) then
    342     List.Assign(Source) else
     357  else if Assigned(Source) then begin
    343358    List.Clear;
     359    List.AddRange(Source);
     360  end else List.Clear;
    344361  if ListView.Items.Count <> List.Count then
    345362    ListView.Items.Count := List.Count;
     
    396413begin
    397414  inherited;
    398   List := TFPGObjectList<TObject>.Create;
    399   List.FreeObjects := False;
     415  List := TObjects.Create;
     416  List.OwnsObjects := False;
    400417end;
    401418
    402419destructor TListViewSort.Destroy;
    403420begin
    404   List.Free;
     421  FreeAndNil(List);
    405422  inherited;
    406423end;
  • trunk/Packages/Common/Memory.pas

    r84 r85  
    1 unit UMemory;
    2 
    3 {$mode Delphi}{$H+}
     1unit Memory;
    42
    53interface
     
    4442  end;
    4543
     44
    4645implementation
    4746
     
    5049procedure TPositionMemory.SetSize(AValue: Integer);
    5150begin
    52   inherited SetSize(AValue);
     51  inherited;
    5352  if FPosition > FSize then FPosition := FSize;
    5453end;
     
    107106begin
    108107  Size := 0;
    109   inherited Destroy;
     108  inherited;
    110109end;
    111110
     
    121120
    122121end.
    123 
  • trunk/Packages/Common/MetaCanvas.pas

    r84 r85  
    1 unit UMetaCanvas;
    2 
    3 {$mode delphi}
     1unit MetaCanvas;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Graphics, Contnrs, Types, fgl;
     6  Classes, SysUtils, Graphics, Types, Generics.Collections;
    97
    108type
     
    1917  end;
    2018
    21   TCanvasObjects = class(TFPGObjectList<TCanvasObject>)
     19  TCanvasObjects = class(TObjectList<TCanvasObject>)
    2220  end;
    2321
     
    6563
    6664  TCanvasPolygon = class(TCanvasObject)
     65    Pen: TPen;
     66    Brush: TBrush;
     67    Points: array of TPoint;
     68    procedure Paint(Canvas: TCanvas); override;
     69    procedure Zoom(Factor: Double); override;
     70    procedure Move(Delta: TPoint); override;
     71    constructor Create;
     72    destructor Destroy; override;
     73  end;
     74
     75  { TCanvasPolyline }
     76
     77  TCanvasPolyline = class(TCanvasObject)
     78    Pen: TPen;
     79    Brush: TBrush;
     80    Points: array of TPoint;
     81    procedure Paint(Canvas: TCanvas); override;
     82    procedure Zoom(Factor: Double); override;
     83    procedure Move(Delta: TPoint); override;
     84    constructor Create;
     85    destructor Destroy; override;
     86  end;
     87
     88  { TCanvasPolyBezier }
     89
     90  TCanvasPolyBezier = class(TCanvasObject)
    6791    Pen: TPen;
    6892    Brush: TBrush;
     
    135159    procedure DoMoveTo(X, Y: Integer); override;
    136160    procedure DoLineTo(X, Y: Integer); override;
     161    procedure DoPolyline(const Points: array of TPoint); override;
     162    procedure DoPolyBezier(Points: PPoint; NumPts: Integer;
     163      Filled: Boolean = False; Continuous: Boolean = False); override;
    137164  public
    138165    Objects: TCanvasObjects;
     
    142169    procedure RoundRect(const Rect: TRect; RX,RY: Integer); overload;
    143170    procedure TextOut(X,Y: Integer; const Text: String); override;
    144     procedure Polygon(Points: PPoint; NumPts: Integer; Winding: boolean = False); override;
     171    procedure Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean = False); override;
     172    procedure Polyline(Points: PPoint; NumPts: Integer); override;
     173    procedure PolyBezier(Points: PPoint; NumPts: Integer;
     174      Filled: Boolean = False; Continuous: Boolean = True); override;
    145175    procedure Ellipse(x1, y1, x2, y2: Integer); override;
    146176    procedure StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic); override;
     
    161191
    162192uses
    163   UGeometric, LCLIntf;
     193  Geometric, LCLIntf;
     194
     195{ TCanvasPolyBezier }
     196
     197procedure TCanvasPolyBezier.Paint(Canvas: TCanvas);
     198begin
     199  Canvas.Pen.Assign(Pen);
     200  Canvas.Brush.Assign(Brush);
     201  Canvas.PolyBezier(Points);
     202end;
     203
     204procedure TCanvasPolyBezier.Zoom(Factor: Double);
     205var
     206  I: Integer;
     207begin
     208  for I := 0 to High(Points) do
     209    Points[I] := Point(Trunc(Points[I].X * Factor),
     210      Trunc(Points[I].Y * Factor));
     211  Pen.Width := Trunc(Pen.Width * Factor);
     212end;
     213
     214procedure TCanvasPolyBezier.Move(Delta: TPoint);
     215var
     216  I: Integer;
     217begin
     218  for I := 0 to High(Points) do
     219    Points[I] := AddPoint(Points[I], Delta);
     220end;
     221
     222constructor TCanvasPolyBezier.Create;
     223begin
     224  Pen := TPen.Create;
     225  Brush := TBrush.Create;
     226end;
     227
     228destructor TCanvasPolyBezier.Destroy;
     229begin
     230  FreeAndNil(Brush);
     231  FreeAndNil(Pen);
     232  inherited;
     233end;
     234
     235{ TCanvasPolyline }
     236
     237procedure TCanvasPolyline.Paint(Canvas: TCanvas);
     238begin
     239  Canvas.Pen.Assign(Pen);
     240  Canvas.Brush.Assign(Brush);
     241  Canvas.Polyline(Points);
     242end;
     243
     244procedure TCanvasPolyline.Zoom(Factor: Double);
     245var
     246  I: Integer;
     247begin
     248  for I := 0 to High(Points) do
     249    Points[I] := Point(Trunc(Points[I].X * Factor),
     250      Trunc(Points[I].Y * Factor));
     251  Pen.Width := Trunc(Pen.Width * Factor);
     252end;
     253
     254procedure TCanvasPolyline.Move(Delta: TPoint);
     255var
     256  I: Integer;
     257begin
     258  for I := 0 to High(Points) do
     259    Points[I] := AddPoint(Points[I], Delta);
     260end;
     261
     262constructor TCanvasPolyline.Create;
     263begin
     264  Pen := TPen.Create;
     265  Brush := TBrush.Create;
     266end;
     267
     268destructor TCanvasPolyline.Destroy;
     269begin
     270  FreeAndNil(Brush);
     271  FreeAndNil(Pen);
     272  inherited;
     273end;
    164274
    165275{ TCanvasPie }
     
    306416destructor TCanvasPolygon.Destroy;
    307417begin
    308   Brush.Free;
    309   Pen.Free;
     418  FreeAndNil(Brush);
     419  FreeAndNil(Pen);
    310420  inherited;
    311421end;
     
    502612end;
    503613
    504 procedure TMetaCanvas.Polygon(Points: PPoint; NumPts: Integer; Winding: boolean
     614procedure TMetaCanvas.Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean
    505615  );
    506616var
     
    508618  I: Integer;
    509619begin
     620  APoints := nil;
    510621  SetLength(APoints, NumPts);
    511622  for I := 0 to High(APoints) do
    512623    APoints[I] := Points[I];
    513624  DoPolygon(APoints);
     625end;
     626
     627procedure TMetaCanvas.Polyline(Points: PPoint; NumPts: Integer);
     628var
     629  APoints: array of TPoint;
     630  I: Integer;
     631begin
     632  APoints := nil;
     633  SetLength(APoints, NumPts);
     634  for I := 0 to High(APoints) do
     635    APoints[I] := Points[I];
     636  DoPolyline(APoints);
     637end;
     638
     639procedure TMetaCanvas.PolyBezier(Points: PPoint; NumPts: Integer;
     640  Filled: Boolean; Continuous: Boolean);
     641begin
     642  DoPolyBezier(Points, NumPts, Filled, Continuous);
    514643end;
    515644
     
    581710end;
    582711
     712procedure TMetaCanvas.DoPolyline(const Points: array of TPoint);
     713var
     714  NewObj: TCanvasPolyline;
     715  I: Integer;
     716begin
     717  NewObj := TCanvasPolyline.Create;
     718  NewObj.Brush.Assign(Brush);
     719  NewObj.Pen.Assign(Pen);
     720  SetLength(NewObj.Points, Length(Points));
     721  for I := 0 to High(Points) do
     722    NewObj.Points[I] := Points[I];
     723  Objects.Add(NewObj);
     724end;
     725
     726procedure TMetaCanvas.DoPolyBezier(Points: PPoint; NumPts: Integer;
     727  Filled: Boolean; Continuous: Boolean);
     728var
     729  NewObj: TCanvasPolyBezier;
     730  I: Integer;
     731begin
     732  NewObj := TCanvasPolyBezier.Create;
     733  NewObj.Brush.Assign(Brush);
     734  NewObj.Pen.Assign(Pen);
     735  SetLength(NewObj.Points, NumPts);
     736  for I := 0 to High(NewObj.Points) do
     737    NewObj.Points[I] := Points[I];
     738  Objects.Add(NewObj);
     739end;
     740
    583741procedure TMetaCanvas.FillRect(const ARect: TRect);
    584742begin
     
    665823
    666824end.
    667 
  • trunk/Packages/Common/PersistentForm.pas

    r84 r85  
    1 unit UPersistentForm;
    2 
    3 {$mode delphi}
    4 
    5 // Date: 2020-11-26
     1unit PersistentForm;
    62
    73interface
    84
    95uses
    10   Classes, SysUtils, Forms, URegistry, LCLIntf, Registry, Controls, ComCtrls,
     6  Classes, SysUtils, Forms, RegistryEx, LCLIntf, Registry, Controls, ComCtrls,
    117  ExtCtrls, LCLType;
    128
     
    2319    procedure SaveControl(Control: TControl);
    2420  public
    25     FormNormalSize: TRect;
    2621    FormRestoredSize: TRect;
    2722    FormWindowState: TWindowState;
     
    157152    RootKey := RegistryContext.RootKey;
    158153    OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True);
    159     // Normal size
    160     FormNormalSize.Left := ReadIntegerWithDefault('NormalLeft', FormNormalSize.Left);
    161     FormNormalSize.Top := ReadIntegerWithDefault('NormalTop', FormNormalSize.Top);
    162     FormNormalSize.Right := ReadIntegerWithDefault('NormalWidth', FormNormalSize.Right - FormNormalSize.Left)
    163       + FormNormalSize.Left;
    164     FormNormalSize.Bottom := ReadIntegerWithDefault('NormalHeight', FormNormalSize.Bottom - FormNormalSize.Top)
    165       + FormNormalSize.Top;
     154
    166155    // Restored size
    167156    FormRestoredSize.Left := ReadIntegerWithDefault('RestoredLeft', FormRestoredSize.Left);
     
    171160    FormRestoredSize.Bottom := ReadIntegerWithDefault('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top)
    172161      + FormRestoredSize.Top;
     162
    173163    // Other state
    174164    FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(FormWindowState)));
     
    185175    RootKey := RegistryContext.RootKey;
    186176    OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True);
    187     // Normal state
    188     WriteInteger('NormalWidth', FormNormalSize.Right - FormNormalSize.Left);
    189     WriteInteger('NormalHeight', FormNormalSize.Bottom - FormNormalSize.Top);
    190     WriteInteger('NormalTop', FormNormalSize.Top);
    191     WriteInteger('NormalLeft', FormNormalSize.Left);
    192     // Restored state
     177
     178    // Restored size
    193179    WriteInteger('RestoredWidth', FormRestoredSize.Right - FormRestoredSize.Left);
    194180    WriteInteger('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top);
    195181    WriteInteger('RestoredTop', FormRestoredSize.Top);
    196182    WriteInteger('RestoredLeft', FormRestoredSize.Left);
     183
    197184    // Other state
    198185    WriteInteger('WindowState', Integer(FormWindowState));
     
    259246begin
    260247  Self.Form := Form;
     248
    261249  // Set default
    262   FormNormalSize := Bounds((Screen.Width - Form.Width) div 2,
    263     (Screen.Height - Form.Height) div 2, Form.Width, Form.Height);
    264250  FormRestoredSize := Bounds((Screen.Width - Form.Width) div 2,
    265251    (Screen.Height - Form.Height) div 2, Form.Width, Form.Height);
     
    269255  LoadFromRegistry(RegistryContext);
    270256
    271   if not EqualRect(FormNormalSize, FormRestoredSize) or
    272     DefaultMaximized then begin
     257  if (FormWindowState = wsMaximized) or DefaultMaximized then begin
    273258    // Restore to maximized state
    274259    Form.WindowState := wsNormal;
     
    279264    // Restore to normal state
    280265    Form.WindowState := wsNormal;
    281     if FEntireVisible then FormNormalSize := CheckEntireVisible(FormNormalSize)
     266    if FEntireVisible then FormRestoredSize := CheckEntireVisible(FormRestoredSize)
    282267      else if FMinVisiblePart > 0 then
    283     FormNormalSize := CheckPartVisible(FormNormalSize, FMinVisiblePart);
    284     if not EqualRect(FormNormalSize, Form.BoundsRect) then
    285       Form.BoundsRect := FormNormalSize;
     268        FormRestoredSize := CheckPartVisible(FormRestoredSize, FMinVisiblePart);
     269    if not EqualRect(FormRestoredSize, Form.BoundsRect) then
     270      Form.BoundsRect := FormRestoredSize;
    286271  end;
    287272  if FormFullScreen then SetFullScreen(True);
     
    292277begin
    293278  Self.Form := Form;
    294   FormNormalSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height);
    295   if not FormFullScreen then
    296     FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
    297       Form.RestoredHeight);
    298   FormWindowState := Form.WindowState;
     279  if not FormFullScreen then begin
     280    FormWindowState := Form.WindowState;
     281    if FormWindowState = wsMaximized then begin
     282      FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
     283        Form.RestoredHeight);
     284    end else
     285    if FormWindowState = wsNormal then begin
     286      FormRestoredSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height);
     287    end;
     288  end;
    299289  SaveToRegistry(RegistryContext);
    300290  SaveControl(Form);
     
    314304  if State then begin
    315305    FormFullScreen := True;
    316     FormNormalSize := Form.BoundsRect;
    317     FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
    318       Form.RestoredHeight);
     306    if Form.WindowState = wsMaximized then begin
     307      FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
     308        Form.RestoredHeight);
     309    end else
     310    if Form.WindowState = wsNormal then begin
     311      FormRestoredSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height);
     312    end;
    319313    FormWindowState := Form.WindowState;
     314    Form.WindowState := wsMaximized;
     315    Form.WindowState := wsNormal;
    320316    ShowWindow(Form.Handle, SW_SHOWFULLSCREEN);
    321317    {$IFDEF WINDOWS}
     
    329325    ShowWindow(Form.Handle, SW_SHOWNORMAL);
    330326    if FormWindowState = wsNormal then begin
    331       Form.BoundsRect := FormNormalSize;
     327      Form.WindowState := wsNormal;
     328      Form.BoundsRect := FormRestoredSize;
    332329    end else
    333330    if FormWindowState = wsMaximized then begin
     
    339336
    340337end.
    341 
  • trunk/Packages/Common/Pool.pas

    r84 r85  
    1 unit UPool;
    2 
    3 {$mode Delphi}{$H+}
     1unit Pool;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, syncobjs, fgl, UThreading;
     6  Classes, SysUtils, syncobjs, Generics.Collections, Threading;
    97
    108type
     
    2220    function NewItemObject: TObject; virtual;
    2321  public
    24     Items: TFPGObjectList<TObject>;
    25     FreeItems: TFPGObjectList<TObject>;
     22    Items: TObjectList<TObject>;
     23    FreeItems: TObjectList<TObject>;
    2624    function Acquire: TObject; virtual;
    2725    procedure Release(Item: TObject); virtual;
     
    108106constructor TThreadedPool.Create;
    109107begin
    110   inherited Create;
     108  inherited;
    111109  Lock := TCriticalSection.Create;
    112110end;
     
    116114  TotalCount := 0;
    117115  Lock.Free;
    118   inherited Destroy;
     116  inherited;
    119117end;
    120118
     
    185183begin
    186184  inherited;
    187   Items := TFPGObjectList<TObject>.Create;
    188   FreeItems := TFPGObjectList<TObject>.Create;
    189   FreeItems.FreeObjects := False;
     185  Items := TObjectList<TObject>.Create;
     186  FreeItems := TObjectList<TObject>.Create;
     187  FreeItems.OwnsObjects := False;
    190188  FReleaseEvent := TEvent.Create(nil, False, False, '');
    191189end;
     
    201199
    202200end.
    203 
  • trunk/Packages/Common/PrefixMultiplier.pas

    r84 r85  
    1 unit UPrefixMultiplier;
     1unit PrefixMultiplier;
    22
    33// Date: 2010-06-01
    4 
    5 {$mode delphi}
    64
    75interface
     
    3331  (
    3432    (ShortText: 'y'; FullText: 'yocto'; Value: 1e-24),
    35           (ShortText: 'z'; FullText: 'zepto'; Value: 1e-21),
     33    (ShortText: 'z'; FullText: 'zepto'; Value: 1e-21),
    3634    (ShortText: 'a'; FullText: 'atto'; Value: 1e-18),
    3735    (ShortText: 'f'; FullText: 'femto'; Value: 1e-15),
     
    5452  (
    5553    (ShortText: 'ys'; FullText: 'yocto'; Value: 1e-24),
    56           (ShortText: 'zs'; FullText: 'zepto'; Value: 1e-21),
     54    (ShortText: 'zs'; FullText: 'zepto'; Value: 1e-21),
    5755    (ShortText: 'as'; FullText: 'atto'; Value: 1e-18),
    5856    (ShortText: 'fs'; FullText: 'femto'; Value: 1e-15),
     
    126124
    127125end.
    128 
  • trunk/Packages/Common/RegistryEx.pas

    r84 r85  
    1 unit URegistry;
    2 
    3 {$MODE delphi}
     1unit RegistryEx;
    42
    53interface
     
    4846    HKEY_CURRENT_CONFIG, HKEY_DYN_DATA);
    4947
     48
    5049implementation
    51 
    5250
    5351{ TRegistryContext }
     
    132130function TRegistryEx.OpenKey(const Key: string; CanCreate: Boolean): Boolean;
    133131begin
    134   {$IFDEF Linux}
     132  {$IFDEF UNIX}
    135133  //CloseKey;
    136134  {$ENDIF}
     
    140138function TRegistryEx.GetCurrentContext: TRegistryContext;
    141139begin
    142   Result.Key := CurrentPath;
     140  Result.Key := String(CurrentPath);
    143141  Result.RootKey := RootKey;
    144142end;
  • trunk/Packages/Common/ResetableThread.pas

    r84 r85  
    1 unit UResetableThread;
    2 
    3 {$mode Delphi}{$H+}
     1unit ResetableThread;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, syncobjs, UThreading, UPool;
     6  Classes, SysUtils, syncobjs, Threading, Pool;
    97
    108type
     
    167165  FreeAndNil(FStopEvent);
    168166  FreeAndNil(FLock);
    169   inherited Destroy;
     167  inherited;
    170168end;
    171169
     
    286284constructor TThreadPool.Create;
    287285begin
    288   inherited Create;
     286  inherited;
    289287end;
    290288
     
    293291  TotalCount := 0;
    294292  WaitForEmpty;
    295   inherited Destroy;
     293  inherited;
    296294end;
    297295
    298296end.
    299 
  • trunk/Packages/Common/ScaleDPI.pas

    r84 r85  
    1 unit UScaleDPI;
     1unit ScaleDPI;
    22
    33{ See: http://wiki.lazarus.freepascal.org/High_DPI }
    44
    5 {$mode delphi}{$H+}
    6 
    75interface
    86
    97uses
    10   Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, StdCtrls,
    11   Contnrs;
     8  Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils,
     9  Generics.Collections;
    1210
    1311type
     12  TControlDimensions = class;
    1413
    1514  { TControlDimension }
     
    1817    BoundsRect: TRect;
    1918    FontHeight: Integer;
    20     Controls: TObjectList; // TList<TControlDimension>
     19    Controls: TControlDimensions;
    2120    // Class specifics
    2221    ButtonSize: TPoint; // TToolBar
     
    2625    constructor Create;
    2726    destructor Destroy; override;
     27  end;
     28
     29  TControlDimensions = class(TObjectList<TControlDimension>)
    2830  end;
    2931
     
    7375constructor TControlDimension.Create;
    7476begin
    75   Controls := TObjectList.Create;
     77  Controls := TControlDimensions.Create;
    7678end;
    7779
     
    7981begin
    8082  FreeAndNil(Controls);
    81   inherited Destroy;
     83  inherited;
    8284end;
    8385
     
    212214  TempBmp: TBitmap;
    213215  Temp: array of TBitmap;
    214   NewWidth, NewHeight: integer;
     216  NewWidth: Integer;
     217  NewHeight: Integer;
    215218  I: Integer;
    216219begin
    217220  ImgList.BeginUpdate;
    218   NewWidth := ScaleX(ImgList.Width, FromDPI.X);
    219   NewHeight := ScaleY(ImgList.Height, FromDPI.Y);
    220 
    221   SetLength(Temp, ImgList.Count);
    222   for I := 0 to ImgList.Count - 1 do
    223   begin
    224     TempBmp := TBitmap.Create;
    225     TempBmp.PixelFormat := pf32bit;
    226     ImgList.GetBitmap(I, TempBmp);
    227     Temp[I] := TBitmap.Create;
    228     Temp[I].SetSize(NewWidth, NewHeight);
    229     Temp[I].PixelFormat := pf32bit;
    230     Temp[I].TransparentColor := TempBmp.TransparentColor;
    231     //Temp[I].TransparentMode := TempBmp.TransparentMode;
    232     Temp[I].Transparent := True;
    233     Temp[I].Canvas.Brush.Style := bsSolid;
    234     Temp[I].Canvas.Brush.Color := Temp[I].TransparentColor;
    235     Temp[I].Canvas.FillRect(0, 0, Temp[I].Width, Temp[I].Height);
    236 
    237     if (Temp[I].Width = 0) or (Temp[I].Height = 0) then Continue;
    238     Temp[I].Canvas.StretchDraw(Rect(0, 0, Temp[I].Width, Temp[I].Height), TempBmp);
    239     TempBmp.Free;
    240   end;
    241 
    242   ImgList.Clear;
    243   ImgList.Width := NewWidth;
    244   ImgList.Height := NewHeight;
    245 
    246   for I := 0 to High(Temp) do
    247   begin
    248     ImgList.Add(Temp[I], nil);
    249     Temp[i].Free;
    250   end;
    251   ImgList.EndUpdate;
     221  try
     222    NewWidth := ScaleX(ImgList.Width, FromDPI.X);
     223    NewHeight := ScaleY(ImgList.Height, FromDPI.Y);
     224
     225    Temp := nil;
     226    SetLength(Temp, ImgList.Count);
     227    for I := 0 to ImgList.Count - 1 do
     228    begin
     229      TempBmp := TBitmap.Create;
     230      try
     231        TempBmp.PixelFormat := pf32bit;
     232        ImgList.GetBitmap(I, TempBmp);
     233        Temp[I] := TBitmap.Create;
     234        Temp[I].SetSize(NewWidth, NewHeight);
     235        {$IFDEF UNIX}
     236        Temp[I].PixelFormat := pf24bit;
     237        {$ELSE}
     238        Temp[I].PixelFormat := pf32bit;
     239        {$ENDIF}
     240        Temp[I].TransparentColor := TempBmp.TransparentColor;
     241        //Temp[I].TransparentMode := TempBmp.TransparentMode;
     242        Temp[I].Transparent := True;
     243        Temp[I].Canvas.Brush.Style := bsSolid;
     244        Temp[I].Canvas.Brush.Color := Temp[I].TransparentColor;
     245        Temp[I].Canvas.FillRect(0, 0, Temp[I].Width, Temp[I].Height);
     246
     247        if (Temp[I].Width = 0) or (Temp[I].Height = 0) then Continue;
     248        Temp[I].Canvas.StretchDraw(Rect(0, 0, Temp[I].Width, Temp[I].Height), TempBmp);
     249      finally
     250        TempBmp.Free;
     251      end;
     252    end;
     253
     254    ImgList.Clear;
     255    ImgList.Width := NewWidth;
     256    ImgList.Height := NewHeight;
     257
     258    for I := 0 to High(Temp) do
     259    begin
     260      ImgList.Add(Temp[I], nil);
     261      Temp[i].Free;
     262    end;
     263  finally
     264    ImgList.EndUpdate;
     265  end;
    252266end;
    253267
     
    327341  with TCoolBar(Control) do begin
    328342    BeginUpdate;
    329     for I := 0 to Bands.Count - 1 do
    330       with Bands[I] do begin
    331         MinWidth := ScaleX(MinWidth, FromDPI.X);
    332         MinHeight := ScaleY(MinHeight, FromDPI.Y);
    333         // Workaround to bad band width auto sizing
    334         //Width := ScaleX(Width, FromDPI.X);
    335         Width := ScaleX(Control.Width + 28, FromDPI.X);
    336         //Control.Invalidate;
     343    try
     344      for I := 0 to Bands.Count - 1 do
     345        with Bands[I] do begin
     346          MinWidth := ScaleX(MinWidth, FromDPI.X);
     347          MinHeight := ScaleY(MinHeight, FromDPI.Y);
     348          // Workaround to bad band width auto sizing
     349          //Width := ScaleX(Width, FromDPI.X);
     350          Width := ScaleX(Control.Width + 28, FromDPI.X);
     351          //Control.Invalidate;
     352        end;
     353      // Workaround for bad autosizing of coolbar
     354      if AutoSize then begin
     355        AutoSize := False;
     356        Height := ScaleY(Height, FromDPI.Y);
     357        AutoSize := True;
    337358      end;
    338     // Workaround for bad autosizing of coolbar
    339     if AutoSize then begin
    340       AutoSize := False;
    341       Height := ScaleY(Height, FromDPI.Y);
    342       AutoSize := True;
    343     end;
    344     EndUpdate;
     359    finally
     360      EndUpdate;
     361    end;
    345362  end;
    346363
  • trunk/Packages/Common/StopWatch.pas

    r7 r85  
    55
    66uses
    7   {$IFDEF Windows}Windows,{$ENDIF}
     7  {$IFDEF WINDOWS}Windows,{$ENDIF}
    88  SysUtils, DateUtils;
    99
     
    3232  end;
    3333
     34
    3435implementation
    3536
     
    4041  fIsRunning := False;
    4142
    42   {$IFDEF Windows}
     43  {$IFDEF WINDOWS}
    4344  fIsHighResolution := QueryPerformanceFrequency(fFrequency) ;
    4445  {$ELSE}
  • trunk/Packages/Common/StringTable.pas

    r84 r85  
    1 unit UStringTable;
    2 
    3 {$mode objfpc}{$H+}
     1unit StringTable;
    42
    53interface
     
    7169end;
    7270
    73 
    7471end.
    75 
  • trunk/Packages/Common/SyncCounter.pas

    r84 r85  
    1 unit USyncCounter;
    2 
    3 {$mode delphi}
     1unit SyncCounter;
    42
    53interface
     
    2523    procedure Assign(Source: TSyncCounter);
    2624  end;
     25
    2726
    2827implementation
     
    6968begin
    7069  Lock.Free;
    71   inherited Destroy;
     70  inherited;
    7271end;
    7372
     
    7978
    8079end.
    81 
  • trunk/Packages/Common/Theme.pas

    r84 r85  
    1 unit UTheme;
     1unit Theme;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, Graphics, ComCtrls, Controls, ExtCtrls, Menus, StdCtrls,
    7   Spin, Forms, Contnrs, Grids;
     7  Spin, Forms, Generics.Collections, Grids;
    88
    99type
     
    1919  { TThemes }
    2020
    21   TThemes = class(TObjectList)
     21  TThemes = class(TObjectList<TTheme>)
    2222    function AddNew(Name: string): TTheme;
    2323    function FindByName(Name: string): TTheme;
     
    4242  end;
    4343
     44const
     45  ThemeNameSystem = 'System';
     46  ThemeNameLight = 'Light';
     47  ThemeNameDark = 'Dark';
     48
    4449procedure Register;
     50
    4551
    4652implementation
     
    7480procedure TThemes.LoadToStrings(Strings: TStrings);
    7581var
    76   Theme: TTheme;
     82  I: Integer;
    7783begin
    78   Strings.Clear;
    79   for Theme in Self do
    80     Strings.AddObject(Theme.Name, Theme);
     84  Strings.BeginUpdate;
     85  try
     86    while Strings.Count < Count do Strings.Add('');
     87    while Strings.Count > Count do Strings.Delete(Strings.Count - 1);
     88    for I := 0 to Count - 1 do begin
     89      Strings[I] := Items[I].Name;
     90      Strings.Objects[I] := Items[I];
     91    end;
     92  finally
     93    Strings.EndUpdate;
     94  end;
    8195end;
    8296
     
    97111  inherited;
    98112  Themes := TThemes.Create;
    99   with Themes.AddNew('System') do begin
     113  with Themes.AddNew(ThemeNameSystem) do begin
    100114    ColorWindow := clWindow;
    101115    ColorWindowText := clWindowText;
     
    105119  end;
    106120  Theme := TTheme(Themes.First);
    107   with Themes.AddNew('Dark') do begin
     121  with Themes.AddNew(ThemeNameDark) do begin
    108122    ColorWindow := RGBToColor($20, $20, $20);
    109123    ColorWindowText := clWhite;
     
    112126    ColorControlSelected := RGBToColor(96, 125, 155);
    113127  end;
    114   with Themes.AddNew('Light') do begin
     128  with Themes.AddNew(ThemeNameLight) do begin
    115129    ColorWindow := clWhite;
    116130    ColorWindowText := clBlack;
     
    123137destructor TThemeManager.Destroy;
    124138begin
    125   Themes.Free;
    126   inherited Destroy;
     139  FreeAndNil(Themes);
     140  inherited;
    127141end;
    128142
     
    167181procedure TThemeManager.UseTheme(Form: TForm);
    168182begin
    169   if not Used and (FTheme.Name = 'System') then Exit;
     183  if not Used and (FTheme.Name = ThemeNameSystem) then Exit;
    170184  ApplyTheme(Form);
    171185  Used := True;
    172186end;
    173187
    174 
    175188end.
  • trunk/Packages/Common/Threading.pas

    r84 r85  
    1 unit UThreading;
    2 
    3 {$mode delphi}
     1unit Threading;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Forms, Contnrs, SyncObjs;
     6  Classes, SysUtils, Forms, Generics.Collections, SyncObjs;
    97
    108type
    119  TExceptionEvent = procedure (Sender: TObject; E: Exception) of object;
    1210  TMethodCall = procedure of object;
    13 
    1411
    1512  { TVirtualThread }
     
    2219    function GetSuspended: Boolean; virtual; abstract;
    2320    function GetTerminated: Boolean; virtual; abstract;
    24     function GetThreadId: Integer; virtual; abstract;
     21    function GetThreadId: TThreadID; virtual; abstract;
    2522    procedure SetFreeOnTerminate(const AValue: Boolean); virtual; abstract;
    2623    procedure SetPriority(const AValue: TThreadPriority); virtual; abstract;
     
    4239    property Terminated: Boolean read GetTerminated write SetTerminated;
    4340    property Finished: Boolean read GetFinished;
    44     property ThreadId: Integer read GetThreadId;
     41    property ThreadId: TThreadID read GetThreadId;
    4542  end;
    4643
     
    6865    function GetSuspended: Boolean; override;
    6966    function GetTerminated: Boolean; override;
    70     function GetThreadId: Integer; override;
     67    function GetThreadId: TThreadID; override;
    7168    procedure SetFreeOnTerminate(const AValue: Boolean); override;
    7269    procedure SetPriority(const AValue: TThreadPriority); override;
     
    10299  { TThreadList }
    103100
    104   TThreadList = class(TObjectList)
    105     function FindById(Id: Integer): TVirtualThread;
     101  TThreadList = class(TObjectList<TVirtualThread>)
     102    function FindById(Id: TThreadID): TVirtualThread;
    106103    constructor Create; virtual;
    107104  end;
     
    164161  if MainThreadID = ThreadID then Method
    165162  else begin
    166     Thread := ThreadList.FindById(ThreadID);
     163    try
     164      ThreadListLock.Acquire;
     165      Thread := ThreadList.FindById(ThreadID);
     166    finally
     167      ThreadListLock.Release;
     168    end;
    167169    if Assigned(Thread) then begin
    168170      Thread.Synchronize(Method);
     
    173175{ TThreadList }
    174176
    175 function TThreadList.FindById(Id: Integer): TVirtualThread;
     177function TThreadList.FindById(Id: TThreadID): TVirtualThread;
    176178var
    177179  I: Integer;
    178180begin
    179181  I := 0;
    180   while (I < ThreadList.Count) and (TVirtualThread(ThreadList[I]).ThreadID <> Id) do
     182  while (I < ThreadList.Count) and (ThreadList[I].ThreadID <> Id) do
    181183    Inc(I);
    182   if I < ThreadList.Count then Result := TVirtualThread(ThreadList[I])
     184  if I < ThreadList.Count then Result := ThreadList[I]
    183185    else Result := nil;
    184186end;
     
    233235end;
    234236
    235 function TListedThread.GetThreadId: Integer;
     237function TListedThread.GetThreadId: TThreadID;
    236238begin
    237239  Result := FThread.ThreadID;
     
    290292  end;
    291293  FThread.Free;
    292   inherited Destroy;
     294  inherited;
    293295end;
    294296
     
    364366
    365367end.
    366 
  • trunk/Packages/Common/Translator.pas

    r84 r85  
    1 unit UTranslator;
    2 
    3 {$mode Delphi}{$H+}
     1unit Translator;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Forms, ExtCtrls, Controls, Contnrs, LazFileUtils, LazUTF8,
    9   Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType,
    10   LCLVersion;
     6  Classes, SysUtils, Forms, ExtCtrls, Controls, LazFileUtils, LazUTF8,
     7  Translations, TypInfo, Dialogs, FileUtil, LCLProc, Languages, LCLType,
     8  LCLVersion, Generics.Collections;
    119
    1210type
    1311  THandleStringEvent = function (AValue: string): string of object;
     12
     13  TPoFiles = class(TObjectList<TPOFile>)
     14  end;
    1415
    1516  { TComponentExcludes }
     
    2425  { TComponentExcludesList }
    2526
    26   TComponentExcludesList = class(TObjectList)
     27  TComponentExcludesList = class(TObjectList<TComponentExcludes>)
    2728    function FindByClassType(AClassType: TClass): TComponentExcludes;
    2829    procedure DumpToStrings(Strings: TStrings);
     
    3637    FOnAutomaticLanguage: THandleStringEvent;
    3738    FOnTranslate: TNotifyEvent;
    38     FPOFilesFolder: string;
    39     FPOFiles: TObjectList; // TObjectList<TPOFile>;
     39    FPoFilesFolder: string;
     40    FPoFiles: TPoFiles;
    4041    function GetLocale: string;
    4142    function GetLocaleShort: string;
     
    4748    procedure TranslateProperty(Component: TPersistent; PropInfo: PPropInfo);
    4849    function IsExcluded(Component: TPersistent; PropertyName: string): Boolean;
    49     function GetLangFileDir: string;
     50    function GetLangFileDirs: TStrings;
    5051  public
    5152    ComponentExcludes: TComponentExcludesList;
    52     Languages: TLanguageList;
     53    Languages: TLanguages;
    5354    procedure Translate;
    54     procedure LanguageListToStrings(Strings: TStrings);
     55    procedure LanguageListToStrings(Strings: TStrings; WithCode: Boolean = True);
    5556    procedure TranslateResourceStrings(PoFileName: string);
    5657    procedure TranslateUnitResourceStrings(UnitName: string; PoFileName: string);
     
    6364    destructor Destroy; override;
    6465  published
    65     property POFilesFolder: string read FPOFilesFolder write SetPOFilesFolder;
     66    property POFilesFolder: string read FPoFilesFolder write SetPOFilesFolder;
    6667    property Language: TLanguage read FLanguage write SetLanguage;
    6768    property OnTranslate: TNotifyEvent read FOnTranslate write FOnTranslate;
     
    7071  end;
    7172
     73const
     74  PoExt = '.po';
     75
    7276procedure Register;
    7377
     78
    7479implementation
     80
     81uses
     82  Common;
    7583
    7684procedure Register;
     
    117125destructor TComponentExcludes.Destroy;
    118126begin
    119   PropertyExcludes.Free;
    120   inherited Destroy;
     127  FreeAndNil(PropertyExcludes);
     128  inherited;
    121129end;
    122130
     
    128136  I, J: Integer;
    129137  Po: TPoFile;
    130   Item: TPOFileItem;
     138  Item: TPoFileItem;
    131139begin
    132140  TranslateComponentRecursive(Application);
     
    134142  // Merge files to single translation file
    135143  try
    136     Po := TPOFile.Create;
    137     for I := 0 to FPOFiles.Count - 1 do
     144    Po := TPoFile.Create;
     145    for I := 0 to FPoFiles.Count - 1 do
    138146    with TPoFile(FPoFiles[I]) do
    139147      for J := 0 to Items.Count - 1 do
     
    159167  FileList: TStringList;
    160168  I: Integer;
     169  J: Integer;
    161170  LocaleShort: string;
    162171  SearchMask: string;
    163 begin
    164   FPOFiles.Clear;
    165   if Assigned(FLanguage) then
    166   try
     172  LangDirs: TStrings;
     173begin
     174  FPoFiles.Clear;
     175  if Assigned(FLanguage) then begin
    167176    LocaleShort := GetLocaleShort;
    168     //ShowMessage(ExtractFileDir(Application.ExeName) +
    169     //  DirectorySeparator + 'Languages' + ' ' + '*.' + LocaleShort + '.po');
    170177    SearchMask := '*';
    171178    if LocaleShort <> '' then SearchMask := SearchMask + '.' + LocaleShort;
    172     SearchMask := SearchMask + '.po';
    173     FileList := FindAllFiles(GetLangFileDir, SearchMask);
    174     for I := 0 to FileList.Count - 1 do begin
    175       FileName := FileList[I];
    176       //FileName := FindLocaleFileName('.po');
    177       if FileExists(FileName) and (
    178       ((LocaleShort = '') and (Pos('.', FileName) = Pos('.po', FileName))) or
    179       (LocaleShort <> '')) then FPOFiles.Add(TPOFile.Create(FileName));
    180     end;
    181   finally
    182     FileList.Free;
     179    SearchMask := SearchMask + PoExt;
     180    LangDirs := GetLangFileDirs;
     181    for J := 0 to LangDirs.Count - 1 do begin
     182      FileList := FindAllFiles(LangDirs[J], SearchMask);
     183      try
     184        for I := 0 to FileList.Count - 1 do begin
     185          FileName := FileList[I];
     186          //FileName := FindLocaleFileName('.po');
     187           if FileExists(FileName) and (
     188          ((LocaleShort = '') and (Pos('.', FileName) = Pos(PoExt, FileName))) or
     189          (LocaleShort <> '')) then FPoFiles.Add(TPOFile.Create(FileName));
     190        end;
     191      finally
     192        FileList.Free;
     193      end;
     194    end;
     195    LangDirs.Free;
    183196  end;
    184197end;
     
    281294var
    282295  Item: TClass;
    283 
    284296  Excludes: TComponentExcludes;
    285297begin
     
    287299  Item := Component.ClassType;
    288300  while Assigned(Item) do begin
    289     //ShowMessage(Component.Name + ', ' + Component.ClassName + ', ' + Item.ClassName + ', ' + PropertyName);
    290301    Excludes := ComponentExcludes.FindByClassType(Item.ClassType);
    291302    if Assigned(Excludes) then begin
     
    299310end;
    300311
    301 function TTranslator.GetLangFileDir: string;
    302 begin
    303   Result := FPOFilesFolder;
    304   if Copy(Result, 1, 1) <> DirectorySeparator then
    305     Result := ExtractFileDir(Application.ExeName) +
    306       DirectorySeparator + Result;
    307 end;
    308 
    309 procedure TTranslator.LanguageListToStrings(Strings: TStrings);
     312function TTranslator.GetLangFileDirs: TStrings;
     313var
     314  I: Integer;
     315begin
     316  Result := TStringList.Create;
     317  Result.Delimiter := ';';
     318  Result.StrictDelimiter := True;
     319  Result.DelimitedText := FPoFilesFolder;
     320
     321  for I := 0 to Result.Count - 1 do begin
     322    Result[I] := StringReplace(Result[I], '/', DirectorySeparator, [rfReplaceAll]);
     323    Result[I] := StringReplace(Result[I], '\', DirectorySeparator, [rfReplaceAll]);
     324    if Copy(Result[I], 1, 1) <> DirectorySeparator then
     325      Result[I] := ExtractFileDir(Application.ExeName) +
     326        DirectorySeparator + Result[I];
     327  end;
     328end;
     329
     330procedure TTranslator.LanguageListToStrings(Strings: TStrings; WithCode: Boolean = True);
    310331var
    311332  I: Integer;
     
    313334begin
    314335  with Strings do begin
    315     Clear;
    316     for I := 0 to Languages.Count - 1 do
    317     with TLanguage(Languages[I]) do
    318       if Available then begin
    319         ItemName := Name;
    320         if Code <> '' then ItemName := ItemName + ' (' + Code + ')';
    321         AddObject(ItemName, Languages[I]);
    322       end;
     336    BeginUpdate;
     337    try
     338      Clear;
     339      for I := 0 to Languages.Count - 1 do
     340      with Languages[I] do
     341        if Available then begin
     342          ItemName := Name;
     343          if WithCode and (Code <> '') then ItemName := ItemName + ' (' + Code + ')';
     344          AddObject(ItemName, Languages[I]);
     345        end;
     346    finally
     347      EndUpdate;
     348    end;
    323349  end;
    324350end;
     
    342368  if Text <> '' then begin
    343369    for I := 0 to FPoFiles.Count - 1 do begin
    344       Result := TPoFile(FPOFiles[I]).Translate(Identifier, Text);
     370      Result := TPoFile(FPoFiles[I]).Translate(Identifier, Text);
    345371      if Result <> Text then Break;
    346372    end;
     
    366392var
    367393  I: Integer;
    368   LangDir: string;
    369 begin
    370   LangDir := GetLangFileDir;
    371   TLanguage(Languages[0]).Available := True; // Automatic
     394  J: Integer;
     395  LangDirs: TStrings;
     396begin
     397  LangDirs := GetLangFileDirs;
     398  Languages.SearchByCode('').Available := True; // Automatic
    372399
    373400  for I := 1 to Languages.Count - 1 do
    374   with TLanguage(Languages[I]) do begin
    375     Available := FileExists(LangDir + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) +
    376       '.' + Code + ExtensionSeparator + 'po') or (Code = 'en');
    377   end;
     401  with Languages[I] do begin
     402    for J := 0 to LangDirs.Count - 1 do begin
     403      if FileExists(LangDirs[J] + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) +
     404        '.' + Code + PoExt) or (Code = 'en') then begin
     405          Available := True;
     406          Continue;
     407        end;
     408    end;
     409  end;
     410  LangDirs.Free;
    378411end;
    379412
     
    381414begin
    382415  inherited;
    383   FPOFiles := TObjectList.Create;
     416  FPoFiles := TPoFiles.Create;
    384417  ComponentExcludes := TComponentExcludesList.Create;
    385   Languages := TLanguageList.Create;
     418  Languages := TLanguages.Create;
    386419  POFilesFolder := 'Languages';
    387420  CheckLanguageFiles;
     
    395428destructor TTranslator.Destroy;
    396429begin
    397   FPOFiles.Free;
    398   Languages.Free;
    399   ComponentExcludes.Free;
    400   inherited Destroy;
     430  FreeAndNil(FPoFiles);
     431  FreeAndNil(Languages);
     432  FreeAndNil(ComponentExcludes);
     433  inherited;
    401434end;
    402435
     
    564597end;
    565598
    566 
    567599end.
    568 
  • trunk/Packages/Common/URI.pas

    r84 r85  
    1 unit UURI;
     1unit URI;
    22
    33// Date: 2011-04-04
    4 
    5 {$mode delphi}
    64
    75interface
     
    8583  end;
    8684
     85
    8786implementation
    8887
     
    183182begin
    184183  Items.Free;
    185   inherited Destroy;
     184  inherited;
    186185end;
    187186
     
    232231begin
    233232  Path.Free;
    234   inherited Destroy;
     233  inherited;
    235234end;
    236235
     
    243242    Fragment := TURI(Source).Fragment;
    244243    Query := TURI(Source).Query;
    245   end else inherited Assign(Source);
     244  end else inherited;
    246245end;
    247246
     
    291290destructor TURL.Destroy;
    292291begin
    293   inherited Destroy;
     292  inherited;
    294293end;
    295294
     
    344343begin
    345344  Directory.Free;
    346   inherited Destroy;
    347 end;
    348 
     345  inherited;
     346end;
    349347
    350348end.
    351 
  • trunk/Packages/Common/XML.pas

    r84 r85  
    1 unit UXMLUtils;
    2 
    3 {$mode delphi}
     1unit XML;
    42
    53interface
     
    1614procedure WriteString(Node: TDOMNode; Name: string; Value: string);
    1715procedure WriteDateTime(Node: TDOMNode; Name: string; Value: TDateTime);
     16procedure WriteDouble(Node: TDOMNode; Name: string; Value: Double);
    1817function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer;
    1918function ReadInt64(Node: TDOMNode; Name: string; DefaultValue: Int64): Int64;
     
    2120function ReadString(Node: TDOMNode; Name: string; DefaultValue: string): string;
    2221function ReadDateTime(Node: TDOMNode; Name: string; DefaultValue: TDateTime): TDateTime;
     22function ReadDouble(Node: TDOMNode; Name: string; DefaultValue: Double): Double;
    2323procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string);
    2424
    2525
    2626implementation
     27
     28function ReadDouble(Node: TDOMNode; Name: string; DefaultValue: Double): Double;
     29var
     30  NewNode: TDOMNode;
     31begin
     32  Result := DefaultValue;
     33  NewNode := Node.FindNode(DOMString(Name));
     34  if Assigned(NewNode) then
     35    Result := StrToFloat(string(NewNode.TextContent));
     36end;
    2737
    2838procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string);
     
    202212end;
    203213
     214procedure WriteDouble(Node: TDOMNode; Name: string; Value: Double);
     215var
     216  NewNode: TDOMNode;
     217begin
     218  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     219  NewNode.TextContent := DOMString(FloatToStr(Value));
     220  Node.AppendChild(NewNode);
     221end;
     222
    204223function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer;
    205224var
     
    254273
    255274end.
    256 
Note: See TracChangeset for help on using the changeset viewer.