added a per-friend upload slots limit in FT. Default is 0=unlimited

This commit is contained in:
csoler 2017-05-08 22:00:51 +02:00
parent add529ffd3
commit 8a86b9ed7d
8 changed files with 143 additions and 5 deletions

View file

@ -38,6 +38,7 @@ TransferPage::TransferPage(QWidget * parent, Qt::WindowFlags flags)
ui.setupUi(this);
QObject::connect(ui._queueSize_SB,SIGNAL(valueChanged(int)),this,SLOT(updateQueueSize(int))) ;
QObject::connect(ui._max_up_SB,SIGNAL(valueChanged(int)),this,SLOT(updateMaxUploadSlots(int))) ;
QObject::connect(ui._defaultStrategy_CB,SIGNAL(activated(int)),this,SLOT(updateDefaultStrategy(int))) ;
QObject::connect(ui._e2e_encryption_CB,SIGNAL(activated(int)),this,SLOT(updateEncryptionPolicy(int))) ;
QObject::connect(ui._diskSpaceLimit_SB,SIGNAL(valueChanged(int)),this,SLOT(updateDiskSizeLimit(int))) ;
@ -59,6 +60,11 @@ void TransferPage::updateMaxTRUpRate(int b)
rsTurtle->setMaxTRForwardRate(b) ;
}
void TransferPage::updateMaxUploadSlots(int b)
{
rsFiles->setMaxUploadSlotsPerFriend(b) ;
}
void TransferPage::updateEncryptionPolicy(int b)
{
switch(b)
@ -100,6 +106,7 @@ void TransferPage::load()
whileBlocking(ui._diskSpaceLimit_SB)->setValue(rsFiles->freeDiskSpaceLimit()) ;
whileBlocking(ui._max_tr_up_per_sec_SB)->setValue(rsTurtle->getMaxTRForwardRate()) ;
whileBlocking(ui._max_up_SB)->setValue(rsFiles->getMaxUploadSlotsPerFriend()) ;
}
void TransferPage::updateDefaultStrategy(int i)

View file

@ -48,6 +48,7 @@ class TransferPage: public ConfigPage
void updateDiskSizeLimit(int) ;
void updateMaxTRUpRate(int);
void updateEncryptionPolicy(int);
void updateMaxUploadSlots(int);
void editDirectories() ;
void setIncomingDirectory();

View file

@ -203,6 +203,13 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Maximum uploads per friend (0 = no limit)</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
@ -251,6 +258,9 @@
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="_max_up_SB"/>
</item>
<item>
<widget class="QComboBox" name="_defaultStrategy_CB">
<property name="enabled">