Changeset 169


Ignore:
Timestamp:
Jan 22, 2018, 11:00:53 AM (7 years ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/AcronymDecoder.lpr

    r95 r169  
    88  {$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UAcronym, Common, SysUtils, TemplateGenerics, UFormImport,
    11   CoolTranslator, UFormCategorySelect, UFormMain, UFormAcronym, UFormSettings,
    12   UFormCategories, UFormAcronyms, UFormImportSource, UFormImportSources,
    13   UFormAbout, UFormImportFormat, UFormImportFormats, UFormImportPattern, UCore,
    14   UFormExport
     10  Forms, UAcronym, Common, SysUtils, TemplateGenerics,
     11  CoolTranslator, UFormMain, UCore
    1512  { you can add units after this };
    1613
  • trunk/Forms/UFormAbout.lfm

    r142 r169  
    11object FormAbout: TFormAbout
    22  Left = 562
    3   Height = 397
    4   Top = 277
    5   Width = 473
     3  Height = 314
     4  Top = 306
     5  Width = 485
    66  Caption = 'About'
    7   ClientHeight = 397
    8   ClientWidth = 473
     7  ClientHeight = 314
     8  ClientWidth = 485
     9  DesignTimePPI = 120
    910  OnCreate = FormCreate
    1011  OnShow = FormShow
    1112  Position = poScreenCenter
    12   LCLVersion = '1.6.0.4'
     13  LCLVersion = '1.8.0.6'
    1314  object LabelDescription: TLabel
    1415    Left = 20
    15     Height = 48
     16    Height = 32
    1617    Top = 108
    17     Width = 433
     18    Width = 445
    1819    Align = alTop
     20    AutoSize = False
    1921    BorderSpacing.Around = 20
    20     Caption = 'Simple tool for quick searching of meaning for various acronyms and abbreviations.'
    2122    ParentColor = False
    2223    WordWrap = True
    2324  end
    2425  object ButtonClose: TButton
    25     Left = 360
     26    Left = 372
    2627    Height = 25
    27     Top = 357
     28    Top = 274
    2829    Width = 93
    2930    Anchors = [akRight, akBottom]
     
    3435  object LabelContent: TLabel
    3536    Left = 20
    36     Height = 24
    37     Top = 176
    38     Width = 433
     37    Height = 20
     38    Top = 160
     39    Width = 445
    3940    Align = alTop
    4041    BorderSpacing.Around = 20
     
    4546    Left = 16
    4647    Height = 25
    47     Top = 357
     48    Top = 274
    4849    Width = 176
    4950    Anchors = [akLeft, akBottom]
     
    5657    Height = 88
    5758    Top = 0
    58     Width = 473
     59    Width = 485
    5960    Align = alTop
    6061    BevelOuter = bvNone
    6162    ClientHeight = 88
    62     ClientWidth = 473
     63    ClientWidth = 485
    6364    TabOrder = 2
    6465    object Image1: TImage
     
    6768      Top = 16
    6869      Width = 69
    69       Picture.Data = {
    70         1754506F727461626C654E6574776F726B477261706869632301000089504E47
    71         0D0A1A0A0000000D49484452000000400000004008030000009DB781EC000000
    72         0C504C544500000000000000003AFFC90EE9675ABE0000000174524E530040E6
    73         D866000000C549444154789CEDD64B0EC3200C04D04C73FF3B77D1AAB2C1DF4E
    74         48BB60364990FC440C121CC7CECEDF054968202580334881888137C1002F8303
    75         664137C99A74228480334803A802EE68B589FEBC6A4030310E18DBE801516F6E
    76         043E8F3E00098CCD2903EAA50740035807385B597E4E82AC5805445F57036613
    77         61A6B10A2C60D7CB5FBA0710EB36353506C65F9E866AC0A982070B346660D5AB
    78         D171FB90C0BC501980EC64A2812C9DC3D5AEF7AF185F5D309A4058BFFA9285B4
    79         FE8A8B2655BEB3F3C33C01B6231002CAEF0D050000000049454E44AE426082
    80       }
    8170    end
    8271    object LabelAppName: TLabel
    8372      Left = 104
    84       Height = 55
     73      Height = 54
    8574      Top = 16
    86       Width = 338
     75      Width = 317
    8776      Align = alCustom
    8877      BorderSpacing.Around = 20
  • trunk/Forms/UFormAbout.pas

    r142 r169  
    5151  if Assigned(ApplicationInfo) then begin
    5252    LabelAppName.Caption := ApplicationInfo.AppName;
     53    LabelDescription.Caption := ApplicationInfo.Description;
     54    LabelDescription.AutoSize := True;
    5355    LabelContent.Caption := SVersion + ': ' + ApplicationInfo.Version + LineEnding +
    5456      SReleaseDate + ': ' + DateToStr(ApplicationInfo.ReleaseDate) + LineEnding +
    5557      SLicense + ': ' + ApplicationInfo.License;
     58    Image1.Picture.Bitmap.Assign(Application.Icon);
    5659  end;
    5760end;
  • trunk/Forms/UFormMain.lfm

    r166 r169  
    33  Height = 602
    44  Top = 261
    5   Width = 998
     5  Width = 847
    66  Caption = 'Acronym Decoder'
    77  ClientHeight = 577
    8   ClientWidth = 998
     8  ClientWidth = 847
    99  DesignTimePPI = 120
    1010  Menu = MainMenu1
     
    2020    Height = 479
    2121    Top = 70
    22     Width = 998
     22    Width = 847
    2323    Align = alClient
    2424    BevelOuter = bvNone
    2525    ClientHeight = 479
    26     ClientWidth = 998
     26    ClientWidth = 847
    2727    TabOrder = 0
    2828    object ListViewFilter1: TListViewFilter
     
    3030      Height = 38
    3131      Top = 6
    32       Width = 979
     32      Width = 828
    3333      OnChange = ListViewFilter1Change
    3434      Anchors = [akTop, akLeft, akRight]
     
    3838      Height = 427
    3939      Top = 44
    40       Width = 980
     40      Width = 829
    4141      Anchors = [akTop, akLeft, akRight, akBottom]
    4242      Columns = <     
     
    6868    Height = 32
    6969    Top = 38
    70     Width = 998
     70    Width = 847
    7171    Align = alTop
    7272    BevelOuter = bvNone
    7373    ClientHeight = 32
    74     ClientWidth = 998
     74    ClientWidth = 847
    7575    TabOrder = 1
    7676    object CheckBoxExactLength: TCheckBox
     
    103103    Height = 38
    104104    Top = 0
    105     Width = 998
    106     AutoSize = True
     105    Width = 847
    107106    Bands = <   
    108107      item
     
    141140      Height = 28
    142141      Top = 5
    143       Width = 135
     142      Width = 132
    144143      Align = alNone
    145144      AutoSize = True
     
    183182      Height = 28
    184183      Top = 5
    185       Width = 120
     184      Width = 117
    186185      Align = alNone
    187186      AutoSize = True
     
    223222      Height = 28
    224223      Top = 5
    225       Width = 62
     224      Width = 59
    226225      Align = alNone
    227226      AutoSize = True
     
    253252      Height = 28
    254253      Top = 5
    255       Width = 91
     254      Width = 88
    256255      Align = alNone
    257256      AutoSize = True
     
    290289    Height = 28
    291290    Top = 549
    292     Width = 998
     291    Width = 847
    293292    Panels = <   
    294293      item
  • trunk/Forms/UFormMain.pas

    r166 r169  
    700700procedure TFormMain.LoadConfig;
    701701begin
    702   RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey);
     702  RegistryContext := TRegistryContext.Create(HKEY_CURRENT_USER, DefaultRegKey);
    703703  Core.PersistentForm1.RegistryContext := RegistryContext;
    704   RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles');
     704  RegistryContext := TRegistryContext.Create(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles');
    705705  LastOpenedList1.LoadFromRegistry(RegistryContext);
    706706
     
    737737procedure TFormMain.SaveConfig;
    738738begin
    739   RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles');
     739  RegistryContext := TRegistryContext.Create(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles');
    740740  LastOpenedList1.SaveToRegistry(RegistryContext);
    741741
  • trunk/Install/win/build.bat

    r168 r169  
     1@echo off
     2
    13if not defined LAZDIR (
    24  set LAZDIR=C:\lazarus
     
    46SET PROJECTNAME=AcronymDecoder
    57
     8SET MAIN_EXE=..\..\%PROJECTNAME%.exe
     9SET WIN32_EXE=..\..\lib\i386-win32-Release\%PROJECTNAME%.exe
     10SET WIN64_EXE=..\..\lib\x86_64-win64-Release\%PROJECTNAME%.exe
     11IF EXIST %MAIN_EXE% del %MAIN_EXE%
     12IF EXIST %WIN32_EXE% del %WIN32_EXE%
     13IF EXIST %WIN64_EXE% del %WIN64_EXE%
     14
    615%LAZDIR%\lazbuild.exe --lazarusdir=%LAZDIR% --build-mode="Release" --cpu=i386 --operating-system=Win32 ..\..\%PROJECTNAME%.lpi
    7 copy ..\..\%PROJECTNAME%.exe ..\..\lib\i386-win32-Release
     16copy %MAIN_EXE% %WIN32_EXE%
    817%LAZDIR%\lazbuild.exe --lazarusdir=%LAZDIR% --build-mode="Release" --cpu=x86_64 --operating-system=Win64 ..\..\%PROJECTNAME%.lpi
    9 copy ..\..\%PROJECTNAME%.exe ..\..\lib\x86_64-win64-Release
     18copy %MAIN_EXE% %WIN64_EXE%
    1019
    1120"c:\Program Files (x86)\Inno Setup 5\ISCC.exe" "%PROJECTNAME%.iss"
  • trunk/Languages/AcronymDecoder.cs.po

    r165 r169  
    3636msgstr "   "
    3737
    38 #: tformabout.labeldescription.caption
    39 msgctxt "tformabout.labeldescription.caption"
    40 msgid "Simple tool for quick searching of meaning for various acronyms and abbreviations."
    41 msgstr "Jednoduchý nástroj pro hledání významu různých zkratek a zkrácení."
    42 
    4338#: tformacronym.acategoryadd.caption
    4439msgctxt "tformacronym.acategoryadd.caption"
  • trunk/Languages/AcronymDecoder.po

    r165 r169  
    2626msgstr ""
    2727
    28 #: tformabout.labeldescription.caption
    29 msgctxt "TFORMABOUT.LABELDESCRIPTION.CAPTION"
    30 msgid "Simple tool for quick searching of meaning for various acronyms and abbreviations."
    31 msgstr ""
    32 
    3328#: tformacronym.acategoryadd.caption
    3429msgctxt "TFORMACRONYM.ACATEGORYADD.CAPTION"
  • trunk/Packages/Common/UApplicationInfo.pas

    r3 r169  
    1414  TApplicationInfo = class(TComponent)
    1515  private
     16    FDescription: string;
    1617    FIdentification: Byte;
    1718    FLicense: string;
     
    3334    constructor Create(AOwner: TComponent); override;
    3435    property Version: string read GetVersion;
     36    function GetRegistryContext: TRegistryContext;
    3537  published
    3638    property Identification: Byte read FIdentification write FIdentification;
     
    4547    property EmailContact: string read FEmailContact write FEmailContact;
    4648    property AppName: string read FAppName write FAppName;
     49    property Description: string read FDescription write FDescription;
    4750    property ReleaseDate: TDateTime read FReleaseDate write FReleaseDate;
    4851    property RegistryKey: string read FRegistryKey write FRegistryKey;
     
    7982end;
    8083
     84function TApplicationInfo.GetRegistryContext: TRegistryContext;
     85begin
     86  Result := TRegistryContext.Create(RegistryRoot, RegistryKey);
     87end;
     88
    8189end.
  • trunk/Packages/Common/UCommon.pas

    r141 r169  
    6363procedure OpenWebPage(URL: string);
    6464procedure OpenFileInShell(FileName: string);
    65 procedure ExecuteProgram(CommandLine: string);
     65procedure ExecuteProgram(Executable: string; Parameters: array of string);
    6666procedure FreeThenNil(var Obj);
    6767function RemoveQuotes(Text: string): string;
     
    7070function GetDirCount(Dir: string): Integer;
    7171function MergeArray(A, B: array of string): TArrayOfString;
     72function LoadFileToStr(const FileName: TFileName): AnsiString;
    7273
    7374
     
    111112  Path := IncludeTrailingPathDelimiter(APath);
    112113
    113   Find := FindFirst(UTF8Decode(Path + AFileSpec), faAnyFile xor faDirectory, SearchRec);
     114  Find := FindFirst(Path + AFileSpec, faAnyFile xor faDirectory, SearchRec);
    114115  while Find = 0 do begin
    115     DeleteFile(Path + UTF8Encode(SearchRec.Name));
     116    DeleteFile(Path + SearchRec.Name);
    116117
    117118    Find := SysUtils.FindNext(SearchRec);
     
    428429end;
    429430
    430 procedure ExecuteProgram(CommandLine: string);
     431procedure ExecuteProgram(Executable: string; Parameters: array of string);
    431432var
    432433  Process: TProcess;
     434  I: Integer;
    433435begin
    434436  try
    435437    Process := TProcess.Create(nil);
    436     Process.CommandLine := CommandLine;
     438    Process.Executable := Executable;
     439    for I := 0 to Length(Parameters) - 1 do
     440      Process.Parameters.Add(Parameters[I]);
    437441    Process.Options := [poNoConsole];
    438442    Process.Execute;
     
    455459procedure OpenFileInShell(FileName: string);
    456460begin
    457   ExecuteProgram('cmd.exe /c start "' + FileName + '"');
     461  ExecuteProgram('cmd.exe', ['/c', 'start', FileName]);
    458462end;
    459463
     
    492496end;
    493497
     498function LoadFileToStr(const FileName: TFileName): AnsiString;
     499var
     500  FileStream: TFileStream;
     501  Read: Integer;
     502begin
     503  Result := '';
     504  FileStream := TFileStream.Create(FileName, fmOpenRead);
     505  try
     506    if FileStream.Size > 0 then begin
     507      SetLength(Result, FileStream.Size);
     508      Read := FileStream.Read(Pointer(Result)^, FileStream.Size);
     509      SetLength(Result, Read);
     510    end;
     511  finally
     512    FileStream.Free;
     513  end;
     514end;
     515
    494516
    495517
  • trunk/Packages/Common/URegistry.pas

    r3 r169  
    99
    1010type
    11   TRegistryRoot = (rrKeyClassesRoot = HKEY($80000000),
    12     rrKeyCurrentUser = HKEY($80000001),
    13     rrKeyLocalMachine = HKEY($80000002),
    14     rrKeyUsers = HKEY($80000003),
    15     rrKeyPerformanceData = HKEY($80000004),
    16     rrKeyCurrentConfig = HKEY($80000005),
    17     rrKeyDynData = HKEY($80000006));
     11  TRegistryRoot = (rrKeyClassesRoot, rrKeyCurrentUser, rrKeyLocalMachine,
     12    rrKeyUsers, rrKeyPerformanceData, rrKeyCurrentConfig, rrKeyDynData);
    1813
    1914  { TRegistryContext }
     
    2318    Key: string;
    2419    class operator Equal(A, B: TRegistryContext): Boolean;
     20    function Create(RootKey: TRegistryRoot; Key: string): TRegistryContext; overload;
     21    function Create(RootKey: HKEY; Key: string): TRegistryContext; overload;
    2522  end;
    2623
     
    4340  end;
    4441
    45 function RegContext(RootKey: HKEY; Key: string): TRegistryContext;
    46 
     42const
     43  RegistryRootHKEY: array[TRegistryRoot] of HKEY = (HKEY_CLASSES_ROOT,
     44    HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_PERFORMANCE_DATA,
     45    HKEY_CURRENT_CONFIG, HKEY_DYN_DATA);
    4746
    4847implementation
    4948
    50 function RegContext(RootKey: HKEY; Key: string): TRegistryContext;
    51 begin
    52   Result.RootKey := RootKey;
    53   Result.Key := Key;
    54 end;
    5549
    5650{ TRegistryContext }
     
    5953begin
    6054  Result := (A.Key = B.Key) and (A.RootKey = B.RootKey);
     55end;
     56
     57function TRegistryContext.Create(RootKey: TRegistryRoot; Key: string): TRegistryContext;
     58begin
     59  Result.RootKey := RegistryRootHKEY[RootKey];
     60  Result.Key := Key;
     61end;
     62
     63function TRegistryContext.Create(RootKey: HKEY; Key: string): TRegistryContext;
     64begin
     65  Result.RootKey := RootKey;
     66  Result.Key := Key;
    6167end;
    6268
  • trunk/Packages/Common/UScaleDPI.pas

    r166 r169  
    325325      AutoSize := False;
    326326      Height := ScaleY(Height, FromDPI.Y);
     327      AutoSize := True;
    327328    end;
    328329    EndUpdate;
  • trunk/UCore.lfm

    r163 r169  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 518
    6   HorizontalOffset = 477
    7   VerticalOffset = 302
    8   Width = 557
     5  Height = 648
     6  HorizontalOffset = 596
     7  VerticalOffset = 378
     8  Width = 696
     9  PPI = 120
    910  object CoolTranslator1: TCoolTranslator
    1011    POFilesFolder = 'Languages'
    1112    OnTranslate = CoolTranslator1Translate
    12     left = 152
    13     top = 152
     13    left = 190
     14    top = 190
    1415  end
    1516  object PersistentForm1: TPersistentForm
    1617    MinVisiblePart = 50
    1718    EntireVisible = False
    18     left = 292
    19     top = 156
     19    left = 365
     20    top = 195
    2021  end
    2122  object JobProgressView1: TJobProgressView
     
    2324    ShowDelay = 0
    2425    AutoClose = False
    25     left = 292
    26     top = 272
     26    left = 365
     27    top = 340
    2728  end
    2829  object ScaleDPI1: TScaleDPI
    2930    AutoDetect = False
    30     left = 156
    31     top = 272
     31    left = 195
     32    top = 340
    3233  end
    3334  object ImageList1: TImageList
    34     left = 292
    35     top = 336
     35    left = 365
     36    top = 420
    3637    Bitmap = {
    3738      4C69140000001000000010000000000000000000000000000000000000000000
     
    12161217    Visible = True
    12171218    OnClick = TrayIcon1Click
    1218     left = 152
    1219     top = 336
     1219    left = 190
     1220    top = 420
    12201221  end
    12211222  object PopupMenuTrayIcon: TPopupMenu
    12221223    Images = ImageList1
    1223     left = 152
    1224     top = 400
     1224    left = 190
     1225    top = 500
    12251226    object MenuItem2: TMenuItem
    12261227      Action = FormMain.AShow
     
    12491250    Height = 32
    12501251    Width = 32
    1251     left = 424
    1252     top = 336
     1252    left = 530
     1253    top = 420
    12531254    Bitmap = {
    12541255      4C69110000002000000020000000000000000000000000000000000000000000
     
    34423443    EmailContact = 'robie@centrum.cz'
    34433444    AppName = 'Acronym Decoder'
     3445    Description = 'Simple tool for quick searching of meaning for various acronyms and abbreviations.'
    34443446    ReleaseDate = 43046
    34453447    RegistryKey = '\Software\'
    34463448    RegistryRoot = rrKeyCurrentUser
    34473449    License = 'CC0'
    3448     left = 80
    3449     top = 24
     3450    left = 100
     3451    top = 30
    34503452  end
    34513453end
Note: See TracChangeset for help on using the changeset viewer.