Changeset 10
- Timestamp:
- Apr 22, 2016, 9:59:52 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 32 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AcronymDecoder.lpi
r9 r10 13 13 </General> 14 14 <i18n> 15 <EnableI18N LFM="False"/> 15 <EnableI18N Value="True"/> 16 <OutDir Value="Languages"/> 16 17 </i18n> 17 18 <VersionInfo> … … 69 70 </local> 70 71 </RunParams> 71 <RequiredPackages Count=" 4">72 <RequiredPackages Count="5"> 72 73 <Item1> 74 <PackageName Value="CoolTranslator"/> 75 <DefaultFilename Value="Packages\CoolTranslator\CoolTranslator.lpk" Prefer="True"/> 76 </Item1> 77 <Item2> 73 78 <PackageName Value="TemplateGenerics"/> 74 79 <DefaultFilename Value="Packages\TemplateGenerics\TemplateGenerics.lpk" Prefer="True"/> 75 </Item 1>76 <Item 2>80 </Item2> 81 <Item3> 77 82 <PackageName Value="Common"/> 78 83 <DefaultFilename Value="Packages\Common\Common.lpk" Prefer="True"/> 79 </Item 2>80 <Item 3>84 </Item3> 85 <Item4> 81 86 <PackageName Value="synapse"/> 82 87 <DefaultFilename Value="Packages\synapse\synapse.lpk" Prefer="True"/> 83 </Item 3>84 <Item 4>88 </Item4> 89 <Item5> 85 90 <PackageName Value="LCL"/> 86 </Item 4>91 </Item5> 87 92 </RequiredPackages> 88 <Units Count=" 5">93 <Units Count="6"> 89 94 <Unit0> 90 95 <Filename Value="AcronymDecoder.lpr"/> … … 116 121 <ResourceBaseClass Value="Form"/> 117 122 </Unit4> 123 <Unit5> 124 <Filename Value="UFormSettings.pas"/> 125 <IsPartOfProject Value="True"/> 126 <ComponentName Value="FormSettings"/> 127 <HasResources Value="True"/> 128 <ResourceBaseClass Value="Form"/> 129 </Unit5> 118 130 </Units> 119 131 </ProjectOptions> … … 144 156 <StackChecks Value="True"/> 145 157 </Checks> 146 <VerifyObjMethodCallValidity Value="True"/>147 158 </CodeGeneration> 148 159 <Linking> -
trunk/AcronymDecoder.lpr
r9 r10 9 9 Interfaces, // this includes the LCL widgetset 10 10 Forms, UFormMain, UAcronym, synapse, UFormImport, Common, SysUtils, TemplateGenerics, 11 UFormAcronym 11 UFormAcronym, CoolTranslator, UFormSettings 12 12 { you can add units after this }; 13 13 … … 33 33 Application.CreateForm(TFormImport, FormImport); 34 34 Application.CreateForm(TFormAcronym, FormAcronym); 35 Application.CreateForm(TFormSettings, FormSettings); 35 36 Application.Run; 36 37 end. -
trunk/Packages/Common/Common.pas
r9 r10 5 5 unit Common; 6 6 7 {$warn 5023 off : no warning about unused units}8 7 interface 9 8 -
trunk/Packages/TemplateGenerics/TemplateGenerics.pas
r9 r10 5 5 unit TemplateGenerics; 6 6 7 {$warn 5023 off : no warning about unused units}8 7 interface 9 8 -
trunk/Packages/synapse/synapse.pas
r9 r10 5 5 unit synapse; 6 6 7 {$warn 5023 off : no warning about unused units}8 7 interface 9 8 -
trunk/UFormAcronym.lfm
r8 r10 13 13 object Label1: TLabel 14 14 Left = 8 15 Height = 2 015 Height = 24 16 16 Top = 16 17 Width = 4317 Width = 60 18 18 Caption = 'Name:' 19 19 ParentColor = False … … 21 21 object EditAcronym: TEdit 22 22 Left = 136 23 Height = 2823 Height = 34 24 24 Top = 15 25 25 Width = 272 … … 30 30 object Label2: TLabel 31 31 Left = 8 32 Height = 2 032 Height = 24 33 33 Top = 49 34 Width = 6134 Width = 83 35 35 Caption = 'Meaning:' 36 36 ParentColor = False … … 38 38 object EditMeaning: TEdit 39 39 Left = 136 40 Height = 2840 Height = 34 41 41 Top = 49 42 42 Width = 272 … … 69 69 object Label3: TLabel 70 70 Left = 8 71 Height = 2 071 Height = 24 72 72 Top = 88 73 Width = 7973 Width = 109 74 74 Caption = 'Description:' 75 75 ParentColor = False -
trunk/UFormImport.lfm
r8 r10 29 29 object ComboBoxDataFormat: TComboBox 30 30 Left = 256 31 Height = 2831 Height = 34 32 32 Top = 5 33 33 Width = 140 34 ItemHeight = 2034 ItemHeight = 0 35 35 ItemIndex = 0 36 36 Items.Strings = ( … … 44 44 object Label1: TLabel 45 45 Left = 153 46 Height = 2 046 Height = 24 47 47 Top = 9 48 Width = 8448 Width = 116 49 49 Caption = 'Data format:' 50 50 ParentColor = False -
trunk/UFormImport.pas
r8 r10 38 38 uses 39 39 UFormMain; 40 41 resourcestring 42 SImportedNewAcronyms = 'Imported %d new acronyms.'; 40 43 41 44 … … 112 115 end; 113 116 if AddedCount > 0 then FormMain.AcronymDb.Modified := True; 114 ShowMessage(Format( 'Imported %d new acronyms.', [AddedCount]));117 ShowMessage(Format(SImportedNewAcronyms, [AddedCount])); 115 118 end; 116 119 … … 159 162 Columns.Free; 160 163 if AddedCount > 0 then FormMain.AcronymDb.Modified := True; 161 ShowMessage(Format( 'Imported %d new acronyms.', [AddedCount]));164 ShowMessage(Format(SImportedNewAcronyms, [AddedCount])); 162 165 end; 163 166 -
trunk/UFormMain.lfm
r9 r10 1 1 object FormMain: TFormMain 2 Left = 5342 Left = 767 3 3 Height = 446 4 Top = 3524 Top = 445 5 5 Width = 631 6 6 Caption = 'Acronym Decoder' … … 13 13 OnDestroy = FormDestroy 14 14 OnShow = FormShow 15 LCLVersion = '1. 7'15 LCLVersion = '1.6.0.4' 16 16 object ListViewAcronyms: TListView 17 17 Left = 8 … … 4342 4342 Visible = True 4343 4343 OnClick = TrayIcon1Click 4344 left = 1524345 top = 2 564344 left = 80 4345 top = 272 4346 4346 end 4347 4347 object PopupMenuTryIcon: TPopupMenu 4348 left = 1444349 top = 1924348 left = 80 4349 top = 208 4350 4350 object MenuItem2: TMenuItem 4351 4351 Action = AShow … … 4355 4355 Action = AImport 4356 4356 end 4357 object MenuItem19: TMenuItem 4358 Action = ASettings 4359 end 4357 4360 object MenuItem1: TMenuItem 4358 4361 Action = AExit … … 4360 4363 end 4361 4364 object ActionList1: TActionList 4362 left = 46 54363 top = 1 714365 left = 464 4366 top = 144 4364 4367 object AExit: TAction 4365 4368 Caption = 'Exit' … … 4413 4416 OnExecute = AFileSaveAsExecute 4414 4417 end 4418 object ASettings: TAction 4419 Caption = 'Settings' 4420 OnExecute = ASettingsExecute 4421 end 4415 4422 end 4416 4423 object PersistentForm1: TPersistentForm 4417 4424 MinVisiblePart = 50 4418 4425 EntireVisible = False 4419 left = 3044420 top = 1124426 left = 264 4427 top = 80 4421 4428 end 4422 4429 object PopupMenuAcronym: TPopupMenu 4423 left = 3594424 top = 2 634430 left = 264 4431 top = 208 4425 4432 object MenuItem4: TMenuItem 4426 4433 Action = AAcronymAdd … … 4437 4444 end 4438 4445 object MainMenu1: TMainMenu 4439 left = 46 54440 top = 1124446 left = 464 4447 top = 80 4441 4448 object MenuItem8: TMenuItem 4442 4449 Caption = 'File' … … 4471 4478 Action = AImport 4472 4479 end 4480 object MenuItem18: TMenuItem 4481 Action = ASettings 4482 end 4473 4483 end 4474 4484 end 4475 4485 object OpenDialog1: TOpenDialog 4476 left = 1514477 top = 854486 left = 80 4487 top = 144 4478 4488 end 4479 4489 object SaveDialog1: TSaveDialog 4480 left = 484481 top = 8 54490 left = 80 4491 top = 88 4482 4492 end 4483 4493 object LastOpenedList1: TLastOpenedList 4484 4494 MaxCount = 10 4485 4495 OnChange = LastOpenedList1Change 4486 left = 5094496 left = 264 4487 4497 top = 267 4488 4498 end 4499 object CoolTranslator1: TCoolTranslator 4500 POFilesFolder = 'Languages' 4501 left = 264 4502 top = 144 4503 end 4489 4504 end -
trunk/UFormMain.pas
r9 r10 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 9 ComCtrls, StdCtrls, ExtCtrls, ActnList, UAcronym, UPersistentForm, Contnrs, 10 URegistry, ULastOpenedList, Registry;10 URegistry, ULastOpenedList, UCoolTranslator, Registry; 11 11 12 12 type … … 19 19 AAcronymRemove: TAction; 20 20 AAcronymRemoveAll: TAction; 21 ASettings: TAction; 21 22 AFileSaveAs: TAction; 22 23 AFileClose: TAction; … … 28 29 AExit: TAction; 29 30 ActionList1: TActionList; 31 CoolTranslator1: TCoolTranslator; 30 32 EditSearch: TEdit; 31 33 LastOpenedList1: TLastOpenedList; … … 41 43 MenuItem16: TMenuItem; 42 44 MenuItem17: TMenuItem; 45 MenuItem18: TMenuItem; 46 MenuItem19: TMenuItem; 43 47 MenuItemOpenRecent: TMenuItem; 44 48 MenuItem2: TMenuItem; … … 67 71 procedure AFileSaveExecute(Sender: TObject); 68 72 procedure AImportExecute(Sender: TObject); 73 procedure ASettingsExecute(Sender: TObject); 69 74 procedure AShowExecute(Sender: TObject); 70 75 procedure EditSearchChange(Sender: TObject); … … 101 106 102 107 uses 103 UFormImport, UFormAcronym; 108 UFormImport, UFormAcronym, UFormSettings; 109 110 resourcestring 111 SModified = 'modified'; 112 SAppExit = 'Application exit'; 113 SAppExitQuery = 'Acronyms were modified. Do you want to save them to file before exit?'; 114 SRemoveAllAcronyms = 'Remove all acronyms'; 115 SRemoveAllAcronymsQuery = 'Do you want to remove all acronyms?'; 116 SRemoveAcronym = 'Remove acronym'; 117 SRemoveAcronymQuery = 'Do you want to remove selected acronym?'; 104 118 105 119 const … … 133 147 begin 134 148 if Assigned(AcronymDb) and AcronymDb.Modified then begin 135 ModalResult := MessageDlg('Application exit', 136 'Acronyms were modified. Do you want to save them to file before exit?', 149 ModalResult := MessageDlg(SAppExit, SAppExitQuery, 137 150 mtConfirmation, [mbYes, mbNo, mbCancel], 0); 138 151 if ModalResult = mrYes then begin … … 237 250 procedure TFormMain.AAcronymRemoveAllExecute(Sender: TObject); 238 251 begin 239 if MessageDlg( 'Remove all acronyms', 'Do you want to remove all acronyms?',252 if MessageDlg(SRemoveAllAcronyms, SRemoveAllAcronymsQuery, 240 253 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 241 254 AcronymDb.Acronyms.Clear; … … 249 262 begin 250 263 if Assigned(ListViewAcronyms.Selected) then begin 251 if MessageDlg( 'Remove acronym', 'Do you want to remove selected acronym?',264 if MessageDlg(SRemoveAcronym, SRemoveAcronymQuery, 252 265 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 253 266 AcronymDb.RemoveAcronym(TAcronymMeaning(ListViewAcronyms.Selected.Data).Acronym.Name, … … 285 298 end; 286 299 300 procedure TFormMain.ASettingsExecute(Sender: TObject); 301 begin 302 FormSettings.ShowModal; 303 end; 304 287 305 procedure TFormMain.AShowExecute(Sender: TObject); 288 306 begin … … 387 405 Title := Application.Title; 388 406 if Assigned(AcronymDb) then Title := Title + ' - ' + ExtractFileName(AcronymDb.FileName); 389 if Assigned(AcronymDb) and AcronymDb.Modified then Title := Title + ' ( modified)';407 if Assigned(AcronymDb) and AcronymDb.Modified then Title := Title + ' (' + SModified + ')'; 390 408 Caption := Title; 391 409 end; … … 396 414 PersistentForm1.RegistryContext := RegistryContext; 397 415 LastOpenedList1.LoadFromRegistry(RegistryContext); 416 417 with TRegistryEx.Create do 418 try 419 RootKey := HKEY_CURRENT_USER; 420 OpenKey(DefaultRegKey, True); 421 if ValueExists('LanguageCode') then 422 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', '')) 423 else CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(''); 424 finally 425 Free; 426 end; 398 427 end; 399 428 … … 401 430 begin 402 431 LastOpenedList1.SaveToRegistry(RegistryContext); 432 433 with TRegistryEx.Create do 434 try 435 RootKey := HKEY_CURRENT_USER; 436 OpenKey(DefaultRegKey, True); 437 if Assigned(CoolTranslator1.Language) and (CoolTranslator1.Language.Code <> '') then 438 WriteString('LanguageCode', CoolTranslator1.Language.Code) 439 else DeleteValue('LanguageCode'); 440 finally 441 Free; 442 end; 403 443 end; 404 444
Note:
See TracChangeset
for help on using the changeset viewer.