ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/design/IBDatabaseEdit.pas
(Generate patch)

Comparing ibx/trunk/design/IBDatabaseEdit.pas (file contents):
Revision 231 by tony, Mon Apr 16 08:32:21 2018 UTC vs.
Revision 291 by tony, Fri Apr 17 10:26:08 2020 UTC

# Line 57 | Line 57 | type
57  
58    TIBDatabaseEditForm = class(TForm)
59      Browse: TButton;
60 +    UseWireCompression: TCheckBox;
61      DatabasePath: TEdit;
62      Label1: TLabel;
63 +    Label10: TLabel;
64      Label7: TLabel;
65      Label8: TLabel;
66      Label9: TLabel;
67 +    ConfigOverrides: TMemo;
68      PortNo: TEdit;
69      Protocol: TComboBox;
70      ConnectionTypeBtn: TRadioGroup;
# Line 84 | Line 87 | type
87      CharacterSet: TComboBox;
88      Test: TButton;
89      procedure BrowseClick(Sender: TObject);
90 +    procedure ConfigOverridesEditingDone(Sender: TObject);
91      procedure DatabaseParamsEditingDone(Sender: TObject);
92      procedure OKBtnClick(Sender: TObject);
93      procedure FormCreate(Sender: TObject);
# Line 96 | Line 100 | type
100      procedure TestClick(Sender: TObject);
101      procedure UserNameEditingDone(Sender: TObject);
102      procedure UseSystemDefaultCSChange(Sender: TObject);
103 +    procedure UseWireCompressionEditingDone(Sender: TObject);
104    private
105      { Private declarations }
106      Database: TIBDatabase;
107 +    FChanging: boolean;
108      function Edit: Boolean;
109      procedure AddParam(aName, aValue: string);
110      procedure DeleteParam(aName: string);
# Line 116 | Line 122 | implementation
122  
123   {$R *.lfm}
124  
125 < uses TypInfo, FBMessages, IBUtils;
125 > uses TypInfo, IBMessages, IBUtils;
126  
127   function EditIBDatabase(ADatabase: TIBDatabase): Boolean;
128   begin
# Line 181 | Line 187 | begin
187    end;
188    ProtocolCloseUp(nil);
189    ConnectionTypeBtnSelectionChanged(nil);
190 <  if Trim(Database.Params.Text) = '' then
191 <    DatabaseParams.Clear
186 <  else
187 <    DatabaseParams.Lines.Assign(Database.Params);
190 >  DatabaseParams.Lines.Assign(Database.Params);
191 >  ConfigOverrides.Lines.Assign(Database.ConfigOverrides);
192    LoginPrompt.Checked := Database.LoginPrompt;
193    UpdateParamEditBoxes;
194    UseSystemDefaultCS.Checked := Database.UseDefaultSystemCodePage;
195 +  UseWireCompression.Checked := Database.WireCompression;
196    Result := False;
197    if ShowModal = mrOk then
198    begin
199      Database.DatabaseName := MakeConnectString(ServerName.Text, DatabasePath.Text,
200        TProtocolAll(Protocol.ItemIndex), PortNo.Text);
201 <    Database.Params := DatabaseParams.Lines;
201 >    Database.Params.Assign(DatabaseParams.Lines);
202 >    Database.ConfigOverrides.Assign(ConfigOverrides.Lines);
203      Database.LoginPrompt := LoginPrompt.Checked;
204      Database.UseDefaultSystemCodePage := UseSystemDefaultCS.Checked;
205      Result := True;
# Line 213 | Line 219 | begin
219      end;
220   end;
221  
222 + procedure TIBDatabaseEditForm.ConfigOverridesEditingDone(Sender: TObject);
223 + begin
224 +  FChanging := true;
225 +  try
226 +    UseWireCompression.Checked := CompareText(ConfigOverrides.Lines.Values['WireCompression'],'true') = 0;
227 +  finally
228 +    FChanging := false;
229 +  end;
230 + end;
231 +
232   procedure TIBDatabaseEditForm.DatabaseParamsEditingDone(Sender: TObject);
233   begin
234    UpdateParamEditBoxes;
# Line 328 | Line 344 | begin
344        AddParam('lc_ctype', CharacterSet.Text)
345   end;
346  
347 + procedure TIBDatabaseEditForm.UseWireCompressionEditingDone(Sender: TObject);
348 + var Index: integer;
349 + begin
350 +  if FChanging then Exit;
351 +  if UseWireCompression.Checked then
352 +    ConfigOverrides.Lines.Values['WireCompression'] := 'true'
353 +  else
354 +  begin
355 +    Index := ConfigOverrides.Lines.IndexOfName('WireCompression');
356 +    if Index <> -1 then
357 +      ConfigOverrides.Lines.Delete(Index);
358 +  end;
359 + end;
360 +
361  
362   end.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines