feat: Add routing profile clone

This commit is contained in:
Nova 2024-09-16 19:49:54 +03:30
parent 52bf297a18
commit e825810a11
No known key found for this signature in database
GPG Key ID: 389787EC83F5D73A
4 changed files with 22 additions and 3 deletions

View File

@ -237,7 +237,7 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Remove the currently generated rule-sets so that they can be regenerated&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation> <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;便&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation></translation>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;便&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>Remove Generated Rule-sets</source>
@ -716,7 +716,6 @@ when set, domain destinations are resolved to IP before connect,
also if the connection cannot be established with the current address family (ipv4, ipv6), a fallback connection is created shortly after, with the other address family.</source>
<translation>outbound.domain_strategy
IPIPv4IPv6使</translation>
</message>
</message>
<message>
<source>Outbound Domain Strategy</source>

View File

@ -159,6 +159,17 @@ void DialogManageRoutes::on_new_route_clicked() {
});
}
void DialogManageRoutes::on_clone_route_clicked() {
auto idx = ui->route_profiles->currentRow();
if (idx < 0) return;
auto chainCopy = std::make_shared<NekoGui::RoutingChain>(*chainList[idx]);
chainCopy->name = chainCopy->name + " clone";
chainCopy->id = -1;
chainList.append(chainCopy);
reloadProfileItems();
}
void DialogManageRoutes::on_edit_route_clicked() {
auto idx = ui->route_profiles->currentRow();
if (idx < 0) return;

View File

@ -40,6 +40,8 @@ public slots:
void on_new_route_clicked();
void on_clone_route_clicked();
void on_edit_route_clicked();
void on_delete_route_clicked();

View File

@ -414,6 +414,13 @@ For more information, see the document &quot;Configuration/DNS&quot;.</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clone_route">
<property name="text">
<string>Clone</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="edit_route">
<property name="text">
@ -449,7 +456,7 @@ For more information, see the document &quot;Configuration/DNS&quot;.</string>
</sizepolicy>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>