Changeset 95 for trunk/Forms/UFormImportSources.pas
- Timestamp:
- Aug 17, 2016, 11:20:37 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormImportSources.pas
r86 r95 187 187 NewImportSource := TImportSource.Create; 188 188 NewImportSource.Sources := ImportSources; 189 FormImportSource.Load(NewImportSource); 190 if FormImportSource.ShowModal = mrOk then begin 191 FormImportSource.Save(NewImportSource); 192 if not Assigned(ImportSources.SearchByName(NewImportSource.Name)) then begin; 193 ImportSources.Add(NewImportSource); 194 NewImportSource := nil; 195 Core.AcronymDb.Modified := True; 196 UpdateList; 197 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); 198 end; 199 if Assigned(NewImportSource) then NewImportSource.Free; 189 FormImportSource := TFormImportSource.Create(Self); 190 try 191 FormImportSource.Load(NewImportSource); 192 if FormImportSource.ShowModal = mrOk then begin 193 FormImportSource.Save(NewImportSource); 194 if not Assigned(ImportSources.SearchByName(NewImportSource.Name)) then begin; 195 ImportSources.Add(NewImportSource); 196 NewImportSource := nil; 197 Core.AcronymDb.Modified := True; 198 UpdateList; 199 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); 200 end; 201 if Assigned(NewImportSource) then NewImportSource.Free; 202 finally 203 FreeAndNil(FormImportSource); 204 end; 200 205 end; 201 206 … … 227 232 NewImportSource := TImportSource.Create; 228 233 NewImportSource.Assign(ListView1.Selected.Data); 229 FormImportSource.Load(NewImportSource); 230 if FormImportSource.ShowModal = mrOk then begin 231 FormImportSource.Save(NewImportSource); 232 if (NewImportSource.Name <> TImportSource(ListView1.Selected.Data).Name) then begin 233 if not Assigned(ImportSources.SearchByName(NewImportSource.Name)) then begin; 234 FormImportSource := TFormImportSource.Create(Self); 235 try 236 FormImportSource.Load(NewImportSource); 237 if FormImportSource.ShowModal = mrOk then begin 238 FormImportSource.Save(NewImportSource); 239 if (NewImportSource.Name <> TImportSource(ListView1.Selected.Data).Name) then begin 240 if not Assigned(ImportSources.SearchByName(NewImportSource.Name)) then begin; 241 TImportSource(ListView1.Selected.Data).Assign(NewImportSource); 242 Core.AcronymDb.Modified := True; 243 UpdateList; 244 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); 245 end else begin 234 246 TImportSource(ListView1.Selected.Data).Assign(NewImportSource); 235 247 Core.AcronymDb.Modified := True; 236 248 UpdateList; 237 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); 238 end else begin 239 TImportSource(ListView1.Selected.Data).Assign(NewImportSource); 240 Core.AcronymDb.Modified := True; 241 UpdateList; 249 end; 242 250 end; 243 end; 244 if Assigned(NewImportSource) then NewImportSource.Free; 251 if Assigned(NewImportSource) then NewImportSource.Free; 252 finally 253 FreeAndNil(FormImportSource); 254 end; 245 255 end; 246 256 end;
Note:
See TracChangeset
for help on using the changeset viewer.