Code cosmetic in "Insert files" dialog:

* Make sure the INSERT query is fired within a try/except block, and keep form open on any error
* Reasonably rename some component names
* Remove InsertFilesWindow(), instead cache the instance of InsertFiles in main form, like it is for most other dialogs
* Get rid of a with .. do block
* Ger rid of a weird form pointer, instead use the "Owner" property
This commit is contained in:
Ansgar Becker
2009-11-21 16:44:31 +00:00
parent 4b7ce24266
commit d6367a09fa
4 changed files with 75 additions and 96 deletions

View File

@ -70,8 +70,6 @@ type
procedure AcceptFiles( var msg : TMessage ); message WM_DROPFILES;
end;
function InsertFilesWindow (AOwner : TComponent; Flags : String = '') : Boolean;
implementation
@ -80,16 +78,6 @@ uses main, helpers, db;
{$R *.DFM}
function InsertFilesWindow (AOwner : TComponent; Flags : String = '') : Boolean;
var
f : TfrmInsertFiles;
begin
f := TfrmInsertFiles.Create(AOwner);
// todo: pass flags
Result := (f.ShowModal=mrOK);
FreeAndNil (f);
end;
{ FormShow }
procedure TfrmInsertFiles.FormShow(Sender: TObject);
begin
@ -363,7 +351,6 @@ end;
procedure TfrmInsertFiles.ButtonInsertClick(Sender: TObject);
begin
FProgressForm := TfrmInsertFilesProgress.Create(Self);
FProgressForm.InsertFilesForm := Self;
FProgressForm.ShowModal;
end;