add brutal upload ui

This commit is contained in:
Nova 2025-11-27 12:22:40 +03:30
parent a2cba53700
commit 1983ef7b51
2 changed files with 59 additions and 19 deletions

View File

@ -277,23 +277,61 @@
</widget>
</item>
<item>
<widget class="QLabel" name="brutal_speed_l">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Server to Client TCP Brutal Speed&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>TCP Brutal Speed</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="brutal_speed"/>
</item>
<item>
<widget class="QLabel" name="brutal_speed_u">
<property name="text">
<string>Mb/s</string>
</property>
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="brutal_speed_l">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Server to Client TCP Brutal Speed&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Brutal Download Speed</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="brutal_speed_u">
<property name="text">
<string>Mb/s</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="brutal_d_speed"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Brutal Upload Speed</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="brutal_u_speed"/>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Mb/s</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>

View File

@ -342,7 +342,8 @@ void DialogEditProfile::typeSelected(const QString &newType) {
auto mux = ent->outbound->GetMux();
ui->multiplex->setCurrentIndex(mux->getMuxState());
ui->brutal_enable->setChecked(mux->brutal->enabled);
ui->brutal_speed->setText(Int2String(mux->brutal->down_mbps));
ui->brutal_d_speed->setText(Int2String(mux->brutal->down_mbps));
ui->brutal_u_speed->setText(Int2String(mux->brutal->up_mbps));
}
// 左边 bean
@ -457,7 +458,8 @@ bool DialogEditProfile::onEnd() {
auto mux = ent->outbound->GetMux();
mux->saveMuxState(ui->multiplex->currentIndex());
mux->brutal->enabled = ui->brutal_enable->isChecked();
mux->brutal->down_mbps = ui->brutal_speed->text().toInt();
mux->brutal->down_mbps = ui->brutal_d_speed->text().toInt();
mux->brutal->up_mbps = ui->brutal_u_speed->text().toInt();
}
return true;