Changeset 32 for trunk/Forms/FormDatabases.pas
- Timestamp:
- Jun 29, 2024, 7:58:36 AM (3 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormDatabases.pas
r31 r32 1 unit UFormDatabases;1 unit FormDatabases; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 Menus, ActnList, UDatabase;7 Menus, ActnList, DbEngine, FormEx; 8 8 9 9 type … … 11 11 { TFormDatabases } 12 12 13 TFormDatabases = class(TForm )13 TFormDatabases = class(TFormEx) 14 14 AAdd: TAction; 15 15 AOpen: TAction; … … 39 39 public 40 40 SelectedProfile: TDbConnectProfile; 41 DbManager: TDbManager; 41 42 procedure ReloadList; 42 43 procedure UpdateInterface; … … 49 50 50 51 uses 51 UCore, UFormConnect;52 FormConnect; 52 53 53 54 resourcestring … … 76 77 if MessageDlg(SRemoveDatabaseConnection, Format(SRemoveDatabaseConnectionQuery, [ 77 78 TDbConnectProfile(ListView1.Selected.Data).Name]), mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin 78 Core.DbManager.ConnectProfiles.Remove(ListView1.Selected.Data);79 DbManager.ConnectProfiles.Remove(ListView1.Selected.Data); 79 80 ReloadList; 80 81 end; … … 90 91 with TFormConnect.Create(nil) do 91 92 try 93 DbManager := Self.DbManager; 92 94 Load(NewConnectProfile); 93 95 if ShowModal = mrOk then begin 94 96 Save(NewConnectProfile); 95 Core.DbManager.ConnectProfiles.Add(NewConnectProfile);97 DbManager.ConnectProfiles.Add(NewConnectProfile); 96 98 ReloadList; 97 99 end else NewConnectProfile.Free; … … 104 106 begin 105 107 if Assigned(ListView1.Selected) then begin 108 DbManager := Self.DbManager; 106 109 with TFormConnect.Create(nil) do 107 110 try 111 DbManager := Self.DbManager; 108 112 Load(TDbConnectProfile(ListView1.Selected.Data)); 109 113 if ShowModal = mrOk then begin … … 128 132 procedure TFormDatabases.ListView1Data(Sender: TObject; Item: TListItem); 129 133 begin 130 if (Item.Index >= 0) and (Item.Index < Core.DbManager.ConnectProfiles.Count) then131 with TDbConnectProfile( Core.DbManager.ConnectProfiles[Item.Index]) do begin134 if (Item.Index >= 0) and (Item.Index < DbManager.ConnectProfiles.Count) then 135 with TDbConnectProfile(DbManager.ConnectProfiles[Item.Index]) do begin 132 136 Item.Caption := Name; 133 137 Item.SubItems.Add(ClientType.Name); 134 138 Item.SubItems.Add(Params.ConnectionString); 135 Item.Data := Core.DbManager.ConnectProfiles[Item.Index];139 Item.Data := DbManager.ConnectProfiles[Item.Index]; 136 140 end 137 141 end; … … 145 149 procedure TFormDatabases.ReloadList; 146 150 begin 147 ListView1.Items.Count := Core.DbManager.ConnectProfiles.Count;151 ListView1.Items.Count := DbManager.ConnectProfiles.Count; 148 152 ListView1.Repaint; 149 153 UpdateInterface;
Note:
See TracChangeset
for help on using the changeset viewer.