diff --git a/src/base/SAKBaseListWidgetItemWidget.cc b/src/base/SAKBaseListWidgetItemWidget.cc index 5e0b4d23e16912abd2343549ea973fe8e9da42a4..47bdd5ea1542fbc57e5da5f54dacd4d464c4af50 100644 --- a/src/base/SAKBaseListWidgetItemWidget.cc +++ b/src/base/SAKBaseListWidgetItemWidget.cc @@ -20,6 +20,7 @@ SAKBaseListWidgetItemWidget::SAKBaseListWidgetItemWidget(QWidget *parent) SAKBaseListWidgetItemWidget::SAKBaseListWidgetItemWidget(quint64 id, QWidget *parent) :QWidget(parent) ,mId(id) + ,mEnable(false) { } diff --git a/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponse.cc b/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponse.cc index 00e53ea5862b19bd83eeccd2341f4360d63feace..973f2dec275617035d4b2e0659621642557c2efa 100644 --- a/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponse.cc +++ b/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponse.cc @@ -195,6 +195,16 @@ void SAKDebuggerPluginAutoResponse::connectSignalsToSlots(QWidget *itemWidget) QVariant::fromValue(description)); }); + connect(cookedItemWidget, + &SAKDebuggerPluginAutoResponseItem::enableChanged, + this, + [&](quint64 id, bool enable){ + updateRecord(id, + mTableCtx.columns.enable, + QVariant::fromValue(enable)); + + }); + connect(cookedItemWidget, &SAKDebuggerPluginAutoResponseItem::referenceTextChanged, this, diff --git a/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponseItem.cc b/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponseItem.cc index ff9910077ee70c261d1df657738551d66741955a..44a93785fb14ac54bc29ba02e1a7ce95957decdb 100644 --- a/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponseItem.cc +++ b/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponseItem.cc @@ -155,6 +155,13 @@ void SAKDebuggerPluginAutoResponseItem::setupItem() emit descriptionChanged(id(), description); }); + connect(mUi->enableCheckBox, &QCheckBox::clicked, + this, [&](){ + bool enable = mUi->enableCheckBox->isChecked(); + setEnable(enable); + emit enableChanged(id(), enable); + }); + connect(mUi->referenceDataLineEdit, &QLineEdit::textChanged, this, [&](const QString description){ emit referenceTextChanged(id(), description); @@ -203,6 +210,8 @@ void SAKDebuggerPluginAutoResponseItem::setupItem() this, [&](int interval){ emit delayTimeChanged(id(), interval); }); + + setEnable(mUi->enableCheckBox->isChecked()); } bool SAKDebuggerPluginAutoResponseItem::needToResponse(QByteArray receiveData, diff --git a/src/debuggers/tcp/client/SAKTcpClientDevice.cc b/src/debuggers/tcp/client/SAKTcpClientDevice.cc index 834bae51f143fd34d4900715a50196006519516a..fe65285dfcd30da29e10dc02d0155cc2edfccef1 100644 --- a/src/debuggers/tcp/client/SAKTcpClientDevice.cc +++ b/src/debuggers/tcp/client/SAKTcpClientDevice.cc @@ -93,10 +93,10 @@ bool SAKTcpClientDevice::initialize() emit errorOccurred(QString("Connection has been closed!")); }); connect(mTcpSocket, -#if QT_VERSION > QT_VERSION_CHECK(5, 14, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QOverload::of(&QTcpSocket::error), -#else +#if QT_VERSION > QT_VERSION_CHECK(5, 14, 0) &QTcpSocket::errorOccurred, +#else + QOverload::of(&QTcpSocket::error), #endif this, [=](QAbstractSocket::SocketError err){ if (err != QAbstractSocket::RemoteHostClosedError) {