Subversion Repositories oidplus

Rev

Rev 234 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 234 Rev 235
Line 1... Line 1...
1
unit Main;
1
unit Main;
2
 
2
 
3
{ This source code is only compatible with Delphi 1.0 ! }
-
 
4
 
-
 
5
interface
3
interface
6
 
4
 
7
uses
5
uses
8
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms,
6
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms,
9
  Dialogs, StdCtrls, IniFiles, Grids, Outline, ExtCtrls;
7
  Dialogs, StdCtrls, IniFiles, Grids, Outline, ExtCtrls;
Line 152... Line 150...
152
  sectionName: string;
150
  sectionName: string;
153
  asn1ids: string;
151
  asn1ids: string;
154
  l: TList;
152
  l: TList;
155
  sl: TStringList;
153
  sl: TStringList;
156
  workItem: TWorkItem;
154
  workItem: TWorkItem;
157
label
-
 
158
  continuework,
-
 
159
  ende;
-
 
160
begin
155
begin
161
  l := TList.Create;
156
  l := TList.Create;
162
  sl := TStringList.Create;
157
  sl := TStringList.Create;
163
 
158
 
164
  workItem := TWorkItem.Create;
159
  workItem := TWorkItem.Create;
165
  workItem.sectionName := oid;
160
  workItem.sectionName := oid;
166
  workItem.ini := ini;
161
  workItem.ini := ini;
167
  workItem.nod := nod;
162
  workItem.nod := nod;
168
  l.Add(workItem);
163
  l.Add(workItem);
169
 
164
 
170
continuework:
-
 
171
 
-
 
172
  if l.Count = 0 then goto ende;
-
 
173
  workItem := l.Items[l.Count-1];
-
 
174
  oid := workItem.sectionName;
-
 
175
  ini := workItem.ini;
-
 
176
  nod := workItem.nod;
-
 
177
  workItem.Free;
-
 
178
  l.Delete(l.Count-1);
165
  while l.Count > 0 do
179
 
-
 
180
  if oid = 'OID:' then
-
 
181
  begin
-
 
182
    nod := Outline1.AddChild(nod, TITLE_OID);
-
 
183
  end
-
 
184
  else
-
 
185
  begin
166
  begin
-
 
167
    workItem := l.Items[l.Count-1];
186
    asn1ids := ini.ReadString(oid, 'asn1id', '');
168
    oid := workItem.sectionName;
-
 
169
    ini := workItem.ini;
-
 
170
    nod := workItem.nod;
-
 
171
    workItem.Free;
-
 
172
    l.Delete(l.Count-1);
-
 
173
 
187
    if ini.ReadBool(oid, 'draft', false) then
174
    if oid = 'OID:' then
-
 
175
    begin
188
      nod := Outline1.AddChild(nod, Trim(oid+' '+Copy(asn1ids,1,Pos(',',asn1ids+',')-1))+' [DRAFT]')
176
      nod := Outline1.AddChild(nod, TITLE_OID);
-
 
177
    end
189
    else
178
    else
-
 
179
    begin
-
 
180
      asn1ids := ini.ReadString(oid, 'asn1id', '');
-
 
181
      if ini.ReadBool(oid, 'draft', false) then
-
 
182
        nod := Outline1.AddChild(nod, Trim(oid+' '+Copy(asn1ids,1,Pos(',',asn1ids+',')-1))+' [DRAFT]')
-
 
183
      else
190
      nod := Outline1.AddChild(nod, Trim(oid+' '+Copy(asn1ids,1,Pos(',',asn1ids+',')-1)));
184
        nod := Outline1.AddChild(nod, Trim(oid+' '+Copy(asn1ids,1,Pos(',',asn1ids+',')-1)));
191
  end;
185
    end;
192
  sl.Clear;
186
    sl.Clear;
193
  for i := ini.ReadInteger(oid, 'delegates', 0) downto 1 do
187
    for i := ini.ReadInteger(oid, 'delegates', 0) downto 1 do
194
  begin
188
    begin
195
    sectionName := ini.ReadString(oid, 'delegate'+IntToStr(i), '');
189
      sectionName := ini.ReadString(oid, 'delegate'+IntToStr(i), '');
196
    if sectionName = '' then continue;
190
      if sectionName = '' then continue;
197
    sl.Add(sectionName);
191
      sl.Add(sectionName);
198
  end;
192
    end;
199
  SortSL(sl);
193
    SortSL(sl);
200
  for i := sl.Count-1 downto 0 do
194
    for i := sl.Count-1 downto 0 do
201
  begin
195
    begin
202
    sectionName := sl.Strings[i];
196
      sectionName := sl.Strings[i];
203
 
197
 
204
    workItem := TWorkItem.Create;
198
      workItem := TWorkItem.Create;
205
    workItem.sectionName := sectionName;
199
      workItem.sectionName := sectionName;
206
    workItem.ini := ini;
200
      workItem.ini := ini;
207
    workItem.nod := nod;
201
      workItem.nod := nod;
208
    l.Add(workItem);
202
      l.Add(workItem);
-
 
203
    end;
-
 
204
    if (oid = 'OID:') or (sl.Count < 125) then
-
 
205
      ExpandNodeAndParents(Outline1.Items[nod]);
209
  end;
206
  end;
210
  if (oid = 'OID:') or (sl.Count < 125) then
-
 
211
    ExpandNodeAndParents(Outline1.Items[nod]);
-
 
212
 
-
 
213
  goto continuework;
-
 
214
 
-
 
215
ende:
-
 
216
 
207
 
217
  sl.Free;
208
  sl.Free;
218
  l.Free;
209
  l.Free;
219
end;
210
end;
220
 
211
 
Line 692... Line 683...
692
      if Trim(Memo1.Text) = '' then
683
      if Trim(Memo1.Text) = '' then
693
      begin
684
      begin
694
        txtFile := ini.ReadString(Edit4.Text, 'information', '');
685
        txtFile := ini.ReadString(Edit4.Text, 'information', '');
695
        if FileExists(DBPath+txtFile) then
686
        if FileExists(DBPath+txtFile) then
696
        begin
687
        begin
697
          DeleteFile(DBPath+txtFile);
688
          SysUtils.DeleteFile(DBPath+txtFile);
698
        end;
689
        end;
699
        if txtFile <> '' then
690
        if txtFile <> '' then
700
        begin
691
        begin
701
          ini.WriteString(Edit4.Text, 'information', '')
692
          ini.WriteString(Edit4.Text, 'information', '')
702
        end;
693
        end;