From: Joao M. <jcm...@us...> - 2005-11-10 00:22:23
|
Update of /cvsroot/instantobjects/Source/Brokers/IBX In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6685/Brokers/IBX Modified Files: InstantIBX.pas InstantIBXConnectionDefEdit.dfm InstantIBXConnectionDefEdit.pas Log Message: Removed connection settings, now IBX Connector has only a connection string field to locate database. Index: InstantIBX.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/IBX/InstantIBX.pas,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** InstantIBX.pas 13 Oct 2005 10:48:56 -0000 1.14 --- InstantIBX.pas 10 Nov 2005 00:22:15 -0000 1.15 *************** *** 25,29 **** * * Contributor(s): ! * Carlo Barazzetta, Nando Dessena * * ***** END LICENSE BLOCK ***** *) --- 25,29 ---- * * Contributor(s): ! * Carlo Barazzetta, Nando Dessena, Joao Morais * * ***** END LICENSE BLOCK ***** *) *************** *** 44,49 **** type - TIBXNetType = (ntLocal, ntTCP, ntNetBEUI, ntSPX); - TInstantIBXOption = (ibxUseDelimitedIdents); TInstantIBXOptions = set of TInstantIBXOption; --- 44,47 ---- *************** *** 55,65 **** TInstantIBXConnectionDef = class(TInstantConnectionBasedConnectionDef) private ! FPath: string; ! FServerName: string; ! FNetType: TIBXNetType; FOptions: TInstantIBXOptions; FParams: string; - function GetDatabaseName: string; - function GetServerName: string; protected function CreateConnection(AOwner: TComponent): TCustomConnection; override; --- 53,59 ---- TInstantIBXConnectionDef = class(TInstantConnectionBasedConnectionDef) private ! FConnectionString: string; FOptions: TInstantIBXOptions; FParams: string; protected function CreateConnection(AOwner: TComponent): TCustomConnection; override; *************** *** 70,78 **** constructor Create(Collection: TCollection); override; function Edit: Boolean; override; - property DatabaseName: string read GetDatabaseName; published ! property Path: string read FPath write FPath; ! property NetType: TIBXNetType read FNetType write FNetType; ! property ServerName: string read GetServerName write FServerName; property Options: TInstantIBXOptions read FOptions write FOptions; property Params: string read FParams write FParams; --- 64,69 ---- constructor Create(Collection: TCollection); override; function Edit: Boolean; override; published ! property ConnectionString: string read FConnectionString write FConnectionString; property Options: TInstantIBXOptions read FOptions write FOptions; property Params: string read FParams write FParams; *************** *** 177,181 **** Connection := TIBDatabase.Create(AOwner); try ! Connection.DatabaseName := DatabaseName; Connection.SQLDialect := 3; Connection.Params.Text := Params; --- 168,172 ---- Connection := TIBDatabase.Create(AOwner); try ! Connection.DatabaseName := ConnectionString; Connection.SQLDialect := 3; Connection.Params.Text := Params; *************** *** 200,227 **** end; - function TInstantIBXConnectionDef.GetDatabaseName: string; - var - Fmt: string; - begin - if NetType = ntLocal then - Result := Path - else begin - case NetType of - ntTCP: Fmt := '%s:%s'; - ntNetBEUI: Fmt := '\\%s\%s'; - ntSPX: Fmt := '%s@%s'; - end; - Result := Format(Fmt, [ServerName, Path]); - end; - end; - - function TInstantIBXConnectionDef.GetServerName: string; - begin - if NetType = ntLocal then - Result := '' - else - Result := FServerName; - end; - procedure TInstantIBXConnectionDef.InitConnector(Connector: TInstantConnector); begin --- 191,194 ---- *************** *** 565,566 **** --- 532,534 ---- end. + Index: InstantIBXConnectionDefEdit.dfm =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/IBX/InstantIBXConnectionDefEdit.dfm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** InstantIBXConnectionDefEdit.dfm 16 Sep 2005 08:59:02 -0000 1.7 --- InstantIBXConnectionDefEdit.dfm 10 Nov 2005 00:22:15 -0000 1.8 *************** *** 4,8 **** BorderStyle = bsDialog Caption = 'IBX Connection' ! ClientHeight = 399 ClientWidth = 362 Color = clBtnFace --- 4,8 ---- BorderStyle = bsDialog Caption = 'IBX Connection' ! ClientHeight = 339 ClientWidth = 362 Color = clBtnFace *************** *** 19,23 **** object BottomBevel: TBevel Left = 0 ! Top = 362 Width = 362 Height = 2 --- 19,23 ---- object BottomBevel: TBevel Left = 0 ! Top = 302 Width = 362 Height = 2 *************** *** 29,63 **** Top = 0 Width = 362 ! Height = 362 Align = alClient BevelOuter = bvNone TabOrder = 0 ! object ServerLabel: TLabel ! Left = 16 ! Top = 36 ! Width = 31 ! Height = 13 ! Caption = '&Server' ! FocusControl = ServerEdit ! end ! object ProtocolLabel: TLabel ! Left = 235 ! Top = 36 ! Width = 39 ! Height = 13 ! Caption = '&Protocol' ! FocusControl = ProtocolEdit ! end ! object DatabaseLabel: TLabel Left = 16 ! Top = 76 ! Width = 46 Height = 13 ! Caption = '&Database' ! FocusControl = DatabaseEdit end object StreamFormatLabel: TLabel Left = 16 ! Top = 312 Width = 53 Height = 13 --- 29,47 ---- Top = 0 Width = 362 ! Height = 302 Align = alClient BevelOuter = bvNone TabOrder = 0 ! object ConnectionStringLabel: TLabel Left = 16 ! Top = 12 ! Width = 84 Height = 13 ! Caption = '&Connection String' ! FocusControl = ConnectionStringEdit end object StreamFormatLabel: TLabel Left = 16 ! Top = 248 Width = 53 Height = 13 *************** *** 67,71 **** object ParamsLabel: TLabel Left = 16 ! Top = 140 Width = 95 Height = 13 --- 51,55 ---- object ParamsLabel: TLabel Left = 16 ! Top = 76 Width = 95 Height = 13 *************** *** 73,79 **** FocusControl = ParamsEditor end ! object Label1: TLabel Left = 136 ! Top = 312 Width = 62 Height = 13 --- 57,63 ---- FocusControl = ParamsEditor end ! object IdDataTypeLabel: TLabel Left = 136 ! Top = 248 Width = 62 Height = 13 *************** *** 81,87 **** FocusControl = IdDataTypeComboBox end ! object Label2: TLabel Left = 256 ! Top = 312 Width = 32 Height = 13 --- 65,71 ---- FocusControl = IdDataTypeComboBox end ! object IdSizeLabel: TLabel Left = 256 ! Top = 248 Width = 32 Height = 13 *************** *** 89,151 **** FocusControl = IdDataTypeComboBox end ! object LocalRadioButton: TRadioButton ! Left = 16 ! Top = 16 ! Width = 57 ! Height = 17 ! Caption = '&Local' ! Checked = True ! TabOrder = 0 ! TabStop = True ! OnClick = LocalRemoteChange ! end ! object RemoteRadioButton: TRadioButton ! Left = 86 ! Top = 16 ! Width = 65 ! Height = 17 ! Caption = '&Remote' ! TabOrder = 1 ! OnClick = LocalRemoteChange ! end ! object ServerEdit: TEdit ! Left = 16 ! Top = 52 ! Width = 209 ! Height = 21 ! TabOrder = 2 ! end ! object ProtocolEdit: TComboBox ! Left = 235 ! Top = 52 ! Width = 110 ! Height = 21 ! Style = csDropDownList ! ItemHeight = 13 ! TabOrder = 3 ! Items.Strings = ( ! 'TCP/IP' ! 'NetBEUI' ! 'SPX') ! end ! object DatabaseEdit: TEdit Left = 16 ! Top = 92 ! Width = 305 Height = 21 ! TabOrder = 4 end ! object DatabaseButton: TButton Left = 321 ! Top = 92 Width = 21 Height = 21 Caption = '...' ! TabOrder = 5 ! OnClick = DatabaseButtonClick end object StreamFormatComboBox: TComboBox Left = 16 ! Top = 328 Width = 113 Height = 21 --- 73,95 ---- FocusControl = IdDataTypeComboBox end ! object ConnectionStringEdit: TEdit Left = 16 ! Top = 28 ! Width = 301 Height = 21 ! TabOrder = 0 end ! object ConnectionStringButton: TButton Left = 321 ! Top = 28 Width = 21 Height = 21 Caption = '...' ! TabOrder = 1 ! OnClick = ConnectionStringButtonClick end object StreamFormatComboBox: TComboBox Left = 16 ! Top = 264 Width = 113 Height = 21 *************** *** 153,201 **** ItemHeight = 13 Sorted = True ! TabOrder = 9 end object UseDelimitedIdentsCheckBox: TCheckBox Left = 16 ! Top = 118 Width = 150 Height = 17 Caption = '&Use delimited identifiers' ! TabOrder = 6 end object LoginPromptCheckBox: TCheckBox Left = 196 ! Top = 118 Width = 150 Height = 17 Caption = '&Login Prompt' ! TabOrder = 7 end object ParamsEditor: TMemo Left = 17 ! Top = 160 Width = 328 Height = 149 ! TabOrder = 8 end object IdDataTypeComboBox: TComboBox Left = 136 ! Top = 328 Width = 113 Height = 21 Style = csDropDownList ItemHeight = 13 ! TabOrder = 10 end object IdSizeEdit: TEdit Left = 256 ! Top = 328 Width = 89 Height = 21 ! TabOrder = 11 end end object BottomPanel: TPanel Left = 0 ! Top = 364 Width = 362 Height = 35 --- 97,145 ---- ItemHeight = 13 Sorted = True ! TabOrder = 5 end object UseDelimitedIdentsCheckBox: TCheckBox Left = 16 ! Top = 54 Width = 150 Height = 17 Caption = '&Use delimited identifiers' ! TabOrder = 2 end object LoginPromptCheckBox: TCheckBox Left = 196 ! Top = 54 Width = 150 Height = 17 Caption = '&Login Prompt' ! TabOrder = 3 end object ParamsEditor: TMemo Left = 17 ! Top = 96 Width = 328 Height = 149 ! TabOrder = 4 end object IdDataTypeComboBox: TComboBox Left = 136 ! Top = 264 Width = 113 Height = 21 Style = csDropDownList ItemHeight = 13 ! TabOrder = 6 end object IdSizeEdit: TEdit Left = 256 ! Top = 264 Width = 89 Height = 21 ! TabOrder = 7 end end object BottomPanel: TPanel Left = 0 ! Top = 304 Width = 362 Height = 35 Index: InstantIBXConnectionDefEdit.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Brokers/IBX/InstantIBXConnectionDefEdit.pas,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** InstantIBXConnectionDefEdit.pas 4 Sep 2005 23:15:53 -0000 1.6 --- InstantIBXConnectionDefEdit.pas 10 Nov 2005 00:22:15 -0000 1.7 *************** *** 25,29 **** * * Contributor(s): ! * Carlo Barazzetta, Nando Dessena * * ***** END LICENSE BLOCK ***** *) --- 25,29 ---- * * Contributor(s): ! * Carlo Barazzetta, Nando Dessena, Joao Morais * * ***** END LICENSE BLOCK ***** *) *************** *** 46,58 **** TInstantIBXConnectionDefEditForm = class(TForm) ClientPanel: TPanel; ! ServerLabel: TLabel; ! ProtocolLabel: TLabel; ! DatabaseLabel: TLabel; ! LocalRadioButton: TRadioButton; ! RemoteRadioButton: TRadioButton; ! ServerEdit: TEdit; ! ProtocolEdit: TComboBox; ! DatabaseEdit: TEdit; ! DatabaseButton: TButton; BottomPanel: TPanel; OkButton: TButton; --- 46,52 ---- TInstantIBXConnectionDefEditForm = class(TForm) ClientPanel: TPanel; ! ConnectionStringLabel: TLabel; ! ConnectionStringEdit: TEdit; ! ConnectionStringButton: TButton; BottomPanel: TPanel; OkButton: TButton; *************** *** 66,78 **** ParamsEditor: TMemo; IdDataTypeComboBox: TComboBox; ! Label1: TLabel; IdSizeEdit: TEdit; ! Label2: TLabel; ! procedure LocalRemoteChange(Sender: TObject); ! procedure DatabaseButtonClick(Sender: TObject); procedure FormCreate(Sender: TObject); private function GetIsValid: Boolean; - procedure UpdateControls; public procedure LoadData(ConnectionDef: TInstantIBXConnectionDef); --- 60,70 ---- ParamsEditor: TMemo; IdDataTypeComboBox: TComboBox; ! IdDataTypeLabel: TLabel; IdSizeEdit: TEdit; ! IdSizeLabel: TLabel; ! procedure ConnectionStringButtonClick(Sender: TObject); procedure FormCreate(Sender: TObject); private function GetIsValid: Boolean; public procedure LoadData(ConnectionDef: TInstantIBXConnectionDef); *************** *** 90,94 **** { TInstantIBXConnectionDefEditForm } ! procedure TInstantIBXConnectionDefEditForm.DatabaseButtonClick( Sender: TObject); begin --- 82,86 ---- { TInstantIBXConnectionDefEditForm } ! procedure TInstantIBXConnectionDefEditForm.ConnectionStringButtonClick( Sender: TObject); begin *************** *** 96,104 **** try Filter := - 'FireBird Database (*.fdb)|*.fdb|' + 'InterBase Database (*.gdb)|*.gdb|' + 'All Files (*.*)|*.*'; if Execute then ! DatabaseEdit.Text := FileName; finally Free; --- 88,96 ---- try Filter := 'InterBase Database (*.gdb)|*.gdb|' + + 'FireBird Database (*.fdb)|*.fdb|' + 'All Files (*.*)|*.*'; if Execute then ! ConnectionStringEdit.Text := FileName; finally Free; *************** *** 112,123 **** IdDataTypeComboBox.ItemIndex := Ord(dtString); IdSizeEdit.Text := IntToStr(InstantDefaultFieldSize); - UpdateControls; end; function TInstantIBXConnectionDefEditForm.GetIsValid: Boolean; begin ! Result := ! (LocalRadioButton.Checked or (ServerEdit.Text <> '')) and ! (DatabaseEdit.Text <> ''); end; --- 104,112 ---- IdDataTypeComboBox.ItemIndex := Ord(dtString); IdSizeEdit.Text := IntToStr(InstantDefaultFieldSize); end; function TInstantIBXConnectionDefEditForm.GetIsValid: Boolean; begin ! Result := ConnectionStringEdit.Text <> ''; end; *************** *** 127,135 **** with ConnectionDef do begin ! LocalRadioButton.Checked := NetType = ntLocal; ! RemoteRadioButton.Checked := NetType <> ntLocal; ! ProtocolEdit.ItemIndex := Ord(NetType) - 1; ! ServerEdit.Text := ServerName; ! DatabaseEdit.Text := Path; StreamFormatComboBox.ItemIndex := Ord(BlobStreamFormat); UseDelimitedIdentsCheckBox.Checked := ibxUseDelimitedIdents in Options; --- 116,120 ---- with ConnectionDef do begin ! ConnectionStringEdit.Text := ConnectionString; StreamFormatComboBox.ItemIndex := Ord(BlobStreamFormat); UseDelimitedIdentsCheckBox.Checked := ibxUseDelimitedIdents in Options; *************** *** 139,149 **** IdSizeEdit.Text := IntToStr(IdSize); end; - UpdateControls; - end; - - procedure TInstantIBXConnectionDefEditForm.LocalRemoteChange( - Sender: TObject); - begin - UpdateControls; end; --- 124,127 ---- *************** *** 153,170 **** with ConnectionDef do begin ! if LocalRadioButton.Checked then ! NetType := ntLocal ! else ! NetType := TIBXNetType(ProtocolEdit.ItemIndex + 1); ! ServerName := ServerEdit.Text; ! Path := DatabaseEdit.Text; BlobStreamFormat := TInstantStreamFormat(StreamFormatComboBox.ItemIndex); Options := []; if UseDelimitedIdentsCheckBox.Checked then ! Options := Options + [ibxUseDelimitedIdents] ! else ! Options := Options - [ibxUseDelimitedIdents]; LoginPrompt := LoginPromptCheckBox.Checked; ! ConnectionDef.Params := ParamsEditor.Lines.Text; IdDataType := TInstantDataType(IdDataTypeComboBox.ItemIndex); IdSize := StrToInt(IdSizeEdit.Text); --- 131,141 ---- with ConnectionDef do begin ! ConnectionString := ConnectionStringEdit.Text; BlobStreamFormat := TInstantStreamFormat(StreamFormatComboBox.ItemIndex); Options := []; if UseDelimitedIdentsCheckBox.Checked then ! Options := Options + [ibxUseDelimitedIdents]; LoginPrompt := LoginPromptCheckBox.Checked; ! Params := ParamsEditor.Lines.Text; IdDataType := TInstantDataType(IdDataTypeComboBox.ItemIndex); IdSize := StrToInt(IdSizeEdit.Text); *************** *** 172,193 **** end; - procedure TInstantIBXConnectionDefEditForm.UpdateControls; - const - Colors: array[Boolean] of TColor = (clBtnFace, clWindow); - var - UseRemote: Boolean; - begin - UseRemote := RemoteRadioButton.Checked; - ServerLabel.Enabled := UseRemote; - ServerEdit.Enabled := UseRemote; - ServerEdit.Color := Colors[UseRemote]; - ProtocolLabel.Enabled := UseRemote; - ProtocolEdit.Enabled := UseRemote; - ProtocolEdit.Color := Colors[UseRemote]; - DatabaseButton.Enabled := not UseRemote; - with ProtocolEdit do - if ItemIndex = -1 then - ItemIndex := 0; - end; - end. --- 143,146 ---- end; end. + |