Changeset 43
- Timestamp:
- Mar 9, 2012, 1:09:52 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 2 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Clients/UChronisClientMySQL.pas
r40 r43 14 14 TChronisClientMySQL = class(TChronisClient) 15 15 protected 16 procedure InitSystemTypes; override; 16 17 function GetConnected: Boolean; override; 17 18 public … … 23 24 procedure ListLoad(AList: TListProxy); override; 24 25 procedure ListSave(AList: TListProxy); override; 25 procedure DefineType(AType: TChronisType); override;26 procedure UndefineType(AType: TChronisType); override;26 procedure TypeDefine(AType: TChronisType); override; 27 procedure TypeUndefine(AType: TChronisType); override; 27 28 procedure Install; 28 29 procedure Uninstall; … … 35 36 implementation 36 37 38 39 resourcestring 40 SMissingBaseType = 'Missing base typ for %s'; 41 SUndefinedType = 'Undefinned type %s'; 42 43 37 44 { TChronisClientMySQL } 45 46 procedure TChronisClientMySQL.InitSystemTypes; 47 begin 48 inherited InitSystemTypes; 49 Types.AddType('Integer', 'int(11)'); 50 Types.AddType('String', 'varchar(255)'); 51 Types.AddType('RelationOne', 'int(11)'); 52 Types.AddType('Double', 'double'); 53 Types.AddType('DateTime', 'datetime'); 54 Types.AddType('Date', 'date'); 55 Types.AddType('Time', 'time'); 56 Types.AddType('Text', 'text'); 57 Types.AddType('Boolean', 'bool'); 58 end; 38 59 39 60 function TChronisClientMySQL.GetConnected: Boolean; … … 103 124 end; 104 125 105 procedure TChronisClientMySQL. DefineType(AType: TChronisType);126 procedure TChronisClientMySQL.TypeDefine(AType: TChronisType); 106 127 var 107 D ata: TDictionaryStringString;128 DbRows: TDbRows; 108 129 I: Integer; 130 Query: string; 131 RefType: TChronisType; 109 132 begin 110 133 try 111 Data := TDictionaryStringString.Create; 112 Data.Add('Name', AType.Name); 113 Database.Insert('Type', Data); 134 DbRows := TDbRows.Create; 135 Query := 'CREATE TABLE IF NOT EXISTS `' + AType.Name + '` ( ' + 136 '`Id` int(11) NOT NULL AUTO_INCREMENT,'; 137 for I := 0 to AType.Properties.Count - 1 do 138 with AType.Properties do begin 139 RefType := Types.SearchByName(Items[I].Value); 140 if not Assigned(RefType) then 141 raise Exception.Create(Format(SUndefinedType, [Items[I].Value])); 142 if RefType.DbType = '' then 143 raise Exception.Create(Format(SMissingBaseType, [RefType.Name])); 144 145 Query := Query + '`' + Items[I].Key + '` ' + RefType.DbType + ' NOT NULL,'; 146 end; 147 Query := Query + 'PRIMARY KEY (`Id`)' + 148 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'; 149 Database.Query(DbRows, Query); 114 150 finally 115 Data.Free; 116 end; 117 if AType is TChronisTypeRecord then begin 118 for I := 0 to TChronisTypeRecord(AType).Items.Count - 1 do 119 try 120 Data := TDictionaryStringString.Create; 121 Data.Add('Name', 122 TChronisTypeRecordItem(TChronisTypeRecord(AType).Items[I]).Name); 123 Data.Add('Type', IntToStr( 124 TChronisTypeRecordItem(TChronisTypeRecord(AType).Items[I]).ItemType.OID)); 125 Database.Insert('TypeRecordItem', Data); 126 finally 127 Data.Free; 128 end; 129 end; 130 end; 131 132 procedure TChronisClientMySQL.UndefineType(AType: TChronisType); 151 DbRows.Free; 152 end; 153 end; 154 155 procedure TChronisClientMySQL.TypeUndefine(AType: TChronisType); 133 156 begin 134 157 … … 156 179 constructor TChronisClientMySQL.Create; 157 180 begin 181 inherited; 158 182 Database := TSqlDatabase.Create(nil); 159 183 end; -
trunk/Application/Clients/UChronisClientXMLRPC.pas
r32 r43 6 6 7 7 uses 8 Classes, SysUtils; 8 Classes, SysUtils, UChronisClient; 9 10 type 11 TChronisClientXMLRPC = class(TChronisClient) 12 end; 9 13 10 14 implementation -
trunk/Application/UChronisClient.pas
r37 r43 9 9 10 10 type 11 EClientNotSet = class(Exception); 12 11 13 TChronisClient = class; 12 14 … … 52 54 end; 53 55 56 { TChronisType } 57 54 58 TChronisType = class 55 OID: Integer;59 Client: TChronisClient; 56 60 Name: string; 57 end; 58 59 TChronisTypeRecordItem = class 60 Name: string; 61 ItemType: TChronisType; 62 end; 63 64 { TChronisTypeRecord } 65 66 TChronisTypeRecord = class(TChronisType) 67 Items: TListObject; // TListObject<TChronisTypeRecordItem> 61 DbType: string; 62 Properties: TDictionaryStringString; 63 procedure Define; 64 procedure Undefine; 68 65 constructor Create; 69 66 destructor Destroy; override; 70 67 end; 71 68 69 { TChronisTypeList } 70 71 TChronisTypeList = class(TListObject) 72 Client: TChronisClient; 73 function AddType(Name: string; DbType: string = ''): TChronisType; 74 function SearchByName(Name: string): TChronisType; 75 end; 76 72 77 { TChronisClient } 73 78 74 79 TChronisClient = class 80 private 75 81 protected 82 procedure InitSystemTypes; virtual; 76 83 function GetConnected: Boolean; virtual; 77 84 public … … 81 88 User: string; 82 89 Password: string; 90 Types: TChronisTypeList; 83 91 procedure ObjectLoad(AObject: TObjectProxy); virtual; abstract; 84 92 procedure ObjectSave(AObject: TObjectProxy); virtual; abstract; … … 87 95 procedure ListLoad(AList: TListProxy); virtual; abstract; 88 96 procedure ListSave(AList: TListProxy); virtual; abstract; 89 procedure DefineType(AType: TChronisType); virtual; abstract; 90 procedure UndefineType(AType: TChronisType); virtual; abstract; 97 procedure TypeDefine(AType: TChronisType); virtual; abstract; 98 procedure TypeUndefine(AType: TChronisType); virtual; abstract; 99 procedure CheckTypes; 91 100 constructor Create; virtual; 101 destructor Destroy; override; 92 102 procedure Connect; virtual; abstract; 93 103 procedure Disconnect; virtual; abstract; … … 95 105 end; 96 106 107 97 108 implementation 98 109 99 { TChronisTypeRecord } 100 101 constructor TChronisTypeRecord.Create; 102 begin 103 Items := TListObject.Create; 104 end; 105 106 destructor TChronisTypeRecord.Destroy; 107 begin 108 Items.Free; 110 resourcestring 111 SClientNotSet = 'Client not set'; 112 113 { TChronisTypeList } 114 115 function TChronisTypeList.AddType(Name: string; DbType: string = ''): TChronisType; 116 begin 117 Result := TChronisType(AddNew(TChronisType.Create)); 118 Result.Client := Client; 119 Result.Name := Name; 120 Result.DbType := DbType; 121 end; 122 123 function TChronisTypeList.SearchByName(Name: string): TChronisType; 124 var 125 I: Integer; 126 begin 127 I := 0; 128 while (I < Count) and (TChronisType(Items[I]).Name <> Name) do Inc(I); 129 if I < Count then Result := TChronisType(Items[I]) 130 else Result := nil; 131 end; 132 133 procedure TChronisType.Define; 134 begin 135 if Assigned(Client) then Client.TypeDefine(Self) 136 else raise EClientNotSet.Create(SClientNotSet); 137 end; 138 139 procedure TChronisType.Undefine; 140 begin 141 if Assigned(Client) then Client.TypeUndefine(Self) 142 else raise EClientNotSet.Create(SClientNotSet); 143 end; 144 145 constructor TChronisType.Create; 146 begin 147 Properties := TDictionaryStringString.Create; 148 end; 149 150 destructor TChronisType.Destroy; 151 begin 152 Properties.Free; 109 153 inherited Destroy; 110 154 end; … … 114 158 procedure TObjectProxy.Load; 115 159 begin 116 Client.ObjectLoad(Self); 160 if Assigned(Client) then Client.ObjectLoad(Self) 161 else raise EClientNotSet.Create(SClientNotSet); 117 162 end; 118 163 119 164 procedure TObjectProxy.Save; 120 165 begin 121 Client.ObjectSave(Self); 166 if Assigned(Client) then Client.ObjectSave(Self) 167 else raise EClientNotSet.Create(SClientNotSet); 122 168 end; 123 169 124 170 procedure TObjectProxy.Delete; 125 171 begin 126 Client.ObjectDelete(Self); 172 if Assigned(Client) then Client.ObjectDelete(Self) 173 else raise EClientNotSet.Create(SClientNotSet); 127 174 end; 128 175 129 176 procedure TObjectProxy.Add; 130 177 begin 131 Client.ObjectAdd(Self); 178 if Assigned(Client) then Client.ObjectAdd(Self) 179 else raise EClientNotSet.Create(SClientNotSet); 132 180 end; 133 181 … … 168 216 procedure TListProxy.Load; 169 217 begin 170 Client.ListLoad(Self); 218 if Assigned(Client) then Client.ListLoad(Self) 219 else raise EClientNotSet.Create(SClientNotSet); 171 220 end; 172 221 173 222 procedure TListProxy.Save; 174 223 begin 175 Client.ListSave(Self); 224 if Assigned(Client) then Client.ListSave(Self) 225 else raise EClientNotSet.Create(SClientNotSet); 176 226 end; 177 227 178 228 { TChronisClient } 179 229 230 procedure TChronisClient.InitSystemTypes; 231 begin 232 end; 233 180 234 function TChronisClient.GetConnected: Boolean; 181 235 begin … … 183 237 end; 184 238 239 procedure TChronisClient.CheckTypes; 240 var 241 StructureVersion: string; 242 Data: TDictionaryStringString; 243 ObjectId: Integer; 244 Tables: TListString; 245 I: Integer; 246 NewProxy: TListProxy; 247 begin 248 try 249 Tables := TListString.Create; 250 Data := TDictionaryStringString.Create; 251 252 NewProxy := TListProxy.Create; 253 NewProxy.Client := Self; 254 NewProxy.SchemaName := 'information_schema'; 255 NewProxy.ObjectName := 'TABLES'; 256 NewProxy.Condition := 'TABLE_SCHEMA = "' + Schema + '"'; 257 NewProxy.Load; 258 //Database.Query(DbRows, 'SHOW TABLES'); 259 Tables.Count := NewProxy.Objects.Count; 260 for I := 0 to NewProxy.Objects.Count - 1 do 261 Tables[I] := TObjectProxy(NewProxy.Objects[I]).Properties.Values['TABLE_NAME']; 262 263 for I := 0 to Types.Count - 1 do 264 with TChronisType(Types[I]) do begin 265 if (DbType = '') and (Tables.IndexOf(Name) = -1) then begin 266 Define; 267 end; 268 end; 269 finally 270 NewProxy.Free; 271 Data.Free; 272 Tables.Free; 273 end; 274 end; 275 185 276 constructor TChronisClient.Create; 186 277 begin 278 Types := TChronisTypeList.Create; 279 Types.Client := Self; 280 InitSystemTypes; 281 end; 282 283 destructor TChronisClient.Destroy; 284 begin 285 Types.Free; 286 inherited Destroy; 187 287 end; 188 288 -
trunk/Forms/UFormItemList.lfm
r42 r43 1 1 object ItemListForm: TItemListForm 2 2 Left = 320 3 Height = 36 93 Height = 366 4 4 Top = 124 5 5 Width = 502 6 6 Caption = 'Item list' 7 ClientHeight = 36 97 ClientHeight = 366 8 8 ClientWidth = 502 9 9 OnCreate = FormCreate … … 11 11 OnShow = FormShow 12 12 LCLVersion = '0.9.31' 13 object ButtonAdd: TButton14 Left = 815 Height = 2016 Top = 34217 Width = 8018 Action = AItemAdd19 Anchors = [akLeft, akBottom]20 TabOrder = 021 end22 object ButtonDelete: TButton23 Left = 9324 Height = 2025 Top = 34226 Width = 8027 Action = AItemDelete28 Anchors = [akLeft, akBottom]29 TabOrder = 130 end31 object ButtonView: TButton32 Left = 17933 Height = 2034 Top = 34235 Width = 8036 Action = AItemView37 Anchors = [akLeft, akBottom]38 TabOrder = 239 end40 object ButtonEdit: TButton41 Left = 26542 Height = 2043 Top = 34244 Width = 8045 Action = AItemEdit46 Anchors = [akLeft, akBottom]47 TabOrder = 348 end49 13 object ListView1: TListView 50 Left = 851 Height = 3 2652 Top = 853 Width = 4 8514 Left = 4 15 Height = 332 16 Top = 4 17 Width = 496 54 18 Anchors = [akTop, akLeft, akRight, akBottom] 55 19 Columns = <> 56 20 OwnerData = True 21 PopupMenu = PopupMenu1 57 22 ReadOnly = True 58 23 RowSelect = True 59 TabOrder = 424 TabOrder = 0 60 25 ViewStyle = vsReport 61 26 OnData = ListView1Data … … 65 30 OnSelectItem = ListView1SelectItem 66 31 end 67 object ButtonClose: TButton 68 Left = 418 69 Height = 20 70 Top = 342 71 Width = 75 72 Action = AClose 73 Anchors = [akRight, akBottom] 74 TabOrder = 5 32 object ToolBar1: TToolBar 33 Left = 0 34 Height = 26 35 Top = 340 36 Width = 502 37 Align = alBottom 38 Images = MainForm.ImageListActions 39 ParentShowHint = False 40 ShowHint = True 41 TabOrder = 1 42 object ToolButton1: TToolButton 43 Left = 1 44 Top = 2 45 Action = AItemAdd 46 end 47 object ToolButton2: TToolButton 48 Left = 24 49 Top = 2 50 Action = AItemView 51 end 52 object ToolButton3: TToolButton 53 Left = 47 54 Top = 2 55 Action = AItemEdit 56 end 57 object ToolButton4: TToolButton 58 Left = 70 59 Top = 2 60 Action = AItemDelete 61 end 62 object ToolButton5: TToolButton 63 Left = 93 64 Top = 2 65 Action = AItemClone 66 end 75 67 end 76 68 object ActionList1: TActionList 69 Images = MainForm.ImageListActions 77 70 left = 229 78 71 top = 104 79 72 object AItemView: TAction 80 73 Caption = 'View' 74 ImageIndex = 6 81 75 OnExecute = AItemViewExecute 82 76 end 83 77 object AItemEdit: TAction 84 78 Caption = 'Edit' 79 ImageIndex = 2 85 80 OnExecute = AItemEditExecute 86 81 end 87 82 object AItemAdd: TAction 88 83 Caption = 'Add' 84 ImageIndex = 3 89 85 OnExecute = AItemAddExecute 90 86 end 91 87 object AItemDelete: TAction 92 88 Caption = 'Delete' 89 ImageIndex = 5 93 90 OnExecute = AItemDeleteExecute 94 91 end … … 97 94 OnExecute = ACloseExecute 98 95 end 96 object AItemClone: TAction 97 Caption = 'Clone' 98 ImageIndex = 4 99 end 100 end 101 object PopupMenu1: TPopupMenu 102 Images = MainForm.ImageListActions 103 left = 232 104 top = 56 105 object MenuItem1: TMenuItem 106 Action = AItemView 107 Bitmap.Data = { 108 36040000424D3604000000000000360000002800000010000000100000000100 109 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF 110 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 111 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 112 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 113 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 114 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 115 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 116 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 117 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00030303000404 118 0400040404000404040A04040435040404650404047B04040488040404880404 119 047B04040465040404350404040A040404000404040003030300030303000404 120 0401040404390C0C0C80545454ACAAAAAAD88C8C8CF15E5E5EFE5E5E5EFE8C8C 121 8CF1AAAAAAD8545454AC0C0C0C80040404390404040103030300030303070404 122 045A3A3A3AA5C6C6C6E6E7E7E7FFA2A2A2FF645D5DFF9E8484FF9E8484FF645D 123 5DFFA2A2A2FFE7E7E7FFC6C6C6E63A3A3AA50404045A03030307030303414848 124 48B1E2E2E2F7EAEAEAFFEAEAEAFF646464FF816F6FFF7A6767FF7A6767FF816F 125 6FFF646464FFEAEAEAFFEAEAEAFFE2E2E2F7484848B103030341030303A07E7E 126 7ED0F0F0F0FFF0F0F0FFF0F0F0FF434343FFBAB2B2FF352E2EFF352E2EFF6D5F 127 5FFF434343FFF0F0F0FFF0F0F0FFF0F0F0FF7E7E7ED0030303A0030303484646 128 46BEE9E9E9F9F6F6F6FFF6F6F6FFBDBDBDFFFFFFFFFF9E9B9BFF413C3CFF4C46 129 46FF5C5C5CFFF6F6F6FFF6F6F6FFE9E9E9F9464646BE03030348010101080101 130 0171353535C6CACACAF0FBFBFBFFA6A6A6FF9B9B9BFF383737FF383737FF3838 131 38FFA6A6A6FFFBFBFBFFCACACAF0353535C60101017101010108010101000101 132 01010000004F070707B44D4D4DD8A9A9A9EE7E7E7EF9424242FF424242FF7E7E 133 7EF9A9A9A9EE4D4D4DD8070707B40000004F0101010101010100010101000101 134 0100000000000000000E0000004E00000094000000B6000000C8000000C80000 135 00B6000000940000004E0000000E000000000101010001010100FFFFFF00FFFF 136 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 137 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 138 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 139 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 140 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 141 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 142 } 143 end 144 object MenuItem2: TMenuItem 145 Action = AItemEdit 146 Bitmap.Data = { 147 36040000424D3604000000000000360000002800000010000000100000000100 148 2000000000000004000064000000640000000000000000000000986B3700976A 149 36FF966935FF966734FF956633FF946532FF946531FF936430FF92622FFF9261 150 2EFF91602DFF90602CFF905F2BFF8F5D2AFF8E5C29FF8D5B28FF996C38FFF8F7 151 F6FFF8F7F5FFF7F6F5FFF6F6F4FFF6F5F3FFF5F5F3FFF5F4F2FFF4F3F1FFF4F3 152 F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F0EEFFF1F0EDFF8E5D29FF996D3AFFF9F8 153 F7FF959594FF878787FF9B9A9AFFF7F6F4FFF6F5F3FFF6F5F3FFF5F4F2FFF4F3 154 F1FFF4F3F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F1EEFF8F5E2AFF9A6E3BFFF9F9 155 F8FF7C7C7CFFC4C4C4FF878787FFF7F6F5FF7A7A7AFF787878FF747474FF7171 156 70FF6D6D6CFF696968FF656565FF616161FFF2F1EFFF905F2BFF9B6F3CFFFAF9 157 F8FFBEBEBDFF929292FFBCBCBBFFF8F7F6FFF7F7F5FFF7F6F4FFF6F5F4FFF6F5 158 F3FFF5F4F2FFF5F4F2FFF4F3F1FFF4F2F0FFF3F2F0FF91602DFF9C703DFFFAFA 159 F9FFFAF9F9FFF9F9F8FFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F5 160 F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FFF4F3F0FF92612EFF9D723EFFFBFB 161 FAFF9F9F9EFF7F7F7FFFAEAEADFFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6 162 F5FFF6F6F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FF92622FFF9D7340FFFCFB 163 FBFF818181FFC4C4C4FF8F8F8FFFFAF9F8FF7B7B7AFF797979FF757574FF7271 164 71FF6D6D6DFF696969FF666665FF626261FFF5F4F2FF936430FF9E7441FFFCFC 165 FCFFB5B5B5FF848484FFBEBDBDFFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FFF8F8 166 F6FFF8F7F5FFF7F6F5FFF7F6F4FFF6F5F3FFF6F5F3FF946531FF9F7542FFFDFD 167 FCFFFCFCFCFFFCFCFBFFFBFBFAFFFBFAFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8 168 F7FFF8F8F6FFF8F7F6FFF7F6F5FFF7F6F4FFF6F5F4FF956633FFA07643FFFEFD 169 FDFF8C8C8CFF525252FFA4A4A4FFFBFBFAFFFBFBFAFFFAFAF9FFFAF9F8FFF9F9 170 F8FFF9F8F7FFF8F8F6FFF8F7F6FFF7F7F5FFF7F6F4FF966734FFA17844FFFEFE 171 FEFF5F5F5FFF949494FF535353FFFCFCFBFF7B7B7BFF797979FF757575FF7272 172 72FF6E6E6EFF6A6A69FF666666FF626262FFF7F7F5FF966935FFA17946FFFFFF 173 FFFF878787FF5D5D5DFFA0A0A0FFFDFCFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFA 174 F9FFFAFAF9FFFAF9F8FFF9F8F7FFF8F8F7FFF8F7F6FF976A36FFA27A47FFFFFF 175 FFFFFFFFFFFFFEFEFEFFFEFEFEFFFDFDFDFFFDFDFCFFFCFCFBFFFCFBFBFFFBFB 176 FAFFFBFAF9FFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FF986B3700A37B48FFBEA2 177 7FFFBEA17EFFBDA17DFFBDA07CFFBD9F7CFFBC9F7BFFBB9E7AFFBB9D7AFFBB9D 178 79FFBA9C78FFB99B78FFB99A77FFB89A76FFB89975FF996C39FFA37B48FFA37B 179 48FFA27A47FFA27946FFA17845FFA07744FFA07643FF9F7542FF9E7441FF9E73 180 40FF9D723FFF9C713EFF9C703DFF9B6F3CFF9A6E3BFF9A6D3AFF 181 } 182 end 183 object MenuItem4: TMenuItem 184 Action = AItemClone 185 Bitmap.Data = { 186 36040000424D3604000000000000360000002800000010000000100000000100 187 2000000000000004000064000000640000000000000000000000000000000000 188 0000000000000000000000000000000000000000000000000000000000000000 189 0000000000000000000000000000000000000000000000000000000000000000 190 00000000000000000000000000000000000000000000840000FF840000FF8400 191 00FF840000FF840000FF840000FF840000FF840000FF840000FF000000000000 192 00000000000000000000000000000000000000000000840000FFFFFFFFFFFFFF 193 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FF000000000000 194 00000000000000000000000000000000000000000000840000FFFFFFFFFF0000 195 00FF000000FF000000FF000000FF000000FFFFFFFFFF840000FF000000000000 196 00FF000000FF000000FF000000FF000000FF000000FF840000FFFFFFFFFFFFFF 197 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FF000000000000 198 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF0000 199 00FF000000FF000000FF000000FF000000FFFFFFFFFF840000FF000000000000 200 00FFFFFFFFFF000000FF000000FF000000FF000000FF840000FFFFFFFFFFFFFF 201 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FF000000000000 202 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF0000 203 00FF000000FFFFFFFFFF840000FF840000FF840000FF840000FF000000000000 204 00FFFFFFFFFF000000FF000000FF000000FF000000FF840000FFFFFFFFFFFFFF 205 FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF840000FF00000000000000000000 206 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFFFFFF 207 FFFFFFFFFFFFFFFFFFFF840000FF840000FF0000000000000000000000000000 208 00FFFFFFFFFF000000FF000000FFFFFFFFFF000000FF840000FF840000FF8400 209 00FF840000FF840000FF840000FF000000000000000000000000000000000000 210 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFF000000FF0000 211 0000000000000000000000000000000000000000000000000000000000000000 212 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF000000FF000000000000 213 0000000000000000000000000000000000000000000000000000000000000000 214 00FF000000FF000000FF000000FF000000FF000000FF00000000000000000000 215 0000000000000000000000000000000000000000000000000000000000000000 216 0000000000000000000000000000000000000000000000000000000000000000 217 0000000000000000000000000000000000000000000000000000000000000000 218 0000000000000000000000000000000000000000000000000000000000000000 219 0000000000000000000000000000000000000000000000000000 220 } 221 end 222 object MenuItem3: TMenuItem 223 Action = AItemDelete 224 Bitmap.Data = { 225 36040000424D3604000000000000360000002800000010000000100000000100 226 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF 227 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 228 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 229 0000000000000000000000000000000000000000000000000000000000000000 230 00000000000000000000000000000000000000000000FFFFFF00000000000000 231 0000000000000000000000000000000000000000000000000000000000000000 232 00000000000000000000000000003A3AE2FFC0C0C0FFFFFFFF00000000000000 233 0000000000003A3AE2FFC0C0C0FF000000000000000000000000000000000000 234 00000000000000000000000000000000000000000000FFFFFF00000000000000 235 00003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF0000000000000000000000000000 236 000000000000000000003A3AE2FFC0C0C0FF0000000003030300000000000000 237 00003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF0000000000000000000000000000 238 0000000000003A3AE2FFC0C0C0FF000000000000000003030300000000000000 239 0000000000003838E0FF3838E0FF3838E0FFC0C0C0FF00000000000000000000 240 00003838E0FF3838E0FFC0C0C0FF000000000000000003030307000000000000 241 000000000000000000003535DDFF3535DDFF3535DDFFC0C0C0FF000000003535 242 DDFF3535DDFFC0C0C0FF00000000000000000000000003030341000000000000 243 00000000000000000000000000003232DAFF3232DAFF3232DAFF3232DAFF3232 244 DAFFC0C0C0FF00000000000000000000000000000000030303A0000000000000 245 0000000000000000000000000000000000002F2FD7FF2F2FD7FF2F2FD7FFC0C0 246 C0FF000000000000000000000000000000000000000003030348000000000000 247 00000000000000000000000000002C2CD4FF2C2CD4FF2C2CD4FF2C2CD4FF2C2C 248 D4FFC0C0C0FF0000000000000000000000000000000001010108000000000000 249 000000000000000000002929D1FF2929D1FF2929D1FFC0C0C0FF000000002929 250 D1FFC0C0C0FF0000000000000000000000000000000001010100000000000000 251 00002626CEFF2626CEFF2626CEFF2626CEFFC0C0C0FF00000000000000000000 252 00002626CEFF2626CEFFC0C0C0FF000000000000000001010100000000002020 253 C8FF2020C8FF2020C8FF2020C8FFC0C0C0FF0000000000000000000000000000 254 0000000000002020C8FF2020C8FFC0C0C0FF00000000FFFFFF00000000001818 255 C0FF1818C0FFC0C0C0FF00000000000000000000000000000000000000000000 256 000000000000000000001818C0FF1818C0FFC0C0C0FFFFFFFF00000000000000 257 0000000000000000000000000000000000000000000000000000000000000000 258 00000000000000000000000000000000000000000000FFFFFF00 259 } 260 end 261 object MenuItem5: TMenuItem 262 Action = AItemAdd 263 Bitmap.Data = { 264 36040000424D3604000000000000360000002800000010000000100000000100 265 2000000000000004000064000000640000000000000000000000000000000000 266 0000000000000000000000000000000000000000000000000000000000000000 267 0000000000000000000000000000000000000000000000000000000000000000 268 000000000000000000000000000000000000D4D4D4FFB2B2B2FFB2B2B2FFD4D4 269 D4FF000000000000000000000000000000000000000000000000000000000000 270 0000000000000000000000000000709B70FF004A00FF004800FF4E764EFFB2B2 271 B2FF000000000000000000000000000000000000000000000000000000000000 272 0000000000000000000000000000004E00FF00C800FF00C400FF004800FFB2B2 273 B2FF000000000000000000000000000000000000000000000000000000000000 274 0000000000000000000000000000005000FF00CA00FF00C600FF004A00FFB2B2 275 B2FF000000000000000000000000000000000000000000000000000000000000 276 0000000000000000000000000000005300FF00CE00FF00CA00FF004C00FFB2B2 277 B2FF00000000000000000000000000000000000000000000000000000000D4D4 278 D4FFB2B2B2FFB2B2B2FFB2B2B2FF005400FF00D200FF00CE00FF004E00FFB2B2 279 B2FFB2B2B2FFB2B2B2FFB2B2B2FFB2B2B2FFD4D4D4FF0000000070A670FF005E 280 00FF005C00FF005A00FF005800FF005600FF00D600FF00D000FF005000FF004E 281 00FF004C00FF004A00FF004A00FF4E764EFFB2B2B2FF00000000006200FF8CFE 282 8CFF00EA00FF00E600FF00E200FF00DE00FF00DA00FF00D400FF00D000FF00CC 283 00FF00C800FF00C400FF00C200FF004800FFB2B2B2FF00000000006400FFECFF 284 ECFF8CFE8CFF8CFE8CFF8CFE8CFF8CFE8CFF00DE00FF00D900FF00D400FF00D0 285 00FF00CC00FF00C800FF00C400FF004A00FFD4D4D4FF0000000070A970FF0064 286 00FF006400FF006200FF006000FF006000FF8CFE8CFF00DD00FF005800FF0056 287 00FF005400FF005300FF005000FF709C70FF0000000000000000000000000000 288 0000000000000000000000000000006000FF8CFE8CFF00E000FF005A00FFB2B2 289 B2FF000000000000000000000000000000000000000000000000000000000000 290 0000000000000000000000000000006200FF8CFE8CFF00E500FF005C00FFB2B2 291 B2FF000000000000000000000000000000000000000000000000000000000000 292 0000000000000000000000000000006400FF8CFE8CFF00E800FF005E00FFB2B2 293 B2FF000000000000000000000000000000000000000000000000000000000000 294 0000000000000000000000000000006400FFECFFECFF8CFE8CFF006000FFD4D4 295 D4FF000000000000000000000000000000000000000000000000000000000000 296 000000000000000000000000000070A970FF006400FF006200FF70A670FF0000 297 0000000000000000000000000000000000000000000000000000 298 } 299 end 99 300 end 100 301 end -
trunk/Forms/UFormItemList.lrt
r42 r43 5 5 TITEMLISTFORM.AITEMDELETE.CAPTION=Delete 6 6 TITEMLISTFORM.ACLOSE.CAPTION=Close 7 TITEMLISTFORM.AITEMCLONE.CAPTION=Clone -
trunk/Forms/UFormItemList.pas
r42 r43 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ActnList, USystem;9 ComCtrls, ActnList, Menus, USystem; 10 10 11 11 type … … 15 15 TItemListForm = class(TForm) 16 16 AClose: TAction; 17 AItemClone: TAction; 17 18 AItemView: TAction; 18 19 AItemEdit: TAction; … … 20 21 AItemDelete: TAction; 21 22 ActionList1: TActionList; 22 ButtonClose: TButton;23 ButtonAdd: TButton;24 ButtonDelete: TButton;25 ButtonEdit: TButton;26 ButtonView: TButton;27 23 ListView1: TListView; 24 MenuItem1: TMenuItem; 25 MenuItem2: TMenuItem; 26 MenuItem3: TMenuItem; 27 MenuItem4: TMenuItem; 28 MenuItem5: TMenuItem; 29 PopupMenu1: TPopupMenu; 30 ToolBar1: TToolBar; 31 ToolButton1: TToolButton; 32 ToolButton2: TToolButton; 33 ToolButton3: TToolButton; 34 ToolButton4: TToolButton; 35 ToolButton5: TToolButton; 28 36 procedure ACloseExecute(Sender: TObject); 29 37 procedure AItemAddExecute(Sender: TObject); … … 46 54 SelectedItem: Integer; 47 55 procedure Reload; 56 procedure UpdateInterface; 48 57 end; 49 58 … … 76 85 ListView1Resize(Self); 77 86 ListView1SelectItem(Self, nil, False); 87 end; 88 89 procedure TItemListForm.UpdateInterface; 90 var 91 I: Integer; 92 begin 93 AItemDelete.Enabled := Assigned(ListView1.Selected); 94 AItemView.Enabled := Assigned(ListView1.Selected); 95 AItemEdit.Enabled := Assigned(ListView1.Selected); 96 AItemClone.Enabled := Assigned(ListView1.Selected); 97 98 for I := 0 to ToolBar1.ButtonCount - 1 do 99 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption; 78 100 end; 79 101 … … 191 213 Selected: Boolean); 192 214 begin 193 ButtonDelete.Enabled := Assigned(ListView1.Selected); 194 ButtonView.Enabled := Assigned(ListView1.Selected); 195 ButtonEdit.Enabled := Assigned(ListView1.Selected); 215 UpdateInterface; 196 216 end; 197 217 -
trunk/Forms/UFormLogin.pas
r42 r43 79 79 procedure TLoginForm.ButtonChangeClick(Sender: TObject); 80 80 begin 81 if LoginProfileForm.ShowModal = mrOk then begin 82 Core.Profiles.FillStrings(ComboBoxConnection.Items); 83 Core.LastProfile := ComboBoxConnection.ItemIndex; 84 ComboBoxConnection.ItemIndex := Core.LastProfile; 85 if (ComboBoxConnection.Items.Count > 0) and 86 (ComboBoxConnection.ItemIndex = -1) then ComboBoxConnection.ItemIndex := 0; 81 try 82 LoginProfileForm := TLoginProfileForm.Create(MainForm); 83 if LoginProfileForm.ShowModal = mrOk then begin 84 Core.Profiles.FillStrings(ComboBoxConnection.Items); 85 Core.LastProfile := ComboBoxConnection.ItemIndex; 86 ComboBoxConnection.ItemIndex := Core.LastProfile; 87 if (ComboBoxConnection.Items.Count > 0) and 88 (ComboBoxConnection.ItemIndex = -1) then ComboBoxConnection.ItemIndex := 0; 89 end; 90 finally 91 LoginProfileForm.Free; 87 92 end; 88 93 end; -
trunk/Forms/UFormLoginProfile.lfm
r42 r43 11 11 OnDestroy = FormDestroy 12 12 OnShow = FormShow 13 Position = poScreenCenter 13 14 LCLVersion = '0.9.31' 14 15 object LabelServer: TLabel … … 30 31 TabOrder = 0 31 32 end 32 object ListBox 1: TListBox33 object ListBoxProfiles: TListBox 33 34 Left = 10 34 35 Height = 289 … … 37 38 Anchors = [akTop, akLeft, akRight, akBottom] 38 39 ItemHeight = 0 39 OnSelectionChange = ListBox 1SelectionChange40 OnSelectionChange = ListBoxProfilesSelectionChange 40 41 ScrollWidth = 246 41 42 TabOrder = 1 -
trunk/Forms/UFormLoginProfile.pas
r42 r43 10 10 11 11 type 12 TConnectProtocol = (cpXMLRPC, cpDirect );12 TConnectProtocol = (cpXMLRPC, cpDirect, cpMySQL); 13 13 14 14 { TConnectProfile } … … 51 51 Label5: TLabel; 52 52 LabelServer: TLabel; 53 ListBox 1: TListBox;53 ListBoxProfiles: TListBox; 54 54 Panel1: TPanel; 55 55 SpinEditPort: TSpinEdit; … … 65 65 procedure FormDestroy(Sender: TObject); 66 66 procedure FormShow(Sender: TObject); 67 procedure ListBox 1SelectionChange(Sender: TObject; User: boolean);67 procedure ListBoxProfilesSelectionChange(Sender: TObject; User: boolean); 68 68 procedure SpinEditPortChange(Sender: TObject); 69 69 private … … 76 76 SProfile = 'Profile'; 77 77 SProtocolXMLRPC = 'XML-RPC'; 78 SProtocolMySQL = 'MySQL'; 79 SProtocolDirect = 'Direct'; 78 80 79 81 var 80 82 LoginProfileForm: TLoginProfileForm; 83 ProtocolTypeText: array[TConnectProtocol] of string; 84 85 procedure UpdateTranslation; 81 86 82 87 implementation … … 123 128 procedure TLoginProfileForm.ComboBoxProtocolChange(Sender: TObject); 124 129 begin 125 if ListBox1.ItemIndex <> - 1 then 126 TConnectProfile(ProfileList[ListBox1.ItemIndex]).Protocol := TConnectProtocol(ComboBoxProtocol.ItemIndex); 130 if ListBoxProfiles.ItemIndex <> - 1 then 131 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).Protocol := 132 TConnectProtocol(ComboBoxProtocol.Items.Objects[ComboBoxProtocol.ItemIndex]); 127 133 end; 128 134 129 135 procedure TLoginProfileForm.EditNameChange(Sender: TObject); 130 136 begin 131 if ListBox 1.ItemIndex <> - 1 then begin132 TConnectProfile(ProfileList[ListBox 1.ItemIndex]).Name := EditName.Text;133 ListBox 1.Items[ListBox1.ItemIndex] := EditName.Text;137 if ListBoxProfiles.ItemIndex <> - 1 then begin 138 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).Name := EditName.Text; 139 ListBoxProfiles.Items[ListBoxProfiles.ItemIndex] := EditName.Text; 134 140 end; 135 141 end; … … 137 143 procedure TLoginProfileForm.EditDatabaseChange(Sender: TObject); 138 144 begin 139 if ListBox 1.ItemIndex <> - 1 then140 TConnectProfile(ProfileList[ListBox 1.ItemIndex]).Database := EditDatabase.Text;145 if ListBoxProfiles.ItemIndex <> - 1 then 146 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).Database := EditDatabase.Text; 141 147 end; 142 148 143 149 procedure TLoginProfileForm.EditServerChange(Sender: TObject); 144 150 begin 145 if ListBox 1.ItemIndex <> - 1 then146 TConnectProfile(ProfileList[ListBox 1.ItemIndex]).HostName := EditServer.Text;151 if ListBoxProfiles.ItemIndex <> - 1 then 152 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).HostName := EditServer.Text; 147 153 end; 148 154 … … 156 162 begin 157 163 ProfileList.AddNew(TConnectProfile.Create); 158 ListBox 1.Items.AddObject(TConnectProfile(ProfileList.Last).Name,164 ListBoxProfiles.Items.AddObject(TConnectProfile(ProfileList.Last).Name, 159 165 TConnectProfile(ProfileList.Last)); 160 166 end; … … 162 168 procedure TLoginProfileForm.ButtonDeleteClick(Sender: TObject); 163 169 begin 164 if ListBox 1.ItemIndex <> - 1 then begin165 ProfileList.Delete(ListBox 1.ItemIndex);166 ListBox 1.Items.Delete(ListBox1.ItemIndex);170 if ListBoxProfiles.ItemIndex <> - 1 then begin 171 ProfileList.Delete(ListBoxProfiles.ItemIndex); 172 ListBoxProfiles.Items.Delete(ListBoxProfiles.ItemIndex); 167 173 end; 168 174 end; … … 178 184 begin 179 185 ComboBoxProtocol.Clear; 180 ComboBoxProtocol.Items.Add(SProtocolXMLRPC); 186 for I := 0 to Integer(High(ProtocolTypeText)) do 187 ComboBoxProtocol.Items.AddObject(ProtocolTypeText[TConnectProtocol(I)], 188 Pointer(I)); 181 189 182 190 MainForm.PersistentForm.Load(Self); 183 191 ProfileList.Assign(Core.Profiles); 184 ProfileList.FillStrings(ListBox 1.Items);185 if Core.LastProfile < ListBox 1.Count then186 ListBox 1.ItemIndex := Core.LastProfile;187 if (ListBox 1.Items.Count > 0) and188 (ListBox 1.ItemIndex = -1) then ListBox1.ItemIndex := 0;189 end; 190 191 procedure TLoginProfileForm.ListBox 1SelectionChange(Sender: TObject;192 ProfileList.FillStrings(ListBoxProfiles.Items); 193 if Core.LastProfile < ListBoxProfiles.Count then 194 ListBoxProfiles.ItemIndex := Core.LastProfile; 195 if (ListBoxProfiles.Items.Count > 0) and 196 (ListBoxProfiles.ItemIndex = -1) then ListBoxProfiles.ItemIndex := 0; 197 end; 198 199 procedure TLoginProfileForm.ListBoxProfilesSelectionChange(Sender: TObject; 192 200 User: boolean); 193 201 begin 194 if ListBox 1.ItemIndex <> -1 then195 with TConnectProfile(ProfileList[ListBox 1.ItemIndex]) do begin202 if ListBoxProfiles.ItemIndex <> -1 then 203 with TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]) do begin 196 204 EditServer.Text := HostName; 197 205 EditDatabase.Text := Database; 198 ComboBoxProtocol.ItemIndex := Integer(Protocol);206 ComboBoxProtocol.ItemIndex := ComboBoxProtocol.Items.IndexOfObject(Pointer(Protocol)); 199 207 SpinEditPort.Value := Port; 200 208 EditName.Text := Name; … … 204 212 procedure TLoginProfileForm.SpinEditPortChange(Sender: TObject); 205 213 begin 206 if ListBox 1.ItemIndex <> - 1 then207 TConnectProfile(ProfileList[ListBox 1.ItemIndex]).Port := SpinEditPort.Value;214 if ListBoxProfiles.ItemIndex <> - 1 then 215 TConnectProfile(ProfileList[ListBoxProfiles.ItemIndex]).Port := SpinEditPort.Value; 208 216 end; 209 217 … … 281 289 end; 282 290 291 procedure UpdateTranslation; 292 begin 293 ProtocolTypeText[cpXMLRPC] := SProtocolXMLRPC; 294 ProtocolTypeText[cpMySQL] := SProtocolMySQL; 295 ProtocolTypeText[cpDirect] := SProtocolDirect; 296 end; 297 283 298 end. 284 299 -
trunk/Forms/UFormMain.lfm
r42 r43 249 249 object AExit: TAction 250 250 Caption = 'Exit' 251 ImageIndex = 7 251 252 OnExecute = AExitExecute 252 253 ShortCut = 32883 … … 254 255 object AToggleFullscreen: TAction 255 256 Caption = 'Fullscreen mode' 257 ImageIndex = 8 256 258 OnExecute = AToggleFullscreenExecute 257 259 ShortCut = 122 … … 337 339 top = 56 338 340 Bitmap = { 339 4C690 20000001000000010000000000000000000000000000000000000000000341 4C69090000001000000010000000000000000000000000000000000000000000 340 342 0000000000000000000000000000000000000000000000000000000000000000 341 343 000000000000000000000000000000000000000000000000000000000000F4F9 … … 401 403 0000000000000000000000000000000000000000000000000000000000000000 402 404 0000000000000000000000000000000000000000000000000000000000000000 403 0000000000000000000000000000 405 0000000000000000000000000000A37B48FFA37B48FFA27A47FFA27946FFA178 406 45FFA07744FFA07643FF9F7542FF9E7441FF9E7340FF9D723FFF9C713EFF9C70 407 3DFF9B6F3CFF9A6E3BFF9A6D3AFFA37B48FFBEA27FFFBEA17EFFBDA17DFFBDA0 408 7CFFBD9F7CFFBC9F7BFFBB9E7AFFBB9D7AFFBB9D79FFBA9C78FFB99B78FFB99A 409 77FFB89A76FFB89975FF996C39FFA27A47FFFFFFFFFFFFFFFFFFFEFEFEFFFEFE 410 FEFFFDFDFDFFFDFDFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFAF9FFFAFAF9FFFAF9 411 F8FFF9F9F7FFF9F8F7FF986B3700A17946FFFFFFFFFF878787FF5D5D5DFFA0A0 412 A0FFFDFCFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFAF9FFFAFAF9FFFAF9F8FFF9F8 413 F7FFF8F8F7FFF8F7F6FF976A36FFA17844FFFEFEFEFF5F5F5FFF949494FF5353 414 53FFFCFCFBFF7B7B7BFF797979FF757575FF727272FF6E6E6EFF6A6A69FF6666 415 66FF626262FFF7F7F5FF966935FFA07643FFFEFDFDFF8C8C8CFF525252FFA4A4 416 A4FFFBFBFAFFFBFBFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8F7FFF8F8F6FFF8F7 417 F6FFF7F7F5FFF7F6F4FF966734FF9F7542FFFDFDFCFFFCFCFCFFFCFCFBFFFBFB 418 FAFFFBFAFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8F7FFF8F8F6FFF8F7F6FFF7F6 419 F5FFF7F6F4FFF6F5F4FF956633FF9E7441FFFCFCFCFFB5B5B5FF848484FFBEBD 420 BDFFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FFF8F8F6FFF8F7F5FFF7F6F5FFF7F6 421 F4FFF6F5F3FFF6F5F3FF946531FF9D7340FFFCFBFBFF818181FFC4C4C4FF8F8F 422 8FFFFAF9F8FF7B7B7AFF797979FF757574FF727171FF6D6D6DFF696969FF6666 423 65FF626261FFF5F4F2FF936430FF9D723EFFFBFBFAFF9F9F9EFF7F7F7FFFAEAE 424 ADFFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F6F4FFF6F5F3FFF5F4 425 F3FFF5F4F2FFF4F3F1FF92622FFF9C703DFFFAFAF9FFFAF9F9FFF9F9F8FFF9F8 426 F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F5F4FFF6F5F3FFF5F4F3FFF5F4 427 F2FFF4F3F1FFF4F3F0FF92612EFF9B6F3CFFFAF9F8FFBEBEBDFF929292FFBCBC 428 BBFFF8F7F6FFF7F7F5FFF7F6F4FFF6F5F4FFF6F5F3FFF5F4F2FFF5F4F2FFF4F3 429 F1FFF4F2F0FFF3F2F0FF91602DFF9A6E3BFFF9F9F8FF7C7C7CFFC4C4C4FF8787 430 87FFF7F6F5FF7A7A7AFF787878FF747474FF717170FF6D6D6CFF696968FF6565 431 65FF616161FFF2F1EFFF905F2BFF996D3AFFF9F8F7FF959594FF878787FF9B9A 432 9AFFF7F6F4FFF6F5F3FFF6F5F3FFF5F4F2FFF4F3F1FFF4F3F1FFF3F2F0FFF3F2 433 EFFFF2F1EFFFF2F1EEFF8F5E2AFF996C38FFF8F7F6FFF8F7F5FFF7F6F5FFF6F6 434 F4FFF6F5F3FFF5F5F3FFF5F4F2FFF4F3F1FFF4F3F1FFF3F2F0FFF3F2EFFFF2F1 435 EFFFF2F0EEFFF1F0EDFF8E5D29FF986B3700976A36FF966935FF966734FF9566 436 33FF946532FF946531FF936430FF92622FFF92612EFF91602DFF90602CFF905F 437 2BFF8F5D2AFF8E5C29FF8D5B28FF000000000000000000000000000000000000 438 000070A970FF006400FF006200FF70A670FF0000000000000000000000000000 439 0000000000000000000000000000000000000000000000000000000000000000 440 0000006400FFECFFECFF8CFE8CFF006000FFD4D4D4FF00000000000000000000 441 0000000000000000000000000000000000000000000000000000000000000000 442 0000006400FF8CFE8CFF00E800FF005E00FFB2B2B2FF00000000000000000000 443 0000000000000000000000000000000000000000000000000000000000000000 444 0000006200FF8CFE8CFF00E500FF005C00FFB2B2B2FF00000000000000000000 445 0000000000000000000000000000000000000000000000000000000000000000 446 0000006000FF8CFE8CFF00E000FF005A00FFB2B2B2FF00000000000000000000 447 000000000000000000000000000070A970FF006400FF006400FF006200FF0060 448 00FF006000FF8CFE8CFF00DD00FF005800FF005600FF005400FF005300FF0050 449 00FF709C70FF0000000000000000006400FFECFFECFF8CFE8CFF8CFE8CFF8CFE 450 8CFF8CFE8CFF00DE00FF00D900FF00D400FF00D000FF00CC00FF00C800FF00C4 451 00FF004A00FFD4D4D4FF00000000006200FF8CFE8CFF00EA00FF00E600FF00E2 452 00FF00DE00FF00DA00FF00D400FF00D000FF00CC00FF00C800FF00C400FF00C2 453 00FF004800FFB2B2B2FF0000000070A670FF005E00FF005C00FF005A00FF0058 454 00FF005600FF00D600FF00D000FF005000FF004E00FF004C00FF004A00FF004A 455 00FF4E764EFFB2B2B2FF0000000000000000D4D4D4FFB2B2B2FFB2B2B2FFB2B2 456 B2FF005400FF00D200FF00CE00FF004E00FFB2B2B2FFB2B2B2FFB2B2B2FFB2B2 457 B2FFB2B2B2FFD4D4D4FF00000000000000000000000000000000000000000000 458 0000005300FF00CE00FF00CA00FF004C00FFB2B2B2FF00000000000000000000 459 0000000000000000000000000000000000000000000000000000000000000000 460 0000005000FF00CA00FF00C600FF004A00FFB2B2B2FF00000000000000000000 461 0000000000000000000000000000000000000000000000000000000000000000 462 0000004E00FF00C800FF00C400FF004800FFB2B2B2FF00000000000000000000 463 0000000000000000000000000000000000000000000000000000000000000000 464 0000709B70FF004A00FF004800FF4E764EFFB2B2B2FF00000000000000000000 465 0000000000000000000000000000000000000000000000000000000000000000 466 000000000000D4D4D4FFB2B2B2FFB2B2B2FFD4D4D4FF00000000000000000000 467 0000000000000000000000000000000000000000000000000000000000000000 468 0000000000000000000000000000000000000000000000000000000000000000 469 0000000000000000000000000000000000000000000000000000000000000000 470 0000000000000000000000000000000000000000000000000000000000000000 471 0000000000000000000000000000000000000000000000000000000000000000 472 0000000000000000000000000000000000000000000000000000000000000000 473 000000000000000000000000000000000000000000FF000000FF000000FF0000 474 00FF000000FF000000FF00000000000000000000000000000000000000000000 475 000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF 476 FFFFFFFFFFFF000000FF000000FF000000000000000000000000000000000000 477 000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF 478 FFFFFFFFFFFF000000FFFFFFFFFF000000FF0000000000000000000000000000 479 000000000000000000000000000000000000000000FFFFFFFFFF000000FF0000 480 00FFFFFFFFFF000000FF840000FF840000FF840000FF840000FF840000FF8400 481 00FF00000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF 482 FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8400 483 00FF840000FF000000000000000000000000000000FFFFFFFFFF000000FF0000 484 00FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8400 485 00FFFFFFFFFF840000FF0000000000000000000000FFFFFFFFFFFFFFFFFFFFFF 486 FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF000000FF000000FFFFFFFFFF8400 487 00FF840000FF840000FF840000FF00000000000000FFFFFFFFFF000000FF0000 488 00FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 489 FFFFFFFFFFFFFFFFFFFF840000FF00000000000000FFFFFFFFFFFFFFFFFFFFFF 490 FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF000000FF000000FF000000FF0000 491 00FF000000FFFFFFFFFF840000FF00000000000000FF000000FF000000FF0000 492 00FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 493 FFFFFFFFFFFFFFFFFFFF840000FF000000000000000000000000000000000000 494 00000000000000000000840000FFFFFFFFFF000000FF000000FF000000FF0000 495 00FF000000FFFFFFFFFF840000FF000000000000000000000000000000000000 496 00000000000000000000840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 497 FFFFFFFFFFFFFFFFFFFF840000FF000000000000000000000000000000000000 498 00000000000000000000840000FF840000FF840000FF840000FF840000FF8400 499 00FF840000FF840000FF840000FF000000000000000000000000000000000000 500 0000000000000000000000000000000000000000000000000000000000000000 501 0000000000000000000000000000000000000000000000000000000000000000 502 0000000000000000000000000000000000000000000000000000000000000000 503 00000000000000000000FFFFFF00000000001818C0FF1818C0FFC0C0C0FF0000 504 0000000000000000000000000000000000000000000000000000000000001818 505 C0FF1818C0FFC0C0C0FFFFFFFF00000000002020C8FF2020C8FF2020C8FF2020 506 C8FFC0C0C0FF00000000000000000000000000000000000000002020C8FF2020 507 C8FFC0C0C0FF00000000FFFFFF0000000000000000002626CEFF2626CEFF2626 508 CEFF2626CEFFC0C0C0FF0000000000000000000000002626CEFF2626CEFFC0C0 509 C0FF000000000000000001010100000000000000000000000000000000002929 510 D1FF2929D1FF2929D1FFC0C0C0FF000000002929D1FFC0C0C0FF000000000000 511 0000000000000000000001010100000000000000000000000000000000000000 512 00002C2CD4FF2C2CD4FF2C2CD4FF2C2CD4FF2C2CD4FFC0C0C0FF000000000000 513 0000000000000000000001010108000000000000000000000000000000000000 514 0000000000002F2FD7FF2F2FD7FF2F2FD7FFC0C0C0FF00000000000000000000 515 0000000000000000000003030348000000000000000000000000000000000000 516 00003232DAFF3232DAFF3232DAFF3232DAFF3232DAFFC0C0C0FF000000000000 517 00000000000000000000030303A0000000000000000000000000000000003535 518 DDFF3535DDFF3535DDFFC0C0C0FF000000003535DDFF3535DDFFC0C0C0FF0000 519 00000000000000000000030303410000000000000000000000003838E0FF3838 520 E0FF3838E0FFC0C0C0FF0000000000000000000000003838E0FF3838E0FFC0C0 521 C0FF00000000000000000303030700000000000000003A3AE2FF3A3AE2FF3A3A 522 E2FFC0C0C0FF00000000000000000000000000000000000000003A3AE2FFC0C0 523 C0FF00000000000000000303030000000000000000003A3AE2FF3A3AE2FF3A3A 524 E2FFC0C0C0FF0000000000000000000000000000000000000000000000003A3A 525 E2FFC0C0C0FF00000000030303000000000000000000000000003A3AE2FFC0C0 526 C0FF000000000000000000000000000000000000000000000000000000000000 527 00000000000000000000FFFFFF00000000000000000000000000000000000000 528 0000000000000000000000000000000000000000000000000000000000000000 529 00003A3AE2FFC0C0C0FFFFFFFF00000000000000000000000000000000000000 530 0000000000000000000000000000000000000000000000000000000000000000 531 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 532 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 533 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 534 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 535 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 536 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 537 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 538 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 539 FF00FFFFFF00FFFFFF00FFFFFF000101010001010100000000000000000E0000 540 004E00000094000000B6000000C8000000C8000000B6000000940000004E0000 541 000E00000000010101000101010001010100010101010000004F070707B44D4D 542 4DD8A9A9A9EE7E7E7EF9424242FF424242FF7E7E7EF9A9A9A9EE4D4D4DD80707 543 07B40000004F01010101010101000101010801010171353535C6CACACAF0FBFB 544 FBFFA6A6A6FF9B9B9BFF383737FF383737FF383838FFA6A6A6FFFBFBFBFFCACA 545 CAF0353535C6010101710101010803030348464646BEE9E9E9F9F6F6F6FFF6F6 546 F6FFBDBDBDFFFFFFFFFF9E9B9BFF413C3CFF4C4646FF5C5C5CFFF6F6F6FFF6F6 547 F6FFE9E9E9F9464646BE03030348030303A07E7E7ED0F0F0F0FFF0F0F0FFF0F0 548 F0FF434343FFBAB2B2FF352E2EFF352E2EFF6D5F5FFF434343FFF0F0F0FFF0F0 549 F0FFF0F0F0FF7E7E7ED0030303A003030341484848B1E2E2E2F7EAEAEAFFEAEA 550 EAFF646464FF816F6FFF7A6767FF7A6767FF816F6FFF646464FFEAEAEAFFEAEA 551 EAFFE2E2E2F7484848B103030341030303070404045A3A3A3AA5C6C6C6E6E7E7 552 E7FFA2A2A2FF645D5DFF9E8484FF9E8484FF645D5DFFA2A2A2FFE7E7E7FFC6C6 553 C6E63A3A3AA50404045A030303070303030004040401040404390C0C0C805454 554 54ACAAAAAAD88C8C8CF15E5E5EFE5E5E5EFE8C8C8CF1AAAAAAD8545454AC0C0C 555 0C800404043904040401030303000303030004040400040404000404040A0404 556 0435040404650404047B04040488040404880404047B04040465040404350404 557 040A040404000404040003030300FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 558 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 559 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 560 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 561 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 562 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 563 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 564 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 565 FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 566 0000000000000000000000000000000000000000000000000000000000000000 567 000000000000000000000000000000000000000000FF000000FF000000FF0000 568 00FF000000FF000000FF000000FF000000FF0000000000000000000000000000 569 000000000000000000000000000000000000000000FF000000FFFFFFFFFFFFFF 570 FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000000000000000000000000000 571 000000000000000000000000000000000000000000FF008484FF000000FFFFFF 572 FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000000000000000000000000000 573 0000840000FF000000000000000000000000000000FF008484FF008484FF0000 574 00FFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000000000000000000000008400 575 00FF840000FF000000000000000000000000000000FF008484FF008484FF0084 576 84FF000000FFFFFFFFFFFFFFFFFF000000FF0000000000000000840000FF8400 577 00FF840000FF840000FF840000FF00000000000000FF008484FF008484FF0084 578 84FF000000FFFFFFFFFFFFFFFFFF000000FF00000000840000FF840000FF8400 579 00FF840000FF840000FF840000FF00000000000000FF008484FF008484FF0084 580 84FF000000FFFFFFFFFFFFFFFFFF000000FF0000000000000000840000FF8400 581 00FF840000FF840000FF840000FF00000000000000FF008484FF008484FF0084 582 84FF000000FFFFFFFFFFFFFFFFFF000000FF0000000000000000000000008400 583 00FF840000FF000000000000000000000000000000FF008484FF008484FF0000 584 00FF000000FFFFFFFFFFFFFFFFFF000000FF0000000000000000000000000000 585 0000840000FF000000000000000000000000000000FF008484FF008484FF0084 586 84FF000000FFFFFFFFFFFFFFFFFF000000FF0000000000000000000000000000 587 0000000000000000000000000000000000FF000000FF008484FF008484FF0084 588 84FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 589 00FF0000000000000000000000000000000000000000000000FF008484FF0084 590 84FF000000FF0000000000000000000000000000000000000000000000000000 591 0000000000000000000000000000000000000000000000000000000000FF0084 592 84FF000000FF0000000000000000000000000000000000000000000000000000 593 0000000000000000000000000000000000000000000000000000000000000000 594 00FF000000FF0000000000000000000000000000000000000000000000000000 595 0000000000000000000000000000000000000000000000000000000000000000 596 0000000000FF0000000000000000000000000000000000000000000000000000 597 0000000000000000000000000000858A8899858A88FF858A88FF858A88FF858A 598 88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A 599 88FF858A88FF858A88FF858A8899858A88FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 600 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 601 FFFFFFFFFFFFFFFFFFFF858A88FF858A88FFFFFFFFFFA46534FFA46534FFA465 602 34FFA46534FFECEEEEFFECEEEEFFEEEFEFFFEDEFEFFFA46534FFA46534FFA465 603 34FFA46534FFFFFFFFFF858A88FF858A88FFFFFFFFFFA46534FFA46534FFA567 604 36FFECEEEEFFECEEEEFFECEEEFFFEEF0F0FFEEF0F0FFEEF0F0FFA56736FFA465 605 34FFA46534FFFFFFFFFF858A88FF858A88FFFFFFFFFFA46534FFA56736FFAA70 606 43FFB4845FFFEEEFEFFFEEEFEFFFF0F1F1FFF0F1F1FFAE784EFFA96E40FFA568 607 38FFA46534FFFFFFFFFF858A88FF858A88FFFFFFFFFFA46635FFEDEFEFFFB382 608 5CFFC39F83FFCFB6A2FFEEF0F0FFF0F2F1FFCCB099FFC0987AFFB27F57FFF1F3 609 F3FFA56737FFFFFFFFFF858A88FF858A88FFFFFFFFFFEFF0F0FFEFF0F0FFEFF1 610 F1FFCFB4A0FFD8C7B9FFE0D3C9FFE2D7CDFFDCCBBDFFCFB49FFFF2F4F4FFF3F4 611 F3FFF2F4F4FFFFFFFFFF858A88FF858A88FFFFFFFFFFEFF1F1FFF0F1F1FFF0F1 612 F2FFF0F2F1FFDFD2C7FFF0F2F2FFF2F3F4FFE2D7CEFFF3F4F5FFF3F4F5FFF3F5 613 F5FFF4F5F4FFFFFFFFFF858A88FF858A88FFFFFFFFFFF3F5F5FFF3F5F5FFF4F5 614 F5FFF4F5F6FFE3D7CCFFF5F5F6FFF6F7F7FFEAE1D9FFF7F8F8FFF8F9F8FFF7F9 615 F9FFF8F8F9FFFFFFFFFF858A88FF858A88FFFFFFFFFFF5F6F6FFF4F6F6FFF6F6 616 F7FFCAAA90FFDBC7B7FFE6DBD3FFEAE2DBFFE4D6CAFFD4BAA6FFF8F9F9FFF9FA 617 FAFFF9F9F9FFFFFFFFFF858A88FF858A88FFFFFFFFFFA46635FFF6F7F7FFAE77 618 4CFFB98B67FFC9A68BFFF7F8F8FFF9F9F9FFD1B59EFFBD916FFFAE764BFFF9FA 619 FAFFA46534FFFFFFFFFF858A88FF858A88FFFFFFFFFFA46534FFA46636FFA76A 620 3BFFAB7246FFF8F9F8FFF8F9F9FFFAFAFAFFFAFAFBFFAA7043FFA56737FFA465 621 34FFA46534FFFFFFFFFF858A88FF858A88FFFFFFFFFFA46534FFA46534FFA465 622 34FFF9FAFAFFF9F9F9FFF9FAF9FFFBFBFBFFFBFBFCFFFBFBFCFFA46534FFA465 623 34FFA46534FFFFFFFFFF858A88FF858A88FFFFFFFFFFA46534FFA46534FFA465 624 34FFA46534FFFAFBFBFFFAFBFBFFFCFCFDFFFDFCFCFFA46534FFA46534FFA465 625 34FFA46534FFFFFFFFFF858A88FF858A88FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 626 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 627 FFFFFFFFFFFFFFFFFFFF858A88FF8186849D858A88FF858A88FF858A88FF858A 628 88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A 629 88FF858A88FF858A88FF7F8382A0 404 630 } 405 631 end 406 632 object MainMenu1: TMainMenu 633 Images = ImageListActions 407 634 left = 456 408 635 top = 120 -
trunk/Forms/UFormMain.pas
r42 r43 9 9 StdCtrls, ActnList, Menus, ExtCtrls, USqlDatabase, DOM, XMLRead, XMLWrite, 10 10 UPersistentForm, UTreeState, SpecializedList, SpecializedDictionary, 11 URegistry, U System, UFormItemList;11 URegistry, UCoolTranslator, USystem, UFormItemList; 12 12 13 13 type … … 112 112 UFormItemView, UFormItemEdit, UFormItemAdd, UFormLogin, UFormSetting, UApplicationInfo, 113 113 UCore, UFormImportStructure, UFormAbout, UFormLoginProfile, UChronisClientDirect, 114 UChronisClient ;114 UChronisClient, UChronisClientMySQL, UChronisClientXMLRPC; 115 115 116 116 {$R *.lfm} … … 155 155 procedure TMainForm.UpdateInterface; 156 156 begin 157 ADisconnect.Enabled := Core.System.Client.Connected;158 AConnect.Enabled := not Core.System.Client.Connected;159 AImportStructure.Enabled := Core.System.Client.Connected;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; 160 160 if Assigned(MainPanelForm) then 161 161 Caption := MainPanelForm.Caption + ' - ' + ApplicationInfo.Name 162 else Caption := 162 else Caption := ApplicationInfo.Name; 163 163 Application.Title := Caption; 164 if Assigned(Core. System.Client) then165 with Core. System.Client do164 if Assigned(Core.Client) then 165 with Core.Client do 166 166 StatusBar1.Panels[0].Text := User + '@' + Host + ':' + IntToStr(Port) + '/' + Schema; 167 167 end; … … 258 258 procedure TMainForm.AImportStructureExecute(Sender: TObject); 259 259 begin 260 ImportStructureForm.ShowModal; 260 try 261 ImportStructureForm := TImportStructureForm.Create(MainForm); 262 ImportStructureForm.ShowModal; 263 finally 264 ImportStructureForm.Free; 265 end; 261 266 end; 262 267 … … 268 273 if LoginForm.ShowModal = mrOK then begin 269 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; 270 280 Core.System.Client.Host := HostName; 271 281 Core.System.Client.Schema := Database; … … 273 283 Core.System.Client.Password := Core.LastPassword; 274 284 Core.System.Client.Port := Port; 275 if Protocol = cpDirect then Core.Client := TChronisClientDirect.Create;276 285 end; 277 286 try … … 292 301 procedure TMainForm.ADisconnectExecute(Sender: TObject); 293 302 begin 303 if Assigned(Core.System.Client) then 294 304 if Core.System.Client.Connected then begin 295 305 Core.System.Client.Disconnect; -
trunk/Languages/chronis.cs.po
r42 r43 108 108 msgstr "Přidat" 109 109 110 #: titemlistform.aitemclone.caption 111 msgid "Clone" 112 msgstr "Duplikovat" 113 110 114 #: titemlistform.aitemdelete.caption 111 115 msgctxt "TITEMLISTFORM.AITEMDELETE.CAPTION" … … 407 411 msgstr "Verze" 408 412 413 #: uchronisclient.sclientnotset 414 msgid "Client not set" 415 msgstr "Nenastaven klient" 416 417 #: uchronisclientmysql.smissingbasetype 418 msgid "Missing base typ for %s" 419 msgstr "Chybějící základní typ pro %s" 420 421 #: uchronisclientmysql.sundefinedtype 422 msgid "Undefinned type %s" 423 msgstr "Neurčený typ %s" 424 409 425 #: uformabout.sapplicationname 410 426 msgctxt "uformabout.sapplicationname" … … 442 458 msgstr "Profil" 443 459 460 #: uformloginprofile.sprotocoldirect 461 msgid "Direct" 462 msgstr "Přímé" 463 464 #: uformloginprofile.sprotocolmysql 465 msgid "MySQL" 466 msgstr "MySQL" 467 444 468 #: uformloginprofile.sprotocolxmlrpc 445 469 msgctxt "uformloginprofile.sprotocolxmlrpc" -
trunk/Languages/chronis.po
r42 r43 96 96 msgstr "" 97 97 98 #: titemlistform.aitemclone.caption 99 msgid "Clone" 100 msgstr "" 101 98 102 #: titemlistform.aitemdelete.caption 99 103 msgctxt "TITEMLISTFORM.AITEMDELETE.CAPTION" … … 385 389 msgstr "" 386 390 391 #: uchronisclient.sclientnotset 392 msgid "Client not set" 393 msgstr "" 394 395 #: uchronisclientmysql.smissingbasetype 396 msgid "Missing base typ for %s" 397 msgstr "" 398 399 #: uchronisclientmysql.sundefinedtype 400 msgid "Undefinned type %s" 401 msgstr "" 402 387 403 #: uformabout.sapplicationname 388 404 msgctxt "uformabout.sapplicationname" … … 420 436 msgstr "" 421 437 438 #: uformloginprofile.sprotocoldirect 439 msgid "Direct" 440 msgstr "" 441 442 #: uformloginprofile.sprotocolmysql 443 msgid "MySQL" 444 msgstr "" 445 422 446 #: uformloginprofile.sprotocolxmlrpc 423 447 msgctxt "uformloginprofile.sprotocolxmlrpc" -
trunk/Module/UModuleSystem.pas
r37 r43 149 149 150 150 procedure TModuleSystem.InitStructure; 151 var 152 StructureVersion: string; 153 Data: TDictionaryStringString; 154 ObjectId: Integer; 155 Tables: TListString; 156 I: Integer; 157 NewProxy: TListProxy; 158 begin 159 with TChronisBase(System) do 151 begin 152 with TChronisBase(System).Client do 160 153 try 161 Tables := TListString.Create; 162 Data := TDictionaryStringString.Create; 163 164 NewProxy := TListProxy.Create; 165 NewProxy.SchemaName := 'information_schema'; 166 NewProxy.ObjectName := 'TABLES'; 167 NewProxy.Condition := 'TABLE_SCHEMA = "' + Client.Schema + '"'; 168 NewProxy.Load; 169 //Database.Query(DbRows, 'SHOW TABLES'); 170 Tables.Count := NewProxy.Objects.Count; 171 for I := 0 to NewProxy.Objects.Count - 1 do 172 Tables[I] := TObjectProxy(NewProxy.Objects[I]).Properties.Values['TABLE']; 173 174 (* if Tables.IndexOf(ObjectTable) = -1 then begin 175 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + ObjectTable + '` ( ' + 176 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 177 '`Name` varchar(255) NOT NULL,' + 178 '`Schema` varchar(255) NOT NULL,' + 179 '`Table` varchar(255) NOT NULL,' + 180 '`PrimaryKey` varchar(255) NOT NULL DEFAULT "Id", ' + 181 '`Sequence` int(11) NOT NULL DEFAULT 0,' + 182 '`Group` int(11) NOT NULL,' + 183 'KEY `Group` (`Group`),' + 184 'PRIMARY KEY (`Id`)' + 185 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 186 187 end; 188 189 if Tables.IndexOf(ObjectGroupTable) = -1 then begin 190 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + ObjectGroupTable + '` ( ' + 191 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 192 '`Name` varchar(255) NOT NULL,' + 193 '`Parent` int(11) NOT NULL DEFAULT 0,' + 194 '`Sequence` int(11) NOT NULL DEFAULT 0,' + 195 'KEY `Parent` (`Parent`),' + 196 'PRIMARY KEY (`Id`)' + 197 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 198 end; 199 200 if Tables.IndexOf(PropertyTable) = -1 then begin 201 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + PropertyTable + '` ( ' + 202 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 203 '`Name` varchar(255) NOT NULL,' + 204 '`Object` int(11) NOT NULL,' + 205 '`PropertyGroup` int(11) NOT NULL DEFAULT 0,' + 206 '`CustomType` int(11) NOT NULL,' + 207 '`Editable` bool NOT NULL DEFAULT 1,' + 208 '`ColumnName` varchar(255) NOT NULL,' + 209 'KEY `Object` (`Object`),' + 210 'KEY `PropertyGroup` (`PropertyGroup`),' + 211 'KEY `CustomType` (`CustomType`),' + 212 'PRIMARY KEY (`Id`)' + 213 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 214 end; 215 if Tables.IndexOf(PropertyTypeTable) = -1 then begin 216 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + PropertyTypeTable + '` ( ' + 217 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 218 '`Name` varchar(255) NOT NULL,' + 219 '`DbType` varchar(255) NOT NULL,' + 220 'PRIMARY KEY (`Id`)' + 221 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 222 end; 223 224 if Tables.IndexOf(PropertyGroupTable) = -1 then begin 225 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + PropertyGroupTable + '` ( ' + 226 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 227 '`Name` varchar(255) NOT NULL,' + 228 '`Object` int(11) NOT NULL,' + 229 'KEY `Object` (`Object`),' + 230 'PRIMARY KEY (`Id`)' + 231 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 232 end; 233 234 if Tables.IndexOf(EnumerationState) = -1 then begin 235 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + EnumerationState + '` ( ' + 236 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 237 '`Enumeration` int(11) NOT NULL,' + 238 '`Name` varchar(255) NOT NULL,' + 239 '`Sequence` int(11) NOT NULL DEFAULT 0,' + 240 'KEY `Enumeration` (`Enumeration`),' + 241 'PRIMARY KEY (`Id`)' + 242 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 243 end; 244 245 if Tables.IndexOf(Enumeration) = -1 then begin 246 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + Enumeration + '` ( ' + 247 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 248 '`Name` varchar(255) NOT NULL,' + 249 'PRIMARY KEY (`Id`)' + 250 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 251 end; 252 253 if Tables.IndexOf(TypeEnumeration) = -1 then begin 254 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeEnumeration + '` ( ' + 255 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 256 '`Enumeration` int(11) NOT NULL,' + 257 'KEY `Enumeration` (`Enumeration`),' + 258 'PRIMARY KEY (`Id`)' + 259 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 260 end; 261 262 if Tables.IndexOf(TypeRelationOne) = -1 then begin 263 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeRelationOne + '` ( ' + 264 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 265 '`CustomType` int(11) NOT NULL,' + 266 '`Object` int(11) NOT NULL,' + 267 'KEY `CustomType` (`CustomType`),' + 268 'PRIMARY KEY (`Id`)' + 269 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 270 end; 271 272 if Tables.IndexOf(TypeRelationMany) = -1 then begin 273 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeRelationMany + '` ( ' + 274 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 275 '`CustomType` int(11) NOT NULL,' + 276 '`ObjectProperty` int(11) NOT NULL,' + 277 'KEY `CustomType` (`CustomType`),' + 278 'PRIMARY KEY (`Id`)' + 279 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 280 end; 281 282 if Tables.IndexOf(TypeFile) = -1 then begin 283 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeFile + '` ( ' + 284 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 285 '`Name` varchar(255) NOT NULL,' + 286 '`Size` int(11) NOT NULL,' + 287 'PRIMARY KEY (`Id`)' + 288 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 289 end; 290 291 if Tables.IndexOf(TypeGPS) = -1 then begin 292 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeGPS + '` ( ' + 293 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 294 '`Latitude` double NOT NULL,' + 295 '`Longitude` double NOT NULL,' + 296 'PRIMARY KEY (`Id`)' + 297 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 298 end; 299 300 if Tables.IndexOf(CustomTypeTableName) = -1 then begin 301 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + CustomTypeTableName + '` ( ' + 302 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 303 '`Type` int NOT NULL,' + 304 'KEY `Type` (`Type`),' + 305 'PRIMARY KEY (`Id`)' + 306 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 307 end; 308 309 if Tables.IndexOf(TypeNumber) = -1 then begin 310 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeNumber + '` ( ' + 311 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 312 '`CustomType` int NOT NULL,' + 313 '`Default` int NOT NULL,' + 314 '`Min` int NOT NULL,' + 315 '`Max` int NOT NULL,' + 316 'KEY `CustomType` (`CustomType`),' + 317 'PRIMARY KEY (`Id`)' + 318 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 319 end; 320 321 if Tables.IndexOf(TypeFloat) = -1 then begin 322 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeFloat + '` ( ' + 323 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 324 '`CustomType` int NOT NULL,' + 325 '`Default` float NOT NULL,' + 326 '`Min` float NOT NULL,' + 327 '`Max` float NOT NULL,' + 328 'KEY `CustomType` (`CustomType`),' + 329 'PRIMARY KEY (`Id`)' + 330 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 331 end; 332 333 if Tables.IndexOf(TypeDateTime) = -1 then begin 334 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeDateTime + '` ( ' + 335 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 336 '`CustomType` int NOT NULL,' + 337 '`Default` datetime NOT NULL,' + 338 '`Min` datetime NOT NULL,' + 339 '`Max` datetime NOT NULL,' + 340 'KEY `CustomType` (`CustomType`),' + 341 'PRIMARY KEY (`Id`)' + 342 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 343 end; 344 345 if Tables.IndexOf(TypeString) = -1 then begin 346 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeString + '` ( ' + 347 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 348 '`CustomType` int NOT NULL,' + 349 '`Default` VARCHAR(255) NOT NULL,' + 350 '`MaxLength` int NOT NULL,' + 351 'KEY `CustomType` (`CustomType`),' + 352 'PRIMARY KEY (`Id`)' + 353 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 354 end; 355 356 if Tables.IndexOf(ModuleTable) = -1 then begin 357 Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + ModuleTable + '` ( ' + 358 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 359 '`Name` VARCHAR(255) NOT NULL,' + 360 '`Author` VARCHAR(255) NOT NULL,' + 361 '`Website` VARCHAR(255) NOT NULL,' + 362 '`Version` VARCHAR(255) NOT NULL,' + 363 '`License` VARCHAR(255) NOT NULL,' + 364 '`Description` TEXT NOT NULL,' + 365 'PRIMARY KEY (`Id`)' + 366 ') ENGINE=InnoDB DEFAULT CHARSET=utf8'); 367 end; *) 154 with Types.AddType(ObjectTable) do begin 155 with Properties do begin 156 Add('Name', 'String'); 157 Add('Schema', 'String'); 158 Add('Table', 'String'); 159 Add('PrimaryKey', 'String'); 160 Add('Sequence', 'Integer'); 161 Add('Group', 'RelationOne'); 162 end; 163 end; 164 165 with Types.AddType(ObjectGroupTable) do begin 166 with Properties do begin 167 Add('Name', 'String'); 168 Add('Schema', 'String'); 169 Add('Parent', 'RelationOne'); 170 Add('Sequence', 'Integer'); 171 end; 172 end; 173 174 with Types.AddType(PropertyTable) do begin 175 with Properties do begin 176 Add('Name', 'String'); 177 Add('Object', 'RelationOne'); 178 Add('PropertyGroup', 'RelationOne'); 179 Add('CustomType', 'RelationOne'); 180 Add('Editable', 'Boolean'); 181 Add('ColumnName', 'String'); 182 end; 183 end; 184 185 with Types.AddType(PropertyTypeTable) do begin 186 with Properties do begin 187 Add('Name', 'String'); 188 Add('DbType', 'String'); 189 end; 190 end; 191 192 with Types.AddType(PropertyGroupTable) do begin 193 with Properties do begin 194 Add('Name', 'String'); 195 Add('Object', 'RelationOne'); 196 end; 197 end; 198 199 with Types.AddType(EnumerationState) do begin 200 with Properties do begin 201 Add('Enumeration', 'RelationOne'); 202 Add('Name', 'String'); 203 Add('Sequence', 'Integer'); 204 end; 205 end; 206 207 with Types.AddType(Enumeration) do begin 208 with Properties do begin 209 Add('Name', 'String'); 210 end; 211 end; 212 213 with Types.AddType(TypeEnumeration) do begin 214 with Properties do begin 215 Add('Enumeration', 'RelationOne'); 216 end; 217 end; 218 219 with Types.AddType(TypeRelationOne) do begin 220 with Properties do begin 221 Add('CustomType', 'RelationOne'); 222 Add('Object', 'Integer'); 223 end; 224 end; 225 226 with Types.AddType(TypeRelationMany) do begin 227 with Properties do begin 228 Add('CustomType', 'RelationOne'); 229 Add('ObjectProperty', 'Integer'); 230 end; 231 end; 232 233 with Types.AddType(TypeFile) do begin 234 with Properties do begin 235 Add('Name', 'String'); 236 Add('Size', 'Integer'); 237 end; 238 end; 239 240 with Types.AddType(TypeGPS) do begin 241 with Properties do begin 242 Add('Latitude', 'Double'); 243 Add('Longitude', 'Double'); 244 end; 245 end; 246 247 with Types.AddType(CustomTypeTableName) do begin 248 with Properties do begin 249 Add('Type', 'RelationOne'); 250 end; 251 end; 252 253 with Types.AddType(TypeNumber) do begin 254 with Properties do begin 255 Add('CustomType', 'RelationOne'); 256 Add('Default', 'Integer'); 257 Add('Min', 'Integer'); 258 Add('Max', 'Integer'); 259 end; 260 end; 261 262 with Types.AddType(TypeFloat) do begin 263 with Properties do begin 264 Add('CustomType', 'RelationOne'); 265 Add('Default', 'Double'); 266 Add('Min', 'Double'); 267 Add('Max', 'Double'); 268 end; 269 end; 270 271 with Types.AddType(TypeDateTime) do begin 272 with Properties do begin 273 Add('CustomType', 'RelationOne'); 274 Add('Default', 'DateTime'); 275 Add('Min', 'DateTime'); 276 Add('Max', 'DateTime'); 277 end; 278 end; 279 280 with Types.AddType(TypeString) do begin 281 with Properties do begin 282 Add('CustomType', 'RelationOne'); 283 Add('Default', 'String'); 284 Add('MaxLength', 'Integer'); 285 end; 286 end; 287 288 with Types.AddType(ModuleTable) do begin 289 with Properties do begin 290 Add('Name', 'String'); 291 Add('Author', 'String'); 292 Add('Website', 'String'); 293 Add('Version', 'String'); 294 Add('License', 'String'); 295 Add('Description', 'Text'); 296 end; 297 end; 298 299 CheckTypes; 368 300 finally 369 Tables.Free;370 Data.Free;371 NewProxy.Free;372 301 end; 373 302 end; -
trunk/UCore.lfm
r38 r43 9 9 object CoolTranslator1: TCoolTranslator 10 10 POFilesFolder = 'Languages' 11 OnTranslate = CoolTranslator1Translate 11 12 left = 103 12 13 top = 55 … … 16 17 FileName = 'DebugLog.txt' 17 18 MaxCount = 100 18 left = 1 7619 top = 1 2119 left = 104 20 top = 104 20 21 end 21 22 end -
trunk/UCore.pas
r42 r43 16 16 CoolTranslator1: TCoolTranslator; 17 17 DebugLog1: TDebugLog; 18 procedure CoolTranslator1Translate(Sender: TObject); 18 19 procedure DataModuleCreate(Sender: TObject); 19 20 procedure DataModuleDestroy(Sender: TObject); … … 55 56 LoadFromRegistry; 56 57 System := TChronisBase.Create; 57 System.Client := TChronisClientMySQL.Create;58 58 //TChronisClientMySQL(System.Client).Database := SqlDatabase1; 59 59 System.RegisterModule(TModuleSystem); … … 63 63 DebugLog1.WriteToFileEnable := True; 64 64 {$ENDIF} 65 end; 66 67 procedure TCore.CoolTranslator1Translate(Sender: TObject); 68 begin 69 UFormLoginProfile.UpdateTranslation; 65 70 end; 66 71 -
trunk/USystem.pas
r42 r43 665 665 Types := TChronisTypeList.Create; 666 666 Modules := TListObject.Create; 667 Client := nil;668 667 end; 669 668 … … 672 671 FreeAndNil(Types); 673 672 FreeAndNil(Modules); 674 FreeAndNil(Client);675 673 inherited Destroy; 676 674 end; -
trunk/chronis.lpi
r42 r43 291 291 <StackChecks Value="True"/> 292 292 </Checks> 293 <VerifyObjMethodCallValidity Value="True"/>294 293 </CodeGeneration> 295 294 <Linking>
Note:
See TracChangeset
for help on using the changeset viewer.