Changeset 90


Ignore:
Timestamp:
Aug 10, 2016, 11:24:45 PM (8 years ago)
Author:
chronos
Message:
  • Added: Acronym export action in menu Tools - Export. Supported formats are CSV and MediaWiki list/table.
Location:
trunk
Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/AcronymDecoder.lpi

    r88 r90  
    234234      </Item5>
    235235    </RequiredPackages>
    236     <Units Count="16">
     236    <Units Count="17">
    237237      <Unit0>
    238238        <Filename Value="AcronymDecoder.lpr"/>
     
    341341        <ResourceBaseClass Value="DataModule"/>
    342342      </Unit15>
     343      <Unit16>
     344        <Filename Value="Forms\UFormExport.pas"/>
     345        <IsPartOfProject Value="True"/>
     346        <ComponentName Value="FormExport"/>
     347        <ResourceBaseClass Value="Form"/>
     348      </Unit16>
    343349    </Units>
    344350  </ProjectOptions>
  • trunk/AcronymDecoder.lpr

    r87 r90  
    1010  Forms, UAcronym, Common, SysUtils, TemplateGenerics, UFormImport,
    1111  CoolTranslator, UFormCategorySelect, UFormMain, UFormAcronym, UFormSettings,
    12   UFormCategories, UFormAcronyms, UFormImportSource, UFormImportSources,
    13   UFormAbout, UFormImportFormat, UFormImportFormats, UFormImportPattern, UCore
     12  UFormCategories, UFormAcronyms, UFormImportSource, UFormImportSources,
     13  UFormAbout, UFormImportFormat, UFormImportFormats, UFormImportPattern, UCore,
     14  UFormExport
    1415  { you can add units after this };
    1516
     
    4647  Application.CreateForm(TFormImportFormats, FormImportFormats);
    4748  Application.CreateForm(TFormImportPattern, FormImportPattern);
     49  Application.CreateForm(TFormExport, FormExport);
    4850  Application.Run;
    4951end.
  • trunk/Forms/UFormImport.lfm

    r55 r90  
    99  Position = poScreenCenter
    1010  LCLVersion = '1.6.0.4'
    11   object ButtonImport: TButton
     11  object ButtonProcess: TButton
    1212    Left = 16
    1313    Height = 25
     
    1515    Width = 107
    1616    Caption = 'Process'
    17     OnClick = ButtonImportClick
     17    OnClick = ButtonProcessClick
    1818    TabOrder = 0
    1919  end
     
    2929  object ComboBoxDataFormat: TComboBox
    3030    Left = 264
    31     Height = 28
     31    Height = 34
    3232    Top = 5
    3333    Width = 140
    34     ItemHeight = 20
     34    ItemHeight = 0
    3535    ItemIndex = 0
    3636    Items.Strings = (
     
    4444  object Label1: TLabel
    4545    Left = 153
    46     Height = 20
     46    Height = 24
    4747    Top = 9
    48     Width = 84
     48    Width = 108
    4949    Caption = 'Data format:'
    5050    ParentColor = False
  • trunk/Forms/UFormImport.lrt

    r16 r90  
    11TFORMIMPORT.CAPTION=Import
    2 TFORMIMPORT.BUTTONIMPORT.CAPTION=Process
     2TFORMIMPORT.BUTTONPROCESS.CAPTION=Process
    33TFORMIMPORT.COMBOBOXDATAFORMAT.TEXT=CSV
    44TFORMIMPORT.LABEL1.CAPTION=Data format:
  • trunk/Forms/UFormImport.pas

    r86 r90  
    1515  TFormImport = class(TForm)
    1616    ButtonLoadFromFile: TButton;
    17     ButtonImport: TButton;
     17    ButtonProcess: TButton;
    1818    ComboBoxDataFormat: TComboBox;
    1919    Label1: TLabel;
    2020    Memo1: TMemo;
    2121    OpenDialog1: TOpenDialog;
    22     procedure ButtonImportClick(Sender: TObject);
     22    procedure ButtonProcessClick(Sender: TObject);
    2323    procedure ButtonLoadFromFileClick(Sender: TObject);
    2424  private
     
    4545{ TFormImport }
    4646
    47 procedure TFormImport.ButtonImportClick(Sender: TObject);
     47procedure TFormImport.ButtonProcessClick(Sender: TObject);
    4848begin
    4949  if ComboBoxDataFormat.ItemIndex = 0 then ImportCSV;
     
    5353procedure TFormImport.ButtonLoadFromFileClick(Sender: TObject);
    5454begin
     55  if ComboBoxDataFormat.ItemIndex = 0 then OpenDialog1.DefaultExt := '.csv';
     56  if ComboBoxDataFormat.ItemIndex = 1 then OpenDialog1.DefaultExt := '.txt';
    5557  if OpenDialog1.Execute then
    5658    Memo1.Lines.LoadFromFile(OpenDialog1.FileName);
  • trunk/Forms/UFormMain.lfm

    r87 r90  
    33  Height = 446
    44  Top = 342
    5   Width = 631
     5  Width = 782
    66  Caption = 'Acronym Decoder'
    7   ClientHeight = 421
    8   ClientWidth = 631
     7  ClientHeight = 414
     8  ClientWidth = 782
    99  Menu = MainMenu1
    1010  OnClose = FormClose
     
    1717  object Panel1: TPanel
    1818    Left = 0
    19     Height = 395
     19    Height = 388
    2020    Top = 26
    21     Width = 631
     21    Width = 782
    2222    Align = alClient
    2323    BevelOuter = bvNone
    24     ClientHeight = 395
    25     ClientWidth = 631
     24    ClientHeight = 388
     25    ClientWidth = 782
    2626    TabOrder = 1
    2727    object CheckBoxExactMath: TCheckBox
    2828      Left = 8
    29       Height = 24
     29      Height = 28
    3030      Top = 3
    31       Width = 104
     31      Width = 129
    3232      Caption = 'Exact match'
    3333      OnChange = CheckBoxExactMathChange
     
    3838      Height = 30
    3939      Top = 32
    40       Width = 616
     40      Width = 767
    4141      OnChange = ListViewFilter1Change
    4242      Anchors = [akTop, akLeft, akRight]
     
    4444    object ListViewAcronyms: TListView
    4545      Left = 8
    46       Height = 323
     46      Height = 316
    4747      Top = 64
    48       Width = 616
     48      Width = 767
    4949      Anchors = [akTop, akLeft, akRight, akBottom]
    5050      Columns = <     
     
    5454        end     
    5555        item
    56           Caption = 'Description'
     56          Caption = 'Meaning'
    5757          Width = 300
    5858        end     
    5959        item
    6060          Caption = 'Categories'
    61           Width = 300
     61          Width = 347
    6262        end>
    6363      OwnerData = True
     
    7575    Height = 26
    7676    Top = 0
    77     Width = 631
     77    Width = 782
    7878    Caption = 'ToolBar1'
    7979    Images = ImageList1
     
    699699    end
    700700    object MenuItem3: TMenuItem
    701       Action = AManualImport
     701      Action = AImport
    702702    end
    703703    object MenuItem19: TMenuItem
     
    793793      OnExecute = AShowExecute
    794794    end
    795     object AManualImport: TAction
    796       Caption = 'Manual import'
    797       OnExecute = AManualImportExecute
     795    object AImport: TAction
     796      Caption = 'Import'
     797      OnExecute = AImportExecute
    798798    end
    799799    object AFileOpen: TAction
     
    866866      OnExecute = AProcessImportsExecute
    867867      ShortCut = 119
     868    end
     869    object AExport: TAction
     870      Caption = 'Export'
     871      OnExecute = AExportExecute
    868872    end
    869873  end
     
    12901294      Caption = 'Tools'
    12911295      object MenuItem17: TMenuItem
    1292         Action = AManualImport
     1296        Action = AImport
     1297      end
     1298      object MenuItem25: TMenuItem
     1299        Action = AExport
    12931300      end
    12941301      object MenuItem23: TMenuItem
     
    20022009  end
    20032010  object PopupMenuOpenRecent: TPopupMenu
    2004     left = 379
    2005     top = 136
     2011    left = 672
     2012    top = 144
    20062013  end
    20072014end
  • trunk/Forms/UFormMain.lrt

    r51 r90  
    22TFORMMAIN.CHECKBOXEXACTMATH.CAPTION=Exact match
    33TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[0].CAPTION=Name
    4 TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[1].CAPTION=Description
     4TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[1].CAPTION=Meaning
    55TFORMMAIN.LISTVIEWACRONYMS.COLUMNS[2].CAPTION=Categories
    66TFORMMAIN.TOOLBAR1.CAPTION=ToolBar1
     
    99TFORMMAIN.AEXIT.CAPTION=Exit
    1010TFORMMAIN.ASHOW.CAPTION=Show
    11 TFORMMAIN.AMANUALIMPORT.CAPTION=Manual import
     11TFORMMAIN.AIMPORT.CAPTION=Import
    1212TFORMMAIN.AFILEOPEN.CAPTION=Open
    1313TFORMMAIN.AFILENEW.CAPTION=New
     
    2222TFORMMAIN.ASHOWIMPORTFORMATS.CAPTION=Import formats
    2323TFORMMAIN.APROCESSIMPORTS.CAPTION=Process imports
     24TFORMMAIN.AEXPORT.CAPTION=Export
    2425TFORMMAIN.MENUITEM8.CAPTION=File
    2526TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent
  • trunk/Forms/UFormMain.pas

    r87 r90  
    1616
    1717  TFormMain = class(TForm)
     18    AExport: TAction;
    1819    AProcessImports: TAction;
    1920    AShowImportFormats: TAction;
     
    2829    AFileNew: TAction;
    2930    AFileOpen: TAction;
    30     AManualImport: TAction;
     31    AImport: TAction;
    3132    AShow: TAction;
    3233    AExit: TAction;
     
    5758    MenuItem23: TMenuItem;
    5859    MenuItem24: TMenuItem;
     60    MenuItem25: TMenuItem;
    5961    MenuItemToolbar: TMenuItem;
    6062    MenuItem4: TMenuItem;
     
    8890    TrayIcon1: TTrayIcon;
    8991    procedure AExitExecute(Sender: TObject);
     92    procedure AExportExecute(Sender: TObject);
    9093    procedure AFileCloseExecute(Sender: TObject);
    9194    procedure AFileNewExecute(Sender: TObject);
     
    9396    procedure AFileSaveAsExecute(Sender: TObject);
    9497    procedure AFileSaveExecute(Sender: TObject);
    95     procedure AManualImportExecute(Sender: TObject);
     98    procedure AImportExecute(Sender: TObject);
    9699    procedure AProcessImportsExecute(Sender: TObject);
    97100    procedure ASettingsExecute(Sender: TObject);
     
    150153
    151154uses
    152   UFormImport, UFormSettings, UFormCategories, UFormAcronyms,
     155  UFormImport, UFormSettings, UFormCategories, UFormAcronyms, UFormExport,
    153156  UFormImportSources, UFormAbout, UFormImportFormats, UCore;
    154157
     
    199202begin
    200203  Close;
     204end;
     205
     206procedure TFormMain.AExportExecute(Sender: TObject);
     207begin
     208  FormExport.ShowModal;
    201209end;
    202210
     
    270278end;
    271279
    272 procedure TFormMain.AManualImportExecute(Sender: TObject);
     280procedure TFormMain.AImportExecute(Sender: TObject);
    273281begin
    274282  FormImport.ShowModal;
     
    421429    case Column of
    422430      0: Result := CompareString(TAcronymMeaning(Item1).Acronym.Name, TAcronymMeaning(Item2).Acronym.Name);
    423       1: Result := CompareString(TAcronymMeaning(Item1).Description, TAcronymMeaning(Item2).Description);
     431      1: Result := CompareString(TAcronymMeaning(Item1).Name, TAcronymMeaning(Item2).Name);
    424432      2: Result := CompareString(TAcronymMeaning(Item1).Categories.GetString, TAcronymMeaning(Item2).Categories.GetString);
    425433    end;
     
    543551  AFileSave.Enabled := Assigned(Core.AcronymDb) and Core.AcronymDb.Modified;
    544552  AFileSaveAs.Enabled := Assigned(Core.AcronymDb);
    545   AManualImport.Enabled := Assigned(Core.AcronymDb);
     553  AImport.Enabled := Assigned(Core.AcronymDb);
     554  AExport.Enabled := Assigned(Core.AcronymDb);
    546555  AProcessImports.Enabled := Assigned(Core.AcronymDb);
    547556  AShowCategories.Enabled := Assigned(Core.AcronymDb);
  • trunk/Languages/AcronymDecoder.cs.po

    r89 r90  
    179179msgstr "Vybrat kategories"
    180180
    181 #: tformimport.buttonimport.caption
    182 msgctxt "tformimport.buttonimport.caption"
     181#: tformexport.buttonprocess.caption
     182#, fuzzy
     183msgctxt "tformexport.buttonprocess.caption"
    183184msgid "Process"
    184185msgstr "Zpracovat"
     186
     187#: tformexport.buttonsavetofile.caption
     188msgid "Save to file"
     189msgstr ""
     190
     191#: tformexport.caption
     192msgctxt "tformexport.caption"
     193msgid "Export"
     194msgstr ""
     195
     196#: tformexport.comboboxdataformat.text
     197#, fuzzy
     198msgctxt "tformexport.comboboxdataformat.text"
     199msgid "CSV"
     200msgstr "CSV"
    185201
    186202#: tformimport.buttonloadfromfile.caption
    187203msgid "Load from file"
    188204msgstr "Načíst ze souboru"
     205
     206#: tformimport.buttonprocess.caption
     207#, fuzzy
     208msgctxt "tformimport.buttonprocess.caption"
     209msgid "Process"
     210msgstr "Zpracovat"
    189211
    190212#: tformimport.caption
     
    194216
    195217#: tformimport.comboboxdataformat.text
     218msgctxt "tformimport.comboboxdataformat.text"
    196219msgid "CSV"
    197220msgstr "CSV"
     
    475498msgstr "Ukončit"
    476499
     500#: tformmain.aexport.caption
     501msgctxt "tformmain.aexport.caption"
     502msgid "Export"
     503msgstr ""
     504
    477505#: tformmain.afileclose.caption
    478506msgctxt "tformmain.afileclose.caption"
     
    496524msgstr "Uložit jako..."
    497525
    498 #: tformmain.amanualimport.caption
    499 msgid "Manual import"
    500 msgstr "Ruční import"
     526#: tformmain.aimport.caption
     527#, fuzzy
     528msgctxt "tformmain.aimport.caption"
     529msgid "Import"
     530msgstr "Importovat"
    501531
    502532#: tformmain.aprocessimports.caption
     
    553583
    554584#: tformmain.listviewacronyms.columns[1].caption
     585#, fuzzy
     586#| msgid "Description"
    555587msgctxt "tformmain.listviewacronyms.columns[1].caption"
    556 msgid "Description"
     588msgid "Meaning"
    557589msgstr "Popis"
    558590
     
    770802msgstr "Opravdu chcete odebrat vybrané kategorie?"
    771803
     804#: uformexport.sexpotedacronyms
     805msgid "Exported %d acronyms"
     806msgstr ""
     807
    772808#: uformimport.simportednewacronyms
    773809msgid "Imported %d new acronyms."
  • trunk/Languages/AcronymDecoder.po

    r89 r90  
    169169msgstr ""
    170170
    171 #: tformimport.buttonimport.caption
    172 msgctxt "tformimport.buttonimport.caption"
     171#: tformexport.buttonprocess.caption
     172msgctxt "TFORMEXPORT.BUTTONPROCESS.CAPTION"
    173173msgid "Process"
     174msgstr ""
     175
     176#: tformexport.buttonsavetofile.caption
     177msgid "Save to file"
     178msgstr ""
     179
     180#: tformexport.caption
     181msgctxt "tformexport.caption"
     182msgid "Export"
     183msgstr ""
     184
     185#: tformexport.comboboxdataformat.text
     186msgctxt "TFORMEXPORT.COMBOBOXDATAFORMAT.TEXT"
     187msgid "CSV"
    174188msgstr ""
    175189
    176190#: tformimport.buttonloadfromfile.caption
    177191msgid "Load from file"
     192msgstr ""
     193
     194#: tformimport.buttonprocess.caption
     195msgctxt "TFORMIMPORT.BUTTONPROCESS.CAPTION"
     196msgid "Process"
    178197msgstr ""
    179198
     
    184203
    185204#: tformimport.comboboxdataformat.text
     205msgctxt "tformimport.comboboxdataformat.text"
    186206msgid "CSV"
    187207msgstr ""
     
    465485msgstr ""
    466486
     487#: tformmain.aexport.caption
     488msgctxt "TFORMMAIN.AEXPORT.CAPTION"
     489msgid "Export"
     490msgstr ""
     491
    467492#: tformmain.afileclose.caption
    468493msgctxt "tformmain.afileclose.caption"
     
    486511msgstr ""
    487512
    488 #: tformmain.amanualimport.caption
    489 msgid "Manual import"
     513#: tformmain.aimport.caption
     514msgctxt "TFORMMAIN.AIMPORT.CAPTION"
     515msgid "Import"
    490516msgstr ""
    491517
     
    544570#: tformmain.listviewacronyms.columns[1].caption
    545571msgctxt "tformmain.listviewacronyms.columns[1].caption"
    546 msgid "Description"
     572msgid "Meaning"
    547573msgstr ""
    548574
     
    760786msgstr ""
    761787
     788#: uformexport.sexpotedacronyms
     789msgid "Exported %d acronyms"
     790msgstr ""
     791
    762792#: uformimport.simportednewacronyms
    763793msgid "Imported %d new acronyms."
Note: See TracChangeset for help on using the changeset viewer.