Changeset 33
- Timestamp:
- Jul 13, 2016, 2:51:53 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AcronymDecoder.lpi
r31 r33 124 124 <Filename Value="Forms\UFormImport.pas"/> 125 125 <IsPartOfProject Value="True"/> 126 <HasResources Value="True"/> 126 <ComponentName Value="FormImport"/> 127 <HasResources Value="True"/> 128 <ResourceBaseClass Value="Form"/> 127 129 </Unit5> 128 130 <Unit6> -
trunk/Forms/UFormAcronym.lfm
r17 r33 122 122 end 123 123 object ActionList1: TActionList 124 Images = FormMain.ImageList1 124 125 left = 361 125 126 top = 240 126 127 object ACategoryRemove: TAction 127 128 Caption = 'Remove' 129 ImageIndex = 4 128 130 OnExecute = ACategoryRemoveExecute 129 131 end 130 132 object ACategoryAdd: TAction 131 133 Caption = 'Add' 134 ImageIndex = 0 132 135 OnExecute = ACategoryAddExecute 133 136 end 134 137 end 135 138 object PopupMenuCategory: TPopupMenu 139 Images = FormMain.ImageList1 136 140 left = 192 137 141 top = 244 142 object MenuItem2: TMenuItem 143 Action = ACategoryAdd 144 end 145 object MenuItem1: TMenuItem 146 Action = ACategoryRemove 147 end 138 148 end 139 149 end -
trunk/Forms/UFormAcronym.pas
r16 r33 29 29 ListBox1: TListBox; 30 30 MemoDescription: TMemo; 31 MenuItem1: TMenuItem; 32 MenuItem2: TMenuItem; 31 33 PopupMenuCategory: TPopupMenu; 32 34 procedure ACategoryAddExecute(Sender: TObject); … … 52 54 uses 53 55 UFormMain, UFormCategorySelect; 54 55 resourcestring56 SCategory = 'Category';57 SRemoveCategory = 'Remove categories';58 SRemoveCategoryQuery = 'Do you really want to remove selected categories?';59 56 60 57 { TFormAcronym } -
trunk/Forms/UFormCategorySelect.lfm
r13 r33 8 8 ClientWidth = 794 9 9 OnShow = FormShow 10 LCLVersion = '1. 7'10 LCLVersion = '1.6.0.4' 11 11 object ListBox1: TListBox 12 12 Left = 16 … … 17 17 ItemHeight = 0 18 18 MultiSelect = True 19 OnDblClick = ListBox1DblClick 20 OnKeyPress = ListBox1KeyPress 19 21 ScrollWidth = 762 20 22 TabOrder = 0 21 TopIndex = -122 23 end 23 24 object ButtonOk: TButton -
trunk/Forms/UFormCategorySelect.pas
r13 r33 18 18 ListBox1: TListBox; 19 19 procedure FormShow(Sender: TObject); 20 procedure ListBox1DblClick(Sender: TObject); 21 procedure ListBox1KeyPress(Sender: TObject; var Key: char); 20 22 private 21 23 { private declarations } … … 26 28 var 27 29 FormCategorySelect: TFormCategorySelect; 30 31 resourcestring 32 SCategory = 'Category'; 33 SRemoveCategory = 'Remove categories'; 34 SRemoveCategoryQuery = 'Do you really want to remove selected categories?'; 28 35 29 36 implementation … … 38 45 procedure TFormCategorySelect.FormShow(Sender: TObject); 39 46 begin 47 end; 48 49 procedure TFormCategorySelect.ListBox1DblClick(Sender: TObject); 50 begin 51 ButtonOk.Click; 52 end; 53 54 procedure TFormCategorySelect.ListBox1KeyPress(Sender: TObject; var Key: char); 55 begin 56 if Key = #13 then ButtonOk.Click; 40 57 end; 41 58 -
trunk/Forms/UFormImportSource.lfm
r29 r33 1 1 object FormImportSource: TFormImportSource 2 Left = 5063 Height = 2824 Top = 3 635 Width = 5072 Left = 492 3 Height = 403 4 Top = 313 5 Width = 604 6 6 Caption = 'Import source' 7 ClientHeight = 282 8 ClientWidth = 507 7 ClientHeight = 403 8 ClientWidth = 604 9 OnShow = FormShow 9 10 LCLVersion = '1.6.0.4' 10 11 object EditName: TEdit 11 Left = 1 6012 Left = 135 12 13 Height = 28 13 14 Top = 10 14 Width = 34015 Width = 455 15 16 Anchors = [akTop, akLeft, akRight] 16 17 TabOrder = 0 … … 25 26 end 26 27 object Label2: TLabel 27 Left = 828 Left = 10 28 29 Height = 20 29 Top = 4 830 Top = 49 30 31 Width = 78 31 32 Caption = 'Source URL:' … … 33 34 end 34 35 object EditURL: TEdit 35 Left = 1 6036 Left = 135 36 37 Height = 28 37 38 Top = 49 38 Width = 34039 Width = 455 39 40 Anchors = [akTop, akLeft, akRight] 40 41 TabOrder = 1 41 42 end 42 43 object ButtonOk: TButton 43 Left = 41244 Left = 515 44 45 Height = 25 45 Top = 24446 Top = 365 46 47 Width = 75 47 48 Anchors = [akRight, akBottom] … … 51 52 end 52 53 object ButtonCancel: TButton 53 Left = 31654 Left = 413 54 55 Height = 25 55 Top = 24456 Top = 365 56 57 Width = 75 57 58 Anchors = [akRight, akBottom] … … 61 62 end 62 63 object Label3: TLabel 63 Left = 1 164 Left = 10 64 65 Height = 20 65 66 Top = 96 … … 69 70 end 70 71 object ComboBox1: TComboBox 71 Left = 1 6072 Left = 135 72 73 Height = 28 73 74 Top = 91 74 Width = 21275 Width = 334 75 76 Anchors = [akTop, akLeft, akRight] 76 77 ItemHeight = 20 … … 79 80 end 80 81 object ButtonShowFormat: TButton 81 Left = 38082 Left = 477 82 83 Height = 25 83 84 Top = 91 84 Width = 1 2085 Width = 112 85 86 Anchors = [akTop, akRight] 86 87 Caption = 'Configure' … … 89 90 end 90 91 object CheckBoxEnabled: TCheckBox 91 Left = 1 192 Left = 10 92 93 Height = 24 93 Top = 1 3694 Top = 128 94 95 Width = 78 95 96 Caption = 'Enabled' 96 97 TabOrder = 6 97 98 end 99 object Label4: TLabel 100 Left = 10 101 Height = 20 102 Top = 160 103 Width = 74 104 Caption = 'Categories:' 105 ParentColor = False 106 end 107 object ListBox1: TListBox 108 Left = 135 109 Height = 141 110 Top = 160 111 Width = 455 112 Anchors = [akTop, akLeft, akRight] 113 ItemHeight = 0 114 MultiSelect = True 115 PopupMenu = PopupMenuCategory 116 ScrollWidth = 358 117 TabOrder = 7 118 end 119 object Button1: TButton 120 Left = 135 121 Height = 25 122 Top = 312 123 Width = 75 124 Action = ACategoryAdd 125 TabOrder = 8 126 end 127 object Button2: TButton 128 Left = 231 129 Height = 25 130 Top = 312 131 Width = 75 132 Action = ACategoryRemove 133 TabOrder = 9 134 end 135 object Bevel1: TBevel 136 Left = 10 137 Height = 2 138 Top = 352 139 Width = 580 140 Anchors = [akLeft, akBottom] 141 end 142 object ActionList1: TActionList 143 Images = FormMain.ImageList1 144 left = 384 145 top = 208 146 object ACategoryRemove: TAction 147 Caption = 'Remove' 148 ImageIndex = 4 149 OnExecute = ACategoryRemoveExecute 150 end 151 object ACategoryAdd: TAction 152 Caption = 'Add' 153 ImageIndex = 0 154 OnExecute = ACategoryAddExecute 155 end 156 end 157 object PopupMenuCategory: TPopupMenu 158 Images = FormMain.ImageList1 159 left = 208 160 top = 208 161 object MenuItem2: TMenuItem 162 Action = ACategoryAdd 163 end 164 object MenuItem1: TMenuItem 165 Action = ACategoryRemove 166 end 167 end 98 168 end -
trunk/Forms/UFormImportSource.lrt
r29 r33 7 7 TFORMIMPORTSOURCE.BUTTONSHOWFORMAT.CAPTION=Configure 8 8 TFORMIMPORTSOURCE.CHECKBOXENABLED.CAPTION=Enabled 9 TFORMIMPORTSOURCE.LABEL4.CAPTION=Categories: 10 TFORMIMPORTSOURCE.ACATEGORYREMOVE.CAPTION=Remove 11 TFORMIMPORTSOURCE.ACATEGORYADD.CAPTION=Add -
trunk/Forms/UFormImportSource.pas
r29 r33 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UAcronym;9 ActnList, Menus, ExtCtrls, UAcronym; 10 10 11 11 type … … 14 14 15 15 TFormImportSource = class(TForm) 16 ACategoryAdd: TAction; 17 ACategoryRemove: TAction; 18 ActionList1: TActionList; 19 Bevel1: TBevel; 20 Button1: TButton; 21 Button2: TButton; 16 22 ButtonShowFormat: TButton; 17 23 ButtonOk: TButton; … … 24 30 Label2: TLabel; 25 31 Label3: TLabel; 32 Label4: TLabel; 33 ListBox1: TListBox; 34 MenuItem1: TMenuItem; 35 MenuItem2: TMenuItem; 36 PopupMenuCategory: TPopupMenu; 37 procedure ACategoryAddExecute(Sender: TObject); 38 procedure ACategoryRemoveExecute(Sender: TObject); 26 39 procedure ButtonShowFormatClick(Sender: TObject); 40 procedure FormShow(Sender: TObject); 27 41 private 28 42 { private declarations } 29 43 public 44 procedure UpdateInterface; 30 45 procedure Load(ImportSource: TImportSource); 31 46 procedure Save(ImportSource: TImportSource); … … 40 55 41 56 uses 42 UFormMain, UFormImportFormat ;57 UFormMain, UFormImportFormat, UFormCategorySelect; 43 58 44 59 { TFormImportSource } … … 62 77 end; 63 78 79 procedure TFormImportSource.FormShow(Sender: TObject); 80 begin 81 UpdateInterface; 82 end; 83 84 procedure TFormImportSource.UpdateInterface; 85 begin 86 ACategoryRemove.Enabled := ListBox1.ItemIndex <> -1; 87 end; 88 89 procedure TFormImportSource.ACategoryAddExecute(Sender: TObject); 90 var 91 I: Integer; 92 begin 93 FormCategorySelect.Load(ListBox1.Items); 94 if FormCategorySelect.ShowModal = mrOk then begin 95 for I := 0 to FormCategorySelect.ListBox1.Count - 1 do 96 if FormCategorySelect.ListBox1.Selected[I] then begin 97 ListBox1.Items.AddObject(FormCategorySelect.ListBox1.Items[I], FormCategorySelect.ListBox1.Items.Objects[I]); 98 end; 99 end; 100 end; 101 102 procedure TFormImportSource.ACategoryRemoveExecute(Sender: TObject); 103 var 104 I: Integer; 105 begin 106 if MessageDlg(SRemoveCategory, SRemoveCategoryQuery, 107 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 108 for I := ListBox1.Items.Count - 1 downto 0 do 109 if ListBox1.Selected[I] then 110 ListBox1.Items.Delete(I); 111 UpdateInterface; 112 end; 113 end; 114 64 115 procedure TFormImportSource.Load(ImportSource: TImportSource); 65 116 var … … 80 131 ComboBox1.ItemIndex := 0; 81 132 CheckBoxEnabled.Checked := ImportSource.Enabled; 133 ImportSource.Categories.AssignToStrings(ListBox1.Items); 82 134 end; 83 135 … … 88 140 ImportSource.Format := TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]); 89 141 ImportSource.Enabled := CheckBoxEnabled.Checked; 142 ImportSource.Categories.AssignFromStrings(ListBox1.Items); 90 143 end; 91 144 -
trunk/Forms/UFormImportSources.lfm
r30 r33 3 3 Height = 414 4 4 Top = 327 5 Width = 5915 Width = 812 6 6 Caption = 'Import sources' 7 7 ClientHeight = 414 8 ClientWidth = 5918 ClientWidth = 812 9 9 OnShow = FormShow 10 10 LCLVersion = '1.6.0.4' … … 13 13 Height = 398 14 14 Top = 8 15 Width = 57715 Width = 798 16 16 Anchors = [akTop, akLeft, akRight, akBottom] 17 17 Checkboxes = True … … 23 23 item 24 24 Caption = 'URL' 25 Width = 407 25 Width = 250 26 end 27 item 28 Caption = 'Count' 29 Width = 70 30 end 31 item 32 Caption = 'Categories' 33 Width = 200 26 34 end> 27 35 MultiSelect = True … … 60 68 object AProcess: TAction 61 69 Caption = 'Process' 70 ImageIndex = 5 62 71 OnExecute = AProcessExecute 63 72 end … … 69 78 object MenuItem1: TMenuItem 70 79 Action = AAdd 80 Bitmap.Data = { 81 36040000424D3604000000000000360000002800000010000000100000000100 82 2000000000000004000064000000640000000000000000000000000000000000 83 0000000000000000000000000000000000000000000000000000000000000000 84 0000000000000000000000000000000000000000000000000000000000000000 85 000000000000000000000000000000000000D4D4D4FFB2B2B2FFB2B2B2FFD4D4 86 D4FF000000000000000000000000000000000000000000000000000000000000 87 0000000000000000000000000000709B70FF004A00FF004800FF4E764EFFB2B2 88 B2FF000000000000000000000000000000000000000000000000000000000000 89 0000000000000000000000000000004E00FF00C800FF00C400FF004800FFB2B2 90 B2FF000000000000000000000000000000000000000000000000000000000000 91 0000000000000000000000000000005000FF00CA00FF00C600FF004A00FFB2B2 92 B2FF000000000000000000000000000000000000000000000000000000000000 93 0000000000000000000000000000005300FF00CE00FF00CA00FF004C00FFB2B2 94 B2FF00000000000000000000000000000000000000000000000000000000D4D4 95 D4FFB2B2B2FFB2B2B2FFB2B2B2FF005400FF00D200FF00CE00FF004E00FFB2B2 96 B2FFB2B2B2FFB2B2B2FFB2B2B2FFB2B2B2FFD4D4D4FF0000000070A670FF005E 97 00FF005C00FF005A00FF005800FF005600FF00D600FF00D000FF005000FF004E 98 00FF004C00FF004A00FF004A00FF4E764EFFB2B2B2FF00000000006200FF8CFE 99 8CFF00EA00FF00E600FF00E200FF00DE00FF00DA00FF00D400FF00D000FF00CC 100 00FF00C800FF00C400FF00C200FF004800FFB2B2B2FF00000000006400FFECFF 101 ECFF8CFE8CFF8CFE8CFF8CFE8CFF8CFE8CFF00DE00FF00D900FF00D400FF00D0 102 00FF00CC00FF00C800FF00C400FF004A00FFD4D4D4FF0000000070A970FF0064 103 00FF006400FF006200FF006000FF006000FF8CFE8CFF00DD00FF005800FF0056 104 00FF005400FF005300FF005000FF709C70FF0000000000000000000000000000 105 0000000000000000000000000000006000FF8CFE8CFF00E000FF005A00FFB2B2 106 B2FF000000000000000000000000000000000000000000000000000000000000 107 0000000000000000000000000000006200FF8CFE8CFF00E500FF005C00FFB2B2 108 B2FF000000000000000000000000000000000000000000000000000000000000 109 0000000000000000000000000000006400FF8CFE8CFF00E800FF005E00FFB2B2 110 B2FF000000000000000000000000000000000000000000000000000000000000 111 0000000000000000000000000000006400FFECFFECFF8CFE8CFF006000FFD4D4 112 D4FF000000000000000000000000000000000000000000000000000000000000 113 000000000000000000000000000070A970FF006400FF006200FF70A670FF0000 114 0000000000000000000000000000000000000000000000000000 115 } 71 116 end 72 117 object MenuItem2: TMenuItem 73 118 Action = AModify 119 Bitmap.Data = { 120 36040000424D3604000000000000360000002800000010000000100000000100 121 2000000000000004000064000000640000000000000000000000986B37FF976A 122 36FF966935FF966734FF956633FF946532FF946531FF936430FF92622FFF9261 123 2EFF91602DFF90602CFF905F2BFF8F5D2AFF8E5C29FF8D5B28FF996C38FFF8F7 124 F6FFF8F7F5FFF7F6F5FFF6F6F4FFF6F5F3FFF5F5F3FFF5F4F2FFF4F3F1FFF4F3 125 F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F0EEFFF1F0EDFF8E5D29FF996D3AFFF9F8 126 F7FF959594FF878787FF9B9A9AFFF7F6F4FFF6F5F3FFF6F5F3FFF5F4F2FFF4F3 127 F1FFF4F3F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F1EEFF8F5E2AFF9A6E3BFFF9F9 128 F8FF7C7C7CFFC4C4C4FF878787FFF7F6F5FF7A7A7AFF787878FF747474FF7171 129 70FF6D6D6CFF696968FF656565FF616161FFF2F1EFFF905F2BFF9B6F3CFFFAF9 130 F8FFBEBEBDFF929292FFBCBCBBFFF8F7F6FFF7F7F5FFF7F6F4FFF6F5F4FFF6F5 131 F3FFF5F4F2FFF5F4F2FFF4F3F1FFF4F2F0FFF3F2F0FF91602DFF9C703DFFFAFA 132 F9FFFAF9F9FFF9F9F8FFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F5 133 F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FFF4F3F0FF92612EFF9D723EFFFBFB 134 FAFF9F9F9EFF7F7F7FFFAEAEADFFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6 135 F5FFF6F6F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FF92622FFF9D7340FFFCFB 136 FBFF818181FFC4C4C4FF8F8F8FFFFAF9F8FF7B7B7AFF797979FF757574FF7271 137 71FF6D6D6DFF696969FF666665FF626261FFF5F4F2FF936430FF9E7441FFFCFC 138 FCFFB5B5B5FF848484FFBEBDBDFFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FFF8F8 139 F6FFF8F7F5FFF7F6F5FFF7F6F4FFF6F5F3FFF6F5F3FF946531FF9F7542FFFDFD 140 FCFFFCFCFCFFFCFCFBFFFBFBFAFFFBFAFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8 141 F7FFF8F8F6FFF8F7F6FFF7F6F5FFF7F6F4FFF6F5F4FF956633FFA07643FFFEFD 142 FDFF8C8C8CFF525252FFA4A4A4FFFBFBFAFFFBFBFAFFFAFAF9FFFAF9F8FFF9F9 143 F8FFF9F8F7FFF8F8F6FFF8F7F6FFF7F7F5FFF7F6F4FF966734FFA17844FFFEFE 144 FEFF5F5F5FFF949494FF535353FFFCFCFBFF7B7B7BFF797979FF757575FF7272 145 72FF6E6E6EFF6A6A69FF666666FF626262FFF7F7F5FF966935FFA17946FFFFFF 146 FFFF878787FF5D5D5DFFA0A0A0FFFDFCFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFA 147 F9FFFAFAF9FFFAF9F8FFF9F8F7FFF8F8F7FFF8F7F6FF976A36FFA27A47FFFFFF 148 FFFFFFFFFFFFFEFEFEFFFEFEFEFFFDFDFDFFFDFDFCFFFCFCFBFFFCFBFBFFFBFB 149 FAFFFBFAF9FFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FF986B37FFA37B48FFBEA2 150 7FFFBEA17EFFBDA17DFFBDA07CFFBD9F7CFFBC9F7BFFBB9E7AFFBB9D7AFFBB9D 151 79FFBA9C78FFB99B78FFB99A77FFB89A76FFB89975FF996C39FFA37B48FFA37B 152 48FFA27A47FFA27946FFA17845FFA07744FFA07643FF9F7542FF9E7441FF9E73 153 40FF9D723FFF9C713EFF9C703DFF9B6F3CFF9A6E3BFF9A6D3AFF 154 } 74 155 end 75 156 object MenuItem3: TMenuItem 76 157 Action = ARemove 158 Bitmap.Data = { 159 36040000424D3604000000000000360000002800000010000000100000000100 160 2000000000000004000064000000640000000000000000000000000000000000 161 0000000000000000000000000000000000000000000000000000000000000000 162 0000000000000000000000000000000000000000000000000000000000000000 163 000000000000DCDCDCFFB2B2B2FFDCDCDCFF0000000000000000000000000000 164 000000000000DCDCDCFFB2B2B2FFDCDCDCFF0000000000000000000000000000 165 00007979A8FF000067FF626291FFB2B2B2FFDCDCDCFF00000000000000000000 166 00007979A8FF000050FF626291FFB2B2B2FFDCDCDCFF00000000000000008C8C 167 BBFF00006EFF0035FFFF000068FF626291FFB2B2B2FFDCDCDCFF000000007979 168 A8FF000054FF0015FFFF000050FF626291FFB2B2B2FF00000000000000000000 169 72FF619BFFFF003AFFFF0035FFFF000067FF626291FFB2B2B2FF7979A8FF0000 170 59FF001BFFFF0018FFFF0015FFFF000050FFDCDCDCFF00000000000000008C8C 171 BBFF000075FF619BFFFF003AFFFF0035FFFF000067FF626291FF000061FF0023 172 FFFF001FFFFF001BFFFF000054FF7979A8FF0000000000000000000000000000 173 00008C8CBBFF000075FF619BFFFF003AFFFF0035FFFF000067FF002CFFFF0027 174 FFFF0023FFFF000059FF7979A8FF000000000000000000000000000000000000 175 0000000000008C8CBBFF000075FF619BFFFF003AFFFF0035FFFF0030FFFF002B 176 FFFF000061FF7979A8FF00000000000000000000000000000000000000000000 177 000000000000000000007979A8FF000075FF003EFFFF003AFFFF0035FFFF0000 178 68FF626291FFB2B2B2FFDCDCDCFF000000000000000000000000000000000000 179 0000000000007979A8FF00007CFF0047FFFF0042FFFF003EFFFF003AFFFF0035 180 FFFF000068FF626291FFB2B2B2FFDCDCDCFF0000000000000000000000000000 181 00007979A8FF000082FF004EFFFF004BFFFF0047FFFF000075FF619BFFFF003A 182 FFFF0035FFFF000068FF626291FFB2B2B2FFDCDCDCFF00000000000000008C8C 183 BBFF000086FF0054FFFF0052FFFF004EFFFF00007CFF7979A8FF000075FF619B 184 FFFF003AFFFF0035FFFF000067FF626291FFB2B2B2FF00000000000000000000 185 88FF619BFFFF0057FFFF0054FFFF000082FF7979A8FF000000008C8CBBFF0000 186 75FF619BFFFF003AFFFF0035FFFF000068FFDCDCDCFF00000000000000008C8C 187 BBFF000088FF619BFFFF000086FF7979A8FF0000000000000000000000008C8C 188 BBFF000075FF619BFFFF00006EFF7979A8FF0000000000000000000000000000 189 00008C8CBBFF000088FF8C8CBBFF000000000000000000000000000000000000 190 00008C8CBBFF000075FF8C8CBBFF000000000000000000000000000000000000 191 0000000000000000000000000000000000000000000000000000000000000000 192 0000000000000000000000000000000000000000000000000000 193 } 77 194 end 78 195 object MenuItem4: TMenuItem -
trunk/Forms/UFormImportSources.lrt
r28 r33 2 2 TFORMIMPORTSOURCES.LISTVIEW1.COLUMNS[0].CAPTION=Name 3 3 TFORMIMPORTSOURCES.LISTVIEW1.COLUMNS[1].CAPTION=URL 4 TFORMIMPORTSOURCES.LISTVIEW1.COLUMNS[2].CAPTION=Count 5 TFORMIMPORTSOURCES.LISTVIEW1.COLUMNS[3].CAPTION=Categories 4 6 TFORMIMPORTSOURCES.AADD.CAPTION=Add 5 7 TFORMIMPORTSOURCES.AREMOVE.CAPTION=Remove -
trunk/Forms/UFormImportSources.pas
r29 r33 67 67 Item.Data := ImportSources[Item.Index]; 68 68 Item.SubItems.Add(URL); 69 Item.SubItems.Add(IntToStr(ItemCount)); 70 Item.SubItems.Add(Categories.GetString); 69 71 Item.Checked := Enabled; 70 72 end; -
trunk/Forms/UFormMain.lfm
r31 r33 4424 4424 end 4425 4425 object MenuItem3: TMenuItem 4426 Action = A Import4426 Action = AManualImport 4427 4427 end 4428 4428 object MenuItem19: TMenuItem … … 4518 4518 OnExecute = AShowExecute 4519 4519 end 4520 object A Import: TAction4521 Caption = ' Import'4522 OnExecute = A ImportExecute4520 object AManualImport: TAction 4521 Caption = 'Manual import' 4522 OnExecute = AManualImportExecute 4523 4523 end 4524 4524 object AFileOpen: TAction … … 5005 5005 Caption = 'Tools' 5006 5006 object MenuItem17: TMenuItem 5007 Action = A Import5007 Action = AManualImport 5008 5008 end 5009 5009 object MenuItem23: TMenuItem -
trunk/Forms/UFormMain.lrt
r30 r33 8 8 TFORMMAIN.AEXIT.CAPTION=Exit 9 9 TFORMMAIN.ASHOW.CAPTION=Show 10 TFORMMAIN.A IMPORT.CAPTION=Import10 TFORMMAIN.AMANUALIMPORT.CAPTION=Manual import 11 11 TFORMMAIN.AFILEOPEN.CAPTION=Open 12 12 TFORMMAIN.AFILENEW.CAPTION=New -
trunk/Forms/UFormMain.pas
r31 r33 28 28 AFileNew: TAction; 29 29 AFileOpen: TAction; 30 A Import: TAction;30 AManualImport: TAction; 31 31 AShow: TAction; 32 32 AExit: TAction; … … 87 87 procedure AFileSaveAsExecute(Sender: TObject); 88 88 procedure AFileSaveExecute(Sender: TObject); 89 procedure A ImportExecute(Sender: TObject);89 procedure AManualImportExecute(Sender: TObject); 90 90 procedure AProcessImportsExecute(Sender: TObject); 91 91 procedure ASettingsExecute(Sender: TObject); … … 259 259 end; 260 260 261 procedure TFormMain.A ImportExecute(Sender: TObject);261 procedure TFormMain.AManualImportExecute(Sender: TObject); 262 262 begin 263 263 FormImport.ShowModal; … … 503 503 AFileSave.Enabled := Assigned(AcronymDb) and AcronymDb.Modified; 504 504 AFileSaveAs.Enabled := Assigned(AcronymDb); 505 A Import.Enabled := Assigned(AcronymDb);505 AManualImport.Enabled := Assigned(AcronymDb); 506 506 AShowCategories.Enabled := Assigned(AcronymDb); 507 507 AShowAcronyms.Enabled := Assigned(AcronymDb); -
trunk/Languages/AcronymDecoder.cs.po
r31 r33 79 79 80 80 #: tformacronym.label4.caption 81 msgctxt "tformacronym.label4.caption" 81 82 msgid "Categories:" 82 83 msgstr "Kategorie:" … … 107 108 108 109 #: tformacronyms.listviewacronyms.columns[0].caption 110 #, fuzzy 111 #| msgid "Name" 109 112 msgctxt "tformacronyms.listviewacronyms.columns[0].caption" 113 msgid "Id" 114 msgstr "Název" 115 116 #: tformacronyms.listviewacronyms.columns[1].caption 117 #, fuzzy 118 #| msgid "Description" 119 msgctxt "tformacronyms.listviewacronyms.columns[1].caption" 110 120 msgid "Name" 111 msgstr "Název" 112 113 #: tformacronyms.listviewacronyms.columns[1].caption 114 msgctxt "tformacronyms.listviewacronyms.columns[1].caption" 121 msgstr "Popis" 122 123 #: tformacronyms.listviewacronyms.columns[2].caption 124 #, fuzzy 125 #| msgid "Categories" 126 msgctxt "tformacronyms.listviewacronyms.columns[2].caption" 115 127 msgid "Description" 116 msgstr "Popis" 117 118 #: tformacronyms.listviewacronyms.columns[2].caption 119 msgctxt "tformacronyms.listviewacronyms.columns[2].caption" 128 msgstr "Kategorie" 129 130 #: tformacronyms.listviewacronyms.columns[3].caption 131 #, fuzzy 132 msgctxt "tformacronyms.listviewacronyms.columns[3].caption" 120 133 msgid "Categories" 121 134 msgstr "Kategorie" … … 332 345 msgstr "Koncový řetězec" 333 346 347 #: tformimportsource.acategoryadd.caption 348 #, fuzzy 349 msgctxt "tformimportsource.acategoryadd.caption" 350 msgid "Add" 351 msgstr "Přidat" 352 353 #: tformimportsource.acategoryremove.caption 354 #, fuzzy 355 msgctxt "tformimportsource.acategoryremove.caption" 356 msgid "Remove" 357 msgstr "Odebrat" 358 334 359 #: tformimportsource.buttoncancel.caption 335 360 msgctxt "tformimportsource.buttoncancel.caption" … … 369 394 msgstr "Formát dat:" 370 395 396 #: tformimportsource.label4.caption 397 #, fuzzy 398 msgctxt "tformimportsource.label4.caption" 399 msgid "Categories:" 400 msgstr "Kategorie:" 401 371 402 #: tformimportsources.aadd.caption 372 403 msgctxt "tformimportsources.aadd.caption" … … 403 434 msgstr "URL" 404 435 436 #: tformimportsources.listview1.columns[2].caption 437 msgid "Count" 438 msgstr "" 439 440 #: tformimportsources.listview1.columns[3].caption 441 #, fuzzy 442 msgctxt "tformimportsources.listview1.columns[3].caption" 443 msgid "Categories" 444 msgstr "Kategorie" 445 405 446 #: tformmain.aexit.caption 406 447 msgid "Exit" … … 428 469 msgstr "Uložit jako..." 429 470 430 #: tformmain.aimport.caption 431 msgctxt "tformmain.aimport.caption" 432 msgid "Import" 433 msgstr "Importovat" 471 #: tformmain.amanualimport.caption 472 msgid "Manual import" 473 msgstr "" 434 474 435 475 #: tformmain.aprocessimports.caption … … 624 664 msgstr "Opravdu chcete odebrat vybrabé kategorie?" 625 665 666 #: uformcategoryselect.scategory 667 #, fuzzy 668 msgctxt "uformcategoryselect.scategory" 669 msgid "Category" 670 msgstr "Kategorie" 671 672 #: uformcategoryselect.sremovecategory 673 #, fuzzy 674 msgctxt "uformcategoryselect.sremovecategory" 675 msgid "Remove categories" 676 msgstr "Odebrat kategorie" 677 678 #: uformcategoryselect.sremovecategoryquery 679 #, fuzzy 680 msgctxt "uformcategoryselect.sremovecategoryquery" 681 msgid "Do you really want to remove selected categories?" 682 msgstr "Opravdu chcete odebrat vybrabé kategorie?" 683 626 684 #: uformimport.simportednewacronyms 627 685 msgid "Imported %d new acronyms." -
trunk/Languages/AcronymDecoder.po
r31 r33 69 69 70 70 #: tformacronym.label4.caption 71 msgctxt "tformacronym.label4.caption" 71 72 msgid "Categories:" 72 73 msgstr "" … … 98 99 #: tformacronyms.listviewacronyms.columns[0].caption 99 100 msgctxt "TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[0].CAPTION" 100 msgid " Name"101 msgid "Id" 101 102 msgstr "" 102 103 103 104 #: tformacronyms.listviewacronyms.columns[1].caption 104 105 msgctxt "TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[1].CAPTION" 105 msgid " Description"106 msgid "Name" 106 107 msgstr "" 107 108 108 109 #: tformacronyms.listviewacronyms.columns[2].caption 109 110 msgctxt "TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[2].CAPTION" 111 msgid "Description" 112 msgstr "" 113 114 #: tformacronyms.listviewacronyms.columns[3].caption 115 msgctxt "TFORMACRONYMS.LISTVIEWACRONYMS.COLUMNS[3].CAPTION" 110 116 msgid "Categories" 111 117 msgstr "" … … 315 321 msgstr "" 316 322 323 #: tformimportsource.acategoryadd.caption 324 msgctxt "TFORMIMPORTSOURCE.ACATEGORYADD.CAPTION" 325 msgid "Add" 326 msgstr "" 327 328 #: tformimportsource.acategoryremove.caption 329 msgctxt "TFORMIMPORTSOURCE.ACATEGORYREMOVE.CAPTION" 330 msgid "Remove" 331 msgstr "" 332 317 333 #: tformimportsource.buttoncancel.caption 318 334 msgctxt "TFORMIMPORTSOURCE.BUTTONCANCEL.CAPTION" … … 352 368 msgstr "" 353 369 370 #: tformimportsource.label4.caption 371 msgctxt "TFORMIMPORTSOURCE.LABEL4.CAPTION" 372 msgid "Categories:" 373 msgstr "" 374 354 375 #: tformimportsources.aadd.caption 355 376 msgctxt "TFORMIMPORTSOURCES.AADD.CAPTION" … … 386 407 msgstr "" 387 408 409 #: tformimportsources.listview1.columns[2].caption 410 msgid "Count" 411 msgstr "" 412 413 #: tformimportsources.listview1.columns[3].caption 414 msgctxt "TFORMIMPORTSOURCES.LISTVIEW1.COLUMNS[3].CAPTION" 415 msgid "Categories" 416 msgstr "" 417 388 418 #: tformmain.aexit.caption 389 419 msgid "Exit" … … 411 441 msgstr "" 412 442 413 #: tformmain.aimport.caption 414 msgctxt "tformmain.aimport.caption" 415 msgid "Import" 443 #: tformmain.amanualimport.caption 444 msgid "Manual import" 416 445 msgstr "" 417 446 … … 606 635 msgstr "" 607 636 637 #: uformcategoryselect.scategory 638 msgctxt "uformcategoryselect.scategory" 639 msgid "Category" 640 msgstr "" 641 642 #: uformcategoryselect.sremovecategory 643 msgctxt "uformcategoryselect.sremovecategory" 644 msgid "Remove categories" 645 msgstr "" 646 647 #: uformcategoryselect.sremovecategoryquery 648 msgctxt "uformcategoryselect.sremovecategoryquery" 649 msgid "Do you really want to remove selected categories?" 650 msgstr "" 651 608 652 #: uformimport.simportednewacronyms 609 653 msgid "Imported %d new acronyms." -
trunk/UAcronym.pas
r31 r33 50 50 51 51 TAcronymMeaning = class 52 Id: Integer; 52 53 Name: string; 53 54 Description: string; … … 65 66 66 67 TAcronymMeanings = class(TObjectList) 68 public 67 69 Acronym: TAcronym; 70 procedure UpdateIds; 68 71 procedure SaveToNode(Node: TDOMNode); 69 72 procedure LoadFromNode(Node: TDOMNode); … … 87 90 88 91 TAcronymCategories = class(TObjectList) 92 Db: TAcronymDb; 89 93 procedure UpdateIds; 90 94 procedure SaveToNode(Node: TDOMNode); 91 95 procedure LoadFromNode(Node: TDOMNode); 96 procedure SaveRefToNode(Node: TDOMNode); 97 procedure LoadRefFromNode(Node: TDOMNode); 92 98 function SearchByName(Name: string): TAcronymCategory; 93 99 function SearchById(Id: Integer): TAcronymCategory; … … 173 179 Sources: TImportSources; 174 180 ItemCount: Integer; 181 Categories: TAcronymCategories; 175 182 function DownloadHTTP(URL: string; Stream: TStream): Boolean; 176 183 procedure Process; … … 660 667 AddedAcronym := Sources.AcronymDb.AddAcronym(NewAcronym.Name, NewAcronym.Meaning); 661 668 AddedAcronym.Description := NewAcronym.Description; 669 AddedAcronym.Categories.Assign(Categories, laOr); 662 670 Inc(ItemCount); 663 671 end; … … 692 700 LastTime := Source.LastTime; 693 701 ItemCount := Source.ItemCount; 702 Categories.Assign(Source.Categories); 694 703 end; 695 704 696 705 procedure TImportSource.SaveToNode(Node: TDOMNode); 706 var 707 NewNode: TDOMNode; 697 708 begin 698 709 WriteString(Node, 'Name', Name); … … 701 712 else WriteInteger(Node, 'ImportFormat', -1); 702 713 WriteBoolean(Node, 'Enabled', Enabled); 714 WriteInteger(Node, 'ItemCount', ItemCount); 715 716 NewNode := Node.OwnerDocument.CreateElement('Categories'); 717 Node.AppendChild(NewNode); 718 Categories.SaveRefToNode(NewNode); 703 719 end; 704 720 705 721 procedure TImportSource.LoadFromNode(Node: TDOMNode); 722 var 723 Node2: TDOMNode; 706 724 begin 707 725 Name := ReadString(Node, 'Name', ''); … … 709 727 Format := Sources.AcronymDb.ImportFormats.SearchById(ReadInteger(Node, 'ImportFormat', -1)); 710 728 Enabled := ReadBoolean(Node, 'Enabled', True); 729 ItemCount := ReadInteger(Node, 'ItemCount', 0); 730 731 Categories.Db := Sources.AcronymDb; 732 Node2 := Node.FindNode('Categories'); 733 if Assigned(Node2) then 734 Categories.LoadRefFromNode(Node2); 711 735 end; 712 736 … … 715 739 Format := nil; 716 740 Enabled := True; 741 Categories := TAcronymCategories.Create; 742 Categories.OwnsObjects := False; 717 743 end; 718 744 719 745 destructor TImportSource.Destroy; 720 begin721 inherited Destroy;722 end;723 724 { TAcronymEntry }725 726 constructor TAcronymEntry.Create;727 begin728 Categories := TStringList.Create;729 end;730 731 destructor TAcronymEntry.Destroy;732 746 begin 733 747 FreeAndNil(Categories); … … 735 749 end; 736 750 751 { TAcronymEntry } 752 753 constructor TAcronymEntry.Create; 754 begin 755 Categories := TStringList.Create; 756 end; 757 758 destructor TAcronymEntry.Destroy; 759 begin 760 FreeAndNil(Categories); 761 inherited Destroy; 762 end; 763 737 764 { TAcronymMeanings } 738 765 766 procedure TAcronymMeanings.UpdateIds; 767 var 768 LastId: Integer; 769 I: Integer; 770 begin 771 // Get highest used ID 772 LastId := 0; 773 for I := 0 to Count - 1 do begin 774 if TAcronymCategory(Items[I]).Id > LastId then LastId := TAcronymCategory(Items[I]).Id; 775 end; 776 // Add ID to new items without ID 777 for I := 0 to Count - 1 do begin 778 if TAcronymCategory(Items[I]).Id = 0 then begin 779 Inc(LastId); 780 TAcronymCategory(Items[I]).Id := LastId; 781 end; 782 end; 783 end; 784 739 785 procedure TAcronymMeanings.SaveToNode(Node: TDOMNode); 740 786 var … … 742 788 NewNode2: TDOMNode; 743 789 begin 790 UpdateIds; 744 791 for I := 0 to Count - 1 do 745 792 with TAcronymMeaning(Items[I]) do begin … … 764 811 Node2 := Node2.NextSibling; 765 812 end; 813 UpdateIds; 766 814 end; 767 815 … … 788 836 var 789 837 NewNode: TDOMNode; 790 NewNode2: TDOMNode;791 I: Integer;792 838 begin 793 839 WriteString(Node, 'Name', Name); … … 797 843 NewNode := Node.OwnerDocument.CreateElement('Categories'); 798 844 Node.AppendChild(NewNode); 799 for I := 0 to Categories.Count - 1 do begin 800 NewNode2 := NewNode.OwnerDocument.CreateElement('Category'); 801 NewNode.AppendChild(NewNode2); 802 WriteInteger(NewNode2, 'Id', TAcronymCategory(Categories[I]).Id); 803 end; 845 Categories.SaveRefToNode(NewNode); 804 846 end; 805 847 … … 807 849 var 808 850 Node2: TDOMNode; 809 Node3: TDOMNode; 810 Category: TAcronymCategory; 811 Id: Integer; 851 I: Integer; 812 852 begin 813 853 Name := ReadString(Node, 'Name', ''); … … 815 855 Language := ReadString(Node, 'Language', ''); 816 856 817 Node3 := Node.FindNode('Categories'); 818 if Assigned(Node3) then begin 819 Node2 := Node3.FirstChild; 820 while Assigned(Node2) and (Node2.NodeName = 'Category') do begin 821 Id := ReadInteger(Node2, 'Id', 0); 822 Category := Acronym.Db.Categories.SearchById(Id); 823 if Assigned(Category) then begin 824 Categories.Add(Category); 825 Category.AcronymMeanings.Add(Self); 826 end; 827 Node2 := Node2.NextSibling; 828 end; 857 Categories.Db := Acronym.Db; 858 Node2 := Node.FindNode('Categories'); 859 if Assigned(Node2) then begin 860 Categories.LoadRefFromNode(Node2); 861 862 // Add reverse references 863 for I := 0 to Categories.Count - 1 do 864 TAcronymCategory(Categories[I]).AcronymMeanings.Add(Self); 829 865 end; 830 866 end; … … 839 875 I: Integer; 840 876 begin 877 if Assigned(Acronym) then 878 Acronym.Meanings.Remove(Self); 841 879 for I := 0 to Categories.Count - 1 do 842 880 TAcronymCategory(Categories[I]).AcronymMeanings.Remove(Self); … … 942 980 end; 943 981 UpdateIds; 982 end; 983 984 procedure TAcronymCategories.SaveRefToNode(Node: TDOMNode); 985 var 986 I: Integer; 987 NewNode: TDOMNode; 988 begin 989 for I := 0 to Count - 1 do begin 990 NewNode := Node.OwnerDocument.CreateElement('Category'); 991 Node.AppendChild(NewNode); 992 WriteInteger(NewNode, 'Id', TAcronymCategory(Items[I]).Id); 993 end; 994 end; 995 996 procedure TAcronymCategories.LoadRefFromNode(Node: TDOMNode); 997 var 998 Node2: TDOMNode; 999 Id: Integer; 1000 Category: TAcronymCategory; 1001 begin 1002 Node2 := Node.FirstChild; 1003 while Assigned(Node2) and (Node2.NodeName = 'Category') do begin 1004 Id := ReadInteger(Node2, 'Id', 0); 1005 Category := Db.Categories.SearchById(Id); 1006 if Assigned(Category) then begin 1007 Add(Category); 1008 end; 1009 Node2 := Node2.NextSibling; 1010 end; 944 1011 end; 945 1012
Note:
See TracChangeset
for help on using the changeset viewer.