1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43:
| procedure TForm1.FormCreate(Sender: TObject); var Config: TIniFile; i: Integer; begin Config := TIniFile.Create(ChangeFileExt(Application.Exename,'.ini')); BackupTimer.Interval := Config.ReadInteger('Global', 'BackupInterval', 60); JobGrid.Cells[0,0] := 'Nr.'; JobGrid.Cells[1,0] := 'Name'; JobGrid.Cells[2,0] := 'Ordner'; JobGrid.Cells[3,0] := 'Mirror'; JobCount := Config.ReadInteger('Jobinfo', 'JobCount', 0); JobGrid.RowCount := JobCount +2; for i := 1 to JobGrid.RowCount do begin JobGrid.Cells[0,i] := IntToStr(i); JobGrid.Cells[1,i] := Config.ReadString('Jobinfo', 'Name'+IntToStr(i), ''); JobGrid.Cells[2,i] := Config.ReadString('Jobinfo', 'Directory'+IntToStr(i), ''); JobGrid.Cells[3,i] := Config.ReadString('Jobinfo', 'Mirror'+IntToStr(i), ''); end; Config.Free; StatusBar.Panels[0].Text := 'Zu erledigende Jobs: ' + IntToStr(JobCount); end;
procedure TForm1.FormDestroy(Sender: TObject); var Config: TIniFile; i: Integer; begin Config := TIniFile.Create(ChangeFileExt(Application.Exename,'.ini')); Config.EraseSection('Jobinfo'); if (JobGrid.RowCount > 1) then begin Config.WriteInteger('Jobinfo', 'JobCount', JobCount); for i := 1 to JobGrid.RowCount do begin Config.WriteString('Jobinfo', 'Name'+IntToStr(i), JobGrid.Cells[1,i]); Config.WriteString('Jobinfo', 'Directory'+IntToStr(i), JobGrid.Cells[2,i]); Config.WriteString('Jobinfo', 'Mirror'+IntToStr(i), JobGrid.Cells[3,i]); end; end; Config.Free; end; |