Changeset 184 for trunk/Forms
- Timestamp:
- Jul 4, 2018, 2:05:48 PM (6 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormAcronyms.pas
r174 r184 50 50 procedure ListViewSort1Filter(ListViewSort: TListViewSort); 51 51 private 52 FAcronyms: TAcronyms; 52 53 MeaningCount: Integer; 53 54 procedure FilterList(List: TListObject); 55 procedure SetAcronyms(AValue: TAcronyms); 54 56 procedure UpdateAcronymsList; 55 57 public 56 58 FocusAcronym: TAcronymMeaning; 59 property Acronyms: TAcronyms read FAcronyms write SetAcronyms; 57 60 procedure UpdateInterface; 58 61 end; … … 147 150 if FormAcronym.ShowModal = mrOk then begin 148 151 FormAcronym.Save(TempEntry); 149 Meaning := Core.AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);152 Meaning := Acronyms.Db.AddAcronym(TempEntry.Name, TempEntry.Meaning); 150 153 Meaning.Description := TempEntry.Description; 151 154 Meaning.Categories.AssignFromStrings(TempEntry.Categories); … … 156 159 TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning); 157 160 158 Core.AcronymDb.Update;161 Acronyms.Db.Update; 159 162 UpdateAcronymsList; 160 163 UpdateInterface; … … 193 196 not FormMain.CompareStrings(TempEntry.Categories, TempCategories) then begin 194 197 // TODO: Update item inplace if possible 195 Core.AcronymDb.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data));196 Meaning := Core.AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning);198 Acronyms.Db.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data)); 199 Meaning := Acronyms.Db.AddAcronym(TempEntry.Name, TempEntry.Meaning); 197 200 Meaning.Description := TempEntry.Description; 198 201 Meaning.Categories.AssignFromStrings(TempEntry.Categories); … … 202 205 if TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.IndexOf(Meaning) = -1 then 203 206 TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning); 204 Core.AcronymDb.Update;207 Acronyms.Db.Update; 205 208 UpdateAcronymsList; 206 209 UpdateInterface; … … 222 225 if MessageDlg(SRemoveAcronym, SRemoveAcronymQuery, 223 226 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 224 Core.AcronymDb.BeginUpdate;227 Acronyms.Db.BeginUpdate; 225 228 for I := ListViewAcronyms.Items.Count - 1 downto 0 do 226 229 if ListViewAcronyms.Items[I].Selected then begin 227 230 ListViewAcronyms.Items[I].Selected := False; 228 Core.AcronymDb.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Items[I].Data));231 Acronyms.Db.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Items[I].Data)); 229 232 end; 230 233 UpdateAcronymsList; 231 234 UpdateInterface; 232 Core.AcronymDb.EndUpdate;235 Acronyms.Db.EndUpdate; 233 236 end; 234 237 end; … … 287 290 procedure TFormAcronyms.ListViewSort1Filter(ListViewSort: TListViewSort); 288 291 begin 289 Core.AcronymDb.Acronyms.Sort(AcronymComparer);290 Core.AcronymDb.AssignToList(ListViewSort1.List);292 Acronyms.Db.Acronyms.Sort(AcronymComparer); 293 Acronyms.Db.AssignToList(ListViewSort1.List); 291 294 MeaningCount := ListViewSort1.List.Count; 292 295 FilterList(ListViewSort1.List); … … 322 325 end; 323 326 327 procedure TFormAcronyms.SetAcronyms(AValue: TAcronyms); 328 begin 329 if FAcronyms = AValue then Exit; 330 FAcronyms := AValue; 331 end; 332 324 333 procedure TFormAcronyms.UpdateAcronymsList; 325 334 begin … … 332 341 procedure TFormAcronyms.UpdateInterface; 333 342 begin 334 ARemove.Enabled := Assigned( Core.AcronymDb) and Assigned(ListViewAcronyms.Selected);335 AModify.Enabled := Assigned( Core.AcronymDb) and Assigned(ListViewAcronyms.Selected);336 AAdd.Enabled := Assigned( Core.AcronymDb);343 ARemove.Enabled := Assigned(FAcronyms) and Assigned(ListViewAcronyms.Selected); 344 AModify.Enabled := Assigned(FAcronyms) and Assigned(ListViewAcronyms.Selected); 345 AAdd.Enabled := Assigned(FAcronyms); 337 346 ASelectAll.Enabled := True; 338 347 end; -
trunk/Forms/UFormExport.lfm
r174 r184 8 8 ClientWidth = 850 9 9 DesignTimePPI = 120 10 OnClose = FormClose 10 11 OnCreate = FormCreate 12 OnShow = FormShow 11 13 Position = poScreenCenter 12 LCLVersion = '1.8. 0.6'14 LCLVersion = '1.8.2.0' 13 15 object ButtonProcess: TButton 14 16 Left = 18 -
trunk/Forms/UFormExport.pas
r174 r184 21 21 procedure ButtonProcessClick(Sender: TObject); 22 22 procedure ButtonSaveToFileClick(Sender: TObject); 23 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 23 24 procedure FormCreate(Sender: TObject); 25 procedure FormShow(Sender: TObject); 24 26 private 25 27 ItemCount: Integer; … … 58 60 end; 59 61 62 procedure TFormExport.FormClose(Sender: TObject; var CloseAction: TCloseAction); 63 begin 64 Core.PersistentForm1.Save(Self); 65 end; 66 60 67 procedure TFormExport.FormCreate(Sender: TObject); 61 68 begin 62 69 Core.CoolTranslator1.TranslateComponentRecursive(Self); 63 70 Core.ThemeManager.UseTheme(Self); 71 end; 72 73 procedure TFormExport.FormShow(Sender: TObject); 74 begin 75 Core.PersistentForm1.Load(Self); 64 76 end; 65 77 -
trunk/Forms/UFormImport.lfm
r174 r184 8 8 ClientWidth = 652 9 9 DesignTimePPI = 120 10 OnClose = FormClose 10 11 OnCreate = FormCreate 12 OnShow = FormShow 11 13 Position = poScreenCenter 12 LCLVersion = '1.8. 0.6'14 LCLVersion = '1.8.2.0' 13 15 object ButtonProcess: TButton 14 16 Left = 16 -
trunk/Forms/UFormImport.pas
r174 r184 22 22 procedure ButtonProcessClick(Sender: TObject); 23 23 procedure ButtonLoadFromFileClick(Sender: TObject); 24 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 24 25 procedure FormCreate(Sender: TObject); 26 procedure FormShow(Sender: TObject); 25 27 private 26 28 procedure ImportMediaWiki; … … 60 62 end; 61 63 64 procedure TFormImport.FormClose(Sender: TObject; var CloseAction: TCloseAction); 65 begin 66 Core.PersistentForm1.Save(Self); 67 end; 68 62 69 procedure TFormImport.FormCreate(Sender: TObject); 63 70 begin 64 71 Core.CoolTranslator1.TranslateComponentRecursive(Self); 65 72 Core.ThemeManager.UseTheme(Self); 73 end; 74 75 procedure TFormImport.FormShow(Sender: TObject); 76 begin 77 Core.PersistentForm1.Load(Self); 66 78 end; 67 79 -
trunk/Forms/UFormMain.lfm
r176 r184 15 15 OnHide = FormHide 16 16 OnShow = FormShow 17 LCLVersion = '1.8. 0.6'17 LCLVersion = '1.8.2.0' 18 18 object PanelMain: TPanel 19 19 Left = 0 … … 416 416 OnExecute = AManageAcronymExecute 417 417 end 418 object ADocumentCheck: TAction 419 Caption = 'Document check' 420 OnExecute = ADocumentCheckExecute 421 end 418 422 end 419 423 object MainMenu1: TMainMenu … … 488 492 object MenuItem23: TMenuItem 489 493 Action = AProcessImports 494 end 495 object MenuItem3: TMenuItem 496 Action = ADocumentCheck 497 end 498 object MenuItem2: TMenuItem 499 Caption = '-' 490 500 end 491 501 object MenuItem18: TMenuItem -
trunk/Forms/UFormMain.pas
r180 r184 16 16 17 17 TFormMain = class(TForm) 18 ADocumentCheck: TAction; 18 19 AFilterEnabledCategories: TAction; 19 20 AManageAcronym: TAction; … … 48 49 MainMenu1: TMainMenu; 49 50 MenuItem1: TMenuItem; 51 MenuItem2: TMenuItem; 52 MenuItem3: TMenuItem; 50 53 MenuItemShowItemsWithoutFilter: TMenuItem; 51 54 MenuItemStatusBar: TMenuItem; … … 98 101 ToolButton8: TToolButton; 99 102 ToolButton9: TToolButton; 103 procedure ADocumentCheckExecute(Sender: TObject); 100 104 procedure AExitExecute(Sender: TObject); 101 105 procedure AExportExecute(Sender: TObject); … … 175 179 uses 176 180 UFormImport, UFormSettings, UFormCategories, UFormAcronyms, UFormExport, 177 UFormImportSources, UFormAbout, UFormImportFormats, UCore ;181 UFormImportSources, UFormAbout, UFormImportFormats, UCore, UFormCheck; 178 182 179 183 resourcestring … … 240 244 begin 241 245 Close; 246 end; 247 248 procedure TFormMain.ADocumentCheckExecute(Sender: TObject); 249 begin 250 FormCheck := TFormCheck.Create(Self); 251 try 252 FormCheck.LoadConfig; 253 FormCheck.ShowModal; 254 FormCheck.SaveConfig; 255 finally 256 FreeAndNil(FormCheck); 257 end; 242 258 end; 243 259 … … 365 381 if Assigned(ListViewAcronyms.Selected) then 366 382 FormAcronyms.FocusAcronym := ListViewAcronyms.Selected.Data; 383 FormAcronyms.Acronyms := Core.AcronymDb.Acronyms; 367 384 FormAcronyms.ShowModal; 368 385 UpdateAcronymsList; … … 429 446 FormAcronyms := TFormAcronyms.Create(Self); 430 447 try 448 FormAcronyms.Acronyms := Core.AcronymDb.Acronyms; 431 449 FormAcronyms.ShowModal; 432 450 UpdateAcronymsList; -
trunk/Forms/UFormSettings.lfm
r174 r184 10 10 Constraints.MinWidth = 389 11 11 DesignTimePPI = 120 12 OnClose = FormClose 12 13 OnCreate = FormCreate 13 14 OnShow = FormShow 14 15 Position = poScreenCenter 15 LCLVersion = '1.8. 0.6'16 LCLVersion = '1.8.2.0' 16 17 object ComboBoxLanguage: TComboBox 17 18 Left = 152 -
trunk/Forms/UFormSettings.pas
r174 r184 31 31 procedure CheckBoxAutomaticDPIChange(Sender: TObject); 32 32 procedure CheckBoxStartOnLogonChange(Sender: TObject); 33 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 33 34 procedure FormCreate(Sender: TObject); 34 35 procedure FormShow(Sender: TObject); … … 55 56 procedure TFormSettings.FormShow(Sender: TObject); 56 57 begin 58 Core.PersistentForm1.Load(Self); 57 59 end; 58 60 … … 69 71 begin 70 72 UpdateInterface; 73 end; 74 75 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction 76 ); 77 begin 78 Core.PersistentForm1.Save(Self); 71 79 end; 72 80
Note:
See TracChangeset
for help on using the changeset viewer.