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

9
src/propertieswidget.cpp

@ -190,6 +190,7 @@ void PropertiesWidget::clear() {
lbl_dllimit->clear(); lbl_dllimit->clear();
lbl_elapsed->clear(); lbl_elapsed->clear();
lbl_connections->clear(); lbl_connections->clear();
reannounce_lbl->clear();
shareRatio->clear(); shareRatio->clear();
listWebSeeds->clear(); listWebSeeds->clear();
PropListModel->clear(); PropListModel->clear();
@ -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) { void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
clear(); clear();
h = _h; h = _h;
@ -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()))+")"); lbl_connections->setText(QString::number(h.num_connections())+" ("+tr("%1 max", "e.g. 10 max").arg(QString::number(h.connections_limit()))+")");
else else
lbl_connections->setText(QString::number(h.num_connections())); lbl_connections->setText(QString::number(h.num_connections()));
// Update next announce time
reannounce_lbl->setText(h.next_announce());
// Update ratio info // Update ratio info
const double ratio = BTSession->getRealRatio(h.hash()); const double ratio = BTSession->getRealRatio(h.hash());
if(ratio > 100.) if(ratio > 100.)

1
src/propertieswidget.h

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

10
src/qtorrenthandle.cpp

@ -79,6 +79,16 @@ QString QTorrentHandle::creation_date() const {
return misc::boostTimeToQString(boostDate); 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 { float QTorrentHandle::progress() const {
Q_ASSERT(h.is_valid()); Q_ASSERT(h.is_valid());
if(!h.status().total_wanted) if(!h.status().total_wanted)

2
src/qtorrenthandle.h

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

49
src/ui/propertieswidget.ui

@ -53,9 +53,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-60</y> <y>0</y>
<width>520</width> <width>520</width>
<height>351</height> <height>360</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
@ -310,16 +310,49 @@
<item row="2" column="4"> <item row="2" column="4">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="text"> <property name="text">
<string notr="true"/> <string>Reannounce in:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="5"> <item row="2" column="5">
<widget class="QLabel" name="label_11"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="text"> <item>
<string notr="true"/> <widget class="QLabel" name="reannounce_lbl">
</property> <property name="sizePolicy">
</widget> <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> </item>
</layout> </layout>
</widget> </widget>

Loading…
Cancel
Save