added UI and parameters for two new options in shared files: max share depth and ignore duplicates

This commit is contained in:
csoler 2017-09-24 17:53:06 +02:00
parent a2ccf97b82
commit 2a99df4d48
11 changed files with 233 additions and 70 deletions

View file

@ -59,6 +59,8 @@ TransferPage::TransferPage(QWidget * parent, Qt::WindowFlags flags)
QObject::connect(ui.prefixesIgnoreList_CB, SIGNAL(toggled(bool)), this,SLOT(updateIgnoreLists())) ;
QObject::connect(ui.suffixesIgnoreList_LE, SIGNAL(editingFinished()), this,SLOT(updateIgnoreLists())) ;
QObject::connect(ui.suffixesIgnoreList_CB, SIGNAL(toggled(bool)), this,SLOT(updateIgnoreLists())) ;
QObject::connect(ui.ignoreDuplicates_CB, SIGNAL(toggled(bool)), this,SLOT(updateIgnoreDuplicates())) ;
QObject::connect(ui.maxDepth_SB, SIGNAL(valueChanged(int)), this,SLOT(updateMaxShareDepth(int))) ;
}
void TransferPage::updateIgnoreLists()
@ -116,6 +118,8 @@ void TransferPage::updateFilePermDirectDL(int i)
void TransferPage::load()
{
ui.ignoreDuplicates_CB->setEnabled(rsFiles->followSymLinks()) ;
whileBlocking(ui.shareDownloadDirectoryCB)->setChecked(rsFiles->getShareDownloadDirectory());
int u = rsFiles->watchPeriod() ;
@ -125,6 +129,8 @@ void TransferPage::load()
whileBlocking(ui.incomingDir)->setText(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str()));
whileBlocking(ui.partialsDir)->setText(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()));
whileBlocking(ui.followSymLinks_CB)->setChecked(rsFiles->followSymLinks());
whileBlocking(ui.ignoreDuplicates_CB)->setChecked(rsFiles->ignoreDuplicates());
whileBlocking(ui.maxDepth_SB)->setValue(rsFiles->maxShareDepth());
whileBlocking(ui._queueSize_SB)->setValue(rsFiles->getQueueSize()) ;
@ -199,6 +205,14 @@ void TransferPage::updateDiskSizeLimit(int s)
{
rsFiles->setFreeDiskSpaceLimit(s) ;
}
void TransferPage::updateIgnoreDuplicates()
{
rsFiles->setIgnoreDuplicates(ui.ignoreDuplicates_CB->isChecked());
}
void TransferPage::updateMaxShareDepth(int s)
{
rsFiles->setMaxShareDepth(s) ;
}
void TransferPage::updateQueueSize(int s)
{
@ -243,4 +257,4 @@ void TransferPage::editDirectories()
void TransferPage::updateAutoCheckDirectories() { rsFiles->setWatchEnabled(ui.autoCheckDirectories_CB->isChecked()) ; }
void TransferPage::updateAutoScanDirectoriesPeriod() { rsFiles->setWatchPeriod(ui.autoCheckDirectoriesDelay_SB->value()); }
void TransferPage::updateShareDownloadDirectory() { rsFiles->shareDownloadDirectory(ui.shareDownloadDirectoryCB->isChecked());}
void TransferPage::updateFollowSymLinks() { rsFiles->setFollowSymLinks(ui.followSymLinks_CB->isChecked()); }
void TransferPage::updateFollowSymLinks() { rsFiles->setFollowSymLinks(ui.followSymLinks_CB->isChecked()); ui.ignoreDuplicates_CB->setEnabled(ui.followSymLinks_CB->isChecked());}

View file

@ -51,6 +51,7 @@ class TransferPage: public ConfigPage
void updateMaxUploadSlots(int);
void updateFilePermDirectDL(int);
void updateIgnoreLists();
void updateMaxShareDepth(int);
void editDirectories() ;
void setIncomingDirectory();
@ -61,6 +62,7 @@ class TransferPage: public ConfigPage
void updateAutoScanDirectoriesPeriod() ;
void updateShareDownloadDirectory() ;
void updateFollowSymLinks() ;
void updateIgnoreDuplicates() ;
private:

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1126</width>
<height>1103</height>
<width>1312</width>
<height>1305</height>
</rect>
</property>
<layout class="QVBoxLayout" name="TransferPageVLayout">
@ -18,33 +18,35 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="shareDownloadHLayout">
<item>
<widget class="QCheckBox" name="shareDownloadDirectoryCB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Automatically share incoming directory (Recommended)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editShareButton">
<property name="text">
<string>Edit Share</string>
</property>
</widget>
</item>
</layout>
<widget class="QPushButton" name="editShareButton">
<property name="text">
<string>Edit Share</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="shareDownloadDirectoryCB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Automatically share incoming directory (Recommended)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="autoCheckDirectoriesHLayout">
<item>
<widget class="QCheckBox" name="autoCheckDirectories_CB">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Auto-check shared directories every </string>
</property>
@ -88,6 +90,30 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="ignoreDuplicates_CB">
<property name="text">
<string>Ignore duplicate files/directories</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Maximum depth:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="maxDepth_SB"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
@ -132,47 +158,57 @@
<property name="title">
<string>Incoming Directory</string>
</property>
<layout class="QGridLayout" name="incomingGBoxGLayout">
<item row="0" column="0">
<widget class="QLineEdit" name="incomingDir">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="incomingButton">
<property name="minimumSize">
<size>
<width>31</width>
<height>31</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>31</width>
<height>31</height>
</size>
</property>
<property name="toolTip">
<string>Browse</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
</layout>
<widget class="QLineEdit" name="incomingDir">
<property name="geometry">
<rect>
<x>21</x>
<y>52</y>
<width>244</width>
<height>36</height>
</rect>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="incomingButton">
<property name="geometry">
<rect>
<x>1224</x>
<y>54</y>
<width>31</width>
<height>31</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>31</width>
<height>31</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>31</width>
<height>31</height>
</size>
</property>
<property name="toolTip">
<string>Browse</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</widget>
</item>
<item>