mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 16:59:21 +02:00
sqldb: TSQLite3Connection: propery editor for DatabaseName, from Silvio Clécio, issue #30841
git-svn-id: trunk@53281 -
This commit is contained in:
parent
b9bc408f0b
commit
e83f7944d0
@ -142,12 +142,26 @@ Type
|
|||||||
function GetAttributes: TPropertyAttributes; override;
|
function GetAttributes: TPropertyAttributes; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TSQLFirebirdFileNamePropertyEditor }
|
||||||
|
|
||||||
TSQLFirebirdFileNamePropertyEditor=class(TFileNamePropertyEditor)
|
TSQLFirebirdFileNamePropertyEditor=class(TFileNamePropertyEditor)
|
||||||
public
|
public
|
||||||
function GetFilter: String; override;
|
function GetFilter: String; override;
|
||||||
function GetInitialDirectory: string; override;
|
function GetInitialDirectory: string; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF HASSQLITE3CONNECTION}
|
||||||
|
|
||||||
|
{ TSQLSQLite3FileNamePropertyEditor }
|
||||||
|
|
||||||
|
TSQLSQLite3FileNamePropertyEditor=class(TFileNamePropertyEditor)
|
||||||
|
public
|
||||||
|
function GetFilter: string; override;
|
||||||
|
function GetInitialDirectory: string; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{ TSQLFileDescriptor }
|
{ TSQLFileDescriptor }
|
||||||
|
|
||||||
TSQLFileDescriptor = class(TProjectFileDescriptor)
|
TSQLFileDescriptor = class(TProjectFileDescriptor)
|
||||||
@ -263,6 +277,9 @@ Resourcestring
|
|||||||
SSQLSource = 'Insert your SQL statements here';
|
SSQLSource = 'Insert your SQL statements here';
|
||||||
|
|
||||||
SFireBirdDatabases = 'Firebird databases';
|
SFireBirdDatabases = 'Firebird databases';
|
||||||
|
{$IFDEF HASSQLITE3CONNECTION}
|
||||||
|
SSQLite3Databases = 'SQLite3 databases';
|
||||||
|
{$ENDIF}
|
||||||
SInterbaseDatabases = 'Interbase databases';
|
SInterbaseDatabases = 'Interbase databases';
|
||||||
SSQLStringsPropertyEditorDlgTitle = 'Editing %s';
|
SSQLStringsPropertyEditorDlgTitle = 'Editing %s';
|
||||||
|
|
||||||
@ -325,7 +342,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
{ TDbfFileNamePropertyEditor }
|
{ TSQLFirebirdFileNamePropertyEditor }
|
||||||
|
|
||||||
function TSQLFirebirdFileNamePropertyEditor.GetFilter: String;
|
function TSQLFirebirdFileNamePropertyEditor.GetFilter: String;
|
||||||
begin
|
begin
|
||||||
@ -340,6 +357,24 @@ begin
|
|||||||
Result:= ExtractFilePath(Result);
|
Result:= ExtractFilePath(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF HASSQLITE3CONNECTION}
|
||||||
|
|
||||||
|
{ TSQLSQLite3FileNamePropertyEditor }
|
||||||
|
|
||||||
|
function TSQLSQLite3FileNamePropertyEditor.GetFilter: string;
|
||||||
|
begin
|
||||||
|
Result := SSQLite3Databases+' (*.db;*.db3;*.sqlite;*.sqlite3)|*.db;*.db3;*.sqlite;*.sqlite3';
|
||||||
|
Result:= Result+ '|'+ inherited GetFilter;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TSQLSQLite3FileNamePropertyEditor.GetInitialDirectory: string;
|
||||||
|
begin
|
||||||
|
Result:= (GetComponent(0) as TSQLConnection).DatabaseName;
|
||||||
|
Result:= ExtractFilePath(Result);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{ TSQLStringsPropertyEditor }
|
{ TSQLStringsPropertyEditor }
|
||||||
|
|
||||||
procedure TSQLStringsPropertyEditor.EditSQL;
|
procedure TSQLStringsPropertyEditor.EditSQL;
|
||||||
@ -518,6 +553,10 @@ begin
|
|||||||
{$IFDEF HASIBCONNECTION}
|
{$IFDEF HASIBCONNECTION}
|
||||||
RegisterPropertyEditor(TypeInfo(AnsiString),
|
RegisterPropertyEditor(TypeInfo(AnsiString),
|
||||||
TIBConnection, 'DatabaseName', TSQLFirebirdFileNamePropertyEditor);
|
TIBConnection, 'DatabaseName', TSQLFirebirdFileNamePropertyEditor);
|
||||||
|
{$ENDIF}
|
||||||
|
{$IFDEF HASSQLITE3CONNECTION}
|
||||||
|
RegisterPropertyEditor(TypeInfo(AnsiString),
|
||||||
|
TSQLite3Connection, 'DatabaseName', TSQLSQLite3FileNamePropertyEditor);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
RegisterPropertyEditor(TypeInfo(AnsiString),
|
RegisterPropertyEditor(TypeInfo(AnsiString),
|
||||||
TSQLConnector, 'ConnectorType', TSQLDBConnectorTypePropertyEditor);
|
TSQLConnector, 'ConnectorType', TSQLDBConnectorTypePropertyEditor);
|
||||||
|
Loading…
Reference in New Issue
Block a user