Skip to content

Commit e6880d3

Browse files
committed
update providerlist, save logins
1 parent a7a0ed5 commit e6880d3

10 files changed

+159
-89
lines changed

Samples/OpenConnect.dproj

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
33
<ProjectGuid>{EB7E0B20-2291-499E-9A3E-A9725074D118}</ProjectGuid>
4-
<ProjectVersion>19.2</ProjectVersion>
4+
<ProjectVersion>19.4</ProjectVersion>
55
<FrameworkType>VCL</FrameworkType>
66
<MainSource>OpenConnect.dpr</MainSource>
77
<Base>True</Base>
@@ -132,17 +132,17 @@
132132
<Form>MainForm</Form>
133133
<FormType>dfm</FormType>
134134
</DCCReference>
135-
<BuildConfiguration Include="Release">
136-
<Key>Cfg_2</Key>
137-
<CfgParent>Base</CfgParent>
138-
</BuildConfiguration>
139135
<BuildConfiguration Include="Base">
140136
<Key>Base</Key>
141137
</BuildConfiguration>
142138
<BuildConfiguration Include="Debug">
143139
<Key>Cfg_1</Key>
144140
<CfgParent>Base</CfgParent>
145141
</BuildConfiguration>
142+
<BuildConfiguration Include="Release">
143+
<Key>Cfg_2</Key>
144+
<CfgParent>Base</CfgParent>
145+
</BuildConfiguration>
146146
</ItemGroup>
147147
<ProjectExtensions>
148148
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
@@ -191,6 +191,16 @@
191191
<Operation>0</Operation>
192192
</Platform>
193193
</DeployClass>
194+
<DeployClass Name="AndroidClasses">
195+
<Platform Name="Android">
196+
<RemoteDir>classes</RemoteDir>
197+
<Operation>64</Operation>
198+
</Platform>
199+
<Platform Name="Android64">
200+
<RemoteDir>classes</RemoteDir>
201+
<Operation>64</Operation>
202+
</Platform>
203+
</DeployClass>
194204
<DeployClass Name="AndroidClassesDexFile">
195205
<Platform Name="Android">
196206
<RemoteDir>classes</RemoteDir>
@@ -492,6 +502,11 @@
492502
<Operation>1</Operation>
493503
<Extensions>.framework</Extensions>
494504
</Platform>
505+
<Platform Name="OSXARM64">
506+
<RemoteDir>Contents\MacOS</RemoteDir>
507+
<Operation>1</Operation>
508+
<Extensions>.framework</Extensions>
509+
</Platform>
495510
<Platform Name="Win32">
496511
<Operation>0</Operation>
497512
</Platform>
@@ -519,6 +534,11 @@
519534
<Operation>1</Operation>
520535
<Extensions>.dylib</Extensions>
521536
</Platform>
537+
<Platform Name="OSXARM64">
538+
<RemoteDir>Contents\MacOS</RemoteDir>
539+
<Operation>1</Operation>
540+
<Extensions>.dylib</Extensions>
541+
</Platform>
522542
<Platform Name="Win32">
523543
<Operation>0</Operation>
524544
<Extensions>.dll;.bpl</Extensions>
@@ -547,6 +567,11 @@
547567
<Operation>1</Operation>
548568
<Extensions>.dylib</Extensions>
549569
</Platform>
570+
<Platform Name="OSXARM64">
571+
<RemoteDir>Contents\MacOS</RemoteDir>
572+
<Operation>1</Operation>
573+
<Extensions>.dylib</Extensions>
574+
</Platform>
550575
<Platform Name="Win32">
551576
<Operation>0</Operation>
552577
<Extensions>.bpl</Extensions>
@@ -576,6 +601,10 @@
576601
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
577602
<Operation>0</Operation>
578603
</Platform>
604+
<Platform Name="OSXARM64">
605+
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
606+
<Operation>0</Operation>
607+
</Platform>
579608
<Platform Name="Win32">
580609
<Operation>0</Operation>
581610
</Platform>
@@ -841,6 +870,10 @@
841870
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
842871
<Operation>1</Operation>
843872
</Platform>
873+
<Platform Name="OSXARM64">
874+
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
875+
<Operation>1</Operation>
876+
</Platform>
844877
</DeployClass>
845878
<DeployClass Name="ProjectOSXEntitlements">
846879
<Platform Name="OSX32">
@@ -851,6 +884,10 @@
851884
<RemoteDir>..\</RemoteDir>
852885
<Operation>1</Operation>
853886
</Platform>
887+
<Platform Name="OSXARM64">
888+
<RemoteDir>..\</RemoteDir>
889+
<Operation>1</Operation>
890+
</Platform>
854891
</DeployClass>
855892
<DeployClass Name="ProjectOSXInfoPList">
856893
<Platform Name="OSX32">
@@ -861,6 +898,10 @@
861898
<RemoteDir>Contents</RemoteDir>
862899
<Operation>1</Operation>
863900
</Platform>
901+
<Platform Name="OSXARM64">
902+
<RemoteDir>Contents</RemoteDir>
903+
<Operation>1</Operation>
904+
</Platform>
864905
</DeployClass>
865906
<DeployClass Name="ProjectOSXResource">
866907
<Platform Name="OSX32">
@@ -871,6 +912,10 @@
871912
<RemoteDir>Contents\Resources</RemoteDir>
872913
<Operation>1</Operation>
873914
</Platform>
915+
<Platform Name="OSXARM64">
916+
<RemoteDir>Contents\Resources</RemoteDir>
917+
<Operation>1</Operation>
918+
</Platform>
874919
</DeployClass>
875920
<DeployClass Required="true" Name="ProjectOutput">
876921
<Platform Name="Android">
@@ -901,6 +946,10 @@
901946
<RemoteDir>Contents\MacOS</RemoteDir>
902947
<Operation>1</Operation>
903948
</Platform>
949+
<Platform Name="OSXARM64">
950+
<RemoteDir>Contents\MacOS</RemoteDir>
951+
<Operation>1</Operation>
952+
</Platform>
904953
<Platform Name="Win32">
905954
<Operation>0</Operation>
906955
</Platform>
@@ -939,16 +988,17 @@
939988
<Operation>1</Operation>
940989
</Platform>
941990
</DeployClass>
942-
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
943-
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
991+
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
992+
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
944993
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
994+
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
995+
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
945996
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
946-
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
947997
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
948-
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
949998
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
950-
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
951-
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
999+
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
1000+
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
1001+
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
9521002
</Deployment>
9531003
<Platforms>
9541004
<Platform value="Win32">True</Platform>

Samples/OpenConnect.res

208 Bytes
Binary file not shown.

Samples/OpenConnectUnit1.dfm

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ object MainForm: TMainForm
1010
Font.Height = -11
1111
Font.Name = 'Tahoma'
1212
Font.Style = []
13-
OldCreateOrder = False
1413
Position = poScreenCenter
14+
OnClose = FormClose
1515
OnCreate = FormCreate
1616
OnDestroy = FormDestroy
17-
PixelsPerInch = 96
1817
TextHeight = 13
1918
object ListView1: TListView
2019
Left = 0
@@ -108,7 +107,7 @@ object MainForm: TMainForm
108107
Height = 33
109108
Cursor = crHandPoint
110109
AutoSize = False
111-
Caption = 'https://github.com/ LandrixSoftware/IDSConnect-for-Delphi'
110+
Caption = 'https://github.com/LandrixSoftware/ IDSConnect-for-Delphi'
112111
Font.Charset = DEFAULT_CHARSET
113112
Font.Color = clBlue
114113
Font.Height = -11
@@ -176,6 +175,9 @@ object MainForm: TMainForm
176175
Align = alBottom
177176
BevelOuter = bvNone
178177
TabOrder = 2
178+
DesignSize = (
179+
1286
180+
41)
179181
object Button1: TButton
180182
Left = 8
181183
Top = 6
@@ -185,5 +187,24 @@ object MainForm: TMainForm
185187
TabOrder = 0
186188
OnClick = Button1Click
187189
end
190+
object Button3: TButton
191+
Left = 1196
192+
Top = 6
193+
Width = 75
194+
Height = 25
195+
Anchors = [akTop, akRight]
196+
Caption = 'Beenden'
197+
TabOrder = 1
198+
OnClick = Button3Click
199+
end
200+
object CheckBox1: TCheckBox
201+
Left = 1016
202+
Top = 10
203+
Width = 169
204+
Height = 17
205+
Anchors = [akTop, akRight]
206+
Caption = 'Aenderungen nicht speichern'
207+
TabOrder = 2
208+
end
188209
end
189210
end

Samples/OpenConnectUnit1.pas

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ TMainForm = class(TForm)
3030
Edit5: TEdit;
3131
Label9: TLabel;
3232
Label10: TLabel;
33+
Button3: TButton;
34+
CheckBox1: TCheckBox;
3335
procedure FormCreate(Sender: TObject);
3436
procedure Button1Click(Sender: TObject);
3537
procedure FormDestroy(Sender: TObject);
3638
procedure Edit3Change(Sender: TObject);
3739
procedure ListView1SelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
3840
procedure Button2Click(Sender: TObject);
3941
procedure Label10Click(Sender: TObject);
42+
procedure FormClose(Sender: TObject; var Action: TCloseAction);
43+
procedure Button3Click(Sender: TObject);
4044
public
4145
Suppliers: TOpenConnectBusinessList;
4246
Configuration : TMemIniFile;
@@ -55,7 +59,12 @@ procedure TMainForm.FormCreate(Sender: TObject);
5559
Suppliers:= TOpenConnectBusinessList.Create;
5660
Configuration := TMemIniFile.Create(ExtractFilePath(ExtractFileDir(ExtractFileDir(Application.ExeName)))+'configuration.ini');
5761
Editable := false;
58-
62+
63+
Left := 50;
64+
Top := 50;
65+
Width := Screen.DesktopWidth-100;
66+
Height := Screen.DesktopHeight-100;
67+
5968
with ListView1.Columns.Add do
6069
begin
6170
Caption := 'Service-Name';
@@ -117,11 +126,25 @@ procedure TMainForm.FormCreate(Sender: TObject);
117126
Alignment := taLeftJustify;
118127
Width := 50;
119128
end;
129+
for var i : Integer := 0 to ListView1.Columns.Count-1 do
130+
ListView1.Columns[i].Width := Configuration.ReadInteger(ListView1.Name,i.ToString,ListView1.Columns[i].Width);
131+
end;
132+
133+
procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
134+
begin
135+
for var i : Integer := 0 to ListView1.Columns.Count-1 do
136+
Configuration.WriteInteger(ListView1.Name,i.ToString,ListView1.Columns[i].Width);
120137
end;
121138

122139
procedure TMainForm.FormDestroy(Sender: TObject);
123140
begin
124-
if Assigned(Configuration) then begin Configuration.UpdateFile; Configuration.Free; Configuration := nil; end;
141+
if Assigned(Configuration) then
142+
begin
143+
if not CheckBox1.Checked then
144+
Configuration.UpdateFile;
145+
Configuration.Free;
146+
Configuration := nil;
147+
end;
125148
if Assigned( Suppliers) then begin ListView1.Clear; Suppliers.Free; Suppliers := nil; end;
126149
end;
127150

@@ -153,7 +176,7 @@ procedure TMainForm.Button1Click(Sender: TObject);
153176
SubItems.Add(Suppliers[i].Supplier[j].Zip);
154177
SubItems.Add(Suppliers[i].Supplier[j].City);
155178
SubItems.Add(Suppliers[i].Supplier[j].Country);
156-
if Configuration.SectionExists(IntToStr(Suppliers[i].ID)+'-'+IntToStr(Suppliers[i].Supplier[j].ID)) then
179+
if Configuration.SectionExists(Suppliers[i].ServiceURL+'-'+IntToStr(Suppliers[i].ID)+'-'+IntToStr(Suppliers[i].Supplier[j].ID)) then
157180
SubItems.Add('vorhanden')
158181
else
159182
SubItems.Add('');
@@ -163,26 +186,35 @@ procedure TMainForm.Button1Click(Sender: TObject);
163186
procedure TMainForm.Edit3Change(Sender: TObject);
164187
var
165188
section : String;
189+
i : Integer;
166190
begin
167191
if ListView1.Selected = nil then
168192
exit;
169193
if not Editable then
170194
exit;
171-
section := ListView1.Selected.SubItems[0]+'-'+ListView1.Selected.SubItems[3];
172-
if Trim(Edit1.Text).IsEmpty and Trim(Edit2.Text).IsEmpty and Trim(Edit3.Text).IsEmpty and
173-
Trim(Edit4.Text).IsEmpty and Trim(Edit5.Text).IsEmpty then
174-
begin
195+
196+
section := ListView1.Selected.SubItems[1]+'-'+ListView1.Selected.SubItems[0]+'-'+ListView1.Selected.SubItems[3];
197+
198+
if //Trim(Edit1.Text).IsEmpty and Trim(Edit2.Text).IsEmpty and
199+
Trim(Edit3.Text).IsEmpty and Trim(Edit4.Text).IsEmpty and Trim(Edit5.Text).IsEmpty then
200+
begin
175201
Configuration.EraseSection(section);
176-
ListView1.Selected.SubItems[ListView1.Selected.SubItems.Count-1] := '';
177202
end else
178203
begin
179204
Configuration.WriteString(section,'idsconnectprocesses',Edit1.Text);
180205
Configuration.WriteString(section,'idsconnecturl',Edit2.Text);
181206
Configuration.WriteString(section,'customerno',Edit3.Text);
182207
Configuration.WriteString(section,'username',Edit4.Text);
183208
Configuration.WriteString(section,'password',Edit5.Text);
184-
ListView1.Selected.SubItems[ListView1.Selected.SubItems.Count-1] := 'vorhanden';
185209
end;
210+
211+
for i := 0 to ListView1.Items.Count-1 do
212+
if Configuration.SectionExists(ListView1.Items[i].SubItems[1]+'-'+ListView1.Items[i].SubItems[0]+'-'+ListView1.Items[i].SubItems[3]) then
213+
ListView1.Items[i].SubItems[ListView1.Selected.SubItems.Count-1] := 'vorhanden'
214+
else
215+
ListView1.Items[i].SubItems[ListView1.Selected.SubItems.Count-1] := '';
216+
217+
186218
end;
187219

188220
procedure TMainForm.ListView1SelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
@@ -195,7 +227,7 @@ procedure TMainForm.ListView1SelectItem(Sender: TObject; Item: TListItem; Select
195227
exit;
196228
Editable := false;
197229
try
198-
section := Item.SubItems[0]+'-'+Item.SubItems[3];
230+
section := Item.SubItems[1]+'-'+Item.SubItems[0]+'-'+Item.SubItems[3];
199231
Edit1.Text := Configuration.ReadString(section,'idsconnectprocesses','');
200232
Edit2.Text := Configuration.ReadString(section,'idsconnecturl','');
201233
Edit3.Text := Configuration.ReadString(section,'customerno','');
@@ -244,6 +276,11 @@ procedure TMainForm.Button2Click(Sender: TObject);
244276
end;
245277
end;
246278

279+
procedure TMainForm.Button3Click(Sender: TObject);
280+
begin
281+
Close;
282+
end;
283+
247284
procedure TMainForm.Label10Click(Sender: TObject);
248285
begin
249286
ShellExecute(0,'open',PChar('https://github.com/LandrixSoftware/IDSConnect-for-Delphi'),'','',SW_SHOWNORMAL);

0 commit comments

Comments
 (0)