Changeset 85
- Timestamp:
- Jun 7, 2024, 11:59:43 AM (3 months ago)
- Location:
- trunk
- Files:
-
- 30 added
- 13 deleted
- 9 edited
- 1 copied
- 39 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r79 r85 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, Math, 9 ActnList, ExtCtrls, StdCtrls, UGame, UPersistentForm, UApplicationInfo,9 ActnList, ExtCtrls, StdCtrls, UGame, PersistentForm, ApplicationInfo, 10 10 LCLType, Syncobjs, DateUtils; 11 11 -
trunk/Forms/UFormSettings.pas
r50 r85 7 7 uses 8 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls, 9 ULanguages, UTheme;9 Languages, Theme; 10 10 11 11 type -
trunk/Game2048.lpi
r80 r85 2 2 <CONFIG> 3 3 <ProjectOptions> 4 <Version Value="1 1"/>4 <Version Value="12"/> 5 5 <General> 6 <Flags> 7 <CompatibilityMode Value="True"/> 8 </Flags> 6 9 <SessionStorage Value="InProjectDir"/> 7 <MainUnit Value="0"/>8 10 <Title Value="2048"/> 9 11 <Scaled Value="True"/> … … 177 179 <Linking> 178 180 <Debugging> 181 <DebugInfoType Value="dsDwarf2Set"/> 179 182 <UseHeaptrc Value="True"/> 180 183 <UseExternalDbgSyms Value="True"/> -
trunk/Languages/Game2048.cs.po
r80 r85 181 181 182 182 #: ucore.swinmessage 183 #, object-pascal-format 183 184 msgctxt "ucore.swinmessage" 184 185 msgid "You reached %s and won! You can continue to play to get higher score." -
trunk/Packages/Common/ApplicationInfo.pas
r84 r85 1 unit UApplicationInfo; 2 3 {$mode delphi} 1 unit ApplicationInfo; 4 2 5 3 interface 6 4 7 5 uses 8 SysUtils, Classes, Forms, URegistry, Controls, Graphics, LCLType;6 SysUtils, Classes, Forms, RegistryEx, Controls, Graphics, LCLType; 9 7 10 8 type … … 59 57 procedure Register; 60 58 59 61 60 implementation 62 61 -
trunk/Packages/Common/Common.Delay.pas
r84 r85 1 unit UDelay; 2 3 {$mode delphi} 1 unit Common.Delay; 4 2 5 3 interface … … 73 71 74 72 end. 75 -
trunk/Packages/Common/Common.lpk
r80 r85 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <CONFIG> 3 <Package Version=" 4">3 <Package Version="5"> 4 4 <PathDelim Value="\"/> 5 5 <Name Value="Common"/> … … 11 11 <PathDelim Value="\"/> 12 12 <SearchPaths> 13 <OtherUnitFiles Value="Forms"/> 13 14 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 14 15 </SearchPaths> … … 33 34 <Other> 34 35 <CompilerMessages> 35 <IgnoredMessages idx 5024="True"/>36 <IgnoredMessages idx6058="True" idx5071="True" idx5024="True" idx3124="True" idx3123="True"/> 36 37 </CompilerMessages> 37 38 </Other> 38 39 </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 42 Source: https://svn.zdechov.net/PascalClassLibrary/Common/"/> 43 <License Value="Copy left."/> 44 <Version Minor="12"/> 45 <Files Count="36"> 43 46 <Item1> 44 47 <Filename Value="StopWatch.pas"/> … … 46 49 </Item1> 47 50 <Item2> 48 <Filename Value=" UCommon.pas"/>49 <UnitName Value=" UCommon"/>51 <Filename Value="Common.pas"/> 52 <UnitName Value="Common"/> 50 53 </Item2> 51 54 <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"/> 55 58 </Item3> 56 59 <Item4> 57 <Filename Value=" UDelay.pas"/>58 <UnitName Value=" UDelay"/>60 <Filename Value="Common.Delay.pas"/> 61 <UnitName Value="Common.Delay"/> 59 62 </Item4> 60 63 <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"/> 64 67 </Item5> 65 68 <Item6> 66 <Filename Value="U URI.pas"/>67 <UnitName Value="U URI"/>69 <Filename Value="URI.pas"/> 70 <UnitName Value="URI"/> 68 71 </Item6> 69 72 <Item7> 70 <Filename Value=" UThreading.pas"/>71 <UnitName Value=" UThreading"/>73 <Filename Value="Threading.pas"/> 74 <UnitName Value="Threading"/> 72 75 </Item7> 73 76 <Item8> 74 <Filename Value=" UMemory.pas"/>75 <UnitName Value=" UMemory"/>77 <Filename Value="Memory.pas"/> 78 <UnitName Value="Memory"/> 76 79 </Item8> 77 80 <Item9> 78 <Filename Value=" UResetableThread.pas"/>79 <UnitName Value=" UResetableThread"/>81 <Filename Value="ResetableThread.pas"/> 82 <UnitName Value="ResetableThread"/> 80 83 </Item9> 81 84 <Item10> 82 <Filename Value=" UPool.pas"/>83 <UnitName Value=" UPool"/>85 <Filename Value="Pool.pas"/> 86 <UnitName Value="Pool"/> 84 87 </Item10> 85 88 <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"/> 89 92 </Item11> 90 93 <Item12> 91 <Filename Value=" URegistry.pas"/>92 <UnitName Value=" URegistry"/>94 <Filename Value="RegistryEx.pas"/> 95 <UnitName Value="RegistryEx"/> 93 96 </Item12> 94 97 <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"/> 98 101 </Item13> 99 102 <Item14> 100 <Filename Value=" UXMLUtils.pas"/>101 <UnitName Value=" UXMLUtils"/>103 <Filename Value="XML.pas"/> 104 <UnitName Value="XML"/> 102 105 </Item14> 103 106 <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"/> 107 110 </Item15> 108 111 <Item16> 109 <Filename Value=" USyncCounter.pas"/>110 <UnitName Value=" USyncCounter"/>112 <Filename Value="SyncCounter.pas"/> 113 <UnitName Value="SyncCounter"/> 111 114 </Item16> 112 115 <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"/> 116 119 </Item17> 117 120 <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"/> 121 124 </Item18> 122 125 <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"/> 126 129 </Item19> 127 130 <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"/> 131 134 </Item20> 132 135 <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"/> 136 139 </Item21> 137 140 <Item22> 138 <Filename Value=" UStringTable.pas"/>139 <UnitName Value=" UStringTable"/>141 <Filename Value="StringTable.pas"/> 142 <UnitName Value="StringTable"/> 140 143 </Item22> 141 144 <Item23> 142 <Filename Value=" UMetaCanvas.pas"/>143 <UnitName Value=" UMetaCanvas"/>145 <Filename Value="MetaCanvas.pas"/> 146 <UnitName Value="MetaCanvas"/> 144 147 </Item23> 145 148 <Item24> 146 <Filename Value=" UGeometric.pas"/>147 <UnitName Value=" UGeometric"/>149 <Filename Value="Geometric.pas"/> 150 <UnitName Value="Geometric"/> 148 151 </Item24> 149 152 <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"/> 153 156 </Item25> 154 157 <Item26> 155 <Filename Value=" ULanguages.pas"/>156 <UnitName Value=" ULanguages"/>158 <Filename Value="Languages.pas"/> 159 <UnitName Value="Languages"/> 157 160 </Item26> 158 161 <Item27> 159 <Filename Value=" UFormAbout.pas"/>160 <UnitName Value=" UFormAbout"/>162 <Filename Value="PixelPointer.pas"/> 163 <UnitName Value="PixelPointer"/> 161 164 </Item27> 162 165 <Item28> 163 <Filename Value="UAboutDialog.pas"/> 164 <HasRegisterProc Value="True"/> 165 <UnitName Value="UAboutDialog"/> 166 <Filename Value="DataFile.pas"/> 167 <UnitName Value="DataFile"/> 166 168 </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> 167 203 </Files> 204 <CompatibilityMode Value="True"/> 168 205 <i18n> 169 206 <EnableI18N Value="True"/> -
trunk/Packages/Common/Common.pas
r84 r85 1 unit UCommon; 2 3 {$mode delphi} 1 unit Common; 4 2 5 3 interface 6 4 7 5 uses 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; 12 10 13 11 type 14 12 TArrayOfByte = array of Byte; 15 TArrayOfString = array of string;16 13 TExceptionEvent = procedure(Sender: TObject; E: Exception) of object; 17 14 … … 35 32 DLLHandle1: HModule; 36 33 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 39 const 40 clLightBlue = TColor($FF8080); 41 clLightGreen = TColor($80FF80); 42 clLightRed = TColor($8080FF); 43 44 function AddLeadingZeroes(const aNumber, Length : integer) : string; 43 45 function BinToInt(BinStr: string): Int64; 44 function TryHexToInt(Data: string; var Value: Integer): Boolean;45 function TryBinToInt(Data: string; var Value: Integer): Boolean;46 46 function BinToHexString(Source: AnsiString): string; 47 47 //function DelTree(DirName : string): Boolean; … … 49 49 function BCDToInt(Value: Byte): Byte; 50 50 function CompareByteArray(Data1, Data2: TArrayOfByte): Boolean; 51 procedure CopyStringArray(Dest: TStringArray; Source: array of string); 52 function CombinePaths(Path1, Path2: string): string; 53 function ComputerName: string; 54 procedure DeleteFiles(APath, AFileSpec: string); 55 function Explode(Separator: Char; Data: string): TStringArray; 56 procedure ExecuteProgram(Executable: string; Parameters: array of string); 57 procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog); 58 procedure FreeThenNil(var Obj); 59 function GetDirCount(Dir: string): Integer; 51 60 function GetUserName: string; 52 function LoggedOnUserNameEx(Format: TUserNameFormat): string;53 function SplitString(var Text: string; Count: Word): string;54 61 function GetBitCount(Variable: QWord; MaxIndex: Integer): Integer; 55 62 function GetBit(Variable: QWord; Index: Byte): Boolean; 63 function GetStringPart(var Text: string; Separator: string): string; 64 function GenerateNewName(OldName: string): string; 65 function GetFileFilterItemExt(Filter: string; Index: Integer): string; 66 function IntToBin(Data: Int64; Count: Byte): string; 67 function Implode(Separator: string; List: TList<string>): string; 68 function Implode(Separator: string; List: TStringList; Around: string = ''): string; 69 function LastPos(const SubStr: String; const S: String): Integer; 70 function LoadFileToStr(const FileName: TFileName): AnsiString; 71 function LoggedOnUserNameEx(Format: TUserNameFormat): string; 72 function MergeArray(A, B: array of string): TStringArray; 73 function OccurenceOfChar(What: Char; Where: string): Integer; 74 procedure OpenWebPage(URL: string); 75 procedure OpenEmail(Email: string); 76 procedure OpenFileInShell(FileName: string); 77 function PosFromIndex(SubStr: string; Text: string; 78 StartIndex: Integer): Integer; 79 function PosFromIndexReverse(SubStr: string; Text: string; 80 StartIndex: Integer): Integer; 81 function RemoveQuotes(Text: string): string; 82 procedure SaveStringToFile(S, FileName: string); 56 83 procedure SetBit(var Variable: Int64; Index: Byte; State: Boolean); overload; 57 84 procedure SetBit(var Variable: QWord; Index: Byte; State: Boolean); overload; 58 85 procedure SetBit(var Variable: Cardinal; Index: Byte; State: Boolean); overload; 59 86 procedure 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);77 87 procedure SearchFiles(AList: TStrings; Dir: string; 78 88 FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil); 79 function GetStringPart(var Text: string; Separator: string): string;89 function SplitString(var Text: string; Count: Word): string; 80 90 function 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); 91 function TryHexToInt(Data: string; out Value: Integer): Boolean; 92 function TryBinToInt(Data: string; out Value: Integer): Boolean; 93 procedure SortStrings(Strings: TStrings); 86 94 87 95 … … 199 207 end;*) 200 208 209 function Implode(Separator: string; List: TStringList; Around: string = ''): string; 210 var 211 I: Integer; 212 begin 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; 218 end; 219 201 220 function LastPos(const SubStr: String; const S: String): Integer; 202 221 begin … … 244 263 end; 245 264 246 function TryHexToInt(Data: string; varValue: Integer): Boolean;265 function TryHexToInt(Data: string; out Value: Integer): Boolean; 247 266 var 248 267 I: Integer; … … 260 279 end; 261 280 262 function TryBinToInt(Data: string; varValue: Integer): Boolean;281 function TryBinToInt(Data: string; out Value: Integer): Boolean; 263 282 var 264 283 I: Integer; … … 288 307 end; 289 308 290 function Explode(Separator: char; Data: string): TArrayOfString; 291 begin 292 SetLength(Result, 0); 293 while Pos(Separator, Data) > 0 do begin 309 function Explode(Separator: Char; Data: string): TStringArray; 310 var 311 Index: Integer; 312 begin 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 294 323 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; 326 end; 327 328 function Implode(Separator: string; List: TList<string>): string; 329 var 330 I: Integer; 331 begin 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; 337 end; 338 339 {$IFDEF WINDOWS} 303 340 function GetUserName: string; 304 341 const … … 308 345 begin 309 346 L := MAX_USERNAME_LENGTH + 2; 347 Result := Default(string); 310 348 SetLength(Result, L); 311 349 if Windows.GetUserName(PChar(Result), L) and (L > 0) then begin … … 321 359 end; 322 360 end; 323 {$ endif}361 {$ENDIF} 324 362 325 363 function ComputerName: string; 326 {$ ifdef mswindows}364 {$IFDEF WINDOWS} 327 365 const 328 366 INFO_BUFFER_SIZE = 32767; … … 339 377 end; 340 378 end; 341 {$ endif}342 {$ ifdef unix}379 {$ENDIF} 380 {$IFDEF UNIX} 343 381 var 344 382 Name: UtsName; 345 383 begin 384 Name := Default(UtsName); 346 385 fpuname(Name); 347 386 Result := Name.Nodename; 348 387 end; 349 {$ endif}350 351 {$ ifdef windows}388 {$ENDIF} 389 390 {$IFDEF WINDOWS} 352 391 function LoggedOnUserNameEx(Format: TUserNameFormat): string; 353 392 const … … 427 466 procedure LoadLibraries; 428 467 begin 429 {$IFDEF W indows}468 {$IFDEF WINDOWS} 430 469 DLLHandle1 := LoadLibrary('secur32.dll'); 431 470 if DLLHandle1 <> 0 then … … 438 477 procedure FreeLibraries; 439 478 begin 440 {$IFDEF W indows}479 {$IFDEF WINDOWS} 441 480 if DLLHandle1 <> 0 then FreeLibrary(DLLHandle1); 442 481 {$ENDIF} … … 471 510 end; 472 511 512 procedure OpenEmail(Email: string); 513 begin 514 OpenURL('mailto:' + Email); 515 end; 516 473 517 procedure OpenFileInShell(FileName: string); 474 518 begin … … 499 543 end; 500 544 501 function MergeArray(A, B: array of string): TArrayOfString; 502 var 503 I: Integer; 504 begin 545 function MergeArray(A, B: array of string): TStringArray; 546 var 547 I: Integer; 548 begin 549 Result := Default(TStringArray); 505 550 SetLength(Result, Length(A) + Length(B)); 506 551 for I := 0 to Length(A) - 1 do … … 669 714 end; 670 715 716 function CombinePaths(Path1, Path2: string): string; 717 begin 718 Result := Path1; 719 if Result <> '' then Result := Result + DirectorySeparator + Path2 720 else Result := Path2; 721 end; 722 723 procedure SortStrings(Strings: TStrings); 724 var 725 Tmp: TStringList; 726 begin 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; 744 end; 745 671 746 672 747 initialization -
trunk/Packages/Common/CommonPackage.pas
r84 r85 3 3 } 4 4 5 unit Common ;5 unit CommonPackage; 6 6 7 7 {$warn 5023 off : no warning about unused units} … … 9 9 10 10 uses 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; 17 17 18 18 implementation … … 20 20 procedure Register; 21 21 begin 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); 34 34 end; 35 35 -
trunk/Packages/Common/DebugLog.pas
r84 r85 1 unit UDebugLog; 2 3 {$mode delphi} 1 unit DebugLog; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, FileUtil, fgl, SyncObjs;6 Classes, SysUtils, FileUtil, Generics.Collections, SyncObjs; 9 7 10 8 type … … 15 13 Group: string; 16 14 Text: string; 15 end; 16 17 TDebugLogItems = class(TObjectList<TDebugLogItem>) 17 18 end; 18 19 … … 29 30 procedure SetMaxCount(const AValue: Integer); 30 31 public 31 Items: T FPGObjectList<TDebugLogItem>;32 Items: TDebugLogItems; 32 33 Lock: TCriticalSection; 33 34 procedure Add(Text: string; Group: string = ''); … … 44 45 45 46 procedure Register; 47 46 48 47 49 implementation … … 117 119 begin 118 120 inherited; 119 Items := T FPGObjectList<TDebugLogItem>.Create;121 Items := TDebugLogItems.Create; 120 122 Lock := TCriticalSection.Create; 121 123 MaxCount := 100; … … 126 128 destructor TDebugLog.Destroy; 127 129 begin 128 Items.Free;129 Lock.Free;130 FreeAndNil(Items); 131 FreeAndNil(Lock); 130 132 inherited; 131 133 end; 132 134 133 135 end. 134 -
trunk/Packages/Common/FindFile.pas
r84 r85 19 19 } 20 20 21 unit UFindFile;21 unit FindFile; 22 22 23 23 interface … … 35 35 private 36 36 s : TStringList; 37 38 37 fSubFolder : boolean; 39 38 fAttr: TFileAttrib; 40 39 fPath : string; 41 40 fFileMask : string; 42 43 41 procedure SetPath(Value: string); 44 42 procedure FileSearch(const inPath : string); … … 46 44 constructor Create(AOwner: TComponent); override; 47 45 destructor Destroy; override; 48 49 46 function SearchForFiles: TStringList; 50 47 published … … 59 56 FilterAll = '*.*'; 60 57 {$ENDIF} 61 {$IFDEF LINUX}58 {$IFDEF UNIX} 62 59 FilterAll = '*'; 63 60 {$ENDIF} 64 61 65 62 procedure Register; 63 66 64 67 65 implementation … … 87 85 begin 88 86 s.Free; 89 inherited Destroy;87 inherited; 90 88 end; 91 89 … … 145 143 SysUtils.FindClose(Rec); 146 144 end; 147 end; 145 end; 148 146 149 147 end. 150 -
trunk/Packages/Common/Forms/FormAbout.lfm
r84 r85 1 1 object FormAbout: TFormAbout 2 Left = 10142 Left = 624 3 3 Height = 402 4 Top = 5774 Top = 622 5 5 Width = 702 6 6 Caption = 'About' … … 8 8 ClientWidth = 702 9 9 DesignTimePPI = 144 10 OnCreate = FormCreate11 10 OnShow = FormShow 12 11 Position = poScreenCenter 13 LCLVersion = '2. 0.10.0'12 LCLVersion = '2.2.6.0' 14 13 object LabelDescription: TLabel 15 14 Left = 30 16 Height = 2 415 Height = 26 17 16 Top = 135 18 17 Width = 642 … … 28 27 object LabelContent: TLabel 29 28 Left = 30 30 Height = 2 431 Top = 1 8929 Height = 26 30 Top = 191 32 31 Width = 642 33 32 Align = alTop … … 67 66 Height = 74 68 67 Top = 30 69 Width = 7 268 Width = 71 70 69 Proportional = True 71 70 Stretch = True … … 94 93 end 95 94 object ButtonClose: TButton 96 Left = 53 295 Left = 531 97 96 Height = 38 98 97 Top = 24 99 Width = 14 098 Width = 141 100 99 Anchors = [akRight, akBottom] 101 100 Caption = 'Close' -
trunk/Packages/Common/Forms/FormAbout.pas
r84 r85 1 unit UFormAbout; 2 3 {$mode delphi} 1 unit FormAbout; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 StdCtrls, ExtCtrls, UApplicationInfo, UCommon, UTranslator, UTheme;7 StdCtrls, ExtCtrls, ApplicationInfo, Common, FormEx; 10 8 11 9 type 12 10 { TFormAbout } 13 11 14 TFormAbout = class(TForm )12 TFormAbout = class(TFormEx) 15 13 ButtonClose: TButton; 16 14 ButtonHomePage: TButton; … … 22 20 PanelButtons: TPanel; 23 21 procedure ButtonHomePageClick(Sender: TObject); 24 procedure FormCreate(Sender: TObject);25 22 procedure FormShow(Sender: TObject); 26 23 private 27 { private declarations }24 FApplicationInfo: TApplicationInfo; 28 25 public 29 AboutDialog: TObject; //TAboutDialog30 26 procedure UpdateInterface; 27 property ApplicationInfo: TApplicationInfo read FApplicationInfo write 28 FApplicationInfo; 31 29 end; 32 30 … … 35 33 36 34 {$R *.lfm} 37 38 uses39 UAboutDialog;40 35 41 36 resourcestring … … 48 43 procedure TFormAbout.FormShow(Sender: TObject); 49 44 begin 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); 66 53 end; 67 54 UpdateInterface; … … 70 57 procedure TFormAbout.UpdateInterface; 71 58 begin 72 ButtonHomePage.Enabled := Assigned(AboutDialog) and 73 Assigned(TAboutDialog(AboutDialog).ApplicationInfo); 59 ButtonHomePage.Enabled := Assigned(ApplicationInfo); 74 60 end; 75 61 76 62 procedure TFormAbout.ButtonHomePageClick(Sender: TObject); 77 63 begin 78 OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage); 79 end; 80 81 procedure TFormAbout.FormCreate(Sender: TObject); 82 begin 64 OpenWebPage(ApplicationInfo.HomePage); 83 65 end; 84 66 85 67 end. 86 -
trunk/Packages/Common/Geometric.pas
r84 r85 1 unit UGeometric; 2 3 {$mode delphi} 1 unit Geometric; 4 2 5 3 interface … … 10 8 type 11 9 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; 12 21 13 22 function Distance(P1, P2: TPoint): Integer; … … 15 24 function AddPoint(const P1, P2: TPoint): TPoint; 16 25 function SubPoint(const P1, P2: TPoint): TPoint; 17 function PointToLineDistance(const P, V, W: TPoint ): Integer;26 function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer; 18 27 function ComparePoint(P1, P2: TPoint): Boolean; 19 28 function RotatePoint(Center, P: TPoint; Angle: Double): TPoint; … … 27 36 function ShiftRect(ARect: TRect; Delta: TPoint): TRect; 28 37 38 29 39 implementation 30 40 … … 51 61 end; 52 62 53 function PointToLineDistance(const P, V, W: TPoint ): Integer;63 function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer; 54 64 var 55 65 l2, t: Double; … … 69 79 if T < 0 then begin 70 80 Result := Distance(P, V); // Beyond the 'v' end of the segment 71 exit; 81 Intersect := V; 82 Exit; 72 83 end 73 84 else if T > 1 then begin 74 85 Result := Distance(P, W); // Beyond the 'w' end of the segment 86 Intersect := W; 75 87 Exit; 76 88 end; … … 78 90 TT.Y := Trunc(V.Y + T * (W.Y - V.Y)); 79 91 Result := Distance(P, TT); 92 Intersect := TT; 80 93 end; 81 94 … … 96 109 I: Integer; 97 110 begin 111 Result := Default(TPointArray); 98 112 SetLength(Result, Length(P)); 99 113 for I := 0 to High(P) do … … 162 176 end; 163 177 178 { TVector } 179 180 function TVector.GetLength: Double; 181 begin 182 Result := Sqrt(Sqr(Direction.X) + Sqr(Direction.Y)); 183 end; 184 185 function TVector.GetAngle: Double; 186 begin 187 Result := ArcTan2(Direction.Y, Direction.X); 188 end; 189 190 procedure TVector.SetLength(Value: Double); 191 var 192 Angle: Double; 193 begin 194 Angle := GetAngle; 195 Direction := Point(Round(Cos(Angle) * Value), 196 Round(Sin(Angle) * Value)); 197 end; 198 199 class function TVector.Create(P1, P2: TPoint): TVector; 200 begin 201 Result.Position := P1; 202 Result.Direction := Point(P2.X - P1.X, P2.Y - P1.Y); 203 end; 164 204 165 205 end. 166 -
trunk/Packages/Common/JobProgressView.lfm
r84 r85 1 1 object FormJobProgressView: TFormJobProgressView 2 2 Left = 467 3 Height = 3453 Height = 414 4 4 Top = 252 5 Width = 5395 Width = 647 6 6 BorderIcons = [biSystemMenu] 7 ClientHeight = 3458 ClientWidth = 5399 DesignTimePPI = 1 207 ClientHeight = 414 8 ClientWidth = 647 9 DesignTimePPI = 144 10 10 OnClose = FormClose 11 11 OnCloseQuery = FormCloseQuery 12 12 OnCreate = FormCreate 13 OnDestroy = FormDestroy14 13 OnHide = FormHide 15 14 OnShow = FormShow 16 15 Position = poScreenCenter 17 LCLVersion = '2. 0.2.0'16 LCLVersion = '2.2.0.4' 18 17 object PanelOperationsTitle: TPanel 19 18 Left = 0 20 Height = 3 219 Height = 38 21 20 Top = 0 22 Width = 53921 Width = 647 23 22 Align = alTop 24 23 BevelOuter = bvNone 25 ClientHeight = 3 226 ClientWidth = 53924 ClientHeight = 38 25 ClientWidth = 647 27 26 FullRepaint = False 28 27 TabOrder = 0 29 28 object LabelOperation: TLabel 30 Left = 831 Height = 2 032 Top = 833 Width = 7629 Left = 10 30 Height = 26 31 Top = 10 32 Width = 99 34 33 Caption = 'Operations:' 35 ParentColor = False36 34 ParentFont = False 37 35 end … … 39 37 object PanelLog: TPanel 40 38 Left = 0 41 Height = 1 3342 Top = 2 1243 Width = 53939 Height = 161 40 Top = 253 41 Width = 647 44 42 Align = alClient 45 43 BevelOuter = bvSpace 46 ClientHeight = 1 3347 ClientWidth = 53944 ClientHeight = 161 45 ClientWidth = 647 48 46 TabOrder = 1 49 47 object MemoLog: TMemo 50 Left = 851 Height = 1 1752 Top = 853 Width = 52348 Left = 10 49 Height = 141 50 Top = 10 51 Width = 627 54 52 Anchors = [akTop, akLeft, akRight, akBottom] 55 53 ReadOnly = True … … 60 58 object PanelProgress: TPanel 61 59 Left = 0 62 Height = 5463 Top = 1 0664 Width = 53960 Height = 65 61 Top = 126 62 Width = 647 65 63 Align = alTop 66 64 BevelOuter = bvNone 67 ClientHeight = 5468 ClientWidth = 53965 ClientHeight = 65 66 ClientWidth = 647 69 67 TabOrder = 2 70 68 object ProgressBarPart: TProgressBar 71 Left = 1 072 Height = 2 473 Top = 2 474 Width = 52369 Left = 12 70 Height = 29 71 Top = 29 72 Width = 628 75 73 Anchors = [akTop, akLeft, akRight] 76 74 TabOrder = 0 77 75 end 78 76 object LabelEstimatedTimePart: TLabel 79 Left = 880 Height = 2 077 Left = 10 78 Height = 26 81 79 Top = -2 82 Width = 1 0380 Width = 132 83 81 Caption = 'Estimated time:' 84 ParentColor = False85 82 end 86 83 end 87 84 object PanelOperations: TPanel 88 85 Left = 0 89 Height = 4290 Top = 6491 Width = 53986 Height = 50 87 Top = 76 88 Width = 647 92 89 Align = alTop 93 90 BevelOuter = bvNone 94 ClientHeight = 4295 ClientWidth = 53991 ClientHeight = 50 92 ClientWidth = 647 96 93 FullRepaint = False 97 94 TabOrder = 3 98 95 object ListViewJobs: TListView 99 Left = 8100 Height = 3 2101 Top = 5102 Width = 52396 Left = 10 97 Height = 38 98 Top = 6 99 Width = 627 103 100 Anchors = [akTop, akLeft, akRight, akBottom] 104 101 AutoWidthLastColumn = True … … 107 104 Columns = < 108 105 item 109 Width = 523106 Width = 614 110 107 end> 111 108 OwnerData = True … … 120 117 object PanelProgressTotal: TPanel 121 118 Left = 0 122 Height = 52123 Top = 1 60124 Width = 539119 Height = 62 120 Top = 191 121 Width = 647 125 122 Align = alTop 126 123 BevelOuter = bvNone 127 ClientHeight = 52128 ClientWidth = 539124 ClientHeight = 62 125 ClientWidth = 647 129 126 TabOrder = 4 130 127 object LabelEstimatedTimeTotal: TLabel 131 Left = 8132 Height = 2 0128 Left = 10 129 Height = 26 133 130 Top = 0 134 Width = 1 41131 Width = 178 135 132 Caption = 'Total estimated time:' 136 ParentColor = False137 133 end 138 134 object ProgressBarTotal: TProgressBar 139 Left = 8140 Height = 2 4141 Top = 2 4142 Width = 523135 Left = 10 136 Height = 29 137 Top = 29 138 Width = 627 143 139 Anchors = [akTop, akLeft, akRight] 144 140 TabOrder = 0 … … 147 143 object PanelText: TPanel 148 144 Left = 0 149 Height = 3 2150 Top = 3 2151 Width = 539145 Height = 38 146 Top = 38 147 Width = 647 152 148 Align = alTop 153 149 BevelOuter = bvNone 154 ClientHeight = 3 2155 ClientWidth = 539150 ClientHeight = 38 151 ClientWidth = 647 156 152 TabOrder = 5 157 153 object LabelText: TLabel 158 Left = 8159 Height = 2 4160 Top = 8161 Width = 525154 Left = 10 155 Height = 29 156 Top = 10 157 Width = 630 162 158 Anchors = [akTop, akLeft, akRight] 163 159 AutoSize = False 164 ParentColor = False165 160 end 166 161 end 167 162 object ImageList1: TImageList 168 BkColor = clForeground 169 left = 200 170 top = 8 163 Left = 240 164 Top = 10 171 165 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 237 170 } 238 171 end … … 241 174 Interval = 100 242 175 OnTimer = TimerUpdateTimer 243 left = 320244 top = 8176 Left = 384 177 Top = 10 245 178 end 246 179 end -
trunk/Packages/Common/JobProgressView.pas
r84 r85 1 unit UJobProgressView; 2 3 {$MODE Delphi} 1 unit JobProgressView; 4 2 5 3 interface … … 7 5 uses 8 6 SysUtils, Variants, Classes, Graphics, Controls, Forms, Syncobjs, 9 Dialogs, ComCtrls, StdCtrls, ExtCtrls, Contnrs, UThreading, Math,7 Dialogs, ComCtrls, StdCtrls, ExtCtrls, Generics.Collections, Threading, Math, 10 8 DateUtils; 11 9 … … 71 69 end; 72 70 73 TJobs = class(TObjectList )71 TJobs = class(TObjectList<TJob>) 74 72 end; 75 73 … … 105 103 procedure ReloadJobList; 106 104 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 107 procedure FormDestroy(Sender: TObject);108 105 procedure ListViewJobsData(Sender: TObject; Item: TListItem); 109 106 procedure TimerUpdateTimer(Sender: TObject); … … 157 154 end; 158 155 159 //var160 // FormJobProgressView: TFormJobProgressView;161 162 156 procedure Register; 163 157 164 158 resourcestring 165 159 SExecuted = 'Executed'; 160 166 161 167 162 implementation … … 187 182 try 188 183 try 189 //raise Exception.Create('Exception in job');190 184 ProgressView.CurrentJob.Method(Job); 191 185 except … … 286 280 end; 287 281 288 procedure TFormJobProgressView.FormDestroy(Sender:TObject);289 begin290 end;291 292 282 procedure TFormJobProgressView.ListViewJobsData(Sender: TObject; Item: TListItem); 293 283 begin 294 284 if (Item.Index >= 0) and (Item.Index < JobProgressView.Jobs.Count) then 295 with TJob(JobProgressView.Jobs[Item.Index])do begin285 with JobProgressView.Jobs[Item.Index] do begin 296 286 Item.Caption := Title; 297 287 if Item.Index = JobProgressView.CurrentJobIndex then Item.ImageIndex := 1 … … 405 395 I := 0; 406 396 while I < Jobs.Count do 407 with TJob(Jobs[I])do begin397 with Jobs[I] do begin 408 398 CurrentJobIndex := I; 409 CurrentJob := TJob(Jobs[I]);399 CurrentJob := Jobs[I]; 410 400 JobProgressChange(Self); 411 401 StartTime := Now; … … 420 410 Method(CurrentJob); 421 411 end else begin 412 Thread := TJobThread.Create(True); 422 413 try 423 Thread := TJobThread.Create(True);424 414 with Thread do begin 425 415 FreeOnTerminate := False; … … 494 484 if AValue = FTerminate then Exit; 495 485 for I := 0 to Jobs.Count - 1 do 496 TJob(Jobs[I]).Terminate := AValue;486 Jobs[I].Terminate := AValue; 497 487 FTerminate := AValue; 498 488 end; … … 620 610 procedure TProgress.Increment; 621 611 begin 622 try623 FLock.Acquire;612 FLock.Acquire; 613 try 624 614 Value := Value + 1; 625 615 finally … … 630 620 procedure TProgress.Reset; 631 621 begin 632 try633 FLock.Acquire;622 FLock.Acquire; 623 try 634 624 FValue := 0; 635 625 finally … … 647 637 begin 648 638 FLock.Free; 649 inherited Destroy;639 inherited; 650 640 end; 651 641 … … 678 668 destructor TJob.Destroy; 679 669 begin 680 Progress.Free;670 FreeAndNil(Progress); 681 671 inherited; 682 672 end; -
trunk/Packages/Common/Languages.pas
r84 r85 1 unit ULanguages; 2 3 {$mode objfpc}{$H+} 1 unit Languages; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Contnrs;6 Classes, SysUtils, Generics.Collections; 9 7 10 8 type … … 15 13 end; 16 14 17 { TLanguage List}18 19 TLanguage List = class(TObjectList)15 { TLanguages } 16 17 TLanguages = class(TObjectList<TLanguage>) 20 18 function SearchByCode(ACode: string): TLanguage; 21 19 procedure AddNew(Code: string; Name: string); 22 constructor Create ;20 constructor Create(FreeObjects: Boolean = True); 23 21 end; 24 22 … … 218 216 SLang_za = 'Zhuang'; 219 217 SLang_zh = 'Chinese'; 218 SLang_zh_Hans = 'Simplified Chinese'; 219 SLang_zh_Hant = 'Traditional Chinese'; 220 220 SLang_zu = 'Zulu'; 221 221 222 222 223 implementation 223 224 224 225 225 { TLanguage List}226 227 function TLanguage List.SearchByCode(ACode: string): TLanguage;226 { TLanguages } 227 228 function TLanguages.SearchByCode(ACode: string): TLanguage; 228 229 var 229 230 I: Integer; 230 231 begin 231 232 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] 234 235 else Result := nil; 235 236 end; 236 237 237 procedure TLanguage List.AddNew(Code: string; Name: string);238 procedure TLanguages.AddNew(Code: string; Name: string); 238 239 var 239 240 NewItem: TLanguage; … … 245 246 end; 246 247 247 constructor TLanguage List.Create;248 constructor TLanguages.Create(FreeObjects: Boolean); 248 249 begin 249 inherited Create;250 inherited; 250 251 AddNew('', SLangAuto); 251 252 AddNew('aa', SLang_aa); … … 441 442 AddNew('za', SLang_za); 442 443 AddNew('zh', SLang_zh); 444 AddNew('zh-Hant', SLang_zh_Hant); 445 AddNew('zh-Hans', SLang_zh_Hans); 443 446 AddNew('zu', SLang_zu); 444 447 end; 445 448 446 449 end. 447 -
trunk/Packages/Common/Languages/DebugLog.cs.po
r84 r85 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 3 "Project-Id-Version: \n" 5 4 "POT-Creation-Date: \n" … … 7 6 "Last-Translator: Jiří Hajda <robie@centrum.cz>\n" 8 7 "Language-Team: \n" 8 "Language: cs\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 3.0.1\n" 11 13 12 #: udebuglog.sfilenamenotdefined 14 #: debuglog.sfilenamenotdefined 15 msgctxt "debuglog.sfilenamenotdefined" 13 16 msgid "Filename not defined" 14 17 msgstr "Neurčen soubor" -
trunk/Packages/Common/Languages/FindFile.cs.po
r84 r85 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 3 "Project-Id-Version: \n" 5 4 "POT-Creation-Date: \n" … … 7 6 "Last-Translator: \n" 8 7 "Language-Team: \n" 8 "Language: cs\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "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" 13 13 14 #: ufindfile.sdirnotfound 14 #: findfile.sdirnotfound 15 msgctxt "findfile.sdirnotfound" 15 16 msgid "Directory not found" 16 17 msgstr "Adresář nenalezen" -
trunk/Packages/Common/Languages/FormAbout.cs.po
r84 r85 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 3 "Project-Id-Version: \n" 5 4 "POT-Creation-Date: \n" … … 7 6 "Last-Translator: Chronos <robie@centrum.cz>\n" 8 7 "Language-Team: \n" 8 "Language: cs\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "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" 13 13 14 #: uformabout.slicense 14 #: formabout.slicense 15 msgctxt "formabout.slicense" 15 16 msgid "License" 16 17 msgstr "Licence" 17 18 18 #: uformabout.sreleasedate 19 #: formabout.sreleasedate 20 msgctxt "formabout.sreleasedate" 19 21 msgid "Release date" 20 22 msgstr "Datum uvolnění" 21 23 22 #: uformabout.sversion 24 #: formabout.sversion 25 msgctxt "formabout.sversion" 23 26 msgid "Version" 24 27 msgstr "Verze" -
trunk/Packages/Common/Languages/JobProgressView.cs.po
r84 r85 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 2.2\n"12 "X-Generator: Poedit 3.0.1\n" 13 13 14 #: ujobprogressview.sestimatedtime 14 #: jobprogressview.sestimatedtime 15 #, object-pascal-format 16 msgctxt "jobprogressview.sestimatedtime" 15 17 msgid "Estimated time: %s" 16 18 msgstr "Odhadovaný čas: %s" 17 19 18 #: ujobprogressview.sexecuted 20 #: jobprogressview.sexecuted 21 msgctxt "jobprogressview.sexecuted" 19 22 msgid "Executed" 20 23 msgstr "Vykonané" 21 24 22 #: ujobprogressview.sfinished 25 #: jobprogressview.sfinished 26 msgctxt "jobprogressview.sfinished" 23 27 msgid "Finished" 24 28 msgstr "Dokončené" 25 29 26 #: ujobprogressview.spleasewait 30 #: jobprogressview.spleasewait 31 msgctxt "jobprogressview.spleasewait" 27 32 msgid "Please wait..." 28 33 msgstr "Prosím čekejte..." 29 34 30 #: ujobprogressview.sterminate 35 #: jobprogressview.sterminate 36 msgctxt "jobprogressview.sterminate" 31 37 msgid "Termination" 32 38 msgstr "Přerušení" 33 39 34 #: ujobprogressview.stotalestimatedtime 40 #: jobprogressview.stotalestimatedtime 41 #, object-pascal-format 42 msgctxt "jobprogressview.stotalestimatedtime" 35 43 msgid "Total estimated time: %s" 36 44 msgstr "Celkový odhadovaný čas: %s" -
trunk/Packages/Common/Languages/Languages.cs.po
r84 r85 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 3 "Project-Id-Version: \n" 5 4 "POT-Creation-Date: \n" … … 7 6 "Last-Translator: Jiří Hajda <software@mezservis.cz>\n" 8 7 "Language-Team: \n" 8 "Language: cs\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "Content-Transfer-Encoding: 8bit\n" 11 12 #: ulanguages.slangauto 12 "X-Generator: Poedit 3.0.1\n" 13 14 #: languages.slangauto 15 msgctxt "languages.slangauto" 13 16 msgid "Automatic" 14 17 msgstr "Automaticky" 15 18 16 #: ulanguages.slang_aa 19 #: languages.slang_aa 20 msgctxt "languages.slang_aa" 17 21 msgid "Afar" 18 22 msgstr "" 19 23 20 #: ulanguages.slang_ab 24 #: languages.slang_ab 25 msgctxt "languages.slang_ab" 21 26 msgid "Abkhazian" 22 27 msgstr "Abcházština" 23 28 24 #: ulanguages.slang_ae 29 #: languages.slang_ae 30 msgctxt "languages.slang_ae" 25 31 msgid "Avestan" 26 32 msgstr "" 27 33 28 #: ulanguages.slang_af 34 #: languages.slang_af 35 msgctxt "languages.slang_af" 29 36 msgid "Afrikaans" 30 37 msgstr "Afrikánština" 31 38 32 #: ulanguages.slang_ak 39 #: languages.slang_ak 40 msgctxt "languages.slang_ak" 33 41 msgid "Akan" 34 42 msgstr "" 35 43 36 #: ulanguages.slang_am 44 #: languages.slang_am 45 msgctxt "languages.slang_am" 37 46 msgid "Amharic" 38 47 msgstr "" 39 48 40 #: ulanguages.slang_an 49 #: languages.slang_an 50 msgctxt "languages.slang_an" 41 51 msgid "Aragonese" 42 52 msgstr "" 43 53 44 #: ulanguages.slang_ar 54 #: languages.slang_ar 55 msgctxt "languages.slang_ar" 45 56 msgid "Arabic" 46 57 msgstr "Arabština" 47 58 48 #: ulanguages.slang_as 59 #: languages.slang_as 60 msgctxt "languages.slang_as" 49 61 msgid "Assamese" 50 62 msgstr "" 51 63 52 #: ulanguages.slang_av 64 #: languages.slang_av 65 msgctxt "languages.slang_av" 53 66 msgid "Avaric" 54 67 msgstr "" 55 68 56 #: ulanguages.slang_ay 69 #: languages.slang_ay 70 msgctxt "languages.slang_ay" 57 71 msgid "Aymara" 58 72 msgstr "" 59 73 60 #: ulanguages.slang_az 74 #: languages.slang_az 75 msgctxt "languages.slang_az" 61 76 msgid "Azerbaijani" 62 77 msgstr "" 63 78 64 #: ulanguages.slang_ba 79 #: languages.slang_ba 80 msgctxt "languages.slang_ba" 65 81 msgid "Bashkir" 66 82 msgstr "" 67 83 68 #: ulanguages.slang_be 84 #: languages.slang_be 85 msgctxt "languages.slang_be" 69 86 msgid "Belarusian" 70 87 msgstr "" 71 88 72 #: ulanguages.slang_bg 89 #: languages.slang_bg 90 msgctxt "languages.slang_bg" 73 91 msgid "Bulgarian" 74 92 msgstr "Maďarština" 75 93 76 #: ulanguages.slang_bh 94 #: languages.slang_bh 95 msgctxt "languages.slang_bh" 77 96 msgid "Bihari" 78 97 msgstr "" 79 98 80 #: ulanguages.slang_bi 99 #: languages.slang_bi 100 msgctxt "languages.slang_bi" 81 101 msgid "Bislama" 82 102 msgstr "" 83 103 84 #: ulanguages.slang_bm 104 #: languages.slang_bm 105 msgctxt "languages.slang_bm" 85 106 msgid "Bambara" 86 107 msgstr "" 87 108 88 #: ulanguages.slang_bn 109 #: languages.slang_bn 110 msgctxt "languages.slang_bn" 89 111 msgid "Bengali" 90 112 msgstr "" 91 113 92 #: ulanguages.slang_bo 114 #: languages.slang_bo 115 msgctxt "languages.slang_bo" 93 116 msgid "Tibetan" 94 117 msgstr "Tibetština" 95 118 96 #: ulanguages.slang_br 119 #: languages.slang_br 120 msgctxt "languages.slang_br" 97 121 msgid "Breton" 98 122 msgstr "" 99 123 100 #: ulanguages.slang_bs 124 #: languages.slang_bs 125 msgctxt "languages.slang_bs" 101 126 msgid "Bosnian" 102 127 msgstr "" 103 128 104 #: ulanguages.slang_ca 129 #: languages.slang_ca 130 msgctxt "languages.slang_ca" 105 131 msgid "Catalan" 106 132 msgstr "Katalánština" 107 133 108 #: ulanguages.slang_ce 134 #: languages.slang_ce 135 msgctxt "languages.slang_ce" 109 136 msgid "Chechen" 110 137 msgstr "" 111 138 112 #: ulanguages.slang_ch 139 #: languages.slang_ch 140 msgctxt "languages.slang_ch" 113 141 msgid "Chamorro" 114 142 msgstr "" 115 143 116 #: ulanguages.slang_co 144 #: languages.slang_co 145 msgctxt "languages.slang_co" 117 146 msgid "Corsican" 118 147 msgstr "" 119 148 120 #: ulanguages.slang_cr 149 #: languages.slang_cr 150 msgctxt "languages.slang_cr" 121 151 msgid "Cree" 122 152 msgstr "Kríjština" 123 153 124 #: ulanguages.slang_cs 154 #: languages.slang_cs 155 msgctxt "languages.slang_cs" 125 156 msgid "Czech" 126 157 msgstr "Čeština" 127 158 128 #: ulanguages.slang_cv 159 #: languages.slang_cv 160 msgctxt "languages.slang_cv" 129 161 msgid "Chuvash" 130 162 msgstr "" 131 163 132 #: ulanguages.slang_cy 164 #: languages.slang_cy 165 msgctxt "languages.slang_cy" 133 166 msgid "Welsh" 134 167 msgstr "" 135 168 136 #: ulanguages.slang_da 169 #: languages.slang_da 170 msgctxt "languages.slang_da" 137 171 msgid "Danish" 138 172 msgstr "Dánština" 139 173 140 #: ulanguages.slang_de 174 #: languages.slang_de 175 msgctxt "languages.slang_de" 141 176 msgid "German" 142 177 msgstr "Němčina" 143 178 144 #: ulanguages.slang_de_at 179 #: languages.slang_de_at 180 msgctxt "languages.slang_de_at" 145 181 msgid "Austrian German" 146 182 msgstr "Australská němčina" 147 183 148 #: ulanguages.slang_de_ch 184 #: languages.slang_de_ch 185 msgctxt "languages.slang_de_ch" 149 186 msgid "Swiss German" 150 187 msgstr "Švédská němčina" 151 188 152 #: ulanguages.slang_dv 189 #: languages.slang_dv 190 msgctxt "languages.slang_dv" 153 191 msgid "Divehi" 154 192 msgstr "" 155 193 156 #: ulanguages.slang_dz 194 #: languages.slang_dz 195 msgctxt "languages.slang_dz" 157 196 msgid "Dzongkha" 158 197 msgstr "" 159 198 160 #: ulanguages.slang_ee 199 #: languages.slang_ee 200 msgctxt "languages.slang_ee" 161 201 msgid "Ewe" 162 202 msgstr "" 163 203 164 #: ulanguages.slang_el 204 #: languages.slang_el 205 msgctxt "languages.slang_el" 165 206 msgid "Greek" 166 207 msgstr "Řečtina" 167 208 168 #: ulanguages.slang_en 209 #: languages.slang_en 210 msgctxt "languages.slang_en" 169 211 msgid "English" 170 212 msgstr "Angličtina" 171 213 172 #: ulanguages.slang_en_au 214 #: languages.slang_en_au 215 msgctxt "languages.slang_en_au" 173 216 msgid "Australian English" 174 217 msgstr "Australská angličtina" 175 218 176 #: ulanguages.slang_en_ca 219 #: languages.slang_en_ca 220 msgctxt "languages.slang_en_ca" 177 221 msgid "Canadian English" 178 222 msgstr "Kanadská angličtina" 179 223 180 #: ulanguages.slang_en_gb 224 #: languages.slang_en_gb 225 msgctxt "languages.slang_en_gb" 181 226 msgid "British English" 182 227 msgstr "Britská angličtina" 183 228 184 #: ulanguages.slang_en_us 229 #: languages.slang_en_us 230 msgctxt "languages.slang_en_us" 185 231 msgid "American English" 186 232 msgstr "Americká angličtina" 187 233 188 #: ulanguages.slang_eo 234 #: languages.slang_eo 235 msgctxt "languages.slang_eo" 189 236 msgid "Esperanto" 190 237 msgstr "Esperanto" 191 238 192 #: ulanguages.slang_es 239 #: languages.slang_es 240 msgctxt "languages.slang_es" 193 241 msgid "Spanish" 194 242 msgstr "Španělština" 195 243 196 #: ulanguages.slang_et 244 #: languages.slang_et 245 msgctxt "languages.slang_et" 197 246 msgid "Estonian" 198 247 msgstr "Estonština" 199 248 200 #: ulanguages.slang_eu 249 #: languages.slang_eu 250 msgctxt "languages.slang_eu" 201 251 msgid "Basque" 202 252 msgstr "" 203 253 204 #: ulanguages.slang_fa 254 #: languages.slang_fa 255 msgctxt "languages.slang_fa" 205 256 msgid "Persian" 206 257 msgstr "Perština" 207 258 208 #: ulanguages.slang_ff 259 #: languages.slang_ff 260 msgctxt "languages.slang_ff" 209 261 msgid "Fulah" 210 262 msgstr "" 211 263 212 #: ulanguages.slang_fi 264 #: languages.slang_fi 265 msgctxt "languages.slang_fi" 213 266 msgid "Finnish" 214 267 msgstr "Finština" 215 268 216 #: ulanguages.slang_fj 269 #: languages.slang_fj 270 msgctxt "languages.slang_fj" 217 271 msgid "Fijian" 218 272 msgstr "" 219 273 220 #: ulanguages.slang_fo 274 #: languages.slang_fo 275 msgctxt "languages.slang_fo" 221 276 msgid "Faroese" 222 277 msgstr "" 223 278 224 #: ulanguages.slang_fr 279 #: languages.slang_fr 280 msgctxt "languages.slang_fr" 225 281 msgid "French" 226 282 msgstr "Francouzština" 227 283 228 #: ulanguages.slang_fr_be229 msgctxt " ulanguages.slang_fr_be"284 #: languages.slang_fr_be 285 msgctxt "languages.slang_fr_be" 230 286 msgid "Walloon" 231 287 msgstr "" 232 288 233 #: ulanguages.slang_fy 289 #: languages.slang_fy 290 msgctxt "languages.slang_fy" 234 291 msgid "Frisian" 235 292 msgstr "" 236 293 237 #: ulanguages.slang_ga 294 #: languages.slang_ga 295 msgctxt "languages.slang_ga" 238 296 msgid "Irish" 239 297 msgstr "Irština" 240 298 241 #: ulanguages.slang_gd 299 #: languages.slang_gd 300 msgctxt "languages.slang_gd" 242 301 msgid "Gaelic" 243 302 msgstr "" 244 303 245 #: ulanguages.slang_gl 304 #: languages.slang_gl 305 msgctxt "languages.slang_gl" 246 306 msgid "Gallegan" 247 307 msgstr "" 248 308 249 #: ulanguages.slang_gn 309 #: languages.slang_gn 310 msgctxt "languages.slang_gn" 250 311 msgid "Guarani" 251 312 msgstr "" 252 313 253 #: ulanguages.slang_gu 314 #: languages.slang_gu 315 msgctxt "languages.slang_gu" 254 316 msgid "Gujarati" 255 317 msgstr "" 256 318 257 #: ulanguages.slang_gv 319 #: languages.slang_gv 320 msgctxt "languages.slang_gv" 258 321 msgid "Manx" 259 322 msgstr "" 260 323 261 #: ulanguages.slang_ha 324 #: languages.slang_ha 325 msgctxt "languages.slang_ha" 262 326 msgid "Hausa" 263 327 msgstr "" 264 328 265 #: ulanguages.slang_he 329 #: languages.slang_he 330 msgctxt "languages.slang_he" 266 331 msgid "Hebrew" 267 332 msgstr "Hebrejština" 268 333 269 #: ulanguages.slang_hi 334 #: languages.slang_hi 335 msgctxt "languages.slang_hi" 270 336 msgid "Hindi" 271 337 msgstr "" 272 338 273 #: ulanguages.slang_ho 339 #: languages.slang_ho 340 msgctxt "languages.slang_ho" 274 341 msgid "Hiri Motu" 275 342 msgstr "" 276 343 277 #: ulanguages.slang_hr 344 #: languages.slang_hr 345 msgctxt "languages.slang_hr" 278 346 msgid "Croatian" 279 347 msgstr "Chorvatština" 280 348 281 #: ulanguages.slang_ht 349 #: languages.slang_ht 350 msgctxt "languages.slang_ht" 282 351 msgid "Haitian" 283 352 msgstr "" 284 353 285 #: ulanguages.slang_hu 354 #: languages.slang_hu 355 msgctxt "languages.slang_hu" 286 356 msgid "Hungarian" 287 357 msgstr "Maďarština" 288 358 289 #: ulanguages.slang_hy 359 #: languages.slang_hy 360 msgctxt "languages.slang_hy" 290 361 msgid "Armenian" 291 362 msgstr "Arménština" 292 363 293 #: ulanguages.slang_hz 364 #: languages.slang_hz 365 msgctxt "languages.slang_hz" 294 366 msgid "Herero" 295 367 msgstr "" 296 368 297 #: ulanguages.slang_ia 369 #: languages.slang_ia 370 msgctxt "languages.slang_ia" 298 371 msgid "Interlingua" 299 372 msgstr "" 300 373 301 #: ulanguages.slang_id 374 #: languages.slang_id 375 msgctxt "languages.slang_id" 302 376 msgid "Indonesian" 303 377 msgstr "" 304 378 305 #: ulanguages.slang_ie 379 #: languages.slang_ie 380 msgctxt "languages.slang_ie" 306 381 msgid "Interlingue" 307 382 msgstr "" 308 383 309 #: ulanguages.slang_ig 384 #: languages.slang_ig 385 msgctxt "languages.slang_ig" 310 386 msgid "Igbo" 311 387 msgstr "" 312 388 313 #: ulanguages.slang_ii 389 #: languages.slang_ii 390 msgctxt "languages.slang_ii" 314 391 msgid "Sichuan Yi" 315 392 msgstr "" 316 393 317 #: ulanguages.slang_ik 394 #: languages.slang_ik 395 msgctxt "languages.slang_ik" 318 396 msgid "Inupiaq" 319 397 msgstr "" 320 398 321 #: ulanguages.slang_io 399 #: languages.slang_io 400 msgctxt "languages.slang_io" 322 401 msgid "Ido" 323 402 msgstr "" 324 403 325 #: ulanguages.slang_is 404 #: languages.slang_is 405 msgctxt "languages.slang_is" 326 406 msgid "Icelandic" 327 407 msgstr "Islandština" 328 408 329 #: ulanguages.slang_it 409 #: languages.slang_it 410 msgctxt "languages.slang_it" 330 411 msgid "Italian" 331 412 msgstr "Italština" 332 413 333 #: ulanguages.slang_iu 414 #: languages.slang_iu 415 msgctxt "languages.slang_iu" 334 416 msgid "Inuktitut" 335 417 msgstr "" 336 418 337 #: ulanguages.slang_ja 419 #: languages.slang_ja 420 msgctxt "languages.slang_ja" 338 421 msgid "Japanese" 339 422 msgstr "Japonština" 340 423 341 #: ulanguages.slang_jv 424 #: languages.slang_jv 425 msgctxt "languages.slang_jv" 342 426 msgid "Javanese" 343 427 msgstr "" 344 428 345 #: ulanguages.slang_ka 429 #: languages.slang_ka 430 msgctxt "languages.slang_ka" 346 431 msgid "Georgian" 347 432 msgstr "Gruzínština" 348 433 349 #: ulanguages.slang_kg 434 #: languages.slang_kg 435 msgctxt "languages.slang_kg" 350 436 msgid "Kongo" 351 437 msgstr "Konžština" 352 438 353 #: ulanguages.slang_ki 439 #: languages.slang_ki 440 msgctxt "languages.slang_ki" 354 441 msgid "Kikuyu" 355 442 msgstr "" 356 443 357 #: ulanguages.slang_kj 444 #: languages.slang_kj 445 msgctxt "languages.slang_kj" 358 446 msgid "Kuanyama" 359 447 msgstr "" 360 448 361 #: ulanguages.slang_kk 449 #: languages.slang_kk 450 msgctxt "languages.slang_kk" 362 451 msgid "Kazakh" 363 452 msgstr "" 364 453 365 #: ulanguages.slang_kl 454 #: languages.slang_kl 455 msgctxt "languages.slang_kl" 366 456 msgid "Greenlandic" 367 457 msgstr "Grónština" 368 458 369 #: ulanguages.slang_km 459 #: languages.slang_km 460 msgctxt "languages.slang_km" 370 461 msgid "Khmer" 371 462 msgstr "" 372 463 373 #: ulanguages.slang_kn 464 #: languages.slang_kn 465 msgctxt "languages.slang_kn" 374 466 msgid "Kannada" 375 467 msgstr "Kannadština" 376 468 377 #: ulanguages.slang_ko 469 #: languages.slang_ko 470 msgctxt "languages.slang_ko" 378 471 msgid "Korean" 379 472 msgstr "Korejština" 380 473 381 #: ulanguages.slang_kr 474 #: languages.slang_kr 475 msgctxt "languages.slang_kr" 382 476 msgid "Kanuri" 383 477 msgstr "" 384 478 385 #: ulanguages.slang_ks 479 #: languages.slang_ks 480 msgctxt "languages.slang_ks" 386 481 msgid "Kashmiri" 387 482 msgstr "" 388 483 389 #: ulanguages.slang_ku 484 #: languages.slang_ku 485 msgctxt "languages.slang_ku" 390 486 msgid "Kurdish" 391 487 msgstr "" 392 488 393 #: ulanguages.slang_kv 489 #: languages.slang_kv 490 msgctxt "languages.slang_kv" 394 491 msgid "Komi" 395 492 msgstr "" 396 493 397 #: ulanguages.slang_kw 494 #: languages.slang_kw 495 msgctxt "languages.slang_kw" 398 496 msgid "Cornish" 399 497 msgstr "Kornština" 400 498 401 #: ulanguages.slang_ky 499 #: languages.slang_ky 500 msgctxt "languages.slang_ky" 402 501 msgid "Kirghiz" 403 502 msgstr "" 404 503 405 #: ulanguages.slang_la 504 #: languages.slang_la 505 msgctxt "languages.slang_la" 406 506 msgid "Latin" 407 507 msgstr "Latina" 408 508 409 #: ulanguages.slang_lb 509 #: languages.slang_lb 510 msgctxt "languages.slang_lb" 410 511 msgid "Luxembourgish" 411 512 msgstr "Lucemburština" 412 513 413 #: ulanguages.slang_lg 514 #: languages.slang_lg 515 msgctxt "languages.slang_lg" 414 516 msgid "Ganda" 415 517 msgstr "" 416 518 417 #: ulanguages.slang_li 519 #: languages.slang_li 520 msgctxt "languages.slang_li" 418 521 msgid "Limburgan" 419 522 msgstr "" 420 523 421 #: ulanguages.slang_ln 524 #: languages.slang_ln 525 msgctxt "languages.slang_ln" 422 526 msgid "Lingala" 423 527 msgstr "" 424 528 425 #: ulanguages.slang_lo 529 #: languages.slang_lo 530 msgctxt "languages.slang_lo" 426 531 msgid "Lao" 427 532 msgstr "Laoština" 428 533 429 #: ulanguages.slang_lt 534 #: languages.slang_lt 535 msgctxt "languages.slang_lt" 430 536 msgid "Lithuanian" 431 537 msgstr "Litevština" 432 538 433 #: ulanguages.slang_lu 539 #: languages.slang_lu 540 msgctxt "languages.slang_lu" 434 541 msgid "Luba-Katanga" 435 542 msgstr "" 436 543 437 #: ulanguages.slang_lv 544 #: languages.slang_lv 545 msgctxt "languages.slang_lv" 438 546 msgid "Latvian" 439 547 msgstr "Lotyština" 440 548 441 #: ulanguages.slang_mg 549 #: languages.slang_mg 550 msgctxt "languages.slang_mg" 442 551 msgid "Malagasy" 443 552 msgstr "" 444 553 445 #: ulanguages.slang_mh 554 #: languages.slang_mh 555 msgctxt "languages.slang_mh" 446 556 msgid "Marshallese" 447 557 msgstr "" 448 558 449 #: ulanguages.slang_mi 559 #: languages.slang_mi 560 msgctxt "languages.slang_mi" 450 561 msgid "Maori" 451 562 msgstr "" 452 563 453 #: ulanguages.slang_mk 564 #: languages.slang_mk 565 msgctxt "languages.slang_mk" 454 566 msgid "Macedonian" 455 567 msgstr "Makedonština" 456 568 457 #: ulanguages.slang_ml 569 #: languages.slang_ml 570 msgctxt "languages.slang_ml" 458 571 msgid "Malayalam" 459 572 msgstr "" 460 573 461 #: ulanguages.slang_mn 574 #: languages.slang_mn 575 msgctxt "languages.slang_mn" 462 576 msgid "Mongolian" 463 577 msgstr "Mongolština" 464 578 465 #: ulanguages.slang_mo 579 #: languages.slang_mo 580 msgctxt "languages.slang_mo" 466 581 msgid "Moldavian" 467 582 msgstr "Moldavština" 468 583 469 #: ulanguages.slang_mr 584 #: languages.slang_mr 585 msgctxt "languages.slang_mr" 470 586 msgid "Marathi" 471 587 msgstr "" 472 588 473 #: ulanguages.slang_ms 589 #: languages.slang_ms 590 msgctxt "languages.slang_ms" 474 591 msgid "Malay" 475 592 msgstr "" 476 593 477 #: ulanguages.slang_mt 594 #: languages.slang_mt 595 msgctxt "languages.slang_mt" 478 596 msgid "Maltese" 479 597 msgstr "" 480 598 481 #: ulanguages.slang_my 599 #: languages.slang_my 600 msgctxt "languages.slang_my" 482 601 msgid "Burmese" 483 602 msgstr "" 484 603 485 #: ulanguages.slang_na 604 #: languages.slang_na 605 msgctxt "languages.slang_na" 486 606 msgid "Nauru" 487 607 msgstr "" 488 608 489 #: ulanguages.slang_nb 609 #: languages.slang_nb 610 msgctxt "languages.slang_nb" 490 611 msgid "Norwegian Bokmaal" 491 612 msgstr "" 492 613 493 #: ulanguages.slang_nd 614 #: languages.slang_nd 615 msgctxt "languages.slang_nd" 494 616 msgid "Ndebele, North" 495 617 msgstr "" 496 618 497 #: ulanguages.slang_ne 619 #: languages.slang_ne 620 msgctxt "languages.slang_ne" 498 621 msgid "Nepali" 499 622 msgstr "" 500 623 501 #: ulanguages.slang_ng 624 #: languages.slang_ng 625 msgctxt "languages.slang_ng" 502 626 msgid "Ndonga" 503 627 msgstr "" 504 628 505 #: ulanguages.slang_nl 629 #: languages.slang_nl 630 msgctxt "languages.slang_nl" 506 631 msgid "Dutch" 507 632 msgstr "Němčina" 508 633 509 #: ulanguages.slang_nl_be 634 #: languages.slang_nl_be 635 msgctxt "languages.slang_nl_be" 510 636 msgid "Flemish" 511 637 msgstr "" 512 638 513 #: ulanguages.slang_nn 639 #: languages.slang_nn 640 msgctxt "languages.slang_nn" 514 641 msgid "Norwegian Nynorsk" 515 642 msgstr "" 516 643 517 #: ulanguages.slang_no 644 #: languages.slang_no 645 msgctxt "languages.slang_no" 518 646 msgid "Norwegian" 519 647 msgstr "Norština" 520 648 521 #: ulanguages.slang_nr 649 #: languages.slang_nr 650 msgctxt "languages.slang_nr" 522 651 msgid "Ndebele, South" 523 652 msgstr "" 524 653 525 #: ulanguages.slang_nv 654 #: languages.slang_nv 655 msgctxt "languages.slang_nv" 526 656 msgid "Navajo" 527 657 msgstr "Navažština" 528 658 529 #: ulanguages.slang_ny 659 #: languages.slang_ny 660 msgctxt "languages.slang_ny" 530 661 msgid "Chichewa" 531 662 msgstr "" 532 663 533 #: ulanguages.slang_oc 664 #: languages.slang_oc 665 msgctxt "languages.slang_oc" 534 666 msgid "Occitan" 535 667 msgstr "" 536 668 537 #: ulanguages.slang_oj 669 #: languages.slang_oj 670 msgctxt "languages.slang_oj" 538 671 msgid "Ojibwa" 539 672 msgstr "" 540 673 541 #: ulanguages.slang_om 674 #: languages.slang_om 675 msgctxt "languages.slang_om" 542 676 msgid "Oromo" 543 677 msgstr "" 544 678 545 #: ulanguages.slang_or 679 #: languages.slang_or 680 msgctxt "languages.slang_or" 546 681 msgid "Oriya" 547 682 msgstr "" 548 683 549 #: ulanguages.slang_os 684 #: languages.slang_os 685 msgctxt "languages.slang_os" 550 686 msgid "Ossetian" 551 687 msgstr "" 552 688 553 #: ulanguages.slang_pa 689 #: languages.slang_pa 690 msgctxt "languages.slang_pa" 554 691 msgid "Panjabi" 555 692 msgstr "" 556 693 557 #: ulanguages.slang_pi 694 #: languages.slang_pi 695 msgctxt "languages.slang_pi" 558 696 msgid "Pali" 559 697 msgstr "" 560 698 561 #: ulanguages.slang_pl 699 #: languages.slang_pl 700 msgctxt "languages.slang_pl" 562 701 msgid "Polish" 563 702 msgstr "Polština" 564 703 565 #: ulanguages.slang_ps 704 #: languages.slang_ps 705 msgctxt "languages.slang_ps" 566 706 msgid "Pushto" 567 707 msgstr "" 568 708 569 #: ulanguages.slang_pt 709 #: languages.slang_pt 710 msgctxt "languages.slang_pt" 570 711 msgid "Portuguese" 571 712 msgstr "Portugalština" 572 713 573 #: ulanguages.slang_pt_br 714 #: languages.slang_pt_br 715 msgctxt "languages.slang_pt_br" 574 716 msgid "Brazilian Portuguese" 575 717 msgstr "Brazislká portugalština" 576 718 577 #: ulanguages.slang_qu 719 #: languages.slang_qu 720 msgctxt "languages.slang_qu" 578 721 msgid "Quechua" 579 722 msgstr "" 580 723 581 #: ulanguages.slang_rm 724 #: languages.slang_rm 725 msgctxt "languages.slang_rm" 582 726 msgid "Raeto-Romance" 583 727 msgstr "" 584 728 585 #: ulanguages.slang_rn 729 #: languages.slang_rn 730 msgctxt "languages.slang_rn" 586 731 msgid "Rundi" 587 732 msgstr "" 588 733 589 #: ulanguages.slang_ro 734 #: languages.slang_ro 735 msgctxt "languages.slang_ro" 590 736 msgid "Romanian" 591 737 msgstr "Romština" 592 738 593 #: ulanguages.slang_ru 739 #: languages.slang_ru 740 msgctxt "languages.slang_ru" 594 741 msgid "Russian" 595 742 msgstr "Ruština" 596 743 597 #: ulanguages.slang_rw 744 #: languages.slang_rw 745 msgctxt "languages.slang_rw" 598 746 msgid "Kinyarwanda" 599 747 msgstr "" 600 748 601 #: ulanguages.slang_sa 749 #: languages.slang_sa 750 msgctxt "languages.slang_sa" 602 751 msgid "Sanskrit" 603 752 msgstr "" 604 753 605 #: ulanguages.slang_sc 754 #: languages.slang_sc 755 msgctxt "languages.slang_sc" 606 756 msgid "Sardinian" 607 757 msgstr "" 608 758 609 #: ulanguages.slang_sd 759 #: languages.slang_sd 760 msgctxt "languages.slang_sd" 610 761 msgid "Sindhi" 611 762 msgstr "" 612 763 613 #: ulanguages.slang_se 764 #: languages.slang_se 765 msgctxt "languages.slang_se" 614 766 msgid "Northern Sami" 615 767 msgstr "" 616 768 617 #: ulanguages.slang_sg 769 #: languages.slang_sg 770 msgctxt "languages.slang_sg" 618 771 msgid "Sango" 619 772 msgstr "" 620 773 621 #: ulanguages.slang_si 774 #: languages.slang_si 775 msgctxt "languages.slang_si" 622 776 msgid "Sinhalese" 623 777 msgstr "" 624 778 625 #: ulanguages.slang_sk 779 #: languages.slang_sk 780 msgctxt "languages.slang_sk" 626 781 msgid "Slovak" 627 782 msgstr "Slovenština" 628 783 629 #: ulanguages.slang_sl 784 #: languages.slang_sl 785 msgctxt "languages.slang_sl" 630 786 msgid "Slovenian" 631 787 msgstr "Slovinština" 632 788 633 #: ulanguages.slang_sm 789 #: languages.slang_sm 790 msgctxt "languages.slang_sm" 634 791 msgid "Samoan" 635 792 msgstr "" 636 793 637 #: ulanguages.slang_sn 794 #: languages.slang_sn 795 msgctxt "languages.slang_sn" 638 796 msgid "Shona" 639 797 msgstr "" 640 798 641 #: ulanguages.slang_so 799 #: languages.slang_so 800 msgctxt "languages.slang_so" 642 801 msgid "Somali" 643 802 msgstr "" 644 803 645 #: ulanguages.slang_sq 804 #: languages.slang_sq 805 msgctxt "languages.slang_sq" 646 806 msgid "Albanian" 647 807 msgstr "Albánština" 648 808 649 #: ulanguages.slang_sr 809 #: languages.slang_sr 810 msgctxt "languages.slang_sr" 650 811 msgid "Serbian" 651 812 msgstr "" 652 813 653 #: ulanguages.slang_ss 814 #: languages.slang_ss 815 msgctxt "languages.slang_ss" 654 816 msgid "Swati" 655 817 msgstr "" 656 818 657 #: ulanguages.slang_st 819 #: languages.slang_st 820 msgctxt "languages.slang_st" 658 821 msgid "Sotho, Southern" 659 822 msgstr "" 660 823 661 #: ulanguages.slang_su 824 #: languages.slang_su 825 msgctxt "languages.slang_su" 662 826 msgid "Sundanese" 663 827 msgstr "Sundština" 664 828 665 #: ulanguages.slang_sv 829 #: languages.slang_sv 830 msgctxt "languages.slang_sv" 666 831 msgid "Swedish" 667 832 msgstr "Švédština" 668 833 669 #: ulanguages.slang_sw 834 #: languages.slang_sw 835 msgctxt "languages.slang_sw" 670 836 msgid "Swahili" 671 837 msgstr "" 672 838 673 #: ulanguages.slang_ta 839 #: languages.slang_ta 840 msgctxt "languages.slang_ta" 674 841 msgid "Tamil" 675 842 msgstr "" 676 843 677 #: ulanguages.slang_te 844 #: languages.slang_te 845 msgctxt "languages.slang_te" 678 846 msgid "Telugu" 679 847 msgstr "" 680 848 681 #: ulanguages.slang_tg 849 #: languages.slang_tg 850 msgctxt "languages.slang_tg" 682 851 msgid "Tajik" 683 852 msgstr "" 684 853 685 #: ulanguages.slang_th 854 #: languages.slang_th 855 msgctxt "languages.slang_th" 686 856 msgid "Thai" 687 857 msgstr "" 688 858 689 #: ulanguages.slang_ti 859 #: languages.slang_ti 860 msgctxt "languages.slang_ti" 690 861 msgid "Tigrinya" 691 862 msgstr "" 692 863 693 #: ulanguages.slang_tk 864 #: languages.slang_tk 865 msgctxt "languages.slang_tk" 694 866 msgid "Turkmen" 695 867 msgstr "" 696 868 697 #: ulanguages.slang_tl 869 #: languages.slang_tl 870 msgctxt "languages.slang_tl" 698 871 msgid "Tagalog" 699 872 msgstr "" 700 873 701 #: ulanguages.slang_tn 874 #: languages.slang_tn 875 msgctxt "languages.slang_tn" 702 876 msgid "Tswana" 703 877 msgstr "" 704 878 705 #: ulanguages.slang_to 879 #: languages.slang_to 880 msgctxt "languages.slang_to" 706 881 msgid "Tonga" 707 882 msgstr "" 708 883 709 #: ulanguages.slang_tr 884 #: languages.slang_tr 885 msgctxt "languages.slang_tr" 710 886 msgid "Turkish" 711 887 msgstr "Turečtina" 712 888 713 #: ulanguages.slang_ts 889 #: languages.slang_ts 890 msgctxt "languages.slang_ts" 714 891 msgid "Tsonga" 715 892 msgstr "" 716 893 717 #: ulanguages.slang_tt 894 #: languages.slang_tt 895 msgctxt "languages.slang_tt" 718 896 msgid "Tatar" 719 897 msgstr "Tatarština" 720 898 721 #: ulanguages.slang_tw 899 #: languages.slang_tw 900 msgctxt "languages.slang_tw" 722 901 msgid "Twi" 723 902 msgstr "" 724 903 725 #: ulanguages.slang_ty 904 #: languages.slang_ty 905 msgctxt "languages.slang_ty" 726 906 msgid "Tahitian" 727 907 msgstr "" 728 908 729 #: ulanguages.slang_ug 909 #: languages.slang_ug 910 msgctxt "languages.slang_ug" 730 911 msgid "Uighur" 731 912 msgstr "" 732 913 733 #: ulanguages.slang_uk 914 #: languages.slang_uk 915 msgctxt "languages.slang_uk" 734 916 msgid "Ukrainian" 735 917 msgstr "Ukrajinština" 736 918 737 #: ulanguages.slang_ur 919 #: languages.slang_ur 920 msgctxt "languages.slang_ur" 738 921 msgid "Urdu" 739 922 msgstr "" 740 923 741 #: ulanguages.slang_uz 924 #: languages.slang_uz 925 msgctxt "languages.slang_uz" 742 926 msgid "Uzbek" 743 927 msgstr "" 744 928 745 #: ulanguages.slang_ve 929 #: languages.slang_ve 930 msgctxt "languages.slang_ve" 746 931 msgid "Venda" 747 932 msgstr "" 748 933 749 #: ulanguages.slang_vi 934 #: languages.slang_vi 935 msgctxt "languages.slang_vi" 750 936 msgid "Vietnamese" 751 937 msgstr "Vietnamština" 752 938 753 #: ulanguages.slang_vo 939 #: languages.slang_vo 940 msgctxt "languages.slang_vo" 754 941 msgid "Volapuk" 755 942 msgstr "" 756 943 757 #: ulanguages.slang_wa758 msgctxt " ulanguages.slang_wa"944 #: languages.slang_wa 945 msgctxt "languages.slang_wa" 759 946 msgid "Walloon" 760 947 msgstr "" 761 948 762 #: ulanguages.slang_wo 949 #: languages.slang_wo 950 msgctxt "languages.slang_wo" 763 951 msgid "Wolof" 764 952 msgstr "" 765 953 766 #: ulanguages.slang_xh 954 #: languages.slang_xh 955 msgctxt "languages.slang_xh" 767 956 msgid "Xhosa" 768 957 msgstr "" 769 958 770 #: ulanguages.slang_yi 959 #: languages.slang_yi 960 msgctxt "languages.slang_yi" 771 961 msgid "Yiddish" 772 962 msgstr "" 773 963 774 #: ulanguages.slang_yo 964 #: languages.slang_yo 965 msgctxt "languages.slang_yo" 775 966 msgid "Yoruba" 776 967 msgstr "" 777 968 778 #: ulanguages.slang_za 969 #: languages.slang_za 970 msgctxt "languages.slang_za" 779 971 msgid "Zhuang" 780 972 msgstr "" 781 973 782 #: ulanguages.slang_zh 974 #: languages.slang_zh 975 msgctxt "languages.slang_zh" 783 976 msgid "Chinese" 784 977 msgstr "Čínština" 785 978 786 #: ulanguages.slang_zu 979 #: languages.slang_zh_hans 980 msgid "Simplified Chinese" 981 msgstr "" 982 983 #: languages.slang_zh_hant 984 msgid "Traditional Chinese" 985 msgstr "" 986 987 #: languages.slang_zu 988 msgctxt "languages.slang_zu" 787 989 msgid "Zulu" 788 990 msgstr "Zuluština" -
trunk/Packages/Common/Languages/Pool.cs.po
r84 r85 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 3 "Project-Id-Version: \n" 5 4 "POT-Creation-Date: \n" … … 7 6 "Last-Translator: Chronos <robie@centrum.cz>\n" 8 7 "Language-Team: \n" 8 "Language: cs\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 3.0.1\n" 11 13 12 #: upool.sobjectpoolempty 14 #: pool.sobjectpoolempty 15 msgctxt "pool.sobjectpoolempty" 13 16 msgid "Object pool is empty" 14 17 msgstr "Zásobník objektů je prázdný" 15 18 16 #: upool.sreleaseerror 19 #: pool.sreleaseerror 20 msgctxt "pool.sreleaseerror" 17 21 msgid "Unknown object for release from pool" 18 22 msgstr "Neznýmý objekt pro uvolnění ze zásobníku" -
trunk/Packages/Common/Languages/ResetableThread.cs.po
r84 r85 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 3 "Project-Id-Version: \n" 5 4 "POT-Creation-Date: \n" … … 7 6 "Last-Translator: Chronos <robie@centrum.cz>\n" 8 7 "Language-Team: \n" 8 "Language: cs\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 3.0.1\n" 11 13 12 #: uresetablethread.swaiterror 14 #: resetablethread.swaiterror 15 msgctxt "resetablethread.swaiterror" 13 16 msgid "WaitFor error" 14 17 msgstr "Chyba WaitFor" -
trunk/Packages/Common/Languages/ScaleDPI.cs.po
r84 r85 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 3 "Project-Id-Version: \n" 5 4 "POT-Creation-Date: \n" … … 7 6 "Last-Translator: \n" 8 7 "Language-Team: \n" 8 "Language: cs\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "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" 13 13 14 #: uscaledpi.swrongdpi 14 #: scaledpi.swrongdpi 15 #, object-pascal-format 16 msgctxt "scaledpi.swrongdpi" 15 17 msgid "Wrong DPI [%d,%d]" 16 18 msgstr "Chybné DPI [%d,%d]" -
trunk/Packages/Common/Languages/Threading.cs.po
r84 r85 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 3 "Project-Id-Version: \n" 5 4 "POT-Creation-Date: \n" … … 7 6 "Last-Translator: Chronos <robie@centrum.cz>\n" 8 7 "Language-Team: \n" 8 "Language: cs\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 3.0.1\n" 11 13 12 #: uthreading.scurrentthreadnotfound 14 #: threading.scurrentthreadnotfound 15 #, object-pascal-format 16 msgctxt "threading.scurrentthreadnotfound" 13 17 msgid "Current thread ID %d not found in virtual thread list." 14 18 msgstr "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} 1 unit LastOpenedList; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Registry, URegistry, Menus, XMLConf, DOM;6 Classes, SysUtils, Registry, RegistryEx, Menus, XMLConf, DOM; 9 7 10 8 type … … 84 82 destructor TLastOpenedList.Destroy; 85 83 begin 86 Items.Free;84 FreeAndNil(Items); 87 85 inherited; 88 86 end; … … 94 92 begin 95 93 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; 97 100 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; 102 103 end; 103 104 end; … … 193 194 194 195 end. 195 -
trunk/Packages/Common/ListViewSort.pas
r84 r85 1 unit UListViewSort;1 unit ListViewSort; 2 2 3 3 // Date: 2019-05-17 4 5 {$mode delphi}6 4 7 5 interface … … 9 7 uses 10 8 {$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; 13 11 14 12 type … … 19 17 TCompareEvent = function (Item1, Item2: TObject): Integer of object; 20 18 TListFilterEvent = procedure (ListViewSort: TListViewSort) of object; 19 20 TObjects = TObjectList<TObject>; 21 21 22 22 { TListViewSort } … … 52 52 {$ENDIF} 53 53 public 54 List: TFPGObjectList<TObject>;55 Source: TFPGObjectList<TObject>;54 Source: TObjects; 55 List: TObjects; 56 56 constructor Create(AOwner: TComponent); override; 57 57 destructor Destroy; override; … … 81 81 FOnChange: TNotifyEvent; 82 82 FStringGrid1: TStringGrid; 83 procedure DoOnChange; 83 84 procedure GridDoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 84 85 procedure GridDoOnResize(Sender: TObject); … … 90 91 function TextEnteredColumn(Index: Integer): Boolean; 91 92 function GetColValue(Index: Integer): string; 93 procedure Reset; 92 94 property StringGrid: TStringGrid read FStringGrid1 write FStringGrid1; 93 95 published … … 147 149 destructor TListViewEx.Destroy; 148 150 begin 149 inherited Destroy;151 inherited; 150 152 end; 151 153 152 154 { TListViewFilter } 155 156 procedure TListViewFilter.DoOnChange; 157 begin 158 if Assigned(FOnChange) then FOnChange(Self); 159 end; 153 160 154 161 procedure TListViewFilter.GridDoOnKeyUp(Sender: TObject; var Key: Word; 155 162 Shift: TShiftState); 156 163 begin 157 if Assigned(FOnChange) then 158 FOnChange(Self); 164 DoOnChange; 159 165 end; 160 166 … … 229 235 end; 230 236 237 procedure TListViewFilter.Reset; 238 var 239 I: Integer; 240 begin 241 with StringGrid do 242 for I := 0 to ColCount - 1 do 243 Cells[I, 0] := ''; 244 DoOnChange; 245 end; 246 231 247 { TListViewSort } 232 248 … … 322 338 ListViewSortCompare: TCompareEvent; 323 339 324 function ListViewCompare(const Item1, Item2: TObject): Integer;340 function ListViewCompare(constref Item1, Item2: TObject): Integer; 325 341 begin 326 342 Result := ListViewSortCompare(Item1, Item2); … … 333 349 ListViewSortCompare := Compare; 334 350 if (List.Count > 0) then 335 List.Sort( ListViewCompare);351 List.Sort(TComparer<TObject>.Construct(ListViewCompare)); 336 352 end; 337 353 … … 339 355 begin 340 356 if Assigned(FOnFilter) then FOnFilter(Self) 341 else if Assigned(Source) then 342 List.Assign(Source) else 357 else if Assigned(Source) then begin 343 358 List.Clear; 359 List.AddRange(Source); 360 end else List.Clear; 344 361 if ListView.Items.Count <> List.Count then 345 362 ListView.Items.Count := List.Count; … … 396 413 begin 397 414 inherited; 398 List := T FPGObjectList<TObject>.Create;399 List. FreeObjects := False;415 List := TObjects.Create; 416 List.OwnsObjects := False; 400 417 end; 401 418 402 419 destructor TListViewSort.Destroy; 403 420 begin 404 List.Free;421 FreeAndNil(List); 405 422 inherited; 406 423 end; -
trunk/Packages/Common/Memory.pas
r84 r85 1 unit UMemory; 2 3 {$mode Delphi}{$H+} 1 unit Memory; 4 2 5 3 interface … … 44 42 end; 45 43 44 46 45 implementation 47 46 … … 50 49 procedure TPositionMemory.SetSize(AValue: Integer); 51 50 begin 52 inherited SetSize(AValue);51 inherited; 53 52 if FPosition > FSize then FPosition := FSize; 54 53 end; … … 107 106 begin 108 107 Size := 0; 109 inherited Destroy;108 inherited; 110 109 end; 111 110 … … 121 120 122 121 end. 123 -
trunk/Packages/Common/MetaCanvas.pas
r84 r85 1 unit UMetaCanvas; 2 3 {$mode delphi} 1 unit MetaCanvas; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Graphics, Contnrs, Types, fgl;6 Classes, SysUtils, Graphics, Types, Generics.Collections; 9 7 10 8 type … … 19 17 end; 20 18 21 TCanvasObjects = class(T FPGObjectList<TCanvasObject>)19 TCanvasObjects = class(TObjectList<TCanvasObject>) 22 20 end; 23 21 … … 65 63 66 64 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) 67 91 Pen: TPen; 68 92 Brush: TBrush; … … 135 159 procedure DoMoveTo(X, Y: Integer); override; 136 160 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; 137 164 public 138 165 Objects: TCanvasObjects; … … 142 169 procedure RoundRect(const Rect: TRect; RX,RY: Integer); overload; 143 170 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; 145 175 procedure Ellipse(x1, y1, x2, y2: Integer); override; 146 176 procedure StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic); override; … … 161 191 162 192 uses 163 UGeometric, LCLIntf; 193 Geometric, LCLIntf; 194 195 { TCanvasPolyBezier } 196 197 procedure TCanvasPolyBezier.Paint(Canvas: TCanvas); 198 begin 199 Canvas.Pen.Assign(Pen); 200 Canvas.Brush.Assign(Brush); 201 Canvas.PolyBezier(Points); 202 end; 203 204 procedure TCanvasPolyBezier.Zoom(Factor: Double); 205 var 206 I: Integer; 207 begin 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); 212 end; 213 214 procedure TCanvasPolyBezier.Move(Delta: TPoint); 215 var 216 I: Integer; 217 begin 218 for I := 0 to High(Points) do 219 Points[I] := AddPoint(Points[I], Delta); 220 end; 221 222 constructor TCanvasPolyBezier.Create; 223 begin 224 Pen := TPen.Create; 225 Brush := TBrush.Create; 226 end; 227 228 destructor TCanvasPolyBezier.Destroy; 229 begin 230 FreeAndNil(Brush); 231 FreeAndNil(Pen); 232 inherited; 233 end; 234 235 { TCanvasPolyline } 236 237 procedure TCanvasPolyline.Paint(Canvas: TCanvas); 238 begin 239 Canvas.Pen.Assign(Pen); 240 Canvas.Brush.Assign(Brush); 241 Canvas.Polyline(Points); 242 end; 243 244 procedure TCanvasPolyline.Zoom(Factor: Double); 245 var 246 I: Integer; 247 begin 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); 252 end; 253 254 procedure TCanvasPolyline.Move(Delta: TPoint); 255 var 256 I: Integer; 257 begin 258 for I := 0 to High(Points) do 259 Points[I] := AddPoint(Points[I], Delta); 260 end; 261 262 constructor TCanvasPolyline.Create; 263 begin 264 Pen := TPen.Create; 265 Brush := TBrush.Create; 266 end; 267 268 destructor TCanvasPolyline.Destroy; 269 begin 270 FreeAndNil(Brush); 271 FreeAndNil(Pen); 272 inherited; 273 end; 164 274 165 275 { TCanvasPie } … … 306 416 destructor TCanvasPolygon.Destroy; 307 417 begin 308 Brush.Free;309 Pen.Free;418 FreeAndNil(Brush); 419 FreeAndNil(Pen); 310 420 inherited; 311 421 end; … … 502 612 end; 503 613 504 procedure TMetaCanvas.Polygon(Points: PPoint; NumPts: Integer; Winding: boolean614 procedure TMetaCanvas.Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean 505 615 ); 506 616 var … … 508 618 I: Integer; 509 619 begin 620 APoints := nil; 510 621 SetLength(APoints, NumPts); 511 622 for I := 0 to High(APoints) do 512 623 APoints[I] := Points[I]; 513 624 DoPolygon(APoints); 625 end; 626 627 procedure TMetaCanvas.Polyline(Points: PPoint; NumPts: Integer); 628 var 629 APoints: array of TPoint; 630 I: Integer; 631 begin 632 APoints := nil; 633 SetLength(APoints, NumPts); 634 for I := 0 to High(APoints) do 635 APoints[I] := Points[I]; 636 DoPolyline(APoints); 637 end; 638 639 procedure TMetaCanvas.PolyBezier(Points: PPoint; NumPts: Integer; 640 Filled: Boolean; Continuous: Boolean); 641 begin 642 DoPolyBezier(Points, NumPts, Filled, Continuous); 514 643 end; 515 644 … … 581 710 end; 582 711 712 procedure TMetaCanvas.DoPolyline(const Points: array of TPoint); 713 var 714 NewObj: TCanvasPolyline; 715 I: Integer; 716 begin 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); 724 end; 725 726 procedure TMetaCanvas.DoPolyBezier(Points: PPoint; NumPts: Integer; 727 Filled: Boolean; Continuous: Boolean); 728 var 729 NewObj: TCanvasPolyBezier; 730 I: Integer; 731 begin 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); 739 end; 740 583 741 procedure TMetaCanvas.FillRect(const ARect: TRect); 584 742 begin … … 665 823 666 824 end. 667 -
trunk/Packages/Common/PersistentForm.pas
r84 r85 1 unit UPersistentForm; 2 3 {$mode delphi} 4 5 // Date: 2020-11-26 1 unit PersistentForm; 6 2 7 3 interface 8 4 9 5 uses 10 Classes, SysUtils, Forms, URegistry, LCLIntf, Registry, Controls, ComCtrls,6 Classes, SysUtils, Forms, RegistryEx, LCLIntf, Registry, Controls, ComCtrls, 11 7 ExtCtrls, LCLType; 12 8 … … 23 19 procedure SaveControl(Control: TControl); 24 20 public 25 FormNormalSize: TRect;26 21 FormRestoredSize: TRect; 27 22 FormWindowState: TWindowState; … … 157 152 RootKey := RegistryContext.RootKey; 158 153 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 166 155 // Restored size 167 156 FormRestoredSize.Left := ReadIntegerWithDefault('RestoredLeft', FormRestoredSize.Left); … … 171 160 FormRestoredSize.Bottom := ReadIntegerWithDefault('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top) 172 161 + FormRestoredSize.Top; 162 173 163 // Other state 174 164 FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(FormWindowState))); … … 185 175 RootKey := RegistryContext.RootKey; 186 176 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 193 179 WriteInteger('RestoredWidth', FormRestoredSize.Right - FormRestoredSize.Left); 194 180 WriteInteger('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top); 195 181 WriteInteger('RestoredTop', FormRestoredSize.Top); 196 182 WriteInteger('RestoredLeft', FormRestoredSize.Left); 183 197 184 // Other state 198 185 WriteInteger('WindowState', Integer(FormWindowState)); … … 259 246 begin 260 247 Self.Form := Form; 248 261 249 // Set default 262 FormNormalSize := Bounds((Screen.Width - Form.Width) div 2,263 (Screen.Height - Form.Height) div 2, Form.Width, Form.Height);264 250 FormRestoredSize := Bounds((Screen.Width - Form.Width) div 2, 265 251 (Screen.Height - Form.Height) div 2, Form.Width, Form.Height); … … 269 255 LoadFromRegistry(RegistryContext); 270 256 271 if not EqualRect(FormNormalSize, FormRestoredSize) or 272 DefaultMaximized then begin 257 if (FormWindowState = wsMaximized) or DefaultMaximized then begin 273 258 // Restore to maximized state 274 259 Form.WindowState := wsNormal; … … 279 264 // Restore to normal state 280 265 Form.WindowState := wsNormal; 281 if FEntireVisible then Form NormalSize := CheckEntireVisible(FormNormalSize)266 if FEntireVisible then FormRestoredSize := CheckEntireVisible(FormRestoredSize) 282 267 else if FMinVisiblePart > 0 then 283 FormNormalSize := CheckPartVisible(FormNormalSize, FMinVisiblePart);284 if not EqualRect(Form NormalSize, Form.BoundsRect) then285 Form.BoundsRect := Form NormalSize;268 FormRestoredSize := CheckPartVisible(FormRestoredSize, FMinVisiblePart); 269 if not EqualRect(FormRestoredSize, Form.BoundsRect) then 270 Form.BoundsRect := FormRestoredSize; 286 271 end; 287 272 if FormFullScreen then SetFullScreen(True); … … 292 277 begin 293 278 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; 299 289 SaveToRegistry(RegistryContext); 300 290 SaveControl(Form); … … 314 304 if State then begin 315 305 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; 319 313 FormWindowState := Form.WindowState; 314 Form.WindowState := wsMaximized; 315 Form.WindowState := wsNormal; 320 316 ShowWindow(Form.Handle, SW_SHOWFULLSCREEN); 321 317 {$IFDEF WINDOWS} … … 329 325 ShowWindow(Form.Handle, SW_SHOWNORMAL); 330 326 if FormWindowState = wsNormal then begin 331 Form.BoundsRect := FormNormalSize; 327 Form.WindowState := wsNormal; 328 Form.BoundsRect := FormRestoredSize; 332 329 end else 333 330 if FormWindowState = wsMaximized then begin … … 339 336 340 337 end. 341 -
trunk/Packages/Common/Pool.pas
r84 r85 1 unit UPool; 2 3 {$mode Delphi}{$H+} 1 unit Pool; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, syncobjs, fgl, UThreading;6 Classes, SysUtils, syncobjs, Generics.Collections, Threading; 9 7 10 8 type … … 22 20 function NewItemObject: TObject; virtual; 23 21 public 24 Items: T FPGObjectList<TObject>;25 FreeItems: T FPGObjectList<TObject>;22 Items: TObjectList<TObject>; 23 FreeItems: TObjectList<TObject>; 26 24 function Acquire: TObject; virtual; 27 25 procedure Release(Item: TObject); virtual; … … 108 106 constructor TThreadedPool.Create; 109 107 begin 110 inherited Create;108 inherited; 111 109 Lock := TCriticalSection.Create; 112 110 end; … … 116 114 TotalCount := 0; 117 115 Lock.Free; 118 inherited Destroy;116 inherited; 119 117 end; 120 118 … … 185 183 begin 186 184 inherited; 187 Items := T FPGObjectList<TObject>.Create;188 FreeItems := T FPGObjectList<TObject>.Create;189 FreeItems. FreeObjects := False;185 Items := TObjectList<TObject>.Create; 186 FreeItems := TObjectList<TObject>.Create; 187 FreeItems.OwnsObjects := False; 190 188 FReleaseEvent := TEvent.Create(nil, False, False, ''); 191 189 end; … … 201 199 202 200 end. 203 -
trunk/Packages/Common/PrefixMultiplier.pas
r84 r85 1 unit UPrefixMultiplier;1 unit PrefixMultiplier; 2 2 3 3 // Date: 2010-06-01 4 5 {$mode delphi}6 4 7 5 interface … … 33 31 ( 34 32 (ShortText: 'y'; FullText: 'yocto'; Value: 1e-24), 35 33 (ShortText: 'z'; FullText: 'zepto'; Value: 1e-21), 36 34 (ShortText: 'a'; FullText: 'atto'; Value: 1e-18), 37 35 (ShortText: 'f'; FullText: 'femto'; Value: 1e-15), … … 54 52 ( 55 53 (ShortText: 'ys'; FullText: 'yocto'; Value: 1e-24), 56 54 (ShortText: 'zs'; FullText: 'zepto'; Value: 1e-21), 57 55 (ShortText: 'as'; FullText: 'atto'; Value: 1e-18), 58 56 (ShortText: 'fs'; FullText: 'femto'; Value: 1e-15), … … 126 124 127 125 end. 128 -
trunk/Packages/Common/RegistryEx.pas
r84 r85 1 unit URegistry; 2 3 {$MODE delphi} 1 unit RegistryEx; 4 2 5 3 interface … … 48 46 HKEY_CURRENT_CONFIG, HKEY_DYN_DATA); 49 47 48 50 49 implementation 51 52 50 53 51 { TRegistryContext } … … 132 130 function TRegistryEx.OpenKey(const Key: string; CanCreate: Boolean): Boolean; 133 131 begin 134 {$IFDEF Linux}132 {$IFDEF UNIX} 135 133 //CloseKey; 136 134 {$ENDIF} … … 140 138 function TRegistryEx.GetCurrentContext: TRegistryContext; 141 139 begin 142 Result.Key := CurrentPath;140 Result.Key := String(CurrentPath); 143 141 Result.RootKey := RootKey; 144 142 end; -
trunk/Packages/Common/ResetableThread.pas
r84 r85 1 unit UResetableThread; 2 3 {$mode Delphi}{$H+} 1 unit ResetableThread; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, syncobjs, UThreading, UPool;6 Classes, SysUtils, syncobjs, Threading, Pool; 9 7 10 8 type … … 167 165 FreeAndNil(FStopEvent); 168 166 FreeAndNil(FLock); 169 inherited Destroy;167 inherited; 170 168 end; 171 169 … … 286 284 constructor TThreadPool.Create; 287 285 begin 288 inherited Create;286 inherited; 289 287 end; 290 288 … … 293 291 TotalCount := 0; 294 292 WaitForEmpty; 295 inherited Destroy;293 inherited; 296 294 end; 297 295 298 296 end. 299 -
trunk/Packages/Common/ScaleDPI.pas
r84 r85 1 unit UScaleDPI;1 unit ScaleDPI; 2 2 3 3 { See: http://wiki.lazarus.freepascal.org/High_DPI } 4 4 5 {$mode delphi}{$H+}6 7 5 interface 8 6 9 7 uses 10 Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, StdCtrls,11 Contnrs;8 Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, 9 Generics.Collections; 12 10 13 11 type 12 TControlDimensions = class; 14 13 15 14 { TControlDimension } … … 18 17 BoundsRect: TRect; 19 18 FontHeight: Integer; 20 Controls: T ObjectList; // TList<TControlDimension>19 Controls: TControlDimensions; 21 20 // Class specifics 22 21 ButtonSize: TPoint; // TToolBar … … 26 25 constructor Create; 27 26 destructor Destroy; override; 27 end; 28 29 TControlDimensions = class(TObjectList<TControlDimension>) 28 30 end; 29 31 … … 73 75 constructor TControlDimension.Create; 74 76 begin 75 Controls := T ObjectList.Create;77 Controls := TControlDimensions.Create; 76 78 end; 77 79 … … 79 81 begin 80 82 FreeAndNil(Controls); 81 inherited Destroy;83 inherited; 82 84 end; 83 85 … … 212 214 TempBmp: TBitmap; 213 215 Temp: array of TBitmap; 214 NewWidth, NewHeight: integer; 216 NewWidth: Integer; 217 NewHeight: Integer; 215 218 I: Integer; 216 219 begin 217 220 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; 252 266 end; 253 267 … … 327 341 with TCoolBar(Control) do begin 328 342 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; 337 358 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; 345 362 end; 346 363 -
trunk/Packages/Common/StopWatch.pas
r7 r85 5 5 6 6 uses 7 {$IFDEF W indows}Windows,{$ENDIF}7 {$IFDEF WINDOWS}Windows,{$ENDIF} 8 8 SysUtils, DateUtils; 9 9 … … 32 32 end; 33 33 34 34 35 implementation 35 36 … … 40 41 fIsRunning := False; 41 42 42 {$IFDEF W indows}43 {$IFDEF WINDOWS} 43 44 fIsHighResolution := QueryPerformanceFrequency(fFrequency) ; 44 45 {$ELSE} -
trunk/Packages/Common/StringTable.pas
r84 r85 1 unit UStringTable; 2 3 {$mode objfpc}{$H+} 1 unit StringTable; 4 2 5 3 interface … … 71 69 end; 72 70 73 74 71 end. 75 -
trunk/Packages/Common/SyncCounter.pas
r84 r85 1 unit USyncCounter; 2 3 {$mode delphi} 1 unit SyncCounter; 4 2 5 3 interface … … 25 23 procedure Assign(Source: TSyncCounter); 26 24 end; 25 27 26 28 27 implementation … … 69 68 begin 70 69 Lock.Free; 71 inherited Destroy;70 inherited; 72 71 end; 73 72 … … 79 78 80 79 end. 81 -
trunk/Packages/Common/Theme.pas
r84 r85 1 unit UTheme;1 unit Theme; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, Graphics, ComCtrls, Controls, ExtCtrls, Menus, StdCtrls, 7 Spin, Forms, Contnrs, Grids;7 Spin, Forms, Generics.Collections, Grids; 8 8 9 9 type … … 19 19 { TThemes } 20 20 21 TThemes = class(TObjectList )21 TThemes = class(TObjectList<TTheme>) 22 22 function AddNew(Name: string): TTheme; 23 23 function FindByName(Name: string): TTheme; … … 42 42 end; 43 43 44 const 45 ThemeNameSystem = 'System'; 46 ThemeNameLight = 'Light'; 47 ThemeNameDark = 'Dark'; 48 44 49 procedure Register; 50 45 51 46 52 implementation … … 74 80 procedure TThemes.LoadToStrings(Strings: TStrings); 75 81 var 76 Theme: TTheme;82 I: Integer; 77 83 begin 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; 81 95 end; 82 96 … … 97 111 inherited; 98 112 Themes := TThemes.Create; 99 with Themes.AddNew( 'System') do begin113 with Themes.AddNew(ThemeNameSystem) do begin 100 114 ColorWindow := clWindow; 101 115 ColorWindowText := clWindowText; … … 105 119 end; 106 120 Theme := TTheme(Themes.First); 107 with Themes.AddNew( 'Dark') do begin121 with Themes.AddNew(ThemeNameDark) do begin 108 122 ColorWindow := RGBToColor($20, $20, $20); 109 123 ColorWindowText := clWhite; … … 112 126 ColorControlSelected := RGBToColor(96, 125, 155); 113 127 end; 114 with Themes.AddNew( 'Light') do begin128 with Themes.AddNew(ThemeNameLight) do begin 115 129 ColorWindow := clWhite; 116 130 ColorWindowText := clBlack; … … 123 137 destructor TThemeManager.Destroy; 124 138 begin 125 Themes.Free;126 inherited Destroy;139 FreeAndNil(Themes); 140 inherited; 127 141 end; 128 142 … … 167 181 procedure TThemeManager.UseTheme(Form: TForm); 168 182 begin 169 if not Used and (FTheme.Name = 'System') then Exit;183 if not Used and (FTheme.Name = ThemeNameSystem) then Exit; 170 184 ApplyTheme(Form); 171 185 Used := True; 172 186 end; 173 187 174 175 188 end. -
trunk/Packages/Common/Threading.pas
r84 r85 1 unit UThreading; 2 3 {$mode delphi} 1 unit Threading; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Forms, Contnrs, SyncObjs;6 Classes, SysUtils, Forms, Generics.Collections, SyncObjs; 9 7 10 8 type 11 9 TExceptionEvent = procedure (Sender: TObject; E: Exception) of object; 12 10 TMethodCall = procedure of object; 13 14 11 15 12 { TVirtualThread } … … 22 19 function GetSuspended: Boolean; virtual; abstract; 23 20 function GetTerminated: Boolean; virtual; abstract; 24 function GetThreadId: Integer; virtual; abstract;21 function GetThreadId: TThreadID; virtual; abstract; 25 22 procedure SetFreeOnTerminate(const AValue: Boolean); virtual; abstract; 26 23 procedure SetPriority(const AValue: TThreadPriority); virtual; abstract; … … 42 39 property Terminated: Boolean read GetTerminated write SetTerminated; 43 40 property Finished: Boolean read GetFinished; 44 property ThreadId: Integerread GetThreadId;41 property ThreadId: TThreadID read GetThreadId; 45 42 end; 46 43 … … 68 65 function GetSuspended: Boolean; override; 69 66 function GetTerminated: Boolean; override; 70 function GetThreadId: Integer; override;67 function GetThreadId: TThreadID; override; 71 68 procedure SetFreeOnTerminate(const AValue: Boolean); override; 72 69 procedure SetPriority(const AValue: TThreadPriority); override; … … 102 99 { TThreadList } 103 100 104 TThreadList = class(TObjectList )105 function FindById(Id: Integer): TVirtualThread;101 TThreadList = class(TObjectList<TVirtualThread>) 102 function FindById(Id: TThreadID): TVirtualThread; 106 103 constructor Create; virtual; 107 104 end; … … 164 161 if MainThreadID = ThreadID then Method 165 162 else begin 166 Thread := ThreadList.FindById(ThreadID); 163 try 164 ThreadListLock.Acquire; 165 Thread := ThreadList.FindById(ThreadID); 166 finally 167 ThreadListLock.Release; 168 end; 167 169 if Assigned(Thread) then begin 168 170 Thread.Synchronize(Method); … … 173 175 { TThreadList } 174 176 175 function TThreadList.FindById(Id: Integer): TVirtualThread;177 function TThreadList.FindById(Id: TThreadID): TVirtualThread; 176 178 var 177 179 I: Integer; 178 180 begin 179 181 I := 0; 180 while (I < ThreadList.Count) and (T VirtualThread(ThreadList[I]).ThreadID <> Id) do182 while (I < ThreadList.Count) and (ThreadList[I].ThreadID <> Id) do 181 183 Inc(I); 182 if I < ThreadList.Count then Result := T VirtualThread(ThreadList[I])184 if I < ThreadList.Count then Result := ThreadList[I] 183 185 else Result := nil; 184 186 end; … … 233 235 end; 234 236 235 function TListedThread.GetThreadId: Integer;237 function TListedThread.GetThreadId: TThreadID; 236 238 begin 237 239 Result := FThread.ThreadID; … … 290 292 end; 291 293 FThread.Free; 292 inherited Destroy;294 inherited; 293 295 end; 294 296 … … 364 366 365 367 end. 366 -
trunk/Packages/Common/Translator.pas
r84 r85 1 unit UTranslator; 2 3 {$mode Delphi}{$H+} 1 unit Translator; 4 2 5 3 interface 6 4 7 5 uses 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; 11 9 12 10 type 13 11 THandleStringEvent = function (AValue: string): string of object; 12 13 TPoFiles = class(TObjectList<TPOFile>) 14 end; 14 15 15 16 { TComponentExcludes } … … 24 25 { TComponentExcludesList } 25 26 26 TComponentExcludesList = class(TObjectList )27 TComponentExcludesList = class(TObjectList<TComponentExcludes>) 27 28 function FindByClassType(AClassType: TClass): TComponentExcludes; 28 29 procedure DumpToStrings(Strings: TStrings); … … 36 37 FOnAutomaticLanguage: THandleStringEvent; 37 38 FOnTranslate: TNotifyEvent; 38 FP OFilesFolder: string;39 FP OFiles: TObjectList; // TObjectList<TPOFile>;39 FPoFilesFolder: string; 40 FPoFiles: TPoFiles; 40 41 function GetLocale: string; 41 42 function GetLocaleShort: string; … … 47 48 procedure TranslateProperty(Component: TPersistent; PropInfo: PPropInfo); 48 49 function IsExcluded(Component: TPersistent; PropertyName: string): Boolean; 49 function GetLangFileDir : string;50 function GetLangFileDirs: TStrings; 50 51 public 51 52 ComponentExcludes: TComponentExcludesList; 52 Languages: TLanguage List;53 Languages: TLanguages; 53 54 procedure Translate; 54 procedure LanguageListToStrings(Strings: TStrings );55 procedure LanguageListToStrings(Strings: TStrings; WithCode: Boolean = True); 55 56 procedure TranslateResourceStrings(PoFileName: string); 56 57 procedure TranslateUnitResourceStrings(UnitName: string; PoFileName: string); … … 63 64 destructor Destroy; override; 64 65 published 65 property POFilesFolder: string read FP OFilesFolder write SetPOFilesFolder;66 property POFilesFolder: string read FPoFilesFolder write SetPOFilesFolder; 66 67 property Language: TLanguage read FLanguage write SetLanguage; 67 68 property OnTranslate: TNotifyEvent read FOnTranslate write FOnTranslate; … … 70 71 end; 71 72 73 const 74 PoExt = '.po'; 75 72 76 procedure Register; 73 77 78 74 79 implementation 80 81 uses 82 Common; 75 83 76 84 procedure Register; … … 117 125 destructor TComponentExcludes.Destroy; 118 126 begin 119 PropertyExcludes.Free;120 inherited Destroy;127 FreeAndNil(PropertyExcludes); 128 inherited; 121 129 end; 122 130 … … 128 136 I, J: Integer; 129 137 Po: TPoFile; 130 Item: TP OFileItem;138 Item: TPoFileItem; 131 139 begin 132 140 TranslateComponentRecursive(Application); … … 134 142 // Merge files to single translation file 135 143 try 136 Po := TP OFile.Create;137 for I := 0 to FP OFiles.Count - 1 do144 Po := TPoFile.Create; 145 for I := 0 to FPoFiles.Count - 1 do 138 146 with TPoFile(FPoFiles[I]) do 139 147 for J := 0 to Items.Count - 1 do … … 159 167 FileList: TStringList; 160 168 I: Integer; 169 J: Integer; 161 170 LocaleShort: string; 162 171 SearchMask: string; 163 begin 164 FPOFiles.Clear; 165 if Assigned(FLanguage) then166 try172 LangDirs: TStrings; 173 begin 174 FPoFiles.Clear; 175 if Assigned(FLanguage) then begin 167 176 LocaleShort := GetLocaleShort; 168 //ShowMessage(ExtractFileDir(Application.ExeName) +169 // DirectorySeparator + 'Languages' + ' ' + '*.' + LocaleShort + '.po');170 177 SearchMask := '*'; 171 178 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; 183 196 end; 184 197 end; … … 281 294 var 282 295 Item: TClass; 283 284 296 Excludes: TComponentExcludes; 285 297 begin … … 287 299 Item := Component.ClassType; 288 300 while Assigned(Item) do begin 289 //ShowMessage(Component.Name + ', ' + Component.ClassName + ', ' + Item.ClassName + ', ' + PropertyName);290 301 Excludes := ComponentExcludes.FindByClassType(Item.ClassType); 291 302 if Assigned(Excludes) then begin … … 299 310 end; 300 311 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); 312 function TTranslator.GetLangFileDirs: TStrings; 313 var 314 I: Integer; 315 begin 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; 328 end; 329 330 procedure TTranslator.LanguageListToStrings(Strings: TStrings; WithCode: Boolean = True); 310 331 var 311 332 I: Integer; … … 313 334 begin 314 335 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; 323 349 end; 324 350 end; … … 342 368 if Text <> '' then begin 343 369 for I := 0 to FPoFiles.Count - 1 do begin 344 Result := TPoFile(FP OFiles[I]).Translate(Identifier, Text);370 Result := TPoFile(FPoFiles[I]).Translate(Identifier, Text); 345 371 if Result <> Text then Break; 346 372 end; … … 366 392 var 367 393 I: Integer; 368 LangDir: string; 369 begin 370 LangDir := GetLangFileDir; 371 TLanguage(Languages[0]).Available := True; // Automatic 394 J: Integer; 395 LangDirs: TStrings; 396 begin 397 LangDirs := GetLangFileDirs; 398 Languages.SearchByCode('').Available := True; // Automatic 372 399 373 400 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; 378 411 end; 379 412 … … 381 414 begin 382 415 inherited; 383 FP OFiles := TObjectList.Create;416 FPoFiles := TPoFiles.Create; 384 417 ComponentExcludes := TComponentExcludesList.Create; 385 Languages := TLanguage List.Create;418 Languages := TLanguages.Create; 386 419 POFilesFolder := 'Languages'; 387 420 CheckLanguageFiles; … … 395 428 destructor TTranslator.Destroy; 396 429 begin 397 F POFiles.Free;398 Languages.Free;399 ComponentExcludes.Free;400 inherited Destroy;430 FreeAndNil(FPoFiles); 431 FreeAndNil(Languages); 432 FreeAndNil(ComponentExcludes); 433 inherited; 401 434 end; 402 435 … … 564 597 end; 565 598 566 567 599 end. 568 -
trunk/Packages/Common/URI.pas
r84 r85 1 unit U URI;1 unit URI; 2 2 3 3 // Date: 2011-04-04 4 5 {$mode delphi}6 4 7 5 interface … … 85 83 end; 86 84 85 87 86 implementation 88 87 … … 183 182 begin 184 183 Items.Free; 185 inherited Destroy;184 inherited; 186 185 end; 187 186 … … 232 231 begin 233 232 Path.Free; 234 inherited Destroy;233 inherited; 235 234 end; 236 235 … … 243 242 Fragment := TURI(Source).Fragment; 244 243 Query := TURI(Source).Query; 245 end else inherited Assign(Source);244 end else inherited; 246 245 end; 247 246 … … 291 290 destructor TURL.Destroy; 292 291 begin 293 inherited Destroy;292 inherited; 294 293 end; 295 294 … … 344 343 begin 345 344 Directory.Free; 346 inherited Destroy; 347 end; 348 345 inherited; 346 end; 349 347 350 348 end. 351 -
trunk/Packages/Common/XML.pas
r84 r85 1 unit UXMLUtils; 2 3 {$mode delphi} 1 unit XML; 4 2 5 3 interface … … 16 14 procedure WriteString(Node: TDOMNode; Name: string; Value: string); 17 15 procedure WriteDateTime(Node: TDOMNode; Name: string; Value: TDateTime); 16 procedure WriteDouble(Node: TDOMNode; Name: string; Value: Double); 18 17 function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer; 19 18 function ReadInt64(Node: TDOMNode; Name: string; DefaultValue: Int64): Int64; … … 21 20 function ReadString(Node: TDOMNode; Name: string; DefaultValue: string): string; 22 21 function ReadDateTime(Node: TDOMNode; Name: string; DefaultValue: TDateTime): TDateTime; 22 function ReadDouble(Node: TDOMNode; Name: string; DefaultValue: Double): Double; 23 23 procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string); 24 24 25 25 26 26 implementation 27 28 function ReadDouble(Node: TDOMNode; Name: string; DefaultValue: Double): Double; 29 var 30 NewNode: TDOMNode; 31 begin 32 Result := DefaultValue; 33 NewNode := Node.FindNode(DOMString(Name)); 34 if Assigned(NewNode) then 35 Result := StrToFloat(string(NewNode.TextContent)); 36 end; 27 37 28 38 procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string); … … 202 212 end; 203 213 214 procedure WriteDouble(Node: TDOMNode; Name: string; Value: Double); 215 var 216 NewNode: TDOMNode; 217 begin 218 NewNode := Node.OwnerDocument.CreateElement(DOMString(Name)); 219 NewNode.TextContent := DOMString(FloatToStr(Value)); 220 Node.AppendChild(NewNode); 221 end; 222 204 223 function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer; 205 224 var … … 254 273 255 274 end. 256 -
trunk/UCore.lfm
r80 r85 2135 2135 end 2136 2136 end 2137 object AboutDialog1: TAboutDialog2138 CoolTranslator = Translator12139 ThemeManager = ThemeManager12140 ApplicationInfo = ApplicationInfo12141 Left = 2612142 Top = 782143 end2144 2137 end -
trunk/UCore.pas
r84 r85 6 6 7 7 uses 8 Classes, SysUtils, UTheme, UPersistentForm, UApplicationInfo, UTranslator,9 URegistry, UAboutDialog, UGame, ActnList, Forms, Controls, Dialogs;8 Classes, SysUtils, Theme, PersistentForm, ApplicationInfo, Translator, 9 RegistryEx, UGame, ActnList, Forms, Controls, Dialogs; 10 10 11 11 type … … 15 15 TCore = class(TDataModule) 16 16 AAbout: TAction; 17 AboutDialog1: TAboutDialog;18 17 AComputer: TAction; 19 18 AHistory: TAction; … … 56 55 Core: TCore; 57 56 57 58 58 implementation 59 59 … … 61 61 62 62 uses 63 UFormMain, UFormSettings, UFormNew, UFormHelp, UFormComputer, 63 UFormMain, UFormSettings, UFormNew, UFormHelp, UFormComputer, FormAbout, 64 64 UFormHistory; 65 65 … … 112 112 113 113 procedure TCore.AAboutExecute(Sender: TObject); 114 begin 115 AboutDialog1.Show; 114 var 115 FormAbout: TFormAbout; 116 begin 117 FormAbout := TFormAbout.Create(nil); 118 try 119 FormAbout.ApplicationInfo := ApplicationInfo1; 120 FormAbout.ShowModal; 121 finally 122 FormAbout.Free; 123 end; 116 124 end; 117 125 -
trunk/UGame.pas
r84 r85 7 7 uses 8 8 Classes, SysUtils, Dialogs, fgl, Graphics, Types, Forms, Math, DateUtils, 9 Controls, URegistry;9 Controls, RegistryEx; 10 10 11 11 type … … 196 196 197 197 uses 198 UCore, UMetaCanvas;198 UCore, MetaCanvas; 199 199 200 200 procedure Translate;
Note:
See TracChangeset
for help on using the changeset viewer.