Ignore:
Timestamp:
Mar 24, 2019, 10:52:35 PM (6 years ago)
Author:
chronos
Message:
  • Modified: More forms use data item property instead Load/Save methods.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNew.pas

    r287 r288  
    600600procedure TFormNew.AServerAddExecute(Sender: TObject);
    601601var
    602   NewServer: TServerInfo;
     602  NewServerInfo: TServerInfo;
    603603begin
    604604  FormServer := TFormServer.Create(nil);
    605   NewServer := TServerInfo.Create;
    606   FormServer.Load(NewServer);
     605  NewServerInfo := TServerInfo.Create;
     606  FormServer.ServerInfo := NewServerInfo;
    607607  if FormServer.ShowModal = mrOK then begin
    608     FormServer.Save(NewServer);
    609     ServerList.Items.Add(NewServer);
     608    ServerList.Items.Add(NewServerInfo);
    610609    ReloadView;
    611   end else NewServer.Free;
     610  end else NewServerInfo.Free;
    612611  FormServer.Free;
    613612end;
     
    615614procedure TFormNew.AServerModifyExecute(Sender: TObject);
    616615var
    617   Server: TServerInfo;
     616  ServerInfo: TServerInfo;
    618617begin
    619618  FormServer := TFormServer.Create(nil);
    620   Server := TServerInfo(ListViewServers.Selected.Data);
    621   FormServer.Load(Server);
     619  ServerInfo := TServerInfo(ListViewServers.Selected.Data);
     620  FormServer.ServerInfo := ServerInfo;
    622621  if FormServer.ShowModal = mrOK then begin
    623     FormServer.Save(Server);
    624622    ReloadView;
    625623  end;
Note: See TracChangeset for help on using the changeset viewer.