Changeset 44 for trunk/Forms
- Timestamp:
- Mar 9, 2012, 3:02:00 PM (13 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormLoginProfile.pas
r43 r44 68 68 procedure SpinEditPortChange(Sender: TObject); 69 69 private 70 SelectedProfile: TConnectProfile; 70 71 ProfileList: TProfileList; 71 72 public 72 73 73 end; 74 74 … … 128 128 procedure TLoginProfileForm.ComboBoxProtocolChange(Sender: TObject); 129 129 begin 130 if ListBoxProfiles.ItemIndex <> - 1then131 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).Protocol :=130 if Assigned(SelectedProfile) then 131 SelectedProfile.Protocol := 132 132 TConnectProtocol(ComboBoxProtocol.Items.Objects[ComboBoxProtocol.ItemIndex]); 133 133 end; … … 135 135 procedure TLoginProfileForm.EditNameChange(Sender: TObject); 136 136 begin 137 if ListBoxProfiles.ItemIndex <> - 1then begin138 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).Name := EditName.Text;137 if Assigned(SelectedProfile) then begin 138 SelectedProfile.Name := EditName.Text; 139 139 ListBoxProfiles.Items[ListBoxProfiles.ItemIndex] := EditName.Text; 140 140 end; … … 143 143 procedure TLoginProfileForm.EditDatabaseChange(Sender: TObject); 144 144 begin 145 if ListBoxProfiles.ItemIndex <> - 1then146 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).Database := EditDatabase.Text;145 if Assigned(SelectedProfile) then 146 SelectedProfile.Database := EditDatabase.Text; 147 147 end; 148 148 149 149 procedure TLoginProfileForm.EditServerChange(Sender: TObject); 150 150 begin 151 if ListBoxProfiles.ItemIndex <> - 1then152 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).HostName := EditServer.Text;151 if Assigned(SelectedProfile) then 152 SelectedProfile.HostName := EditServer.Text; 153 153 end; 154 154 … … 202 202 if ListBoxProfiles.ItemIndex <> -1 then 203 203 with TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]) do begin 204 SelectedProfile := nil; 204 205 EditServer.Text := HostName; 205 206 EditDatabase.Text := Database; … … 207 208 SpinEditPort.Value := Port; 208 209 EditName.Text := Name; 210 SelectedProfile := TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]); 209 211 end; 210 212 end; … … 212 214 procedure TLoginProfileForm.SpinEditPortChange(Sender: TObject); 213 215 begin 214 if ListBoxProfiles.ItemIndex <> - 1then215 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).Port := SpinEditPort.Value;216 if Assigned(SelectedProfile) then 217 SelectedProfile.Port := SpinEditPort.Value; 216 218 end; 217 219 -
trunk/Forms/UFormMain.pas
r43 r44 307 307 Core.System.Types.Clear; 308 308 FreeAndNil(Core.Client); 309 UpdateInterface; 310 end; 309 Core.System.Client := Core.Client; 310 end; 311 UpdateInterface; 311 312 end; 312 313
Note:
See TracChangeset
for help on using the changeset viewer.