-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathqMaintenance.pas
More file actions
75 lines (62 loc) · 1.67 KB
/
qMaintenance.pas
File metadata and controls
75 lines (62 loc) · 1.67 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
unit qMaintenance;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Registry;
type
TMaintenance = class(TForm)
Regather: TButton;
Button2: TButton;
Close: TButton;
GroupBox1: TGroupBox;
procedure Button2Click(Sender: TObject);
procedure CloseClick(Sender: TObject);
procedure RegatherClick(Sender: TObject);
private
FIniFile: TRegIniFile;
public
{ Public declarations }
end;
var
Maintenance: TMaintenance;
implementation
uses qIRCMain, qSettins, qSettings;
{$R *.DFM}
procedure TMaintenance.Button2Click(Sender: TObject);
begin
Settins.Server.Clear;
IRCMain.StartNew;
IRCMain.UpdateSvrBox(Settins.Server.ItemIndex);
ShowMessage('Defaults were loaded. If you wish to UNDO'#13'this, please click Cancel down below.');
end;
procedure TMaintenance.CloseClick(Sender: TObject);
begin
Settins.CloseMaintenance;
end;
procedure TMaintenance.RegatherClick(Sender: TObject);
Var
Done : Boolean;
I : Integer;
P : Integer;
Tmp : String;
begin
ShowMessage('fix me');
Exit;
Done := False;
FIniFile := TRegIniFile.Create('Software');
P := Settins.Server.Items.Count;
I := P;
Repeat
Tmp := IRCMain.ReadStr('Servers', 'Server_' + IntToStr(I));
If (Tmp = '') Then Break;
IRCMain.AddToServerList(Tmp);
Inc(I);
Until Done;
If (P = I) Then
ShowMessage('No previous servers found. Sorry!')
Else
ShowMessage('Found ' + IntToStr(I - P) + ' previous servers.');
Settins.Server.ItemIndex := FIniFile.ReadInteger('Servers', 'Selected', 0);
FIniFile.Free;
end;
end.