починил редактирование интеграций

This commit is contained in:
PC1\PTyTb
2025-08-08 00:57:37 +03:00
parent f125d23fcc
commit 7d9eaaac4e
4 changed files with 138 additions and 92 deletions
+55 -76
View File
@@ -35,11 +35,11 @@ type
procedure UpdateGridFromArray;
procedure AddChat(newRecord: TOBSChat);
procedure EdtChat(newRecord: TOBSChat);
procedure EdtChat(newRecord: TOBSChat; oldPort: Integer);
procedure DelChat(aPort: Integer);
procedure AddNotify(newRecord: TOBSNotify);
procedure EdtNotify(newRecord: TOBSNotify);
procedure EdtNotify(newRecord: TOBSNotify; oldPort: Integer);
procedure DelNotify(aPort: Integer);
procedure AddKandinsky(newRecord: TOBSKandinsky);
@@ -90,7 +90,7 @@ begin
dport := strtoint(sgWebChats.Cells[0, i]) + 1;
end;
fCreateChat.sbWebServerPort.Value := dport;
fCreateChat.isEdit:=false;
fCreateChat.isEdit := false;
fCreateChat.Show;
end;
@@ -122,7 +122,7 @@ begin
dport := strtoint(sgWebChats.Cells[0, i]) + 1;
end;
fCreateNotify.sbWebServerPort.Value := dport;
fCreateNotify.isEdit:=false;
fCreateNotify.isEdit := false;
fCreateNotify.Show;
end;
@@ -175,7 +175,7 @@ begin
if listKandinsky[i].port = aPort then
begin
// Ñäâèãàåì ýëåìåíòû ìàññèâà
for j := i to High(listKandinsky) - 1 do
for j := i to High(listKandinsky) do
listKandinsky[j] := listKandinsky[j + 1];
// Óìåíüøàåì ðàçìåð ìàññèâà
SetLength(listKandinsky, Length(listKandinsky) - 1);
@@ -197,7 +197,7 @@ begin
if listNotify[i].port = aPort then
begin
// Ñäâèãàåì ýëåìåíòû ìàññèâà
for j := i to High(listNotify) - 1 do
for j := i to High(listNotify) do
listNotify[j] := listNotify[j + 1];
// Óìåíüøàåì ðàçìåð ìàññèâà
SetLength(listNotify, Length(listNotify) - 1);
@@ -210,87 +210,66 @@ begin
db.SaveRecordArray<TOBSNotify>('listNotify', listNotify);
end;
procedure TfrOBS.EdtChat(newRecord: TOBSChat);
procedure TfrOBS.EdtChat(newRecord: TOBSChat; oldPort: Integer);
var
rChat: TOBSChat;
SavedColor: TAlphaColor;
i: Integer;
begin
rChat:= newRecord;
if TryStrToUInt('$' + rChat.ColorBlock, Cardinal(SavedColor)) then
fCreateChat.frChatSettings1.cpStyleBlockColor.Color := SavedColor
else
fCreateChat.frChatSettings1.cpStyleBlockColor.Color := TAlphaColorRec.Black;
fCreateChat.frChatSettings1.ccbStyleBorderColor.ItemIndex :=
rChat.ColorBorder;
fCreateChat.frChatSettings1.ccbBColor.ItemIndex := rChat.ColorBackground;
fCreateChat.frChatSettings1.sbStyleBlockBorderSize.Value := rChat.SolidBorder;
fCreateChat.frChatSettings1.sbStyleBlockPadding.Value := rChat.Paddings;
fCreateChat.frFontSettings1.ccbFontColor.ItemIndex := rChat.ColorFont;
fCreateChat.frFontSettings1.sbFontSize.Value := rChat.SizeFont;
fCreateChat.frFontSettings1.cbFontStyleDefault.ItemIndex := rChat.StyleFont;
fCreateChat.sbTimeMsg.Value := rChat.TimeMess;
fCreateChat.sbMaxMsg.Value := rChat.MaxCountMess;
fCreateChat.sbWebServerPort.Value := rChat.port;
fCreateChat.Show;
for i := 0 to High(listChats) do
if listChats[i].port = oldPort then
begin
listChats[i] := newRecord;
UpdateGridFromArray;
db.SaveRecordArray<TOBSChat>('listChats', listChats);
Break;
end;
end;
procedure TfrOBS.EdtNotify(newRecord: TOBSNotify);
procedure TfrOBS.EdtNotify(newRecord: TOBSNotify; oldPort: Integer);
var
OBSNotify: TOBSNotify;
SavedColor: TAlphaColor;
i: Integer;
begin
OBSNotify:=newRecord;
with OBSNotify do
begin
fCreateNotify.edtESImage.Text := Picture;
fCreateNotify.edtESSound.Text := Sound;
if TryStrToUInt('$' + ColorBlock, Cardinal(SavedColor)) then
fCreateNotify.frColorSettings1.cpStyleBlockColor.Color := SavedColor
else
fCreateNotify.frColorSettings1.cpStyleBlockColor.Color :=
TAlphaColorRec.Black;
// fCreateNotify. ColorBlock:= GetColorFromColorPanel(frColorSettings1.cpStyleBlockColor.Color);
fCreateNotify.frColorSettings1.sbStyleBlockBorderSize.Value := SolidBorder;
fCreateNotify.frColorSettings1.sbStyleBlockPadding.Value := Paddings;
fCreateNotify.frColorSettings1.ccbStyleBorderColor.ItemIndex := ColorBorder;
fCreateNotify.frColorSettings1.ccbBColor.ItemIndex := ColorBackground;
fCreateNotify.edtESTitle.Text := HeaderText;
fCreateNotify.frFontSettings2.ccbFontColor.ItemIndex := HeaderColorFont;
fCreateNotify.frFontSettings2.sbFontSize.Value := HeaderSizeFont;
fCreateNotify.frFontSettings2.cbFontStyleDefault.ItemIndex :=
HeaderStyleFont;
fCreateNotify.edtESMessage.Text := MessText;
fCreateNotify.frFontSettings3.ccbFontColor.ItemIndex := MessColorFont;
fCreateNotify.frFontSettings3.sbFontSize.Value := MessSizeFont;
fCreateNotify.frFontSettings3.cbFontStyleDefault.ItemIndex := MessStyleFont;
fCreateNotify.sbTimeMsg.Value := TimeMess;
fCreateNotify.cbEventsType.ItemIndex := TypeEvent;
fCreateNotify.edtIF.Text := TypeEdit;
fCreateNotify.sbWebServerPort.Value := port;
end;
for i := 0 to High(listNotify) do
if listNotify[i].port = oldPort then
begin
listNotify[i] := newRecord;
UpdateGridFromArray;
db.SaveRecordArray<TOBSNotify>('listNotify', listNotify);
Break;
end;
end;
procedure TfrOBS.sgWebChatsCellDblClick(const Column: TColumn;
const Row: Integer);
var
myChatRec: TOBSChat;
myNotifyRec: TOBSNotify;
i: Integer;
begin
if sgWebChats.Cells[1,row] = 'Îïîâåùåíèå' then
begin
fCreateNotify.isEdit:=true;
fCreateNotify.Show;
end;
if sgWebChats.Cells[1,row] = '×àò' then
begin
fCreateChat.isEdit:=true;
fCreateChat.Show;
end;
if sgWebChats.Cells[1, Row] = 'Îïîâåùåíèå' then
begin
for i := 0 to High(listNotify) do
if listNotify[i].port = (strtoint(sgWebChats.Cells[0, Row])) then
begin
myNotifyRec := listNotify[i];
Break;
end;
fCreateNotify.isEdit := true;
fCreateNotify.setRecord(myNotifyRec);
fCreateNotify.Show;
end;
if sgWebChats.Cells[1, Row] = '×àò' then
begin
for i := 0 to High(listChats) do
if listChats[i].port = (strtoint(sgWebChats.Cells[0, Row])) then
begin
myChatRec := listChats[i];
Break;
end;
fCreateChat.isEdit := true;
fCreateChat.setRecord(myChatRec);
fCreateChat.Show;
end;
end;
procedure TfrOBS.UpdateGridFromArray;