Changeset 95 for trunk/Forms/UFormImportFormats.pas
- Timestamp:
- Aug 17, 2016, 11:20:37 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormImportFormats.pas
r86 r95 112 112 NewImportFormat := TImportFormat.Create; 113 113 NewImportFormat.Formats := ImportFormats; 114 FormImportFormat.Load(NewImportFormat); 115 if FormImportFormat.ShowModal = mrOk then begin 116 FormImportFormat.Save(NewImportFormat); 117 if not Assigned(ImportFormats.SearchByName(NewImportFormat.Name)) then begin; 118 ImportFormats.Add(NewImportFormat); 119 NewImportFormat := nil; 120 Core.AcronymDb.Modified := True; 121 UpdateList; 122 end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name])); 114 FormImportFormat := TFormImportFormat.Create(Self); 115 try 116 FormImportFormat.Load(NewImportFormat); 117 if FormImportFormat.ShowModal = mrOk then begin 118 FormImportFormat.Save(NewImportFormat); 119 if not Assigned(ImportFormats.SearchByName(NewImportFormat.Name)) then begin; 120 ImportFormats.Add(NewImportFormat); 121 NewImportFormat := nil; 122 Core.AcronymDb.Modified := True; 123 UpdateList; 124 end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name])); 125 end; 126 if Assigned(NewImportFormat) then NewImportFormat.Free; 127 finally 128 FreeAndNil(FormImportFormat); 123 129 end; 124 if Assigned(NewImportFormat) then NewImportFormat.Free;125 130 end; 126 131 … … 132 137 NewImportFormat := TImportFormat.Create; 133 138 NewImportFormat.Assign(ListView1.Selected.Data); 134 FormImportFormat.Load(NewImportFormat); 135 if FormImportFormat.ShowModal = mrOk then begin 136 FormImportFormat.Save(NewImportFormat); 137 if (NewImportFormat.Name <> TImportFormat(ListView1.Selected.Data).Name) then begin 138 if not Assigned(ImportFormats.SearchByName(NewImportFormat.Name)) then begin; 139 FormImportFormat := TFormImportFormat.Create(Self); 140 try 141 FormImportFormat.Load(NewImportFormat); 142 if FormImportFormat.ShowModal = mrOk then begin 143 FormImportFormat.Save(NewImportFormat); 144 if (NewImportFormat.Name <> TImportFormat(ListView1.Selected.Data).Name) then begin 145 if not Assigned(ImportFormats.SearchByName(NewImportFormat.Name)) then begin; 146 TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat); 147 Core.AcronymDb.Modified := True; 148 UpdateList; 149 end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name])); 150 end else begin 139 151 TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat); 140 152 Core.AcronymDb.Modified := True; 141 153 UpdateList; 142 end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name])); 143 end else begin 144 TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat); 145 Core.AcronymDb.Modified := True; 146 UpdateList; 154 end; 147 155 end; 156 if Assigned(NewImportFormat) then NewImportFormat.Free; 157 finally 158 FreeAndNil(FormImportFormat); 148 159 end; 149 if Assigned(NewImportFormat) then NewImportFormat.Free;150 160 end; 151 161 end;
Note:
See TracChangeset
for help on using the changeset viewer.