Changeset 69


Ignore:
Timestamp:
Aug 1, 2016, 12:43:49 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Set zero imported acronyms count before start of processing import sources.
  • Modified: Open dialogs positioned at center of screen.
  • Added: Open example acronyms by default if no other files were openned yet.
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Example acronyms.adp

    r66 r69  
    3662336623            <Category>
    3662436624              <Id>4</Id>
     36625            </Category>
     36626          </Categories>
     36627        </Meaning>
     36628      </Meanings>
     36629    </Acronym>
     36630    <Acronym>
     36631      <Name>n0rp</Name>
     36632      <Meanings>
     36633        <Meaning>
     36634          <Name>Alternate form of pr0n, intentional misspelling of porn</Name>
     36635          <Description/>
     36636          <Language/>
     36637          <Categories>
     36638            <Category>
     36639              <Id>6</Id>
     36640            </Category>
     36641          </Categories>
     36642        </Meaning>
     36643      </Meanings>
     36644    </Acronym>
     36645    <Acronym>
     36646      <Name>namewaster</Name>
     36647      <Meanings>
     36648        <Meaning>
     36649          <Name>person who abandons an account shortly after its creation</Name>
     36650          <Description/>
     36651          <Language/>
     36652          <Categories>
     36653            <Category>
     36654              <Id>6</Id>
    3662536655            </Category>
    3662636656          </Categories>
     
    3716137191      <Enabled>-1</Enabled>
    3716237192      <ItemCount>150</ItemCount>
    37163       <LastImportTime>2016-07-28T11:17:50.848+02:00</LastImportTime>
     37193      <LastImportTime>2016-08-01T12:38:42.584+02:00</LastImportTime>
    3716437194      <UserName/>
    3716537195      <Categories>
     
    3717537205      <Enabled>-1</Enabled>
    3717637206      <ItemCount>74</ItemCount>
    37177       <LastImportTime>2016-07-28T11:17:52.362+02:00</LastImportTime>
     37207      <LastImportTime>2016-08-01T12:38:45.016+02:00</LastImportTime>
    3717837208      <UserName/>
    3717937209      <Categories>
     
    3718937219      <Enabled>-1</Enabled>
    3719037220      <ItemCount>733</ItemCount>
    37191       <LastImportTime>2016-07-28T11:17:54.015+02:00</LastImportTime>
     37221      <LastImportTime>2016-08-01T12:38:46.946+02:00</LastImportTime>
    3719237222      <UserName/>
    3719337223      <Categories>
     
    3720337233      <Enabled>-1</Enabled>
    3720437234      <ItemCount>1336</ItemCount>
    37205       <LastImportTime>2016-07-28T11:17:55.794+02:00</LastImportTime>
     37235      <LastImportTime>2016-08-01T12:38:49.197+02:00</LastImportTime>
    3720637236      <UserName/>
    3720737237      <Categories>
     
    3721637246      <ImportFormat>4</ImportFormat>
    3721737247      <Enabled>-1</Enabled>
    37218       <ItemCount>293</ItemCount>
    37219       <LastImportTime>2016-07-28T11:17:57.120+02:00</LastImportTime>
     37248      <ItemCount>294</ItemCount>
     37249      <LastImportTime>2016-08-01T12:38:50.701+02:00</LastImportTime>
    3722037250      <UserName/>
    3722137251      <Categories>
  • trunk/Forms/UFormAbout.lfm

    r65 r69  
    99  OnCreate = FormCreate
    1010  OnShow = FormShow
     11  Position = poScreenCenter
    1112  LCLVersion = '1.6.0.4'
    1213  object LabelAppName: TLabel
  • trunk/Forms/UFormAcronym.lfm

    r55 r69  
    1010  OnKeyUp = FormKeyUp
    1111  OnShow = FormShow
     12  Position = poScreenCenter
    1213  LCLVersion = '1.6.0.4'
    1314  object Label1: TLabel
  • trunk/Forms/UFormAcronyms.lfm

    r55 r69  
    99  OnCreate = FormCreate
    1010  OnShow = FormShow
     11  Position = poScreenCenter
    1112  LCLVersion = '1.6.0.4'
    1213  object ListViewAcronyms: TListView
  • trunk/Forms/UFormCategories.lfm

    r51 r69  
    99  OnCreate = FormCreate
    1010  OnShow = FormShow
     11  Position = poScreenCenter
    1112  LCLVersion = '1.6.0.4'
    1213  object ListViewCategories: TListView
  • trunk/Forms/UFormCategorySelect.lfm

    r55 r69  
    11object FormCategorySelect: TFormCategorySelect
    2   Left = 786
     2  Left = 500
    33  Height = 602
    4   Top = 370
     4  Top = 253
    55  Width = 794
    66  Caption = 'Select categories'
     
    88  ClientWidth = 794
    99  OnShow = FormShow
     10  Position = poScreenCenter
    1011  LCLVersion = '1.6.0.4'
    1112  object ListBox1: TListBox
  • trunk/Forms/UFormImportFormat.lfm

    r55 r69  
    99  OnCreate = FormCreate
    1010  OnShow = FormShow
     11  Position = poScreenCenter
    1112  LCLVersion = '1.6.0.4'
    1213  object ButtonOk: TButton
  • trunk/Forms/UFormImportFormats.lfm

    r51 r69  
    99  OnCreate = FormCreate
    1010  OnShow = FormShow
     11  Position = poScreenCenter
    1112  LCLVersion = '1.6.0.4'
    1213  object ListView1: TListView
  • trunk/Forms/UFormImportPattern.lfm

    r55 r69  
    99  OnCreate = FormCreate
    1010  OnShow = FormShow
     11  Position = poScreenCenter
    1112  LCLVersion = '1.6.0.4'
    1213  object Label8: TLabel
  • trunk/Forms/UFormImportSource.lfm

    r55 r69  
    88  ClientWidth = 604
    99  OnShow = FormShow
     10  Position = poScreenCenter
    1011  LCLVersion = '1.6.0.4'
    1112  object EditName: TEdit
  • trunk/Forms/UFormImportSources.lfm

    r52 r69  
    99  OnCreate = FormCreate
    1010  OnShow = FormShow
     11  Position = poScreenCenter
    1112  LCLVersion = '1.6.0.4'
    1213  object ListView1: TListView
  • trunk/Forms/UFormMain.pas

    r64 r69  
    124124    ProjectClosed: Boolean;
    125125    ImportTotalItemCount: Integer;
     126    procedure ProjectOpen(FileName: string);
    126127    procedure Initialize;
    127128    procedure ProcessImportsJob(Job: TJob);
     
    244245    OpenDialog1.FileName := AcronymDb.FileName;
    245246  if OpenDialog1.Execute then begin
    246     AFileClose.Execute;
    247     if ProjectClosed then begin
    248       AFileNew.Execute;
    249       AcronymDb.LoadFromFile(OpenDialog1.FileName);
    250       LastOpenedList1.AddItem(OpenDialog1.FileName);
    251       UpdateAcronymsList;
    252       UpdateInterface;
    253     end;
     247    ProjectOpen(OpenDialog1.FileName);
    254248  end;
    255249end;
     
    441435end;
    442436
     437procedure TFormMain.ProjectOpen(FileName: string);
     438begin
     439  AFileClose.Execute;
     440  if ProjectClosed then begin
     441    try
     442      AFileNew.Execute;
     443      AcronymDb.LoadFromFile(FileName);
     444      LastOpenedList1.AddItem(FileName);
     445    finally
     446      UpdateAcronymsList;
     447      UpdateInterface;
     448    end;
     449  end;
     450end;
     451
    443452procedure TFormMain.Initialize;
    444453begin
     
    448457
    449458    if ParamCount > 0 then begin
     459      // Open file specified as command line parameter
    450460      AcronymDB.LoadFromFile(ParamStr(1));
    451461      LastOpenedList1.AddItem(OpenDialog1.FileName);
    452462    end else
    453     if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then
    454       AcronymDB.LoadFromFile(LastOpenedList1.Items[0]);
     463    if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then begin
     464      // Open last opened file
     465      AcronymDB.LoadFromFile(LastOpenedList1.Items[0])
     466    end else begin
     467      // Open default database with examples if no item is in recent openned history
     468      ProjectOpen(ExtractFileDir(Application.ExeName) + DirectorySeparator + 'Example Acronyms.adp');
     469    end;
    455470    UpdateAcronymsList;
    456471    ListViewFilter1.UpdateFromListView(ListViewAcronyms);
     
    564579  RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey);
    565580  PersistentForm1.RegistryContext := RegistryContext;
     581  RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles');
    566582  LastOpenedList1.LoadFromRegistry(RegistryContext);
    567583
     
    583599procedure TFormMain.SaveConfig;
    584600begin
     601  RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles');
    585602  LastOpenedList1.SaveToRegistry(RegistryContext);
    586603
  • trunk/Forms/UFormSettings.lfm

    r55 r69  
    88  ClientWidth = 689
    99  OnShow = FormShow
     10  Position = poScreenCenter
    1011  LCLVersion = '1.6.0.4'
    1112  object ComboBoxLanguage: TComboBox
  • trunk/UAcronym.pas

    r67 r69  
    430430  AddedAcronym: TAcronymMeaning;
    431431begin
    432   ItemCount := 0;
    433432  NewAcronym := TAcronymEntry.Create;
    434433  try
     
    550549procedure TImportSource.Process;
    551550begin
     551  ItemCount := 0;
    552552  case Format.Kind of
    553553    ifkParseURL: ProcessTextParseURL;
Note: See TracChangeset for help on using the changeset viewer.