-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateModalWindow.pas
More file actions
87 lines (73 loc) · 2.33 KB
/
Copy pathUpdateModalWindow.pas
File metadata and controls
87 lines (73 loc) · 2.33 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
unit UpdateModalWindow;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ShellApi, OleCtrls, SHDocVw, IniFiles;
type
TUpdateApp = class(TForm)
ReleaseHistory: TRichEdit;
DownloadApp: TButton;
LabelAppVersion: TLabel;
CheckBoxOffNoti: TCheckBox;
procedure FormPaint(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure LabelAppVersionMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure LabelAppVersionMouseLeave(Sender: TObject);
procedure DownloadAppClick(Sender: TObject);
private
public
end;
var
UpdateApp: TUpdateApp;
implementation
uses MainForm, AboutModalWindow;
{$R *.dfm}
procedure TUpdateApp.DownloadAppClick(Sender: TObject);
begin
ShellExecute(Handle, 'open', 'https://github.com/tasks-delivery/front-editor/raw/master/Front_Editor.exe', nil, nil, SW_SHOW);
end;
procedure TUpdateApp.FormClose(Sender: TObject; var Action: TCloseAction);
var IniFile: TIniFile;
First : Boolean;
begin
if CheckBoxOffNoti.State = cbUnchecked then First:=false
else First:=True;
IniFile:=TIniFile.Create(ExtractFilePath(Application.ExeName)+'Config.INI');
IniFile.WriteBool('CheckBox', 'First', First);
IniFile.Free;
end;
procedure TUpdateApp.FormCreate(Sender: TObject);
begin
LabelAppVersion.Font.Color := clBlue;
LabelAppVersion.Font.Style := [fsUnderline];
LabelAppVersion.Caption := 'New version has been released';
end;
procedure TUpdateApp.FormPaint(Sender: TObject);
var IniFile: TIniFile;
First : Boolean;
begin
if releaseVersion = Main.WebBrowser1.OleObject.Document.documentElement.innerText then
begin
LabelAppVersion.Visible := True;
DownloadApp.Enabled := True;
end;
begin
IniFile:=TIniFile.Create(ExtractFilePath(Application.ExeName)+'Config.INI');
First:=IniFile.ReadBool('CheckBox', 'First', False);
if First = True then CheckBoxOffNoti.State:=cbChecked
else CheckBoxOffNoti.State:=cbUnchecked;
IniFile.Free;
end;
end;
procedure TUpdateApp.LabelAppVersionMouseLeave(Sender: TObject);
begin
LabelAppVersion.Font.Color := clBlue;
end;
procedure TUpdateApp.LabelAppVersionMouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
begin
LabelAppVersion.Font.Color := clRed;
end;
end.