Changeset 50


Ignore:
Timestamp:
Jul 25, 2016, 5:07:25 PM (8 years ago)
Author:
chronos
Message:
  • Added: New pattern action "Remove on start".
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAbout.lfm

    r43 r50  
    11object FormAbout: TFormAbout
    2   Left = 561
     2  Left = 562
    33  Height = 397
    4   Top = 276
     4  Top = 277
    55  Width = 473
    66  Caption = 'About'
  • trunk/Forms/UFormAcronyms.lfm

    r45 r50  
    11object FormAcronyms: TFormAcronyms
    2   Left = 424
     2  Left = 426
    33  Height = 558
    4   Top = 310
     4  Top = 184
    55  Width = 740
    66  Caption = 'Acronyms'
     
    88  ClientWidth = 740
    99  OnShow = FormShow
    10   LCLVersion = '1.7'
     10  LCLVersion = '1.6.0.4'
    1111  object ListViewAcronyms: TListView
    1212    Left = 8
     
    2121      end   
    2222      item
    23         Caption = 'Meaning'
     23        Caption = 'Description'
    2424        Width = 300
    2525      end   
  • trunk/Forms/UFormAcronyms.lrt

    r45 r50  
    11TFORMACRONYMS.CAPTION=Acronyms
    22TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[0].CAPTION=Name
    3 TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[1].CAPTION=Meaning
     3TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[1].CAPTION=Description
    44TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[2].CAPTION=Categories
    55TFORMACRONYMS.AADD.CAPTION=Add
  • trunk/Forms/UFormImportFormat.lfm

    r47 r50  
    11object FormImportFormat: TFormImportFormat
    2   Left = 461
     2  Left = 462
    33  Height = 433
    4   Top = 321
     4  Top = 322
    55  Width = 664
    66  Caption = 'Import format'
  • trunk/Forms/UFormImportSource.lfm

    r46 r50  
    11object FormImportSource: TFormImportSource
    2   Left = 492
     2  Left = 493
    33  Height = 444
    4   Top = 313
     4  Top = 315
    55  Width = 604
    66  Caption = 'Import source'
  • trunk/Forms/UFormImportSources.lfm

    r39 r50  
    11object FormImportSources: TFormImportSources
    2   Left = 473
     2  Left = 475
    33  Height = 414
    4   Top = 327
     4  Top = 329
    55  Width = 812
    66  Caption = 'Import sources'
  • trunk/Forms/UFormMain.lfm

    r45 r50  
    11object FormMain: TFormMain
    2   Left = 427
     2  Left = 429
    33  Height = 446
    4   Top = 423
     4  Top = 342
    55  Width = 631
    66  Caption = 'Acronym Decoder'
    7   ClientHeight = 414
     7  ClientHeight = 421
    88  ClientWidth = 631
    99  Menu = MainMenu1
     
    1313  OnDestroy = FormDestroy
    1414  OnShow = FormShow
    15   LCLVersion = '1.7'
     15  LCLVersion = '1.6.0.4'
    1616  object Panel1: TPanel
    1717    Left = 0
    18     Height = 388
     18    Height = 395
    1919    Top = 26
    2020    Width = 631
    2121    Align = alClient
    2222    BevelOuter = bvNone
    23     ClientHeight = 388
     23    ClientHeight = 395
    2424    ClientWidth = 631
    2525    TabOrder = 0
    2626    object CheckBoxExactMath: TCheckBox
    2727      Left = 8
    28       Height = 28
     28      Height = 24
    2929      Top = 3
    30       Width = 129
     30      Width = 104
    3131      Caption = 'Exact match'
    3232      OnChange = CheckBoxExactMathChange
     
    4343    object ListViewAcronyms: TListView
    4444      Left = 8
    45       Height = 316
     45      Height = 323
    4646      Top = 64
    4747      Width = 616
  • trunk/Forms/UFormMain.pas

    r45 r50  
    139139resourcestring
    140140  SAddedCount = 'Imported %d acronyms';
     141  SProcessImportSources = 'Process import sources';
    141142
    142143
     
    274275begin
    275276  ImportTotalItemCount := 0;
    276   JobProgressView1.AddJob('Process import sources', ProcessImportsJob);
     277  JobProgressView1.AddJob(SProcessImportSources, ProcessImportsJob);
    277278  JobProgressView1.Start;
    278279  ShowMessage(Format(SAddedCount, [ImportTotalItemCount]));
  • trunk/Languages/AcronymDecoder.cs.po

    r46 r50  
    1010"Content-Transfer-Encoding: 8bit\n"
    1111"Language: cs\n"
    12 "X-Generator: Poedit 1.8.7.1\n"
     12"X-Generator: Poedit 1.8.8\n"
    1313
    1414#: tformabout.buttonclose.caption
     
    115115#: tformacronyms.listviewacronyms.columns[1].caption
    116116msgctxt "tformacronyms.listviewacronyms.columns[1].caption"
    117 msgid "Meaning"
    118 msgstr "Význam"
     117msgid "Description"
     118msgstr "Popis"
    119119
    120120#: tformacronyms.listviewacronyms.columns[2].caption
     
    608608msgstr "Žádný"
    609609
     610#: uacronym.sremoveonstart
     611msgid "Remove on start"
     612msgstr "Odebrat při startu"
     613
    610614#: uacronym.sskip
    611615msgid "Skip"
    612616msgstr "Přeskočit"
     617
     618#: uacronym.sunsupportedauthmethod
     619msgid "Unsupported HTTP authorization method"
     620msgstr "Nepodporovaná metoda HTTP autorizace"
    613621
    614622#: uacronym.sunsupportedimportformat
     
    766774msgstr "upraveno"
    767775
     776#: uformmain.sprocessimportsources
     777msgid "Process import sources"
     778msgstr "Zpracovat zdroje importu"
  • trunk/Languages/AcronymDecoder.po

    r46 r50  
    105105#: tformacronyms.listviewacronyms.columns[1].caption
    106106msgctxt "TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[1].CAPTION"
    107 msgid "Meaning"
     107msgid "Description"
    108108msgstr ""
    109109
     
    598598msgstr ""
    599599
     600#: uacronym.sremoveonstart
     601msgid "Remove on start"
     602msgstr ""
     603
    600604#: uacronym.sskip
    601605msgid "Skip"
     606msgstr ""
     607
     608#: uacronym.sunsupportedauthmethod
     609msgid "Unsupported HTTP authorization method"
    602610msgstr ""
    603611
     
    756764msgstr ""
    757765
     766#: uformmain.sprocessimportsources
     767msgid "Process import sources"
     768msgstr ""
     769
  • trunk/UAcronym.pas

    r47 r50  
    115115  end;
    116116
    117   TImportPatternFlag = (ipfNone, ipfNewItem, ipfSkip);
     117  TImportPatternFlag = (ipfNone, ipfNewItem, ipfSkip, ipfRemove);
    118118  TImportVariable = (ivNone, ivAcronym, ivMeaning, ivDescription);
    119119
     
    247247  SNewItem = 'New item';
    248248  SSkip = 'Skip';
     249  SRemoveOnStart = 'Remove on start';
     250  SUnsupportedAuthMethod = 'Unsupported HTTP authorization method';
    249251
    250252
     
    258260  ImportPatternFlagString[ipfNewItem] := SNewItem;
    259261  ImportPatternFlagString[ipfSkip] := SSkip;
     262  ImportPatternFlagString[ipfRemove] := SRemoveOnStart;
    260263end;
    261264
     
    393396var
    394397  H: string;
    395   P: Integer;
    396398begin
    397399  with TFPHttpClient(Sender) do begin
     
    400402
    401403    if H <> 'Basic' then
    402       raise Exception.Create('Unsupported HTTP authorization method');
     404      raise Exception.Create(SUnsupportedAuthMethod);
    403405
    404406    if (Self.UserName <> '') and (UserName = '') then begin
     
    440442
    441443  // Remove unneeded items
    442 {  repeat
     444  repeat
    443445    LastLength := Length(S);
    444446    for I := 0 to Format.ItemPatterns.Count - 1 do
    445447    with TImportPattern(Format.ItemPatterns[I]) do
    446     if Flag = ipfSkip then begin
     448    if Flag = ipfRemove then begin
    447449      P := Pos(StartString, S);
    448450      if P > 0 then begin
     
    455457    end;
    456458  until Length(S) = LastLength;
    457 }
     459
    458460  // Find items
    459461  repeat
     
    462464    while I < Format.ItemPatterns.Count do
    463465    with TImportPattern(Format.ItemPatterns[I]) do begin
    464       if Flag <> ipfSkip then begin
     466      if Flag <> ipfRemove then begin
    465467        if Length(StartString) > 0 then begin
    466468          P := Pos(StartString, S);
     
    470472        if ((Length(StartString) > 0) and (P > 0)) or (Length(StartString) = 0) then begin
    471473          P := Pos(EndString, S);
    472           T := StripHTML(Copy(S, 1, P - 1));
    473           T := StringReplace(T, '&quot;', '"', [rfReplaceAll]);
    474           T := StringReplace(T, '&trade;', 'TM', [rfReplaceAll]);
    475           T := StringReplace(T, '&amp;', '&', [rfReplaceAll]);
    476           T := StringReplace(T, '&#160;', ' ', [rfReplaceAll]); // No break space
    477           T := Trim(T);
    478           case Variable of
    479             ivAcronym: NewAcronym.Name := T;
    480             ivMeaning: NewAcronym.Meaning := T;
    481             ivDescription: NewAcronym.Description := T;
     474          T := Copy(S, 1, P - 1);
     475          if Flag <> ipfSkip then begin
     476            T := StripHTML(T);
     477            T := StringReplace(T, '&quot;', '"', [rfReplaceAll]);
     478            T := StringReplace(T, '&trade;', 'TM', [rfReplaceAll]);
     479            T := StringReplace(T, '&amp;', '&', [rfReplaceAll]);
     480            T := StringReplace(T, '&#160;', ' ', [rfReplaceAll]); // No break space
     481            T := Trim(T);
     482            case Variable of
     483              ivAcronym: NewAcronym.Name := T;
     484              ivMeaning: NewAcronym.Meaning := T;
     485              ivDescription: NewAcronym.Description := T;
     486            end;
    482487          end;
    483488          Delete(S, 1, P + Length(EndString) - 1);
Note: See TracChangeset for help on using the changeset viewer.