Browse Source

- Display URL seeds in torrent properties

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
6a028c9efd
  1. 159
      src/propertiesWidget.ui
  2. 23
      src/propertieswidget.cpp
  3. 1
      src/propertieswidget.h

159
src/propertiesWidget.ui

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>756</width>
<height>291</height>
<height>333</height>
</rect>
</property>
<property name="sizePolicy">
@ -466,23 +466,6 @@ @@ -466,23 +466,6 @@
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="text">
<string>Trackers:</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="_21">
<property name="spacing">
@ -733,8 +716,144 @@ @@ -733,8 +716,144 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="page_3"/>
<widget class="QWidget" name="page_4"/>
<widget class="QWidget" name="page_3">
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QListWidget" name="listWebSeeds"/>
</item>
<item>
<layout class="QHBoxLayout" name="_19">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="deleteWS_button">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/Icons/oxygen/list-remove.png</normaloff>:/Icons/oxygen/list-remove.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addWS_button">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/Icons/oxygen/list-add.png</normaloff>:/Icons/oxygen/list-add.png</iconset>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_4">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QTreeView" name="filesList">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::AllEditTriggers</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="_6">
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="collapseAllButton">
<property name="text">
<string>Collapse all</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="expandAllButton">
<property name="text">
<string>Expand all</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item>

23
src/propertieswidget.cpp

@ -135,6 +135,8 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) { @@ -135,6 +135,8 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
incrementalDownload->setChecked(TorrentPersistentData::isSequentialDownload(h.hash()));
// Trackers
loadTrackers();
// URL seeds
loadUrlSeeds();
// downloaded pieces updater
progressBarUpdater = new RealProgressBarThread(progressBar, h);
progressBarUpdater->start();
@ -213,6 +215,27 @@ void PropertiesWidget::loadTrackers() { @@ -213,6 +215,27 @@ void PropertiesWidget::loadTrackers() {
}
}
void PropertiesWidget::loadUrlSeeds(){
QStringList already_added;
listWebSeeds->clear();
QVariantList url_seeds = TorrentPersistentData::getUrlSeeds(h.hash());
foreach(const QVariant &var_url_seed, url_seeds){
QString url_seed = var_url_seed.toString();
if(!url_seed.isEmpty()) {
new QListWidgetItem(url_seed, listWebSeeds);
already_added << url_seed;
}
}
// Load the hard-coded url seeds
QStringList hc_seeds = h.url_seeds();
// Add hard coded url seeds
foreach(const QString &hc_seed, hc_seeds){
if(!already_added.contains(hc_seed)){
new QListWidgetItem(hc_seed, listWebSeeds);
}
}
}
/* Tab buttons */
QPushButton* PropertiesWidget::getButtonFromIndex(int index) {
switch(index) {

1
src/propertieswidget.h

@ -66,6 +66,7 @@ protected slots: @@ -66,6 +66,7 @@ protected slots:
void loadDynamicData();
void setIncrementalDownload(int checkboxState);
void loadTrackers();
void loadUrlSeeds();
void on_main_infos_button_clicked();
void on_trackers_button_clicked();
void on_url_seeds_button_clicked();

Loading…
Cancel
Save