RemoveResearchProject1Click method

Applies to
TForm1

Declaration
procedure RemoveResearchProject1Click(Sender: TObject);

Implementation

procedure TForm1.RemoveResearchProject1Click(Sender: TObject);
var ini1:TInifile;

procedure remove_files();
begin
if Sender<>nil then play_snd(1);
fop1.FileList.Clear;
fop1.FileList.Add(get_prj_info(Label1.Caption).path_);
if MessageBox(0,PChar('Do you wants to remove files and folders related with the "'+Label1.Caption+'" project ?'),PChar(Application.Title),MB_YESNO+MB_ICONQUESTION)=6 then
   fop1.Execute;
end;

begin try
if get_wikires_prj_count=0 then exit;
ini1:=TINiFIle.Create(get_res_profile);
if get_wikires_prj_count=1 then begin
   if MessageBox(0,PChar('Are you sure do you wants to remove selected research project "'+Label1.Caption+'" ?'#10#13'After removing this project, WikiResearcher may automatically close, because there are no more projects on your computer !'),PChar(Application.Title),MB_YESNO+MB_ICONQUESTION)=6 then begin
      remove_files;
      ini1.EraseSection(Label1.Caption);
      Application.Terminate;
   end;
end else begin
   if MessageBox(0,PChar('Are you sure do you wants to remove selected research project "'+Label1.Caption+'" ?'),PChar(Application.Title),MB_YESNO+MB_ICONQUESTION)=6 then begin
      remove_files;
      ini1.EraseSection(Label1.Caption);
      FormCreate(nil);
   end;
end;
ini1.free;
except end;End;


HTML generated by Time2HELP
http://www.time2help.com