unit unitSettings;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
|
ComCtrls, inifiles;
|
|
|
|
type
|
|
|
|
{ TformSettings }
|
|
|
|
TformSettings = class(TForm)
|
|
Button1: TButton;
|
|
Button2: TButton;
|
|
CheckBox1: TCheckBox;
|
|
CheckBox2: TCheckBox;
|
|
CheckBox3: TCheckBox;
|
|
Edit1: TEdit;
|
|
Edit2: TEdit;
|
|
Edit3: TEdit;
|
|
Label1: TLabel;
|
|
Label2: TLabel;
|
|
Label3: TLabel;
|
|
UpDown1: TUpDown;
|
|
UpDown2: TUpDown;
|
|
procedure Button1Click(Sender: TObject);
|
|
procedure Button2Click(Sender: TObject);
|
|
private
|
|
{ private declarations }
|
|
public
|
|
{ public declarations }
|
|
end;
|
|
|
|
var
|
|
formSettings: TformSettings;
|
|
|
|
implementation
|
|
|
|
{$R *.lfm}
|
|
|
|
{ TformSettings }
|
|
|
|
procedure TformSettings.Button1Click(Sender: TObject);
|
|
var ini: TIniFile;
|
|
begin
|
|
//tray icon visible
|
|
//close to tray
|
|
//not show
|
|
//not timeout ms
|
|
//list update ms
|
|
//threads count
|
|
ini:=TIniFile.Create('.aria2g.ini');
|
|
ini.WriteBool('APP','TRAY_ICON',CheckBox1.Checked);
|
|
ini.WriteBool('APP','CLOSE_TO_TRAY_ICON',CheckBox2.Checked);
|
|
ini.WriteBool('APP','NOTIFICATIONS',CheckBox3.Checked);
|
|
ini.WriteInteger('APP','NOTIFICATION_DELAY_MS',StrToInt(Edit1.Text));
|
|
ini.WriteInteger('APP','LIST_UPDATE_DELAY_MS',StrToInt(Edit3.Text));
|
|
ini.WriteInteger('APP','THREADS_DEFAULT',StrToInt(Edit2.Text));
|
|
ini.Free;
|
|
close;
|
|
end;
|
|
|
|
procedure TformSettings.Button2Click(Sender: TObject);
|
|
begin
|
|
close;
|
|
end;
|
|
|
|
end.
|
|
|