Browse Source

- Based on libtorrent v0.12 (still unreleased, use libtorrent cvs)

- Added Peer Exchange (PeX)
- Display number of complete/incomplete sources in download list for each torrent
- Updated version to v0.9.0beta1
adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
931cfb6783
  1. 4
      Changelog
  2. 2
      INSTALL
  3. 6
      qcm/libtorrent.qcm
  4. 15
      src/GUI.cpp
  5. 2
      src/about_imp.h
  6. 16
      src/createtorrent_imp.cpp
  7. 133
      src/properties.ui
  8. 43
      src/properties_imp.cpp

4
Changelog

@ -1,12 +1,14 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v0.9.0 * Unknown - Christophe Dumez <chris@qbittorrent.org> - v0.9.0
- FEATURE: Based on libtorrent v0.12
- FEATURE: Based on Qt 4.2 - FEATURE: Based on Qt 4.2
- FEATURE: Brand new trayicon from Qt 4.2 - FEATURE: Brand new trayicon from Qt 4.2
- FEATURE: Support Peer Exchange (PeX)
- FEATURE: Added a menu action to visit qBittorrent website - FEATURE: Added a menu action to visit qBittorrent website
- FEATURE: Added a menu action to report a bug in qBittorrent - FEATURE: Added a menu action to report a bug in qBittorrent
- FEATURE: Use hashtables for faster lookup - FEATURE: Use hashtables for faster lookup
- FEATURE: Improved the way parameters are passed between qBT instances (socket) - FEATURE: Improved the way parameters are passed between qBT instances (socket)
- FEATURE: User is warned when hard drive becomes full and downloads are paused - FEATURE: User is warned when hard drive becomes full and downloads are paused
- FEATURE: Seeds / Leechers are displayed in download list as well as in torrent properties - FEATURE: Number of complete/incomplete sources are now displayed in download list for each torrent
- BUGFIX: Fixed download from url that would fail sometimes - BUGFIX: Fixed download from url that would fail sometimes
- BUGFIX: Save directory was reset to default when filtering files in torrent - BUGFIX: Save directory was reset to default when filtering files in torrent
- BUGFIX: Force a refresh of download list when the window is shown (avoid delay) - BUGFIX: Force a refresh of download list when the window is shown (avoid delay)

2
INSTALL

@ -16,7 +16,7 @@ will install and execute qBittorrent hopefully without any problems.
Dependencies: Dependencies:
- Qt >= 4.2 (libqt-devel, libqtgui, libqtcore, libqtnetwork) - Qt >= 4.2 (libqt-devel, libqtgui, libqtcore, libqtnetwork)
- rb_libtorrent by Arvid Norberg (>= v0.11 REQUIRED) - libtorrent by Arvid Norberg (>= v0.12 REQUIRED)
-> http://libtorrent.sf.net -> http://libtorrent.sf.net
Be carefull: another library (the one used by rtorrent) use the same name. Be carefull: another library (the one used by rtorrent) use the same name.
These are TWO different libraries and qBittorrent will only work with the one provided These are TWO different libraries and qBittorrent will only work with the one provided

6
qcm/libtorrent.qcm

@ -7,7 +7,7 @@ class qc_libtorrent : public ConfObj
{ {
public: public:
qc_libtorrent(Conf *c) : ConfObj(c) {} qc_libtorrent(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent >= 0.11"; } QString name() const { return "libtorrent >= 0.12"; }
QString shortname() const { return "libtorrent"; } QString shortname() const { return "libtorrent"; }
bool exec(){ bool exec(){
QString s; QString s;
@ -15,8 +15,8 @@ public:
sl += "/usr/include"; sl += "/usr/include";
sl += "/usr/local/include"; sl += "/usr/local/include";
sl += "/sw/include"; sl += "/sw/include";
if(!conf->findHeader("libtorrent/kademlia/node.hpp", sl, &s)) { if(!conf->findHeader("libtorrent/extensions/ut_pex.hpp", sl, &s)) {
qWarning("libtorrent v0.11 includes not found!\nYou can download it at http://www.libtorrent.net"); qWarning("libtorrent v0.12 includes not found!\nYou can download it at http://www.libtorrent.net");
return false; return false;
} }
conf->addIncludePath(s); conf->addIncludePath(s);

15
src/GUI.cpp

@ -40,6 +40,9 @@
#include <boost/filesystem/exception.hpp> #include <boost/filesystem/exception.hpp>
#include <curl/curl.h> #include <curl/curl.h>
#include <libtorrent/extensions/metadata_transfer.hpp>
#include <libtorrent/extensions/ut_pex.hpp>
#include "GUI.h" #include "GUI.h"
#include "misc.h" #include "misc.h"
#include "createtorrent_imp.h" #include "createtorrent_imp.h"
@ -127,7 +130,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
DHTEnabled = false; DHTEnabled = false;
// Configure BT session according to options // Configure BT session according to options
configureSession(); configureSession();
s->disable_extensions(); s->add_extension(&create_metadata_plugin);
s->add_extension(&create_ut_pex_plugin);
// download thread // download thread
downloader = new downloadThread(this); downloader = new downloadThread(this);
connect(downloader, SIGNAL(downloadFinished(QString, QString, int, QString)), this, SLOT(processDownloadedFile(QString, QString, int, QString))); connect(downloader, SIGNAL(downloadFinished(QString, QString, int, QString)), this, SLOT(processDownloadedFile(QString, QString, int, QString)));
@ -523,14 +527,9 @@ void GUI::updateDlList(bool force){
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)torrentStatus.upload_payload_rate)); DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)torrentStatus.upload_payload_rate));
break; break;
default: default:
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(QString(misc::toString(torrentStatus.num_complete, true).c_str())+"/"+QString(misc::toString(torrentStatus.num_incomplete, true).c_str())));
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1)); DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
} }
if(torrentStatus.num_complete == -1 && torrentStatus.num_incomplete == -1){ DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(QString(misc::toString(torrentStatus.num_seeds, true).c_str())+"/"+QString(misc::toString(torrentStatus.num_peers - torrentStatus.num_seeds, true).c_str())));
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(tr("Unknown")));
}else{
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(QString(misc::toString(torrentStatus.num_complete, true).c_str())+"/"+QString(misc::toString(torrentStatus.num_incomplete, true).c_str())));
}
} }
}catch(invalid_handle e){ }catch(invalid_handle e){
continue; continue;
@ -1296,7 +1295,7 @@ void GUI::addTorrent(const QString& path, bool fromScanDir, const QString& from_
DLListModel->setData(DLListModel->index(row, SIZE), QVariant((qlonglong)t.total_size())); DLListModel->setData(DLListModel->index(row, SIZE), QVariant((qlonglong)t.total_size()));
DLListModel->setData(DLListModel->index(row, DLSPEED), QVariant((double)0.)); DLListModel->setData(DLListModel->index(row, DLSPEED), QVariant((double)0.));
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)0.)); DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)0.));
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(tr("Unknown"))); DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant("0/0"));
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1)); DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
// Pause torrent if it was paused last time // Pause torrent if it was paused last time
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+QString(t.name().c_str())+".paused")){ if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+QString(t.name().c_str())+".paused")){

2
src/about_imp.h

@ -23,7 +23,7 @@
#define ABOUT_H #define ABOUT_H
#include "ui_about.h" #include "ui_about.h"
#define VERSION "v0.9.0alpha1" #define VERSION "v0.9.0beta1"
class about : public QDialog, private Ui::AboutDlg{ class about : public QDialog, private Ui::AboutDlg{
Q_OBJECT Q_OBJECT

16
src/createtorrent_imp.cpp

@ -26,12 +26,13 @@
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp> #include <boost/filesystem/fstream.hpp>
#include "libtorrent/entry.hpp" #include <libtorrent/entry.hpp>
#include "libtorrent/bencode.hpp" #include <libtorrent/bencode.hpp>
#include "libtorrent/torrent_info.hpp" #include <libtorrent/torrent_info.hpp>
#include "libtorrent/file.hpp" #include <libtorrent/file.hpp>
#include "libtorrent/storage.hpp" #include <libtorrent/storage.hpp>
#include "libtorrent/hasher.hpp" #include <libtorrent/hasher.hpp>
#include <libtorrent/file_pool.hpp>
#include "createtorrent_imp.h" #include "createtorrent_imp.h"
@ -105,7 +106,8 @@ void createtorrent::on_createButton_clicked(){
add_files(t, full_path.branch_path(), full_path.leaf()); add_files(t, full_path.branch_path(), full_path.leaf());
t.set_piece_size(piece_size); t.set_piece_size(piece_size);
storage st(t, full_path.branch_path()); file_pool fp;
storage st(t, full_path.branch_path(), fp);
QStringList trackers = txt_announce->toPlainText().split('\n'); QStringList trackers = txt_announce->toPlainText().split('\n');
for(int i=0; i<trackers.size(); ++i){ for(int i=0; i<trackers.size(); ++i){
t.add_tracker((const char*)trackers.at(i).toUtf8()); t.add_tracker((const char*)trackers.at(i).toUtf8());

133
src/properties.ui

@ -6,7 +6,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>538</width> <width>538</width>
<height>585</height> <height>567</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
@ -86,138 +86,13 @@
<number>6</number> <number>6</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="label" > <widget class="QLabel" name="savePath_lbl" >
<property name="font" >
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="text" >
<string>Download state:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="dlState" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>111</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="lbl_seeds" >
<property name="font" >
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="text" >
<string>Seeders:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="nbSeeds" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_leechers" >
<property name="font" > <property name="font" >
<font> <font>
<family>Sans Serif</family> <weight>75</weight>
<pointsize>9</pointsize> <bold>true</bold>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font> </font>
</property> </property>
<property name="text" >
<string>Leechers:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="nbLeechers" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="savePath_lbl" >
<property name="text" > <property name="text" >
<string>Save path:</string> <string>Save path:</string>
</property> </property>

43
src/properties_imp.cpp

@ -46,32 +46,6 @@ properties::properties(QWidget *parent, torrent_handle h, QStringList trackerErr
torrent_status torrentStatus = h.status(); torrent_status torrentStatus = h.status();
torrent_info torrentInfo = h.get_torrent_info(); torrent_info torrentInfo = h.get_torrent_info();
fileName->setText(torrentInfo.name().c_str()); fileName->setText(torrentInfo.name().c_str());
torrent_status::state_t state = torrentStatus.state;
switch(state){
case torrent_status::finished:
dlState->setText(tr("Finished"));
break;
case torrent_status::queued_for_checking:
dlState->setText(tr("Queued for checking"));
break;
case torrent_status::checking_files:
dlState->setText(tr("Checking files"));
break;
case torrent_status::connecting_to_tracker:
dlState->setText(tr("Connecting to tracker"));
break;
case torrent_status::downloading_metadata:
dlState->setText(tr("Downloading Metadata"));
break;
case torrent_status::downloading:
dlState->setText(tr("Downloading"));
break;
case torrent_status::seeding:
dlState->setText(tr("Seeding"));
break;
case torrent_status::allocating:
dlState->setText(tr("Allocating"));
}
QString tracker = QString(torrentStatus.current_tracker.c_str()).trimmed(); QString tracker = QString(torrentStatus.current_tracker.c_str()).trimmed();
if(!tracker.isEmpty()){ if(!tracker.isEmpty()){
trackerURL->setText(tracker); trackerURL->setText(tracker);
@ -98,23 +72,6 @@ properties::properties(QWidget *parent, torrent_handle h, QStringList trackerErr
snprintf(tmp, MAX_CHAR_TMP, "%.1f", ratio); snprintf(tmp, MAX_CHAR_TMP, "%.1f", ratio);
shareRatio->setText(tmp); shareRatio->setText(tmp);
} }
float complete, partial;
QString completeStr, partialStr;
complete = torrentStatus.num_complete;
if(complete == -1){
completeStr = tr("Unknown");
}else{
completeStr = QString(misc::toString(complete).c_str());
}
partial = torrentStatus.num_incomplete;
if(partial == -1){
partialStr = tr("Unknown");
}else{
partialStr = QString(misc::toString(partial).c_str());
}
nbSeeds->setText(completeStr);
nbLeechers->setText(partialStr);
// Tracker Errors // Tracker Errors
for(int i=0; i < trackerErrors.size(); ++i){ for(int i=0; i < trackerErrors.size(); ++i){
this->trackerErrors->append(trackerErrors.at(i)); this->trackerErrors->append(trackerErrors.at(i));

Loading…
Cancel
Save