Changeset 45 for trunk


Ignore:
Timestamp:
Mar 12, 2012, 10:23:40 AM (13 years ago)
Author:
chronos
Message:
  • Modified: TChronisBase.Active property control Client connection instead of direct call of Client.Connect and Client.Disconnect methods.
Location:
trunk
Files:
4 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Clients/UChronisClientMySQL.pas

    r44 r45  
    4040  SMissingBaseType = 'Missing base typ for %s';
    4141  SUndefinedType = 'Undefinned type %s';
     42  SCantLoadObjectWithoutId = 'Can''t load object without id';
    4243
    4344
     
    6970  Table: string;
    7071begin
     72  if AObject.Id = 0 then raise Exception.Create(SCantLoadObjectWithoutId);
    7173  try
    7274    DbRows := TDbRows.Create;
  • trunk/Application/UApplicationInfo.pas

    r41 r45  
    5050  Name := 'ChronIS';
    5151  Identification := 1;
    52   ReleaseDate := EncodeDate(2012, 3, 9);
     52  ReleaseDate := EncodeDate(2012, 3, 12);
    5353  MajorVersion := 0;
    5454  MinorVersion := 1;
  • trunk/Application/UChronisClient.pas

    r44 r45  
    112112  end;
    113113
    114 
    115114implementation
    116115
     
    251250  NewProxy.Load;
    252251  if NewProxy.Objects.Count > 0 then begin
    253     DbVersion := TObjectProxy(NewProxy.Objects[0]).Properties.Values['Version'];
     252    NewObject := TObjectProxy.Create;
     253    NewObject.Client := Self;
     254    NewObject.SchemaName := Schema;
     255    NewObject.ObjectName := SystemVersionObject;
     256    NewObject.Id := 1;
     257    NewObject.Load;
     258
     259    DbVersion := NewObject.Properties.Values['Version'];
    254260    if Version <> DbVersion then
    255261      raise Exception.Create(Format(SVersionMismatch, [Version, DbVersion]));
  • trunk/Application/UDataTypes.pas

    r42 r45  
    270270    Proxy.ObjectName := PropertyTable;
    271271    Proxy.Condition := 'Id=' + IntToStr(PropertyID);
     272    Proxy.Load;
    272273    ObjectId := StrToInt(TObjectProxy(Proxy.Objects[0]).Properties.Values['Object']);
    273274    PropertyName := TObjectProxy(Proxy.Objects[0]).Properties.Values['ColumnName'];
  • trunk/Forms/UFormMain.lfm

    r43 r45  
    153153  object PanelMenu: TPanel
    154154    Left = 0
    155     Height = 407
    156     Top = 0
     155    Height = 381
     156    Top = 26
    157157    Width = 184
    158158    Align = alLeft
    159159    BevelOuter = bvNone
    160     ClientHeight = 407
     160    ClientHeight = 381
    161161    ClientWidth = 184
    162162    TabOrder = 0
     
    171171    object TreeView1: TTreeView
    172172      Left = 4
    173       Height = 383
     173      Height = 357
    174174      Top = 19
    175175      Width = 180
     
    186186  object PanelData: TPanel
    187187    Left = 189
    188     Height = 407
    189     Top = 0
     188    Height = 381
     189    Top = 26
    190190    Width = 451
    191191    Align = alClient
     
    195195  object Splitter1: TSplitter
    196196    Left = 184
    197     Height = 407
    198     Top = 0
     197    Height = 381
     198    Top = 26
    199199    Width = 5
    200200  end
     
    216216    SimplePanel = False
    217217  end
     218  object ToolBar1: TToolBar
     219    Left = 0
     220    Height = 26
     221    Top = 0
     222    Width = 640
     223    Images = ImageListActions
     224    ParentShowHint = False
     225    ShowHint = True
     226    TabOrder = 4
     227    object ToolButton1: TToolButton
     228      Left = 1
     229      Top = 2
     230      Action = AConnect
     231    end
     232    object ToolButton2: TToolButton
     233      Left = 24
     234      Top = 2
     235      Action = ADisconnect
     236    end
     237    object ToolButton3: TToolButton
     238      Left = 47
     239      Top = 2
     240      Width = 10
     241      Style = tbsSeparator
     242    end
     243    object ToolButton4: TToolButton
     244      Left = 57
     245      Top = 2
     246      Action = ASettings
     247    end
     248    object ToolButton5: TToolButton
     249      Left = 80
     250      Top = 2
     251      Action = AToggleFullscreen
     252    end
     253  end
    218254  object ActionListItem: TActionList
    219255    Images = ImageListActions
     
    223259      Category = 'ObjectGroup'
    224260      Caption = 'Delete'
     261      OnExecute = AObjectGroupDeleteExecute
    225262    end
    226263    object AObjectGroupAddGroup: TAction
     
    262299      Caption = 'Connect'
    263300      Hint = 'Connect'
     301      ImageIndex = 10
    264302      OnExecute = AConnectExecute
    265303    end
     
    267305      Caption = 'Settings'
    268306      Hint = 'Settings'
     307      ImageIndex = 11
    269308      OnExecute = ASettingsExecute
    270309    end
     
    279318    object ADisconnect: TAction
    280319      Caption = 'Disconnect'
     320      ImageIndex = 9
    281321      OnExecute = ADisconnectExecute
    282322    end
     
    339379    top = 56
    340380    Bitmap = {
    341       4C69090000001000000010000000000000000000000000000000000000000000
     381      4C690C0000001000000010000000000000000000000000000000000000000000
    342382      0000000000000000000000000000000000000000000000000000000000000000
    343383      000000000000000000000000000000000000000000000000000000000000F4F9
     
    627667      FFFFFFFFFFFFFFFFFFFF858A88FF8186849D858A88FF858A88FF858A88FF858A
    628668      88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
    629       88FF858A88FF858A88FF7F8382A0
     669      88FF858A88FF858A88FF7F8382A0E8DCCCFF393939FFB98C5700B98C5700B98C
     670      5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C
     671      5700B98C5700B98C5700B98C57000C0C0CFFE9DDCCFF555555FF555555FF5555
     672      55FF555555FF555555FFB98C5700B98C5700B98C5700B98C5700B98C5700B98C
     673      5700B98C5700B98C5700B98C5700777777FF393939FFB88C57FFE9DDCCFFE9DD
     674      CCFFE8DCCCFFE8DCCCFF555555FFB98C5700B98C5700B98C5700B98C5700B98C
     675      5700B98C5700B98C5700B98C5700B98C57000C0C0CFFE8DCCCFFB88C57FFB88C
     676      57FFB88C57FFB88C57FFB88C57FF0C0C0CFFB98C5700B98C5700B98C5700B98C
     677      5700B98C5700B98C5700B98C5700B98C57000C0C0CFFE8DCCCFFB88C57FFB88C
     678      57FFB88C57FFB88C57FF0C0C0CFF777777FFB98C5700B98C5700B98C5700B98C
     679      5700B98C5700B98C5700B98C5700B98C57000C0C0CFFE8DCCCFFB88C57FFB88C
     680      57FFB88C57FF0C0C0CFF777777FF969696FFB98C5700B98C5700B98C5700B98C
     681      5700B98C5700B98C5700B98C5700B98C57000C0C0CFFE8DCCCFFB88C57FFB88C
     682      57FF0C0C0CFF777777FF969696FFB98C5700B98C5700003366FFB98C5700B98C
     683      5700B98C5700B98C5700B98C5700B98C5700777777FF0C0C0CFFB88C57FF0C0C
     684      0CFF777777FF969696FFB98C5700B98C5700003366FFE9DDCCFF777777FF0C0C
     685      0CFFB98C5700B98C5700B98C5700B98C5700B98C5700777777FF0C0C0CFF7777
     686      77FF969696FFB98C5700B98C5700003366FFE9DDCCFFE9DDCCFF0C0C0CFFE9DD
     687      CCFF0C0C0CFFB98C5700B98C5700B98C5700B98C5700B98C5700777777FF9696
     688      96FFB98C5700B98C5700003366FFE9DDCCFFE9DDCCFF0C0C0CFFE9DDCCFFB88C
     689      57FFB88C57FF0C0C0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C
     690      5700B98C5700003366FFE9DDCCFFE9DDCCFF0C0C0CFFE9DDCCFFB88C57FFB88C
     691      57FFB88C57FF0C0C0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C
     692      5700B98C5700969696FF777777FF0C0C0CFFE9DDCCFFB88C57FFB88C57FFB88C
     693      57FFB88C57FF0C0C0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C
     694      5700B98C5700B98C57000C0C0CFFE8DCCCFFB88C57FFB88C57FFB88C57FFB88C
     695      57FFB88C57FF0C0C0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C
     696      5700B98C5700B98C5700777777FF0C0C0CFFB88C57FFB88C57FFB88C57FFB88C
     697      57FFB88C57FF0C0C0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C
     698      5700B98C5700B98C5700B98C5700777777FF0C0C0CFF0C0C0CFF0C0C0CFF0C0C
     699      0CFF0C0C0CFFE9DDCCFF393939FFB98C5700B98C5700B98C5700B98C5700B98C
     700      5700B98C5700B98C5700B98C5700B98C5700969696FF969696FF969696FF9696
     701      96FF969696FF0C0C0CFFE8DCCCFFE9DDCDFF555555FFB98C5700B98C5700B98C
     702      5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C
     703      5700B98C5700B98C5700B98C57000C0C0CFFEADECDFF555555FFB98C5700B98C
     704      5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C
     705      5700B98C5700B98C5700B98C5700B98C57000C0C0CFFEADECDFF555555FFB98C
     706      5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C
     707      5700B98C5700B98C5700B98C5700B98C5700B98C57000C0C0CFFEADECDFF5555
     708      55FF555555FF555555FF555555FF555555FFB98C5700B98C5700B98C5700B98C
     709      5700B98C5700B98C5700B98C5700B98C5700B98C5700777777FF555555FFB98C
     710      57FFEADECDFFEADECDFFE9DDCDFFE9DDCDFF555555FFB98C5700B98C5700B98C
     711      5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C57000C0C0CFFE9DD
     712      CDFFB98C57FFB98C57FFB98C57FFB98C57FFB98C57FF0C0C0CFFB98C5700B98C
     713      5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C57000C0C0CFFE9DD
     714      CDFFB98C57FFB98C57FFB98C57FFB98C57FF0C0C0CFFEADECDFF555555FFB98C
     715      5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C57000C0C0CFFE9DD
     716      CDFFB98C57FFB98C57FFB98C57FF0C0C0CFFEADECDFFB98C57FFB98C57FF0C0C
     717      0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C57000C0C0CFFE9DD
     718      CDFFB98C57FFB98C57FF0C0C0CFFEADECDFFB98C57FFB98C57FFB98C57FF0C0C
     719      0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C5700969696FF0C0C
     720      0CFFB98C57FF0C0C0CFFEADECDFFB98C57FFB98C57FFB98C57FFB98C57FF0C0C
     721      0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C57007777
     722      77FF0C0C0CFFEADECDFFB98C57FFB98C57FFB98C57FFB98C57FFB98C57FF0C0C
     723      0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C
     724      5700777777FF0C0C0CFFB98C57FFB98C57FFB98C57FFB98C57FFB98C57FF0C0C
     725      0CFFB98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C
     726      5700B98C5700777777FF0C0C0CFF0C0C0CFF0C0C0CFF0C0C0CFF0C0C0CFFE9DD
     727      CDFF555555FFB98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C
     728      5700B98C5700B98C5700969696FF969696FF969696FF969696FF969696FF0C0C
     729      0CFFEADECDFF555555FFB98C5700B98C5700B98C5700B98C5700B98C5700B98C
     730      5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C
     731      57000C0C0CFFEADECDFF555555FFB98C5700B98C5700B98C5700B98C5700B98C
     732      5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C5700B98C
     733      5700B98C57000C0C0CFFE9DDCDFF000000000000000000000000000000000000
     734      000000000000A19588FF9C9083FF9C9083FFA19588FF00000000000000000000
     735      00000000000000000000000000000000000000000000000000009C9083FF9C90
     736      83FF00000000998D80FFFFFFFFFFFFFFFFFF998D80FF000000009C9083FF9C90
     737      83FF0000000000000000000000000000000000000000998F83FFCCC5BEFFF6F1
     738      EEFF908377FF908377FFEDE7E0FFEDE7E0FF908377FF908377FFF6F1EEFFCCC5
     739      BEFFA9A096FF000000000000000000000000675D50FFCDC6BFFFF6F1EEFFF8F7
     740      F4FFF8F7F4FFFFFFFFFFFCFDFDFFFCFDFDFFFFFFFFFFF8F7F4FFF8F7F4FFF6F1
     741      EEFFCDC6BFFF696053FF0000000000000000696053FFF6F1EEFFBBAC9DFFDFD8
     742      D3FFEEEFEFFFEBE7E2FFE3D9D1FFE3D9D1FFEBE7E2FFEEEFEFFFDFD8D3FFBBAC
     743      9DFFF6F1EEFF696053FF000000000000000000000000696053FFDFDFDEFFDFDF
     744      DEFFD1C4BAFF8E8377FF44392EFF44392EFF8E8377FFD1C4BAFFDFDFDEFFDFDF
     745      DEFF696053FF00000000000000008E8378FF897D72FF84796CFFD8D5D3FFC9C2
     746      B9FFA99C90FF594F45FFFFFFFFFFFFFFFFFF60564DFFA99C90FFC9C2B9FFD8D5
     747      D3FF84796CFF897D72FF8E8378FF877B70FFFFFFFFFFFFFFFFFFBFBCB8FFD6CD
     748      C5FF695E53FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF695E53FFD6CDC5FFBFBC
     749      B8FFFFFFFFFFFFFFFFFF877B70FF897E74FFE8E0D7FFE8E0D7FFB0ACA8FFE8E3
     750      DDFF695E53FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF695E53FFE8E3DDFFB0AC
     751      A8FFE8E0D7FFE8E0D7FF897E74FF463B2FFF3E3328FF61564CFFAFA8A4FFC1BC
     752      B6FFAFA8A4FF695E53FFFFFFFFFFFFFFFFFF695E53FFAFA8A4FFC1BCB6FFAFA8
     753      A4FF61564CFF3E3328FF463B2FFF000000000000000061564CFFE1D9D1FFACA3
     754      9BFFE4E1DCFFAFA8A4FF695E53FF695E53FFAFA8A4FFE4E1DCFFACA39BFFE1D9
     755      D1FF61564CFF0000000000000000000000003F3428FFE1D9D1FFEBE7E2FFE1D9
     756      D1FFAEA7A0FFE2DDDAFFB7B1ABFFB7B1ABFFE2DDDAFFAEA7A0FFE1D9D1FFEBE7
     757      E2FFE1D9D1FF3F3428FF00000000000000003F3428FFB6B0A9FFE1D9D1FFC8BE
     758      B4FFE1D9D1FFC8BEB4FFEDE5DDFFEDE5DDFFC8BEB4FFE1D9D1FFC8BEB4FFE1D9
     759      D1FFB6B0A9FF3F3428FF0000000000000000000000003F3428FF877D73FFE1D9
     760      D1FF574D42FF766C63FFEDE5DDFFEDE5DDFF766C63FF574D42FFE1D9D1FF877D
     761      73FF3F3428FF00000000000000000000000000000000000000003F3428FF3F34
     762      28FF00000000776D66FFE5DBD2FFE5DBD2FF776D66FF000000003F3428FF3F34
     763      28FF000000000000000000000000000000000000000000000000000000000000
     764      0000000000003F3428FF3F3428FF3F3428FF3F3428FF00000000000000000000
     765      0000000000000000000000000000
    630766    }
    631767  end
     
    645781      object MenuItem14: TMenuItem
    646782        Action = AExit
     783        Bitmap.Data = {
     784          36040000424D3604000000000000360000002800000010000000100000000100
     785          2000000000000004000064000000640000000000000000000000000000000000
     786          0000000000000000000000000000000000FF0000000000000000000000000000
     787          0000000000000000000000000000000000000000000000000000000000000000
     788          00000000000000000000000000FF000000FF0000000000000000000000000000
     789          0000000000000000000000000000000000000000000000000000000000000000
     790          000000000000000000FF008484FF000000FF0000000000000000000000000000
     791          0000000000000000000000000000000000000000000000000000000000000000
     792          0000000000FF008484FF008484FF000000FF0000000000000000000000000000
     793          0000000000000000000000000000000000000000000000000000000000FF0000
     794          00FF008484FF008484FF008484FF000000FF000000FF000000FF000000FF0000
     795          00FF000000FF000000FF000000FF000000000000000000000000000000000000
     796          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     797          0000000000000000000000000000000000000000000000000000000000000000
     798          00FF008484FF008484FF000000FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     799          0000000000000000000000000000840000FF0000000000000000000000000000
     800          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     801          00000000000000000000840000FF840000FF0000000000000000000000000000
     802          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     803          000000000000840000FF840000FF840000FF840000FF840000FF000000000000
     804          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     805          0000840000FF840000FF840000FF840000FF840000FF840000FF000000000000
     806          00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
     807          000000000000840000FF840000FF840000FF840000FF840000FF000000000000
     808          00FF008484FF008484FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
     809          00000000000000000000840000FF840000FF0000000000000000000000000000
     810          00FF008484FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
     811          0000000000000000000000000000840000FF0000000000000000000000000000
     812          00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
     813          0000000000000000000000000000000000000000000000000000000000000000
     814          00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
     815          0000000000000000000000000000000000000000000000000000000000000000
     816          0000000000000000000000000000000000000000000000000000000000000000
     817          0000000000000000000000000000000000000000000000000000
     818        }
    647819      end
    648820    end
     
    651823      object MenuItem15: TMenuItem
    652824        Action = AToggleFullscreen
     825        Bitmap.Data = {
     826          36040000424D3604000000000000360000002800000010000000100000000100
     827          20000000000000040000640000006400000000000000000000008186849D858A
     828          88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
     829          88FF858A88FF858A88FF858A88FF858A88FF858A88FF7F8382A0858A88FFFFFF
     830          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
     831          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF858A88FF858A88FFFFFF
     832          FFFFA46534FFA46534FFA46534FFA46534FFFAFBFBFFFAFBFBFFFCFCFDFFFDFC
     833          FCFFA46534FFA46534FFA46534FFA46534FFFFFFFFFF858A88FF858A88FFFFFF
     834          FFFFA46534FFA46534FFA46534FFF9FAFAFFF9F9F9FFF9FAF9FFFBFBFBFFFBFB
     835          FCFFFBFBFCFFA46534FFA46534FFA46534FFFFFFFFFF858A88FF858A88FFFFFF
     836          FFFFA46534FFA46636FFA76A3BFFAB7246FFF8F9F8FFF8F9F9FFFAFAFAFFFAFA
     837          FBFFAA7043FFA56737FFA46534FFA46534FFFFFFFFFF858A88FF858A88FFFFFF
     838          FFFFA46635FFF6F7F7FFAE774CFFB98B67FFC9A68BFFF7F8F8FFF9F9F9FFD1B5
     839          9EFFBD916FFFAE764BFFF9FAFAFFA46534FFFFFFFFFF858A88FF858A88FFFFFF
     840          FFFFF5F6F6FFF4F6F6FFF6F6F7FFCAAA90FFDBC7B7FFE6DBD3FFEAE2DBFFE4D6
     841          CAFFD4BAA6FFF8F9F9FFF9FAFAFFF9F9F9FFFFFFFFFF858A88FF858A88FFFFFF
     842          FFFFF3F5F5FFF3F5F5FFF4F5F5FFF4F5F6FFE3D7CCFFF5F5F6FFF6F7F7FFEAE1
     843          D9FFF7F8F8FFF8F9F8FFF7F9F9FFF8F8F9FFFFFFFFFF858A88FF858A88FFFFFF
     844          FFFFEFF1F1FFF0F1F1FFF0F1F2FFF0F2F1FFDFD2C7FFF0F2F2FFF2F3F4FFE2D7
     845          CEFFF3F4F5FFF3F4F5FFF3F5F5FFF4F5F4FFFFFFFFFF858A88FF858A88FFFFFF
     846          FFFFEFF0F0FFEFF0F0FFEFF1F1FFCFB4A0FFD8C7B9FFE0D3C9FFE2D7CDFFDCCB
     847          BDFFCFB49FFFF2F4F4FFF3F4F3FFF2F4F4FFFFFFFFFF858A88FF858A88FFFFFF
     848          FFFFA46635FFEDEFEFFFB3825CFFC39F83FFCFB6A2FFEEF0F0FFF0F2F1FFCCB0
     849          99FFC0987AFFB27F57FFF1F3F3FFA56737FFFFFFFFFF858A88FF858A88FFFFFF
     850          FFFFA46534FFA56736FFAA7043FFB4845FFFEEEFEFFFEEEFEFFFF0F1F1FFF0F1
     851          F1FFAE784EFFA96E40FFA56838FFA46534FFFFFFFFFF858A88FF858A88FFFFFF
     852          FFFFA46534FFA46534FFA56736FFECEEEEFFECEEEEFFECEEEFFFEEF0F0FFEEF0
     853          F0FFEEF0F0FFA56736FFA46534FFA46534FFFFFFFFFF858A88FF858A88FFFFFF
     854          FFFFA46534FFA46534FFA46534FFA46534FFECEEEEFFECEEEEFFEEEFEFFFEDEF
     855          EFFFA46534FFA46534FFA46534FFA46534FFFFFFFFFF858A88FF858A88FFFFFF
     856          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
     857          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF858A88FF858A8899858A
     858          88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
     859          88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A8899
     860        }
    653861      end
    654862      object MenuItem16: TMenuItem
  • trunk/Forms/UFormMain.pas

    r44 r45  
    6161    Splitter1: TSplitter;
    6262    StatusBar1: TStatusBar;
     63    ToolBar1: TToolBar;
     64    ToolButton1: TToolButton;
     65    ToolButton2: TToolButton;
     66    ToolButton3: TToolButton;
     67    ToolButton4: TToolButton;
     68    ToolButton5: TToolButton;
    6369    TreeView1: TTreeView;
    6470    procedure AAboutExecute(Sender: TObject);
     
    6975    procedure AObjectEditExecute(Sender: TObject);
    7076    procedure AObjectGroupAddGroupExecute(Sender: TObject);
     77    procedure AObjectGroupDeleteExecute(Sender: TObject);
    7178    procedure AObjectGroupEditExecute(Sender: TObject);
    7279    procedure ASettingsExecute(Sender: TObject);
     
    154161
    155162procedure TMainForm.UpdateInterface;
    156 begin
    157   ADisconnect.Enabled := Assigned(Core.Client) and Core.Client.Connected;
    158   AConnect.Enabled := Assigned(Core.Client) and not Core.Client.Connected;
    159   AImportStructure.Enabled := Assigned(Core.Client) and Core.Client.Connected;
     163var
     164  I: Integer;
     165begin
     166  ADisconnect.Enabled := Core.System.Active;
     167  AConnect.Enabled := not Core.System.Active;
     168  AImportStructure.Enabled := Core.System.Active;
    160169  if Assigned(MainPanelForm) then
    161170    Caption := MainPanelForm.Caption + ' - ' + ApplicationInfo.Name
    162171    else Caption := ApplicationInfo.Name;
    163172  Application.Title := Caption;
    164   if Assigned(Core.Client) then
    165   with Core.Client do
     173  if Core.System.Active then
     174  with Core.System.Client do
    166175    StatusBar1.Panels[0].Text := User + '@' + Host + ':' + IntToStr(Port) + '/' + Schema;
     176
     177  for I := 0 to ToolBar1.ButtonCount - 1 do
     178    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
    167179end;
    168180
     
    201213
    202214procedure TMainForm.AObjectGroupAddGroupExecute(Sender: TObject);
     215begin
     216
     217end;
     218
     219procedure TMainForm.AObjectGroupDeleteExecute(Sender: TObject);
    203220begin
    204221
     
    270287  try
    271288    LoginForm := TLoginForm.Create(MainForm);
    272   Core.Profiles.LoadFromRegistry(Core.RegistryRootKey, Core.RegistryKey);
    273   if LoginForm.ShowModal = mrOK then begin
    274     with TConnectProfile(Core.Profiles[Core.LastProfile]) do begin
    275       FreeAndNil(Core.Client);
    276       if Protocol = cpMySQL then Core.Client := TChronisClientMySQL.Create
    277         else if Protocol = cpDirect then Core.Client := TChronisClientDirect.Create
    278         else if Protocol = cpXMLRPC then Core.Client := TChronisClientXMLRPC.Create;
    279       Core.System.Client := Core.Client;
    280       Core.System.Client.Host := HostName;
    281       Core.System.Client.Schema := Database;
    282       Core.System.Client.User := Core.LastUserName;
    283       Core.System.Client.Password := Core.LastPassword;
    284       Core.System.Client.Port := Port;
     289    Core.Profiles.LoadFromRegistry(Core.RegistryRootKey, Core.RegistryKey);
     290    if LoginForm.ShowModal = mrOK then begin
     291      with TConnectProfile(Core.Profiles[Core.LastProfile]) do begin
     292        FreeAndNil(Core.System.Client);
     293        if Protocol = cpMySQL then Core.System.Client := TChronisClientMySQL.Create
     294          else if Protocol = cpDirect then Core.System.Client := TChronisClientDirect.Create
     295          else if Protocol = cpXMLRPC then Core.System.Client := TChronisClientXMLRPC.Create;
     296        Core.System.Client.Host := HostName;
     297        Core.System.Client.Schema := Database;
     298        Core.System.Client.User := Core.LastUserName;
     299        Core.System.Client.Password := Core.LastPassword;
     300        Core.System.Client.Port := Port;
     301      end;
     302      try
     303        Core.System.Active := True;
     304        LoadTree;
     305      except
     306        on E: Exception do ShowMessage(E.Message);
     307      end;
    285308    end;
    286     try
    287       Core.System.Client.Connect;
    288       if Core.System.IsDatabaseEmpty then Core.System.ModuleSystem.Install;
    289       Core.System.LoadTypes;
    290       LoadTree;
    291       UpdateInterface;
    292     except
    293       on E: Exception do ShowMessage(E.Message);
    294     end;
    295   end;
    296309  finally
    297310    LoginForm.Free;
     311    UpdateInterface;
    298312  end;
    299313end;
     
    302316begin
    303317  if Assigned(Core.System.Client) then
    304   if Core.System.Client.Connected then begin
    305     Core.System.Client.Disconnect;
     318  if Core.System.Active then begin
     319    Core.System.Active := False;
    306320    TreeView1.Items.Clear;
    307     Core.System.Types.Clear;
    308     FreeAndNil(Core.Client);
    309     Core.System.Client := Core.Client;
    310321  end;
    311322  UpdateInterface;
  • trunk/Languages/chronis.cs.po

    r44 r45  
    423423msgstr ""
    424424
     425#: uchronisclientmysql.scantloadobjectwithoutid
     426msgid "Can't load object without id"
     427msgstr ""
     428
    425429#: uchronisclientmysql.smissingbasetype
    426430msgid "Missing base typ for %s"
  • trunk/Languages/chronis.po

    r44 r45  
    401401msgstr ""
    402402
     403#: uchronisclientmysql.scantloadobjectwithoutid
     404msgid "Can't load object without id"
     405msgstr ""
     406
    403407#: uchronisclientmysql.smissingbasetype
    404408msgid "Missing base typ for %s"
  • trunk/UCore.pas

    r43 r45  
    3333    RegistryRootKey: HKEY;
    3434    System: TChronisBase;
    35     Client: TChronisClient;
    3635  end;
    3736
  • trunk/USystem.pas

    r44 r45  
    107107
    108108  TChronisBase = class
     109  private
     110    FActive: Boolean;
     111    procedure SetActive(AValue: Boolean);
     112  public
    109113    Types: TChronisTypeList;
    110114    Client: TChronisClient;
    111     //Database: TSqlDatabase;
    112115    Modules: TListObject; // TListObject<TChronisModule>
    113116    ModuleSystem: TChronisModule;
     
    143146    constructor Create;
    144147    destructor Destroy; override;
     148    property Active: Boolean read FActive write SetActive;
    145149  private
    146150  end;
     
    266270end;
    267271
     272procedure TChronisBase.SetActive(AValue: Boolean);
     273begin
     274  if FActive = AValue then Exit;
     275  FActive := AValue;
     276  if AValue then begin
     277    Client.Connect;
     278    if Client.Connected then begin
     279      if IsDatabaseEmpty then ModuleSystem.Install;
     280      LoadTypes;
     281    end else FActive := False;
     282  end else begin
     283    Client.Disconnect;
     284    FreeAndNil(Client);
     285    Types.Clear;
     286  end;
     287end;
     288
    268289procedure TChronisBase.RegisterModule(ModuleClass: TChronisModuleClass);
    269290begin
     
    664685    Proxy.SchemaName := 'information_schema';
    665686    Proxy.ObjectName := 'tables';
    666     Proxy.Condition := 'table_name = "Information" AND table_schema = "' +
     687    Proxy.Condition := 'table_name = "SystemModule" AND table_schema = "' +
    667688      Client.Schema + '"';
    668689    Proxy.Load;
Note: See TracChangeset for help on using the changeset viewer.