Changeset 69 for trunk/Forms
- Timestamp:
- Aug 1, 2016, 12:43:49 PM (8 years ago)
- Location:
- trunk/Forms
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormAbout.lfm
r65 r69 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow 11 Position = poScreenCenter 11 12 LCLVersion = '1.6.0.4' 12 13 object LabelAppName: TLabel -
trunk/Forms/UFormAcronym.lfm
r55 r69 10 10 OnKeyUp = FormKeyUp 11 11 OnShow = FormShow 12 Position = poScreenCenter 12 13 LCLVersion = '1.6.0.4' 13 14 object Label1: TLabel -
trunk/Forms/UFormAcronyms.lfm
r55 r69 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow 11 Position = poScreenCenter 11 12 LCLVersion = '1.6.0.4' 12 13 object ListViewAcronyms: TListView -
trunk/Forms/UFormCategories.lfm
r51 r69 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow 11 Position = poScreenCenter 11 12 LCLVersion = '1.6.0.4' 12 13 object ListViewCategories: TListView -
trunk/Forms/UFormCategorySelect.lfm
r55 r69 1 1 object FormCategorySelect: TFormCategorySelect 2 Left = 7862 Left = 500 3 3 Height = 602 4 Top = 3704 Top = 253 5 5 Width = 794 6 6 Caption = 'Select categories' … … 8 8 ClientWidth = 794 9 9 OnShow = FormShow 10 Position = poScreenCenter 10 11 LCLVersion = '1.6.0.4' 11 12 object ListBox1: TListBox -
trunk/Forms/UFormImportFormat.lfm
r55 r69 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow 11 Position = poScreenCenter 11 12 LCLVersion = '1.6.0.4' 12 13 object ButtonOk: TButton -
trunk/Forms/UFormImportFormats.lfm
r51 r69 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow 11 Position = poScreenCenter 11 12 LCLVersion = '1.6.0.4' 12 13 object ListView1: TListView -
trunk/Forms/UFormImportPattern.lfm
r55 r69 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow 11 Position = poScreenCenter 11 12 LCLVersion = '1.6.0.4' 12 13 object Label8: TLabel -
trunk/Forms/UFormImportSource.lfm
r55 r69 8 8 ClientWidth = 604 9 9 OnShow = FormShow 10 Position = poScreenCenter 10 11 LCLVersion = '1.6.0.4' 11 12 object EditName: TEdit -
trunk/Forms/UFormImportSources.lfm
r52 r69 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow 11 Position = poScreenCenter 11 12 LCLVersion = '1.6.0.4' 12 13 object ListView1: TListView -
trunk/Forms/UFormMain.pas
r64 r69 124 124 ProjectClosed: Boolean; 125 125 ImportTotalItemCount: Integer; 126 procedure ProjectOpen(FileName: string); 126 127 procedure Initialize; 127 128 procedure ProcessImportsJob(Job: TJob); … … 244 245 OpenDialog1.FileName := AcronymDb.FileName; 245 246 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); 254 248 end; 255 249 end; … … 441 435 end; 442 436 437 procedure TFormMain.ProjectOpen(FileName: string); 438 begin 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; 450 end; 451 443 452 procedure TFormMain.Initialize; 444 453 begin … … 448 457 449 458 if ParamCount > 0 then begin 459 // Open file specified as command line parameter 450 460 AcronymDB.LoadFromFile(ParamStr(1)); 451 461 LastOpenedList1.AddItem(OpenDialog1.FileName); 452 462 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; 455 470 UpdateAcronymsList; 456 471 ListViewFilter1.UpdateFromListView(ListViewAcronyms); … … 564 579 RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey); 565 580 PersistentForm1.RegistryContext := RegistryContext; 581 RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles'); 566 582 LastOpenedList1.LoadFromRegistry(RegistryContext); 567 583 … … 583 599 procedure TFormMain.SaveConfig; 584 600 begin 601 RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey + '\RecentFiles'); 585 602 LastOpenedList1.SaveToRegistry(RegistryContext); 586 603 -
trunk/Forms/UFormSettings.lfm
r55 r69 8 8 ClientWidth = 689 9 9 OnShow = FormShow 10 Position = poScreenCenter 10 11 LCLVersion = '1.6.0.4' 11 12 object ComboBoxLanguage: TComboBox
Note:
See TracChangeset
for help on using the changeset viewer.