Browse Source

User can force tracker reannounce

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
c2da227254
  1. 1
      Changelog
  2. 9
      src/propertieswidget.cpp
  3. 1
      src/propertieswidget.h
  4. 10
      src/qtorrenthandle.cpp
  5. 2
      src/qtorrenthandle.h
  6. 49
      src/ui/propertieswidget.ui

1
Changelog

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
- FEATURE: Added support for strict super seeding
- FEATURE: The user can force listening on a particular network interface
- FEATURE: Added cookie support for RSS feeds
- FEATURE: User can force tracker reannounce
- COSMETIC: Display peers country name in tooltip
* Sun Mar 14 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.0

9
src/propertieswidget.cpp

@ -190,6 +190,7 @@ void PropertiesWidget::clear() { @@ -190,6 +190,7 @@ void PropertiesWidget::clear() {
lbl_dllimit->clear();
lbl_elapsed->clear();
lbl_connections->clear();
reannounce_lbl->clear();
shareRatio->clear();
listWebSeeds->clear();
PropListModel->clear();
@ -215,6 +216,12 @@ void PropertiesWidget::updateSavePath(QTorrentHandle& _h) { @@ -215,6 +216,12 @@ void PropertiesWidget::updateSavePath(QTorrentHandle& _h) {
}
}
void PropertiesWidget::on_reannounce_btn_clicked() {
if(h.is_valid()) {
h.force_reannounce();
}
}
void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
clear();
h = _h;
@ -329,6 +336,8 @@ void PropertiesWidget::loadDynamicData() { @@ -329,6 +336,8 @@ void PropertiesWidget::loadDynamicData() {
lbl_connections->setText(QString::number(h.num_connections())+" ("+tr("%1 max", "e.g. 10 max").arg(QString::number(h.connections_limit()))+")");
else
lbl_connections->setText(QString::number(h.num_connections()));
// Update next announce time
reannounce_lbl->setText(h.next_announce());
// Update ratio info
const double ratio = BTSession->getRealRatio(h.hash());
if(ratio > 100.)

1
src/propertieswidget.h

@ -100,6 +100,7 @@ protected slots: @@ -100,6 +100,7 @@ protected slots:
void showPiecesAvailability(bool show);
void updateSavePath(QTorrentHandle& h);
void renameSelectedFile();
void on_reannounce_btn_clicked();
public slots:
void loadDynamicData();

10
src/qtorrenthandle.cpp

@ -79,6 +79,16 @@ QString QTorrentHandle::creation_date() const { @@ -79,6 +79,16 @@ QString QTorrentHandle::creation_date() const {
return misc::boostTimeToQString(boostDate);
}
QString QTorrentHandle::next_announce() const {
Q_ASSERT(h.is_valid());
return misc::userFriendlyDuration(h.status().next_announce.total_seconds());
}
qlonglong QTorrentHandle::next_announce_s() const {
Q_ASSERT(h.is_valid());
return h.status().next_announce.total_seconds();
}
float QTorrentHandle::progress() const {
Q_ASSERT(h.is_valid());
if(!h.status().total_wanted)

2
src/qtorrenthandle.h

@ -121,6 +121,8 @@ class QTorrentHandle { @@ -121,6 +121,8 @@ class QTorrentHandle {
bool super_seeding() const;
#endif
QString creation_date() const;
QString next_announce() const;
qlonglong next_announce_s() const;
void get_peer_info(std::vector<peer_info>&) const;
#ifndef DISABLE_GUI
bool resolve_countries() const;

49
src/ui/propertieswidget.ui

@ -53,9 +53,9 @@ @@ -53,9 +53,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-60</y>
<y>0</y>
<width>520</width>
<height>351</height>
<height>360</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@ -310,16 +310,49 @@ @@ -310,16 +310,49 @@
<item row="2" column="4">
<widget class="QLabel" name="label_10">
<property name="text">
<string notr="true"/>
<string>Reannounce in:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QLabel" name="label_11">
<property name="text">
<string notr="true"/>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="reannounce_lbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="reannounce_btn">
<property name="toolTip">
<string>Force reannounce</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/Icons/oxygen/run-build.png</normaloff>:/Icons/oxygen/run-build.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>

Loading…
Cancel
Save