Compare commits
91 Commits
release-2.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c1ca776be3 | ||
![]() |
0e9abc1762 | ||
![]() |
e24ce87946 | ||
![]() |
308e358d3f | ||
![]() |
d15e6a4847 | ||
![]() |
e311239a28 | ||
![]() |
df677789d2 | ||
![]() |
0af44eadb6 | ||
![]() |
85cafe530e | ||
![]() |
7609db28f1 | ||
![]() |
fefda39284 | ||
![]() |
b2f98bd059 | ||
![]() |
26c69fe6d4 | ||
![]() |
bf4f1a7c37 | ||
![]() |
9b0dd39d9d | ||
![]() |
66d4cc2ab8 | ||
![]() |
0bcbaf6521 | ||
![]() |
e074872b24 | ||
![]() |
63ec1e618e | ||
![]() |
331c15b76c | ||
![]() |
d2089c9aad | ||
![]() |
3c8326d3b6 | ||
![]() |
2d0713ca1d | ||
![]() |
afaca423cc | ||
![]() |
ff08abe177 | ||
![]() |
159be479cc | ||
![]() |
f3066b07b5 | ||
![]() |
aa58636832 | ||
![]() |
5d1a584eac | ||
![]() |
7ee9abd646 | ||
![]() |
4d977a8d46 | ||
![]() |
5c891724c4 | ||
![]() |
185af18790 | ||
![]() |
fa6da97cf9 | ||
![]() |
9503d9b024 | ||
![]() |
de7b6ca553 | ||
![]() |
1788078594 | ||
![]() |
3caf473424 | ||
![]() |
5435bd2354 | ||
![]() |
1cdb22a7e3 | ||
![]() |
95a9424ae7 | ||
![]() |
902196a176 | ||
![]() |
dbfef8665b | ||
![]() |
b3d8f2400f | ||
![]() |
c12ae58868 | ||
![]() |
4b77bb57ad | ||
![]() |
a6b1d308c2 | ||
![]() |
b483f09d11 | ||
![]() |
bbb5ad31c4 | ||
![]() |
3d4c1fe7da | ||
![]() |
7a2c0d5d5a | ||
![]() |
39d86c5f61 | ||
![]() |
e2cdbbb184 | ||
![]() |
e83f9245a9 | ||
![]() |
52f25c44eb | ||
![]() |
1ed565d8e5 | ||
![]() |
10801f111b | ||
![]() |
efe1655834 | ||
![]() |
7f71e3981e | ||
![]() |
8113f8df63 | ||
![]() |
62f579fdbe | ||
![]() |
1d4454c6eb | ||
![]() |
310433fb54 | ||
![]() |
c0520146e9 | ||
![]() |
35f6675d86 | ||
![]() |
9494b15bd5 | ||
![]() |
3b82120923 | ||
![]() |
b9a0adc311 | ||
![]() |
1e21ac3d79 | ||
![]() |
864bb8285e | ||
![]() |
208e988c70 | ||
![]() |
5cbcfb8efb | ||
![]() |
107b833703 | ||
![]() |
e2208a484e | ||
![]() |
5ab7c91d49 | ||
![]() |
a91ad3c9c7 | ||
![]() |
385f950c2b | ||
![]() |
4667a84939 | ||
![]() |
5af0cacf0c | ||
![]() |
bceb00d35f | ||
![]() |
51068294f1 | ||
![]() |
bcdf4e42fa | ||
![]() |
214bb13843 | ||
![]() |
7998395532 | ||
![]() |
35aee18112 | ||
![]() |
8ddbdd34ed | ||
![]() |
66a5e479c7 | ||
![]() |
8f5bd2bc9f | ||
![]() |
5be2624cb1 | ||
![]() |
f9684d662d | ||
![]() |
9373796dd5 |
@@ -1,4 +1,9 @@
|
||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.3.0
|
||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.4.0
|
||||
- FEATURE: Added actions to "Move to top/bottom" of priority queue
|
||||
- FEATURE: Added Auto-Shutdown on downloads completion feature
|
||||
- FEATURE: Added label-level Pause/Resume/Delete actions
|
||||
|
||||
* Tue Jul 27 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.3.0
|
||||
- FEATURE: Simplified torrent root folder renaming/truncating (< v2.3.0 is no longer forward compatible)
|
||||
- FEATURE: Remember previous save paths in torrent addition dialog
|
||||
- FEATURE: Max number of half-open connections can now be edited
|
||||
@@ -15,10 +20,12 @@
|
||||
- FEATURE: Torrents can be automatically paused once they reach a given ratio
|
||||
- FEATURE: Several files can now be disabled at once
|
||||
- FEATURE: Added "Select All/None" buttons to files list
|
||||
- FEATURE: Added support for BitComet links (bc://bt/...)
|
||||
- BUGFIX: Hide seeding torrents files priorities in Web UI
|
||||
- BUGFIX: The user can disable permanently recursive torrent download
|
||||
- BUGFIX: Peer Exchange status is now correctly reported
|
||||
- BUGFIX: Use an INI file instead of the registry on Windows (More reliable)
|
||||
- BUGFIX: Removed client spoofing feature to avoid tracker blacklisting
|
||||
- COSMETIC: Display peers country name in tooltip
|
||||
- COSMETIC: Display number of torrents in transfers tab label
|
||||
- COSMETIC: Simplified program preferences
|
||||
|
84
configure
vendored
@@ -18,15 +18,24 @@ Main options:
|
||||
--help This help text.
|
||||
|
||||
Dependency options:
|
||||
--disable-gui Disable qBittorrent Graphical user
|
||||
interface for headless running
|
||||
--with-libboost-inc=[path] Path to libboost include files
|
||||
--with-libboost-lib=[path] Path to libboost library files
|
||||
--disable-libnotify Disable use of libnotify
|
||||
--disable-geoip-database Disable use of geoip-database
|
||||
--with-geoip-database-embedded Geoip Database will be embedded in
|
||||
qBittorrent executable (please follow
|
||||
instructions in src/geoip/README)
|
||||
--disable-gui Disable qBittorrent
|
||||
Graphical user interface for
|
||||
headless running
|
||||
--with-libboost-inc=[path] Path to libboost include
|
||||
files
|
||||
--with-libboost-lib=[path] Path to libboost library
|
||||
files
|
||||
--disable-libnotify Disable use of libnotify
|
||||
--disable-geoip-database Disable use of geoip-database
|
||||
--with-geoip-database-embedded Geoip Database will be
|
||||
embedded in qBittorrent
|
||||
executable (please follow
|
||||
instructions in
|
||||
src/geoip/README)
|
||||
--disable-qtsingleapplication Disable use of libboost
|
||||
--with-qtsingleapplication=[system|shipped] Use the shipped
|
||||
qtsingleapplication library
|
||||
or the system one
|
||||
|
||||
EOT
|
||||
}
|
||||
@@ -173,6 +182,16 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
;;
|
||||
|
||||
--disable-qtsingleapplication)
|
||||
QC_DISABLE_qtsingleapplication="Y"
|
||||
shift
|
||||
;;
|
||||
|
||||
--with-qtsingleapplication=*)
|
||||
QC_WITH_QTSINGLEAPPLICATION=$optarg
|
||||
shift
|
||||
;;
|
||||
|
||||
--verbose)
|
||||
QC_VERBOSE="Y"
|
||||
shift
|
||||
@@ -200,6 +219,8 @@ echo QC_WITH_LIBBOOST_LIB=$QC_WITH_LIBBOOST_LIB
|
||||
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
|
||||
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
|
||||
echo QC_WITH_GEOIP_DATABASE_EMBEDDED=$QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||
echo QC_DISABLE_qtsingleapplication=$QC_DISABLE_qtsingleapplication
|
||||
echo QC_WITH_QTSINGLEAPPLICATION=$QC_WITH_QTSINGLEAPPLICATION
|
||||
echo
|
||||
fi
|
||||
|
||||
@@ -529,10 +550,21 @@ public:
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
QStringList incs3;
|
||||
QString req_ver3 = "2.0";
|
||||
QString version3, libs3, other3;
|
||||
if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) {
|
||||
for(int n = 0; n < incs3.count(); ++n)
|
||||
conf->addIncludePath(incs3[n]);
|
||||
if(!libs3.isEmpty())
|
||||
conf->addLib(libs3);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -574,6 +606,33 @@ public:
|
||||
#endif
|
||||
}
|
||||
};
|
||||
#line 1 "qtsingleapplication.qcm"
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: libboost
|
||||
arg: with-qtsingleapplication=[system|shipped], Use the shipped qtsingleapplication library or the system one
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
class qc_qtsingleapplication : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_qtsingleapplication(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "qtsingleapplication library"; }
|
||||
QString shortname() const { return "qtsingleapplication"; }
|
||||
|
||||
bool exec(){
|
||||
QString s;
|
||||
s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION");
|
||||
if(s.compare("system", Qt::CaseInsensitive) == 0) {
|
||||
// System
|
||||
conf->addDefine("USE_SYSTEM_QTSINGLEAPPLICATION");
|
||||
printf(" [system] ");
|
||||
} else {
|
||||
printf(" [shipped] ");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
EOT
|
||||
cat >$1/modules_new.cpp <<EOT
|
||||
@@ -595,6 +654,9 @@ cat >$1/modules_new.cpp <<EOT
|
||||
o = new qc_geoip_database(conf);
|
||||
o->required = false;
|
||||
o->disabled = false;
|
||||
o = new qc_qtsingleapplication(conf);
|
||||
o->required = false;
|
||||
o->disabled = false;
|
||||
|
||||
EOT
|
||||
cat >$1/conf4.h <<EOT
|
||||
@@ -1546,6 +1608,8 @@ export QC_WITH_LIBBOOST_LIB
|
||||
export QC_DISABLE_libnotify
|
||||
export QC_DISABLE_geoip_database
|
||||
export QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||
export QC_DISABLE_qtsingleapplication
|
||||
export QC_WITH_QTSINGLEAPPLICATION
|
||||
export QC_VERBOSE
|
||||
rm -rf .qconftemp
|
||||
(
|
||||
|
@@ -19,4 +19,6 @@
|
||||
</dep>
|
||||
<dep type='geoip-database'>
|
||||
</dep>
|
||||
<dep type='qtsingleapplication'>
|
||||
</dep>
|
||||
</qconf>
|
||||
|
@@ -40,10 +40,21 @@ public:
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
QStringList incs3;
|
||||
QString req_ver3 = "2.0";
|
||||
QString version3, libs3, other3;
|
||||
if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) {
|
||||
for(int n = 0; n < incs3.count(); ++n)
|
||||
conf->addIncludePath(incs3[n]);
|
||||
if(!libs3.isEmpty())
|
||||
conf->addLib(libs3);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
114
src/GUI.cpp
@@ -187,6 +187,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
actionSearch_engine->setChecked(Preferences::isSearchEnabled());
|
||||
displaySearchTab(actionSearch_engine->isChecked());
|
||||
displayRSSTab(actionRSS_Reader->isChecked());
|
||||
actionShutdown_when_downloads_complete->setChecked(Preferences::shutdownWhenDownloadsComplete());
|
||||
|
||||
show();
|
||||
|
||||
@@ -279,10 +280,7 @@ GUI::~GUI() {
|
||||
delete BTSession;
|
||||
// Deleting remaining top level widgets
|
||||
qDebug("Deleting remaining top level widgets");
|
||||
foreach (QWidget *win, QApplication::topLevelWidgets()) {
|
||||
if(win && win != this)
|
||||
delete win;
|
||||
}
|
||||
|
||||
// May freeze for a few seconds after the next line
|
||||
// because the Bittorrent session proxy will
|
||||
// actually be deleted now and destruction
|
||||
@@ -345,10 +343,18 @@ void GUI::on_actionBugReport_triggered() const {
|
||||
}
|
||||
|
||||
void GUI::tab_changed(int new_tab) {
|
||||
if(new_tab == TAB_TRANSFER) {
|
||||
Q_UNUSED(new_tab);
|
||||
// We cannot rely on the index new_tab
|
||||
// because the tab order is undetermined now
|
||||
if(tabs->currentWidget() == vSplitter) {
|
||||
qDebug("Changed tab to transfer list, refreshing the list");
|
||||
transferList->refreshList();
|
||||
properties->loadDynamicData();
|
||||
return;
|
||||
}
|
||||
if(tabs->currentWidget() == searchEngine) {
|
||||
qDebug("Changed tab to search engine, giving focus to search input");
|
||||
searchEngine->giveFocusToSearchInput();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,15 +407,17 @@ void GUI::createKeyboardShortcuts() {
|
||||
|
||||
// Keyboard shortcuts slots
|
||||
void GUI::displayTransferTab() const {
|
||||
tabs->setCurrentIndex(TAB_TRANSFER);
|
||||
tabs->setCurrentWidget(transferList);
|
||||
}
|
||||
|
||||
void GUI::displaySearchTab() const {
|
||||
tabs->setCurrentIndex(TAB_SEARCH);
|
||||
if(searchEngine)
|
||||
tabs->setCurrentWidget(searchEngine);
|
||||
}
|
||||
|
||||
void GUI::displayRSSTab() const {
|
||||
tabs->setCurrentIndex(TAB_RSS);
|
||||
if(rssWidget)
|
||||
tabs->setCurrentWidget(rssWidget);
|
||||
}
|
||||
|
||||
// End of keyboard shortcuts slots
|
||||
@@ -418,7 +426,7 @@ void GUI::readSettings() {
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
settings.beginGroup(QString::fromUtf8("MainWindow"));
|
||||
restoreGeometry(settings.value("geometry").toByteArray());
|
||||
const QStringList &sizes_str = settings.value("vSplitterSizes", QStringList()).toStringList();
|
||||
const QStringList sizes_str = settings.value("vSplitterSizes", QStringList()).toStringList();
|
||||
// Splitter size
|
||||
QList<int> sizes;
|
||||
if(sizes_str.size() == 2) {
|
||||
@@ -509,10 +517,12 @@ void GUI::on_actionExit_triggered() {
|
||||
close();
|
||||
}
|
||||
|
||||
int GUI::getCurrentTabIndex() const {
|
||||
QWidget* GUI::getCurrentTabWidget() const {
|
||||
if(isMinimized() || !isVisible())
|
||||
return -1;
|
||||
return tabs->currentIndex();
|
||||
return 0;
|
||||
if(tabs->currentIndex() == 0)
|
||||
return transferList;
|
||||
return tabs->currentWidget();
|
||||
}
|
||||
|
||||
void GUI::setTabText(int index, QString text) const {
|
||||
@@ -551,7 +561,7 @@ void GUI::on_actionAbout_triggered() {
|
||||
|
||||
void GUI::showEvent(QShowEvent *e) {
|
||||
qDebug("** Show Event **");
|
||||
if(getCurrentTabIndex() == TAB_TRANSFER) {
|
||||
if(getCurrentTabWidget() == transferList) {
|
||||
qDebug("-> Refreshing transfer list");
|
||||
transferList->refreshList();
|
||||
properties->loadDynamicData();
|
||||
@@ -615,21 +625,47 @@ void GUI::on_actionCreate_torrent_triggered() {
|
||||
}
|
||||
|
||||
bool GUI::event(QEvent * e) {
|
||||
if(e->type() == QEvent::WindowStateChange) {
|
||||
qDebug("Window change event");
|
||||
//Now check to see if the window is minimised
|
||||
if(isMinimized()) {
|
||||
qDebug("minimisation");
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
if(systrayIcon && settings.value(QString::fromUtf8("Preferences/General/MinimizeToTray"), false).toBool()) {
|
||||
if(!qApp->activeWindow() || !qApp->activeWindow()->isModal()) {
|
||||
qDebug("Minimize to Tray enabled, hiding!");
|
||||
e->accept();
|
||||
QTimer::singleShot(0, this, SLOT(hide()));
|
||||
return true;
|
||||
switch(e->type()) {
|
||||
case QEvent::WindowStateChange: {
|
||||
qDebug("Window change event");
|
||||
//Now check to see if the window is minimised
|
||||
if(isMinimized()) {
|
||||
qDebug("minimisation");
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
if(systrayIcon && settings.value(QString::fromUtf8("Preferences/General/MinimizeToTray"), false).toBool()) {
|
||||
qDebug("Has active window: %d", (int)(qApp->activeWindow() != 0));
|
||||
// Check if there is a modal window
|
||||
bool has_modal_window = false;
|
||||
foreach (QWidget *widget, QApplication::allWidgets()) {
|
||||
if(widget->isModal()) {
|
||||
has_modal_window = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Iconify if there is no modal window
|
||||
if(!has_modal_window) {
|
||||
qDebug("Minimize to Tray enabled, hiding!");
|
||||
e->accept();
|
||||
QTimer::singleShot(0, this, SLOT(hide()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef Q_WS_MAC
|
||||
case QEvent::ToolBarChange: {
|
||||
qDebug("MAC: Received a toolbar change event!");
|
||||
bool ret = QMainWindow::event(e);
|
||||
|
||||
qDebug("MAC: new toolbar visibility is %d", !actionTop_tool_bar->isChecked());
|
||||
actionTop_tool_bar->toggle();
|
||||
Preferences::setToolbarDisplayed(actionTop_tool_bar->isChecked());
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return QMainWindow::event(e);
|
||||
}
|
||||
@@ -639,7 +675,7 @@ void GUI::dropEvent(QDropEvent *event) {
|
||||
event->acceptProposedAction();
|
||||
QStringList files;
|
||||
if(event->mimeData()->hasUrls()) {
|
||||
const QList<QUrl> &urls = event->mimeData()->urls();
|
||||
const QList<QUrl> urls = event->mimeData()->urls();
|
||||
foreach(const QUrl &url, urls) {
|
||||
const QString tmp = url.toString().trimmed();
|
||||
if(!tmp.isEmpty())
|
||||
@@ -652,12 +688,20 @@ void GUI::dropEvent(QDropEvent *event) {
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
|
||||
foreach(QString file, files) {
|
||||
#ifdef Q_WS_WIN
|
||||
file = file.trimmed().replace(QString::fromUtf8("file:///"), QString::fromUtf8(""), Qt::CaseInsensitive);
|
||||
#else
|
||||
file = file.trimmed().replace(QString::fromUtf8("file://"), QString::fromUtf8(""), Qt::CaseInsensitive);
|
||||
#endif
|
||||
qDebug("Dropped file %s on download list", file.toLocal8Bit().data());
|
||||
if(file.startsWith(QString::fromUtf8("http://"), Qt::CaseInsensitive) || file.startsWith(QString::fromUtf8("ftp://"), Qt::CaseInsensitive) || file.startsWith(QString::fromUtf8("https://"), Qt::CaseInsensitive)) {
|
||||
BTSession->downloadFromUrl(file);
|
||||
continue;
|
||||
}
|
||||
if(file.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
qDebug("Converting bc link to magnet link");
|
||||
file = misc::bcLinkToMagnet(file);
|
||||
}
|
||||
if(file.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
// FIXME: Possibly skipped torrent addition dialog
|
||||
BTSession->addMagnetUri(file);
|
||||
@@ -694,7 +738,7 @@ void GUI::on_actionOpen_triggered() {
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
// Open File Open Dialog
|
||||
// Note: it is possible to select more than one file
|
||||
const QStringList &pathsList = QFileDialog::getOpenFileNames(0,
|
||||
const QStringList pathsList = QFileDialog::getOpenFileNames(0,
|
||||
tr("Open Torrent Files"), settings.value(QString::fromUtf8("MainWindowLastDir"), QDir::homePath()).toString(),
|
||||
tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||
if(!pathsList.empty()) {
|
||||
@@ -731,6 +775,10 @@ void GUI::processParams(const QStringList& params) {
|
||||
if(param.startsWith(QString::fromUtf8("http://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("ftp://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("https://"), Qt::CaseInsensitive)) {
|
||||
BTSession->downloadFromUrl(param);
|
||||
}else{
|
||||
if(param.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
qDebug("Converting bc link to magnet link");
|
||||
param = misc::bcLinkToMagnet(param);
|
||||
}
|
||||
if(param.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
if(useTorrentAdditionDialog) {
|
||||
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
|
||||
@@ -885,6 +933,7 @@ void GUI::updateGUI() {
|
||||
}
|
||||
|
||||
void GUI::showNotificationBaloon(QString title, QString msg) const {
|
||||
if(!Preferences::useProgramNotification()) return;
|
||||
#ifdef WITH_LIBNOTIFY
|
||||
if (notify_init ("summary-body")) {
|
||||
NotifyNotification* notification;
|
||||
@@ -912,7 +961,11 @@ void GUI::showNotificationBaloon(QString title, QString msg) const {
|
||||
void GUI::downloadFromURLList(const QStringList& url_list) {
|
||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
|
||||
foreach(const QString& url, url_list) {
|
||||
foreach(QString url, url_list) {
|
||||
if(url.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
qDebug("Converting bc link to magnet link");
|
||||
url = misc::bcLinkToMagnet(url);
|
||||
}
|
||||
if(url.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
if(useTorrentAdditionDialog) {
|
||||
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
|
||||
@@ -1014,6 +1067,11 @@ void GUI::on_actionTop_tool_bar_triggered() {
|
||||
Preferences::setToolbarDisplayed(is_visible);
|
||||
}
|
||||
|
||||
void GUI::on_actionShutdown_when_downloads_complete_triggered() {
|
||||
bool is_checked = static_cast<QAction*>(sender())->isChecked();
|
||||
Preferences::setShutdownWhenDownloadsComplete(is_checked);
|
||||
}
|
||||
|
||||
void GUI::on_actionSpeed_in_title_bar_triggered() {
|
||||
displaySpeedInTitle = static_cast<QAction*>(sender())->isChecked();
|
||||
Preferences::showSpeedInTitleBar(displaySpeedInTitle);
|
||||
|
@@ -37,8 +37,6 @@
|
||||
#include "ui_mainwindow.h"
|
||||
#include "qtorrenthandle.h"
|
||||
|
||||
enum TabIndex{TAB_TRANSFER, TAB_SEARCH, TAB_RSS};
|
||||
|
||||
class Bittorrent;
|
||||
class QTimer;
|
||||
class downloadFromURL;
|
||||
@@ -68,7 +66,7 @@ public:
|
||||
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
|
||||
~GUI();
|
||||
// Methods
|
||||
int getCurrentTabIndex() const;
|
||||
QWidget* getCurrentTabWidget() const;
|
||||
TransferListWidget* getTransferList() const { return transferList; }
|
||||
QMenu* getTrayIconMenu();
|
||||
|
||||
@@ -172,6 +170,7 @@ private slots:
|
||||
void on_actionRSS_Reader_triggered();
|
||||
void on_actionSpeed_in_title_bar_triggered();
|
||||
void on_actionTop_tool_bar_triggered();
|
||||
void on_actionShutdown_when_downloads_complete_triggered();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
BIN
src/Icons/oxygen/go-bottom.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
src/Icons/oxygen/go-down.png
Normal file
After Width: | Height: | Size: 892 B |
BIN
src/Icons/oxygen/go-top.png
Normal file
After Width: | Height: | Size: 996 B |
BIN
src/Icons/oxygen/go-up.png
Normal file
After Width: | Height: | Size: 929 B |
BIN
src/Icons/qBitTorrentDocument.icns
Normal file
@@ -1,6 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;Network;P2P;
|
||||
Comment=V2.3.0
|
||||
Comment=V2.4.0
|
||||
Exec=qbittorrent %f
|
||||
GenericName=Bittorrent client
|
||||
GenericName[ar]=العميل Bittorrent
|
||||
|
BIN
src/Icons/skin/arrow-right.gif
Normal file
After Width: | Height: | Size: 54 B |
BIN
src/Icons/skin/delete_perm22.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
@@ -10,13 +10,13 @@
|
||||
<string>torrent</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>qbittorrentDocument</string>
|
||||
<string>qBitTorrentDocument</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>BitTorrent Document</string>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/x-bittorrent</string>
|
||||
</array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/x-bittorrent</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
@@ -47,7 +47,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>2.3.0</string>
|
||||
<string>2.4.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
|
@@ -47,7 +47,6 @@ class about : public QDialog, private Ui::AboutDlg{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
// Set icons
|
||||
logo->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/qbittorrent22.png")));
|
||||
mascot_lbl->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/mascot.png")));
|
||||
//Title
|
||||
lb_name->setText(QString::fromUtf8("<b><h1>")+tr("qBittorrent")+QString::fromUtf8(" "VERSION"</h1></b>"));
|
||||
// Thanks
|
||||
|
@@ -11,15 +11,15 @@
|
||||
#include "preferences.h"
|
||||
|
||||
enum AdvSettingsCols {PROPERTY, VALUE};
|
||||
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE };
|
||||
#define ROW_COUNT 12
|
||||
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, PROGRAM_NOTIFICATIONS };
|
||||
#define ROW_COUNT 13
|
||||
|
||||
class AdvancedSettings: public QTableWidget {
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh, *spin_maxhalfopen;
|
||||
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding;
|
||||
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding, *cb_program_notifications;
|
||||
QComboBox *combo_iface;
|
||||
|
||||
public:
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
delete spin_maxhalfopen;
|
||||
delete cb_super_seeding;
|
||||
delete combo_iface;
|
||||
delete cb_program_notifications;
|
||||
}
|
||||
|
||||
public slots:
|
||||
@@ -85,6 +86,8 @@ public slots:
|
||||
} else {
|
||||
Preferences::setNetworkInterface(combo_iface->currentText());
|
||||
}
|
||||
// Program notification
|
||||
Preferences::useProgramNotification(cb_program_notifications->isChecked());
|
||||
}
|
||||
|
||||
protected slots:
|
||||
@@ -175,7 +178,7 @@ protected slots:
|
||||
setItem(NETWORK_IFACE, PROPERTY, new QTableWidgetItem(tr("Network Interface (requires restart)")));
|
||||
combo_iface = new QComboBox;
|
||||
combo_iface->addItem(tr("Any interface", "i.e. Any network interface"));
|
||||
const QString ¤t_iface = Preferences::getNetworkInterface();
|
||||
const QString current_iface = Preferences::getNetworkInterface();
|
||||
int i = 1;
|
||||
foreach(const QNetworkInterface& iface, QNetworkInterface::allInterfaces()) {
|
||||
if(iface.name() == "lo") continue;
|
||||
@@ -186,6 +189,12 @@ protected slots:
|
||||
}
|
||||
connect(combo_iface, SIGNAL(currentIndexChanged(int)), this, SLOT(emitSettingsChanged()));
|
||||
setCellWidget(NETWORK_IFACE, VALUE, combo_iface);
|
||||
// Program notifications
|
||||
setItem(PROGRAM_NOTIFICATIONS, PROPERTY, new QTableWidgetItem(tr("Display program notification baloons")));
|
||||
cb_program_notifications = new QCheckBox();
|
||||
connect(cb_program_notifications, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
|
||||
cb_program_notifications->setChecked(Preferences::useProgramNotification());
|
||||
setCellWidget(PROGRAM_NOTIFICATIONS, VALUE, cb_program_notifications);
|
||||
}
|
||||
|
||||
void emitSettingsChanged() {
|
||||
|
@@ -108,6 +108,7 @@ public:
|
||||
session* getSession() const;
|
||||
QHash<QString, TrackerInfos> getTrackersInfo(QString hash) const;
|
||||
bool hasActiveTorrents() const;
|
||||
bool hasDownloadingTorrents() const;
|
||||
bool isQueueingEnabled() const;
|
||||
int getMaximumActiveDownloads() const;
|
||||
int getMaximumActiveTorrents() const;
|
||||
@@ -162,10 +163,10 @@ public slots:
|
||||
void startTorrentsInPause(bool b);
|
||||
void setDefaultTempPath(QString temppath);
|
||||
void setAppendLabelToSavePath(bool append);
|
||||
void appendLabelToTorrentSavePath(QTorrentHandle h);
|
||||
void changeLabelInTorrentSavePath(QTorrentHandle h, QString old_label, QString new_label);
|
||||
void appendLabelToTorrentSavePath(QTorrentHandle &h);
|
||||
void changeLabelInTorrentSavePath(QTorrentHandle &h, QString old_label, QString new_label);
|
||||
#if LIBTORRENT_VERSION_MINOR > 14
|
||||
void appendqBextensionToTorrent(QTorrentHandle h, bool append);
|
||||
void appendqBextensionToTorrent(QTorrentHandle &h, bool append);
|
||||
void setAppendqBExtension(bool append);
|
||||
#endif
|
||||
void applyEncryptionSettings(pe_settings se);
|
||||
@@ -226,6 +227,7 @@ private:
|
||||
QPointer<BandwidthScheduler> bd_scheduler;
|
||||
QMap<QUrl, QString> savepath_fromurl;
|
||||
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
||||
QHash<QString, QString> savePathsToRemove;
|
||||
QStringList torrentsToPausedAfterChecking;
|
||||
QTimer resumeDataTimer;
|
||||
// Ratio
|
||||
|
@@ -50,6 +50,7 @@
|
||||
#include "torrentpersistentdata.h"
|
||||
#include "createtorrent_imp.h"
|
||||
#include "misc.h"
|
||||
#include "qinisettings.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
using namespace boost::filesystem;
|
||||
@@ -80,8 +81,11 @@ createtorrent::~createtorrent() {
|
||||
}
|
||||
|
||||
void createtorrent::on_addFolder_button_clicked(){
|
||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), QDir::homePath(), QFileDialog::ShowDirsOnly);
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString();
|
||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), last_path, QFileDialog::ShowDirsOnly);
|
||||
if(!dir.isEmpty()) {
|
||||
settings.setValue("CreateTorrent/last_add_path", dir);
|
||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||
dir = dir.replace("/", "\\");
|
||||
#endif
|
||||
@@ -90,8 +94,11 @@ void createtorrent::on_addFolder_button_clicked(){
|
||||
}
|
||||
|
||||
void createtorrent::on_addFile_button_clicked(){
|
||||
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath());
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString();
|
||||
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), last_path);
|
||||
if(!file.isEmpty()) {
|
||||
settings.setValue("CreateTorrent/last_add_path", misc::removeLastPathPart(file));
|
||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||
file = file.replace("/", "\\");
|
||||
#endif
|
||||
@@ -177,14 +184,14 @@ void createtorrent::on_createButton_clicked(){
|
||||
return;
|
||||
}
|
||||
QStringList trackers = allItems(trackers_list);
|
||||
/*if(!trackers.size()){
|
||||
QMessageBox::critical(0, tr("No tracker path set"), tr("Please set at least one tracker"));
|
||||
return;
|
||||
}*/
|
||||
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), QDir::homePath(), tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
QString last_path = settings.value("CreateTorrent/last_save_path", QDir::homePath()).toString();
|
||||
|
||||
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), last_path, tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||
if(!destination.isEmpty()) {
|
||||
if(!destination.endsWith(QString::fromUtf8(".torrent")))
|
||||
destination += QString::fromUtf8(".torrent");
|
||||
settings.setValue("CreateTorrent/last_save_path", misc::removeLastPathPart(destination));
|
||||
destination += QString::fromUtf8(".torrent");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
|
||||
show();
|
||||
// Paste clipboard if there is an URL in it
|
||||
QString clip_txt = qApp->clipboard()->text();
|
||||
if(clip_txt.startsWith("http://", Qt::CaseInsensitive) || clip_txt.startsWith("https://", Qt::CaseInsensitive) || clip_txt.startsWith("ftp://", Qt::CaseInsensitive) || clip_txt.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
if(clip_txt.startsWith("http://", Qt::CaseInsensitive) || clip_txt.startsWith("https://", Qt::CaseInsensitive) || clip_txt.startsWith("ftp://", Qt::CaseInsensitive) || clip_txt.startsWith("magnet:", Qt::CaseInsensitive) || clip_txt.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
textUrls->setText(clip_txt);
|
||||
}
|
||||
}
|
||||
|
@@ -101,7 +101,7 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
}
|
||||
|
||||
void downloadThread::loadCookies(const QString &host_name, QString url) {
|
||||
const QList<QByteArray> &raw_cookies = Preferences::getHostNameCookies(host_name);
|
||||
const QList<QByteArray> raw_cookies = Preferences::getHostNameCookies(host_name);
|
||||
QNetworkCookieJar *cookie_jar = networkManager.cookieJar();
|
||||
QList<QNetworkCookie> cookies;
|
||||
qDebug("Loading cookies for host name: %s", qPrintable(host_name));
|
||||
@@ -135,7 +135,7 @@ QNetworkReply* downloadThread::downloadUrl(QString url){
|
||||
loadCookies(host_name, url);
|
||||
// Process download request
|
||||
qDebug("url is %s", qPrintable(url));
|
||||
const QUrl &qurl = QUrl::fromEncoded(url.toLocal8Bit());
|
||||
const QUrl qurl = QUrl::fromEncoded(url.toLocal8Bit());
|
||||
QNetworkRequest request(qurl);
|
||||
// Spoof Firefox 3.5 user agent to avoid
|
||||
// Web server banning
|
||||
|
@@ -81,7 +81,11 @@ void engineSelectDlg::dropEvent(QDropEvent *event) {
|
||||
QString file;
|
||||
foreach(file, files) {
|
||||
qDebug("dropped %s", qPrintable(file));
|
||||
#ifdef Q_WS_WIN
|
||||
file = file.replace("file:///", "");
|
||||
#else
|
||||
file = file.replace("file://", "");
|
||||
#endif
|
||||
if(file.startsWith("http://", Qt::CaseInsensitive) || file.startsWith("https://", Qt::CaseInsensitive) || file.startsWith("ftp://", Qt::CaseInsensitive)) {
|
||||
setCursor(QCursor(Qt::WaitCursor));
|
||||
downloader->downloadUrl(file);
|
||||
@@ -265,7 +269,7 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
|
||||
if(QFile::exists(dest_path)) {
|
||||
// Backup in case install fails
|
||||
QFile::copy(dest_path, dest_path+".bak");
|
||||
QFile::remove(dest_path);
|
||||
misc::safeRemove(dest_path);
|
||||
update = true;
|
||||
}
|
||||
// Copy the plugin
|
||||
@@ -276,22 +280,22 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
|
||||
if(!supported_engines->contains(plugin_name)) {
|
||||
if(update) {
|
||||
// Remove broken file
|
||||
QFile::remove(dest_path);
|
||||
misc::safeRemove(dest_path);
|
||||
// restore backup
|
||||
QFile::copy(dest_path+".bak", dest_path);
|
||||
QFile::remove(dest_path+".bak");
|
||||
misc::safeRemove(dest_path+".bak");
|
||||
QMessageBox::warning(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin could not be updated, keeping old version.", "%1 is the name of the search engine").arg(plugin_name));
|
||||
return;
|
||||
} else {
|
||||
// Remove broken file
|
||||
QFile::remove(dest_path);
|
||||
misc::safeRemove(dest_path);
|
||||
QMessageBox::warning(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin could not be installed.", "%1 is the name of the search engine").arg(plugin_name));
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Install was successful, remove backup
|
||||
if(update) {
|
||||
QFile::remove(dest_path+".bak");
|
||||
misc::safeRemove(dest_path+".bak");
|
||||
}
|
||||
if(update) {
|
||||
QMessageBox::information(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin was successfully updated.", "%1 is the name of the search engine").arg(plugin_name));
|
||||
@@ -409,7 +413,7 @@ bool engineSelectDlg::parseVersionsFile(QString versions_file) {
|
||||
// Close file
|
||||
versions.close();
|
||||
// Clean up tmp file
|
||||
QFile::remove(versions_file);
|
||||
misc::safeRemove(versions_file);
|
||||
if(file_correct && !updated) {
|
||||
QMessageBox::information(this, tr("Search plugin update")+" -- "+tr("qBittorrent"), tr("All your plugins are already up to date."));
|
||||
}
|
||||
@@ -439,21 +443,21 @@ void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
|
||||
}
|
||||
}
|
||||
// Delete tmp file
|
||||
QFile::remove(filePath);
|
||||
misc::safeRemove(filePath);
|
||||
return;
|
||||
}
|
||||
if(url.endsWith("versions.txt")) {
|
||||
if(!parseVersionsFile(filePath)) {
|
||||
QMessageBox::warning(this, tr("Search plugin update")+" -- "+tr("qBittorrent"), tr("Sorry, update server is temporarily unavailable."));
|
||||
}
|
||||
QFile::remove(filePath);
|
||||
misc::safeRemove(filePath);
|
||||
return;
|
||||
}
|
||||
if(url.endsWith(".py", Qt::CaseInsensitive)) {
|
||||
QString plugin_name = url.split('/').last();
|
||||
plugin_name.replace(".py", "");
|
||||
installPlugin(filePath, plugin_name);
|
||||
QFile::remove(filePath);
|
||||
misc::safeRemove(filePath);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -208,12 +208,6 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
|
||||
Preferences::setLSDEnabled(m["lsd"].toBool());
|
||||
if(m.contains("encryption"))
|
||||
Preferences::setEncryptionSetting(m["encryption"].toInt());
|
||||
if(m.contains("peer_id"))
|
||||
Preferences::setPeerID(m["peer_id"].toString());
|
||||
if(m.contains("peer_version"))
|
||||
Preferences::setClientVersion(m["peer_version"].toString());
|
||||
if(m.contains("peer_build"))
|
||||
Preferences::setClientBuild(m["peer_build"].toString());
|
||||
// Proxy
|
||||
if(m.contains("proxy_type"))
|
||||
Preferences::setPeerProxyType(m["proxy_type"].toInt());
|
||||
@@ -295,9 +289,6 @@ QVariantMap EventManager::getGlobalPreferences() const {
|
||||
data["pex"] = Preferences::isPeXEnabled();
|
||||
data["lsd"] = Preferences::isLSDEnabled();
|
||||
data["encryption"] = Preferences::getEncryptionSetting();
|
||||
data["peer_id"] = Preferences::getPeerID();
|
||||
data["peer_version"] = Preferences::getClientVersion();
|
||||
data["peer_build"] = Preferences::getClientBuild();
|
||||
// Proxy
|
||||
data["proxy_type"] = Preferences::getPeerProxyType();
|
||||
data["proxy_ip"] = Preferences::getPeerProxyIp();
|
||||
|
@@ -201,9 +201,14 @@ signals:
|
||||
|
||||
private:
|
||||
void addTorrentsFromDir(const QDir &dir, QStringList &torrents) {
|
||||
const QStringList &files = dir.entryList(filters, QDir::Files, QDir::Unsorted);
|
||||
foreach(const QString &file, files)
|
||||
torrents << dir.canonicalPath() + '/' + file;
|
||||
const QStringList files = dir.entryList(filters, QDir::Files, QDir::Unsorted);
|
||||
foreach(const QString &file, files) {
|
||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||
torrents << dir.absoluteFilePath(file).replace("/", "\\");
|
||||
#else
|
||||
torrents << dir.absoluteFilePath(file);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
@@ -41,6 +41,7 @@
|
||||
using namespace libtorrent;
|
||||
|
||||
class GeoIP : public QObject {
|
||||
Q_OBJECT
|
||||
protected:
|
||||
#ifdef WITH_GEOIP_EMBEDDED
|
||||
static QString geoipFolder(bool embedded=false) {
|
||||
@@ -75,7 +76,7 @@ protected:
|
||||
}
|
||||
// Remove destination files
|
||||
if(QFile::exists(geoipDBpath(false)))
|
||||
QFile::remove(geoipDBpath(false));
|
||||
misc::safeRemove(geoipDBpath(false));
|
||||
// Copy from executable to hard disk
|
||||
qDebug("%s -> %s", qPrintable(geoipDBpath(true)), qPrintable(geoipDBpath(false)));
|
||||
if(!QFile::copy(geoipDBpath(true), geoipDBpath(false))) {
|
||||
|
@@ -89,6 +89,10 @@ public slots:
|
||||
if(param.startsWith(QString::fromUtf8("http://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("ftp://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("https://"), Qt::CaseInsensitive)) {
|
||||
BTSession->downloadFromUrl(param);
|
||||
}else{
|
||||
if(param.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
qDebug("Converting bc link to magnet link");
|
||||
param = misc::bcLinkToMagnet(param);
|
||||
}
|
||||
if(param.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
BTSession->addMagnetUri(param);
|
||||
} else {
|
||||
|
@@ -133,7 +133,7 @@ QString HttpConnection::translateDocument(QString data) {
|
||||
|
||||
void HttpConnection::respond() {
|
||||
//qDebug("Respond called");
|
||||
const QString &peer_ip = socket->peerAddress().toString();
|
||||
const QString peer_ip = socket->peerAddress().toString();
|
||||
const int nb_fail = parent->NbFailedAttemptsForIp(peer_ip);
|
||||
if(nb_fail >= MAX_AUTH_FAILED_ATTEMPTS) {
|
||||
generator.setStatusLine(403, "Forbidden");
|
||||
@@ -333,6 +333,10 @@ void HttpConnection::respondCommand(QString command)
|
||||
foreach(QString url, list){
|
||||
url = url.trimmed();
|
||||
if(!url.isEmpty()){
|
||||
if(url.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
qDebug("Converting bc link to magnet link");
|
||||
url = misc::bcLinkToMagnet(url);
|
||||
}
|
||||
if(url.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||
emit MagnetReadyToBeDownloaded(url);
|
||||
} else {
|
||||
@@ -496,6 +500,16 @@ void HttpConnection::respondCommand(QString command)
|
||||
if(h.is_valid()) h.queue_position_down();
|
||||
return;
|
||||
}
|
||||
if(command == "topPrio") {
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(parser.post("hash"));
|
||||
if(h.is_valid()) h.queue_position_top();
|
||||
return;
|
||||
}
|
||||
if(command == "bottomPrio") {
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(parser.post("hash"));
|
||||
if(h.is_valid()) h.queue_position_bottom();
|
||||
return;
|
||||
}
|
||||
if(command == "recheck"){
|
||||
recheckTorrent(parser.post("hash"));
|
||||
return;
|
||||
|
300
src/icons.qrc
@@ -47,7 +47,7 @@ namespace json {
|
||||
case QVariant::LongLong:
|
||||
case QVariant::UInt:
|
||||
case QVariant::ULongLong:
|
||||
case QMetaType::Float:
|
||||
//case QMetaType::Float:
|
||||
return v.value<QString>();
|
||||
case QVariant::StringList:
|
||||
case QVariant::List: {
|
||||
|
50
src/lang.qrc
@@ -1,34 +1,34 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>lang/qbittorrent_es.qm</file>
|
||||
<file>lang/qbittorrent_sk.qm</file>
|
||||
<file>lang/qbittorrent_zh_TW.qm</file>
|
||||
<file>lang/qbittorrent_pt.qm</file>
|
||||
<file>lang/qbittorrent_sv.qm</file>
|
||||
<file>lang/qbittorrent_pl.qm</file>
|
||||
<file>lang/qbittorrent_it.qm</file>
|
||||
<file>lang/qbittorrent_ar.qm</file>
|
||||
<file>lang/qbittorrent_ko.qm</file>
|
||||
<file>lang/qbittorrent_en.qm</file>
|
||||
<file>lang/qbittorrent_ro.qm</file>
|
||||
<file>lang/qbittorrent_bg.qm</file>
|
||||
<file>lang/qbittorrent_ru.qm</file>
|
||||
<file>lang/qbittorrent_nl.qm</file>
|
||||
<file>lang/qbittorrent_nb.qm</file>
|
||||
<file>lang/qbittorrent_hu.qm</file>
|
||||
<file>lang/qbittorrent_ru.qm</file>
|
||||
<file>lang/qbittorrent_zh_TW.qm</file>
|
||||
<file>lang/qbittorrent_tr.qm</file>
|
||||
<file>lang/qbittorrent_fi.qm</file>
|
||||
<file>lang/qbittorrent_uk.qm</file>
|
||||
<file>lang/qbittorrent_cs.qm</file>
|
||||
<file>lang/qbittorrent_pt_BR.qm</file>
|
||||
<file>lang/qbittorrent_sk.qm</file>
|
||||
<file>lang/qbittorrent_ja.qm</file>
|
||||
<file>lang/qbittorrent_el.qm</file>
|
||||
<file>lang/qbittorrent_ca.qm</file>
|
||||
<file>lang/qbittorrent_hr.qm</file>
|
||||
<file>lang/qbittorrent_sr.qm</file>
|
||||
<file>lang/qbittorrent_hu.qm</file>
|
||||
<file>lang/qbittorrent_da.qm</file>
|
||||
<file>lang/qbittorrent_de.qm</file>
|
||||
<file>lang/qbittorrent_zh.qm</file>
|
||||
<file>lang/qbittorrent_ja.qm</file>
|
||||
<file>lang/qbittorrent_tr.qm</file>
|
||||
<file>lang/qbittorrent_pt.qm</file>
|
||||
<file>lang/qbittorrent_it.qm</file>
|
||||
<file>lang/qbittorrent_fr.qm</file>
|
||||
<file>lang/qbittorrent_uk.qm</file>
|
||||
<file>lang/qbittorrent_zh.qm</file>
|
||||
<file>lang/qbittorrent_ko.qm</file>
|
||||
<file>lang/qbittorrent_nb.qm</file>
|
||||
<file>lang/qbittorrent_sv.qm</file>
|
||||
<file>lang/qbittorrent_de.qm</file>
|
||||
<file>lang/qbittorrent_sr.qm</file>
|
||||
<file>lang/qbittorrent_pt_BR.qm</file>
|
||||
<file>lang/qbittorrent_da.qm</file>
|
||||
<file>lang/qbittorrent_cs.qm</file>
|
||||
<file>lang/qbittorrent_pl.qm</file>
|
||||
<file>lang/qbittorrent_bg.qm</file>
|
||||
<file>lang/qbittorrent_ar.qm</file>
|
||||
<file>lang/qbittorrent_es.qm</file>
|
||||
<file>lang/qbittorrent_en.qm</file>
|
||||
<file>lang/qbittorrent_hr.qm</file>
|
||||
<file>lang/qbittorrent_ro.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|