mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-19 18:30:34 +08:00
add: added ConnectionRename, GroupRename UI slot implementations
This commit is contained in:
parent
85d980e91b
commit
c7a6bca26f
@ -1 +1 @@
|
||||
4171
|
||||
4177
|
||||
|
@ -482,6 +482,7 @@ namespace Qv2ray::core::handlers
|
||||
{
|
||||
return tr("Group does not exist");
|
||||
}
|
||||
OnGroupRenamed(id, groups[id].displayName, newName);
|
||||
groups[id].displayName = newName;
|
||||
return {};
|
||||
}
|
||||
|
@ -187,6 +187,9 @@
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../../../resources.qrc">:/assets/icons/qv2ray.ico</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
|
@ -40,6 +40,12 @@ ConnectionItemWidget::ConnectionItemWidget(const ConnectionId &id, QWidget *pare
|
||||
{
|
||||
emit RequestWidgetFocus(this);
|
||||
}
|
||||
connect(ConnectionManager, &QvConnectionHandler::OnConnectionRenamed, [&](const ConnectionId &id, const QString &, const QString &newName) {
|
||||
if (id == connectionId)
|
||||
{
|
||||
connNameLabel->setText(newName);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ======================================= Initialisation for root nodes.
|
||||
@ -61,6 +67,13 @@ ConnectionItemWidget::ConnectionItemWidget(const GroupId &id, QWidget *parent) :
|
||||
connect(ConnectionManager, &QvConnectionHandler::OnConnectionChanged, this, &ConnectionItemWidget::RecalculateConnectionsCount);
|
||||
connect(ConnectionManager, &QvConnectionHandler::OnConnectionGroupChanged, this, &ConnectionItemWidget::RecalculateConnectionsCount);
|
||||
connect(ConnectionManager, &QvConnectionHandler::OnSubscriptionUpdateFinished, this, &ConnectionItemWidget::RecalculateConnectionsCount);
|
||||
//
|
||||
connect(ConnectionManager, &QvConnectionHandler::OnGroupRenamed, [&](const GroupId &id, const QString &, const QString &newName) {
|
||||
if (id == groupId)
|
||||
{
|
||||
connNameLabel->setText(newName);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ConnectionItemWidget::BeginConnection()
|
||||
|
Loading…
Reference in New Issue
Block a user