add: added default outbound Combobox UI

This commit is contained in:
QwQ 2020-08-02 11:31:33 +08:00
parent 08a5d3d30b
commit 8fd9b3baf5
No known key found for this signature in database
GPG Key ID: E7FAEFAFCD031D4B
3 changed files with 11 additions and 4 deletions

View File

@ -1 +1 @@
5840
5841

View File

@ -93,6 +93,7 @@ RouteEditor::RouteEditor(QJsonObject connection, QWidget *parent) : QvDialog(par
connect(nodeDispatcher.get(), &NodeDispatcher::OnRuleCreated, this, &RouteEditor::OnDispatcherRuleCreated);
connect(nodeDispatcher.get(), &NodeDispatcher::OnInboundOutboundNodeHovered, this, &RouteEditor::OnDispatcherInboundOutboundHovered);
connect(nodeDispatcher.get(), &NodeDispatcher::RequestEditChain, this, &RouteEditor::OnDispatcherEditChainRequested);
connect(nodeDispatcher.get(), &NodeDispatcher::OnObjectTagChanged, this, &RouteEditor::OnDispatcherObjectTagChanged);
//
{
//
@ -166,7 +167,8 @@ void RouteEditor::OnDispatcherInboundOutboundHovered(const QString &tag, const P
void RouteEditor::OnDispatcherOutboundCreated(std::shared_ptr<OutboundObjectMeta> out, QtNodes::Node &)
{
defaultOutboundCombo->addItem(out->getDisplayName());
if (out->metaType != METAOUTBOUND_BALANCER)
defaultOutboundCombo->addItem(out->getDisplayName());
}
void RouteEditor::OnDispatcherRuleCreated(std::shared_ptr<RuleObject> rule, QtNodes::Node &)
@ -203,7 +205,7 @@ void RouteEditor::OnDispatcherObjectTagChanged(ComplexTagNodeMode t, const QStri
else if (t == NODE_OUTBOUND)
{
const auto id = defaultOutboundCombo->findText(original);
if (id > 0)
if (id >= 0)
defaultOutboundCombo->setItemText(id, current);
}
}
@ -453,7 +455,11 @@ void RouteEditor::on_domainStrategyCombo_currentIndexChanged(const QString &arg1
void RouteEditor::on_defaultOutboundCombo_currentTextChanged(const QString &arg1)
{
LOADINGCHECK
// defaultOutbound = arg1;
if (defaultOutboundTag != arg1)
{
LOG(MODULE_UI, "Default outbound changed: " + arg1)
defaultOutboundTag = arg1;
}
}
void RouteEditor::on_importExistingBtn_clicked()

View File

@ -70,6 +70,7 @@ class RouteEditor
void OnDispatcherObjectTagChanged(ComplexTagNodeMode, const QString, const QString);
private:
QString defaultOutboundTag;
std::shared_ptr<NodeDispatcher> nodeDispatcher;
ChainEditorWidget *chainWidget;
RoutingEditorWidget *ruleWidget;