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

Comparing ibx/trunk/design/IBDBReg.pas (file contents):
Revision 143 by tony, Fri Feb 23 12:11:21 2018 UTC vs.
Revision 315 by tony, Thu Feb 25 11:56:36 2021 UTC

# Line 63 | Line 63 | type
63    Property editor the DataBase Name property.  Brings up the Open dialog }
64  
65    TIBFileNameProperty = class(TStringProperty)
66 +  protected
67 +    function GetFilter: string; virtual;
68    public
69      procedure Edit; override;
70      function GetAttributes: TPropertyAttributes; override;
71    end;
72  
73 +  { TIBLibraryNameProperty }
74 +
75 +  TIBLibraryNameProperty = class(TIBFileNameProperty)
76 +  protected
77 +    function GetFilter: string; override;
78 +  end;
79 +
80    { TIBNameProperty
81    }
82    TIBNameProperty = class(TStringProperty)
# Line 203 | Line 212 | type
212     function GetVerbCount: Integer; override;
213    end;
214  
215 +  { TIBXServiceEditor }
216 +
217 +  TIBXServiceEditor = class(TComponentEditor)
218 +  public
219 +    procedure ExecuteVerb(Index: Integer); override;
220 +    function GetVerb(Index: Integer): string; override;
221 +    function GetVerbCount: Integer; override;
222 +  end;
223 +
224    TIBStoredProcParamsProperty = class(TCollectionPropertyEditor)
225    end;
226  
# Line 399 | Line 417 | procedure Register;
417  
418   implementation
419  
420 < uses IB, IBQuery, IBStoredProc, IBCustomDataSet, FBMessages,
421 <     IBSQL, IBSQLMonitor, IBDatabaseInfo, IBEvents, IBTypes,
422 <     IBServices, IBDatabaseEdit, IBTransactionEdit,
420 > uses IB, IBQuery, IBStoredProc, IBCustomDataSet, IBMessages,
421 >     IBSQL, IBSQLMonitor, IBDatabaseInfo, IBEvents, IBInternals,
422 >     IBServices, IBXServices, IBDatabaseEdit, IBTransactionEdit,
423       IBBatchMove, IBExtract,LResources, IBSelectSQLEditor,
424       IBModifySQLEditor,IBDeleteSQLEditor,IBRefreshSQLEditor,
425       IBInsertSQLEditor, IBGeneratorEditor, IBUpdateSQLEditor, IBDataSetEditor,
426       IBSQLEditor, ibserviceeditor, LCLVersion, IBDynamicGrid, IBLookupComboEditBox,
427       IBTreeView, DBControlGrid, ibxscript, IBLocalDBSupport, IBDSDialogs,
428 <     IBArrayGrid, IBVersion, IBDataOutput;
428 >     IBArrayGrid, IBVersion, IBDataOutput, IBXServiceEditor;
429  
430   const
431    IBPalette1 = 'Firebird'; {do not localize}
432 <  IBPalette2 = 'Firebird Admin'; {do not localize}
432 >  IBPalette2 = 'Firebird Legacy Admin'; {do not localize}
433    IBPalette3 = 'Firebird Data Controls';   {do not localize}
434 <  
434 >  IBPalette4 = 'Firebird Admin'; {do not localize}
435 >
436   resourcestring
437     SInterbaseExpressVersion = 'Firebird Express for Lazarus ' + IBX_VERSION;
438     SEditSQL = 'Edit SQL';
# Line 428 | Line 447 | const
447  
448   procedure Register;
449   begin
450 +  AllowUseOfFBLIB := true;
451    if not TryIBLoad then
452    begin
453      MessageDlg('IBX is unable to locate the Firebird Library - have you remembered to install it?',mtError,[mbOK],0);
# Line 435 | Line 455 | begin
455    end;
456  
457    RegisterNoIcon([TIBStringField, TIBBCDField, TIBMemoField, TIBArrayField,
458 <    TIBSmallintField, TIBIntegerField, TIBLargeIntField]);
458 >    TIBSmallintField, TIBIntegerField, TIBLargeIntField, TIBDateTimeField,
459 >    TIBTimeField]);
460    {$if lcl_fullversion < 01010000}
461    {see http://bugs.freepascal.org/view.php?id=19035 }
462    RegisterNoIcon([TIntegerField]);
# Line 446 | Line 467 | begin
467         TIBStoredProc,TIBBatchMove,  TIBTable,TIBExtract, TIBXScript, TIBLocalDBSupport,
468         TIBBlockFormatOut,TIBCSVDataOut,TIBInsertStmtsOut]);
469    if FirebirdAPI.HasServiceAPI  then
470 +  begin
471 +    RegisterComponents(IBPalette4, [TIBXServicesConnection, TIBXConfigService,
472 +      TIBXClientSideBackupService, TIBXServerSideBackupService,
473 +      TIBXClientSideRestoreService, TIBXServerSideRestoreService,
474 +      TIBXValidationService, TIBXOnlineValidationService, TIBXStatisticalService,
475 +      TIBXLogService, TIBXSecurityService, TIBXServerProperties,
476 +      TIBXLimboTransactionResolutionService,TIBXServicesUserList, TIBXServicesLimboTransactionsList]);
477      RegisterComponents(IBPalette2, [TIBConfigService, TIBBackupService,
478 <      TIBRestoreService, TIBValidationService, TIBOnlineValidationService, TIBStatisticalService,
478 >      TIBRestoreService, TIBValidationService,
479 >      TIBOnlineValidationService, TIBStatisticalService,
480        TIBLogService, TIBSecurityService, TIBServerProperties]);
481 <
481 >  end;
482  
483    RegisterComponents(IBPalette3,[TIBLookupComboEditBox,TIBDynamicGrid,TIBTreeView,TDBControlGrid, TIBArrayGrid]);
484 +
485    RegisterPropertyEditor(TypeInfo(TIBFileName), TIBDatabase, 'DatabaseName', TIBFileNameProperty); {do not localize}
486 +  RegisterPropertyEditor(TypeInfo(TIBFileName), TIBDatabase, 'FirebirdLibraryPathName', TIBLibraryNameProperty); {do not localize}
487 +  RegisterPropertyEditor(TypeInfo(TIBFileName), TIBXServicesConnection, 'FirebirdLibraryPathName', TIBLibraryNameProperty); {do not localize}
488    RegisterPropertyEditor(TypeInfo(string), TIBStoredProc, 'StoredProcName', TIBStoredProcNameProperty); {do not localize}
489    RegisterPropertyEditor(TypeInfo(string), TIBStoredProc, 'PackageName', TIBPackageNameProperty); {do not localize}
490    RegisterPropertyEditor(TypeInfo(TParams), TIBStoredProc, 'Params', TIBStoredProcParamsProperty);
# Line 488 | Line 520 | begin
520    RegisterComponentEditor(TIBSQL, TIBSQLEditor);
521    RegisterComponentEditor(TIBCustomService, TIBServiceEditor);
522    RegisterComponentEditor(TIBArrayGrid, TIBArrayGridEditor);
523 +  RegisterComponentEditor(TIBXServicesConnection, TIBXServiceEditor);
524  
525  
526    {Firebird Data Access Controls}
# Line 527 | Line 560 | begin
560    end;
561   end;
562  
563 + { TIBLibraryNameProperty }
564 +
565 + function TIBLibraryNameProperty.GetFilter: string;
566 + begin
567 +  Result := SLibraryNameFilter; {do not localise}
568 + end;
569 +
570 + { TIBXServiceEditor }
571 +
572 + procedure TIBXServiceEditor.ExecuteVerb(Index: Integer);
573 + begin
574 +  if Index < inherited GetVerbCount then
575 +    inherited ExecuteVerb(Index) else
576 +  begin
577 +    Dec(Index, inherited GetVerbCount);
578 +    case Index of
579 +      0 : if IBXServiceEditor.EditIBXService(TIBXServicesConnection(Component)) then Designer.Modified;
580 +    end;
581 +  end;
582 + end;
583 +
584 + function TIBXServiceEditor.GetVerb(Index: Integer): string;
585 + begin
586 +  if Index < inherited GetVerbCount then
587 +    Result := inherited GetVerb(Index) else
588 +  begin
589 +    Dec(Index, inherited GetVerbCount);
590 +    case Index of
591 +      0: Result := SIBServiceEditor;
592 +      1 : Result := SInterbaseExpressVersion;
593 +    end;
594 +  end;
595 + end;
596 +
597 + function TIBXServiceEditor.GetVerbCount: Integer;
598 + begin
599 +  Result := inherited GetVerbCount + 2;
600 + end;
601 +
602   { TIBUpdateRefreshSQLProperty }
603  
604   function TIBUpdateRefreshSQLProperty.GetObjects: boolean;
# Line 711 | Line 783 | begin
783    Result := inherited GetVerbCount + 2;
784   end;
785  
786 + function TIBFileNameProperty.GetFilter: string;
787 + begin
788 +  Result := SDatabaseFilter; {do not localize}
789 + end;
790 +
791   { TIBFileNameProperty }
792   procedure TIBFileNameProperty.Edit;
793   begin
794    with TOpenDialog.Create(Application) do
795      try
796        InitialDir := ExtractFilePath(GetStrValue);
797 <      Filter := SDatabaseFilter; {do not localize}
797 >      Filter := GetFilter;
798        if Execute then
799          SetStrValue(FileName);
800      finally

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines