Графический интерфейс в aria2c RPC http://blindage.org/?p=5385
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

unitsettings.pas 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. unit unitSettings;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  6. ComCtrls, inifiles;
  7. type
  8. { TformSettings }
  9. TformSettings = class(TForm)
  10. Button1: TButton;
  11. Button2: TButton;
  12. CheckBox1: TCheckBox;
  13. CheckBox2: TCheckBox;
  14. CheckBox3: TCheckBox;
  15. Edit1: TEdit;
  16. Edit2: TEdit;
  17. Edit3: TEdit;
  18. Label1: TLabel;
  19. Label2: TLabel;
  20. Label3: TLabel;
  21. UpDown1: TUpDown;
  22. UpDown2: TUpDown;
  23. procedure Button1Click(Sender: TObject);
  24. procedure Button2Click(Sender: TObject);
  25. private
  26. { private declarations }
  27. public
  28. { public declarations }
  29. end;
  30. var
  31. formSettings: TformSettings;
  32. implementation
  33. {$R *.lfm}
  34. { TformSettings }
  35. procedure TformSettings.Button1Click(Sender: TObject);
  36. var ini: TIniFile;
  37. begin
  38. //tray icon visible
  39. //close to tray
  40. //not show
  41. //not timeout ms
  42. //list update ms
  43. //threads count
  44. ini:=TIniFile.Create('.aria2g.ini');
  45. ini.WriteBool('APP','TRAY_ICON',CheckBox1.Checked);
  46. ini.WriteBool('APP','CLOSE_TO_TRAY_ICON',CheckBox2.Checked);
  47. ini.WriteBool('APP','NOTIFICATIONS',CheckBox3.Checked);
  48. ini.WriteInteger('APP','NOTIFICATION_DELAY_MS',StrToInt(Edit1.Text));
  49. ini.WriteInteger('APP','LIST_UPDATE_DELAY_MS',StrToInt(Edit3.Text));
  50. ini.WriteInteger('APP','THREADS_DEFAULT',StrToInt(Edit2.Text));
  51. ini.Free;
  52. close;
  53. end;
  54. procedure TformSettings.Button2Click(Sender: TObject);
  55. begin
  56. close;
  57. end;
  58. end.