You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-11-09 10:02:39 +01:00
Compare commits
57 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
014b86290b | ||
|
|
9836d4ec07 | ||
|
|
b5b14d4d43 | ||
|
|
dff1666b6c | ||
|
|
e6966bec31 | ||
|
|
e92f6a3d96 | ||
|
|
f70aab3877 | ||
|
|
ec44efb261 | ||
|
|
d227ed8b59 | ||
|
|
395c2c862a | ||
|
|
e7eb61c0c3 | ||
|
|
7cd2ec57d3 | ||
|
|
4941f24fff | ||
|
|
94cb5fe0b6 | ||
|
|
4828ffa280 | ||
|
|
622d9701cb | ||
|
|
93c4b521bb | ||
|
|
9c7374e4a1 | ||
|
|
1d58e7fd7f | ||
|
|
ed9c68eea0 | ||
|
|
1b8a87c54d | ||
|
|
a33b978564 | ||
|
|
f9cf937e20 | ||
|
|
7109685913 | ||
|
|
bd222ac8bd | ||
|
|
b675f4ac58 | ||
|
|
9989ec79c9 | ||
|
|
20167c2276 | ||
|
|
e26a1d5342 | ||
|
|
3734e11879 | ||
|
|
4632c6fda9 | ||
|
|
62ff08b6b5 | ||
|
|
f50b62624a | ||
|
|
d380eb9958 | ||
|
|
a71bdde022 | ||
|
|
e8e6894b5c | ||
|
|
d92f69fa0f | ||
|
|
77d7a1ec49 | ||
|
|
d5c174a6f8 | ||
|
|
173999e504 | ||
|
|
1ed928bc39 | ||
|
|
b85d51ba79 | ||
|
|
779b53722b | ||
|
|
76780c4c46 | ||
|
|
da74f24a71 | ||
|
|
01c56865db | ||
|
|
b541c9fa4c | ||
|
|
aac0fbcbe4 | ||
|
|
b315551edd | ||
|
|
58a885cb87 | ||
|
|
d19282285c | ||
|
|
e0d8ca39a5 | ||
|
|
ec3169c9b0 | ||
|
|
7bfd7e9cda | ||
|
|
459bb8c51d | ||
|
|
9159a9f25d | ||
|
|
8ea8f8a9f7 |
4
AUTHORS
4
AUTHORS
@@ -12,10 +12,6 @@ Code from other projects:
|
|||||||
copyright: Malte Starostik <malte@kde.org>
|
copyright: Malte Starostik <malte@kde.org>
|
||||||
license: LGPL
|
license: LGPL
|
||||||
|
|
||||||
* files src/search_engine/socks.py
|
|
||||||
copyright: Dan Haim <negativeiq@users.sourceforge.net>
|
|
||||||
license: BSD
|
|
||||||
|
|
||||||
Images Authors:
|
Images Authors:
|
||||||
* files: src/Icons/*.png
|
* files: src/Icons/*.png
|
||||||
copyright: Gnome Icon Theme
|
copyright: Gnome Icon Theme
|
||||||
|
|||||||
92
Changelog
92
Changelog
@@ -1,94 +1,4 @@
|
|||||||
* Mon Feb 8 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.4
|
* Web Dec 31 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.5
|
||||||
- BUGFIX: Fix file prioritizing in a torrent
|
|
||||||
- BUGFIX: Make sure seeding torrents display a progress of 100%
|
|
||||||
- BUGFIX: Usage display was improved and localized (--help)
|
|
||||||
- BUGFIX: Fix possible crash when deleting a torrent
|
|
||||||
- BUGFIX: Fix possible crash when changing torrents label
|
|
||||||
|
|
||||||
* Sun Jan 31 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.3
|
|
||||||
- BUGFIX: Fix "Append .!qB extension to complete files" (libtorrent v0.15)
|
|
||||||
- BUGFIX: Make sure bandwidth limiting dialogs are centered on screen
|
|
||||||
- BUGFIX: Added support for HTTP redirection
|
|
||||||
- BUGFIX: Fix compilation error when geoip database is embedded
|
|
||||||
- BUGFIX: Fix crash when double-clicking on a torrent that has no metadata to open its save path
|
|
||||||
- BUGFIX: Fix Scan directory preferences in Web UI
|
|
||||||
- BUGFIX: Clear torrent error state when resuming it
|
|
||||||
|
|
||||||
* Sun Jan 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.2
|
|
||||||
- FEATURE: Added back file prioritizing in a torrent
|
|
||||||
- BUGFIX: Fix issue causing torrents not to be displayed in the list
|
|
||||||
- BUGFIX: Make sure invalid torrent are removed from the transfer list
|
|
||||||
- BUGFIX: Fix overwrite check when renaming a folder in a torrent
|
|
||||||
- BUGFIX: Force a recheck after renaming files to avoid overwriting
|
|
||||||
- BUGFIX: Improve "Open destination folder" behavior
|
|
||||||
- BUGFIX: Fix race condition in RSS that could cause a crash on startup
|
|
||||||
- BUGFIX: Improved user friendlyness of size units
|
|
||||||
- BUGFIX: Optimized transfer list repainting
|
|
||||||
- COSMETIC: Improved transfer speed display in peers list
|
|
||||||
|
|
||||||
* Wed Jan 20 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.1
|
|
||||||
- BUGFIX: Fix compilation with Qt4.4
|
|
||||||
- BUGFIX: Save torrent metadata so that it does not have to be re-downloaded on restart (Magnet links)
|
|
||||||
- BUGFIX: Fix folder renaming in a torrent (would rename children under certain conditions)
|
|
||||||
- BUGFIX: Nox version no longer requires libQtXml
|
|
||||||
- BUGFIX: Configure file now checks for pkg-config executable which is required
|
|
||||||
- BUGFIX: Torrents added from magnet links were not remembered on restart
|
|
||||||
- BUGFIX: "Add in pause" setting can be ignored from torrent addition dialog
|
|
||||||
- BUGFIX: Fix renaming of files with unicode characters in their name
|
|
||||||
- BUGFIX: Fix typo in legal notice (startup)
|
|
||||||
- BUGFIX: Can listen on ports < 1024 (must be root)
|
|
||||||
- BUGFIX: Paused torrents can now be rechecked
|
|
||||||
- BUGFIX: Fix "open torrent destination" feature when path contains spaces
|
|
||||||
- I18N: Updated translations (Hungarian, Chinese, Russian)
|
|
||||||
|
|
||||||
* Mon Jan 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.0
|
|
||||||
- FEATURE: Graphical User Interface can be disabled at compilation time (headless running)
|
|
||||||
- FEATURE: Torrents can be labeled/categorized
|
|
||||||
- FEATURE: Labeled torrent can be downloaded corresponding subfolders
|
|
||||||
- FEATURE: Disk cache size can be set from preferences
|
|
||||||
- FEATURE: Peer Exchange (PeX) can be disabled from preferences
|
|
||||||
- FEATURE: Append !.qB extension to incomplete files option (libtorrent >= v0.15 only)
|
|
||||||
- FEATURE: Torrent files/folders can be renamed (torrent addition dialog or files properties)
|
|
||||||
- FEATURE: uTorrent compatible tracker list support (use torrentz.com url as a default)
|
|
||||||
- FEATURE: Better proxy support and preferences remodeling
|
|
||||||
- FEATURE: qBittorrent can identify itself as uTorrent, Vuze or KTorrent (Any stable version)
|
|
||||||
- FEATURE: Torrents can be renamed in transfer list
|
|
||||||
- FEATURE: Display torrent addition dialog for magnet links too
|
|
||||||
- FEATURE: Files contained in a torrent are opened on double click (files panel)
|
|
||||||
- FEATURE: Added support for magnet links in search engine
|
|
||||||
- FEATURE: Added vertor.com and torrentdownloads.net search plugins
|
|
||||||
- FEATURE: Search engine can now use a SOCKS5 proxy
|
|
||||||
- FEATURE: HTTP proxy support for peer communication
|
|
||||||
- BUGFIX: Search engine loads new proxy settings without program restart
|
|
||||||
- BUGFIX: Use XDG folders (.cache, .local) instead of .qbittorrent
|
|
||||||
- BUGFIX: Added legal notice on startup that the user must accept
|
|
||||||
- BUGFIX: Protect Web UI authentication against brute forcing
|
|
||||||
- BUGFIX: Use HTTP digest mode for Web UI authentication (instead of Basic)
|
|
||||||
- BUGFIX: Properly display torrents with one file in subfolder(s)
|
|
||||||
- BUGFIX: Display Web UI favicon
|
|
||||||
- BUGFIX: File priority can be set for finished torrents that have filtered files
|
|
||||||
- COSMETIC: Use checkboxes to filter torrent content instead of comboboxes
|
|
||||||
- COSMETIC: Use alternating row colors in transfer list (set in program preferences)
|
|
||||||
- COSMETIC: Added a spin box to speed limiting dialog for manual input
|
|
||||||
|
|
||||||
* Mon Jan 11 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.0.7
|
|
||||||
- BUGFIX: Fix 'Add in pause' setting in torrent addition dialog
|
|
||||||
- BUGFIX: Update RSS feed as soon as feed downloader is enabled
|
|
||||||
- BUGFIX: RSS Feed downloader ignores articles above maximum number of articles
|
|
||||||
- BUGFIX: Fix possible bug when deleting a RSS folder
|
|
||||||
- BUGFIX: Remove persistant data when a RSS feed is deleted
|
|
||||||
- BUGFIX: RSS filters are now alphabetically sorted
|
|
||||||
- BUGFIX: Fix crash when renaming currently displayed RSS filter
|
|
||||||
- BUGFIX: Remove overwriting confirmation when exporting RSS filters since Qt takes care of it
|
|
||||||
|
|
||||||
* Tue Jan 5 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.0.6
|
|
||||||
- BUGFIX: Fix detection of invalid torrent files
|
|
||||||
- BUGFIX: Stop catching signals once one has been caught to avoid possible infinite loop
|
|
||||||
- BUGFIX: Force data recheck whenever a torrent is moved
|
|
||||||
- BUGFIX: Detect existing torrent data even if incomplete torrents are saved to a different folder
|
|
||||||
- COSMETIC: Improve torrent deletion confirmation dialog so that the text that not get truncated
|
|
||||||
|
|
||||||
* Thu Dec 31 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.5
|
|
||||||
- BUGFIX: Fix crash with downloaded/availability bars when the torrent has too many pieces
|
- BUGFIX: Fix crash with downloaded/availability bars when the torrent has too many pieces
|
||||||
|
|
||||||
* Wed Dec 30 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.4
|
* Wed Dec 30 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.4
|
||||||
|
|||||||
61
INSTALL
61
INSTALL
@@ -1,55 +1,32 @@
|
|||||||
qBittorrent - A BitTorrent client in C++ / Qt4
|
qBittorrent - A BitTorrent client in C++ / Qt4
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
1) Compile and install qBittorrent with Qt4 Graphical Interface
|
./configure
|
||||||
|
make && make install
|
||||||
|
qbittorrent
|
||||||
|
|
||||||
$ ./configure
|
will install and execute qBittorrent hopefully without any problems.
|
||||||
$ make && make install
|
|
||||||
$ qbittorrent
|
|
||||||
|
|
||||||
will install and execute qBittorrent hopefully without any problems.
|
Dependencies:
|
||||||
|
- Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
|
||||||
|
|
||||||
Dependencies:
|
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.0 REQUIRED, >= v0.15.0 ADVISED)
|
||||||
- Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
|
-> http://www.qbittorrent.org/download.php (advised)
|
||||||
|
-> http://www.libtorrent.net
|
||||||
|
Be careful: another library (the one used by rTorrent) uses a similar name.
|
||||||
|
|
||||||
- pkg-config executable
|
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
||||||
|
|
||||||
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, >= v0.15.0 ADVISED)
|
- python >= 2.3 (needed by search engine)
|
||||||
-> http://www.libtorrent.net
|
* Run time only dependency
|
||||||
Be careful: another library (the one used by rTorrent) uses a similar name.
|
|
||||||
|
|
||||||
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
- libnotify >= 0.4.2, glib-2.0 (optional)
|
||||||
|
* Can be used for system notifications to replace standard Qt notifications
|
||||||
- python >= 2.3 (needed by search engine)
|
so that it integrates better into the Desktop
|
||||||
* Run time only dependency
|
|
||||||
|
|
||||||
- libnotify >= 0.4.2, glib-2.0 (optional)
|
|
||||||
* Can be used for system notifications to replace standard Qt notifications
|
|
||||||
so that it integrates better into the Desktop
|
|
||||||
|
|
||||||
- geoip-database (optional)
|
|
||||||
* If qBittorrent cannot find this database, it will try to resolve countries using the Internet but it will be a lot slower.
|
|
||||||
* Run time only dependency
|
|
||||||
|
|
||||||
2) Compile and install qBittorrent without Qt4 Graphical interface
|
|
||||||
|
|
||||||
$ ./configure --disable-gui
|
|
||||||
$ make && make install
|
|
||||||
$ qbittorrent
|
|
||||||
|
|
||||||
will install and execute qBittorrent hopefully without any problems.
|
|
||||||
|
|
||||||
Dependencies:
|
|
||||||
- Qt >= 4.4.0 (libqt-devel, libqtcore, libqtnetwork)
|
|
||||||
|
|
||||||
- pkg-config executable
|
|
||||||
|
|
||||||
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, >= v0.15.0 ADVISED)
|
|
||||||
-> http://www.libtorrent.net
|
|
||||||
Be careful: another library (the one used by rTorrent) uses a similar name.
|
|
||||||
|
|
||||||
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
|
||||||
|
|
||||||
|
- geoip-database (optional)
|
||||||
|
* If qBittorrent cannot find this database, it will try to resolve countries using the Internet but it will be a lot slower.
|
||||||
|
* Run time only dependency
|
||||||
|
|
||||||
DOCUMENTATION:
|
DOCUMENTATION:
|
||||||
Please note that there is a documentation with a "compiling howto" at http://wiki.qbittorrent.org.
|
Please note that there is a documentation with a "compiling howto" at http://wiki.qbittorrent.org.
|
||||||
|
|||||||
55
configure
vendored
55
configure
vendored
@@ -18,8 +18,6 @@ Main options:
|
|||||||
--help This help text.
|
--help This help text.
|
||||||
|
|
||||||
Dependency options:
|
Dependency options:
|
||||||
--disable-gui Disable qBittorrent Graphical user
|
|
||||||
interface for headless running
|
|
||||||
--with-libboost-inc=[path] Path to libboost include files
|
--with-libboost-inc=[path] Path to libboost include files
|
||||||
--disable-libnotify Disable use of libnotify
|
--disable-libnotify Disable use of libnotify
|
||||||
--disable-geoip-database Disable use of geoip-database
|
--disable-geoip-database Disable use of geoip-database
|
||||||
@@ -142,11 +140,6 @@ while [ $# -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--disable-gui)
|
|
||||||
QC_DISABLE_GUI="Y"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
|
|
||||||
--with-libboost-inc=*)
|
--with-libboost-inc=*)
|
||||||
QC_WITH_LIBBOOST_INC=$optarg
|
QC_WITH_LIBBOOST_INC=$optarg
|
||||||
shift
|
shift
|
||||||
@@ -188,7 +181,6 @@ echo PREFIX=$PREFIX
|
|||||||
echo BINDIR=$BINDIR
|
echo BINDIR=$BINDIR
|
||||||
echo DATADIR=$DATADIR
|
echo DATADIR=$DATADIR
|
||||||
echo EX_QTDIR=$EX_QTDIR
|
echo EX_QTDIR=$EX_QTDIR
|
||||||
echo QC_DISABLE_GUI=$QC_DISABLE_GUI
|
|
||||||
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
||||||
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
|
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
|
||||||
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
|
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
|
||||||
@@ -298,7 +290,6 @@ cat >$1/modules.cpp <<EOT
|
|||||||
/*
|
/*
|
||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
name: Qt >= 4.4
|
name: Qt >= 4.4
|
||||||
arg: disable-gui, Disable qBittorrent Graphical user interface for headless running
|
|
||||||
-----END QCMOD-----
|
-----END QCMOD-----
|
||||||
*/
|
*/
|
||||||
class qc_qt4 : public ConfObj
|
class qc_qt4 : public ConfObj
|
||||||
@@ -309,9 +300,6 @@ public:
|
|||||||
QString shortname() const { return "Qt 4.4"; }
|
QString shortname() const { return "Qt 4.4"; }
|
||||||
bool exec()
|
bool exec()
|
||||||
{
|
{
|
||||||
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
|
||||||
conf->addDefine("DISABLE_GUI");
|
|
||||||
}
|
|
||||||
if(QT_VERSION >= 0x040500) {
|
if(QT_VERSION >= 0x040500) {
|
||||||
conf->addDefine("QT_4_5");
|
conf->addDefine("QT_4_5");
|
||||||
}
|
}
|
||||||
@@ -319,23 +307,6 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#line 1 "pkg-config.qcm"
|
|
||||||
/*
|
|
||||||
-----BEGIN QCMOD-----
|
|
||||||
name: pkg-config
|
|
||||||
-----END QCMOD-----
|
|
||||||
*/
|
|
||||||
#include <QProcess>
|
|
||||||
class qc_pkg_config : public ConfObj
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
qc_pkg_config(Conf *c) : ConfObj(c) {}
|
|
||||||
QString name() const { return "pkg-config executable"; }
|
|
||||||
QString shortname() const { return "pkg-config"; }
|
|
||||||
bool exec(){
|
|
||||||
return !conf->findProgram("pkg-config").isEmpty();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#line 1 "libtorrent-rasterbar.qcm"
|
#line 1 "libtorrent-rasterbar.qcm"
|
||||||
/*
|
/*
|
||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
@@ -347,11 +318,11 @@ class qc_libtorrent_rasterbar : public ConfObj
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
|
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libtorrent-rasterbar >= 0.14.4"; }
|
QString name() const { return "libtorrent-rasterbar >= 0.14.0 (>= 0.15.0 advised)"; }
|
||||||
QString shortname() const { return "libtorrent-rasterbar"; }
|
QString shortname() const { return "libtorrent-rasterbar"; }
|
||||||
bool exec(){
|
bool exec(){
|
||||||
QStringList incs;
|
QStringList incs;
|
||||||
QString req_ver = "0.14.4";
|
QString req_ver = "0.14.0";
|
||||||
QString adv_ver = "0.15.0";
|
QString adv_ver = "0.15.0";
|
||||||
QString version, libs, other;
|
QString version, libs, other;
|
||||||
VersionMode mode = VersionMin;
|
VersionMode mode = VersionMin;
|
||||||
@@ -362,7 +333,7 @@ public:
|
|||||||
if(!libs.isEmpty())
|
if(!libs.isEmpty())
|
||||||
conf->addLib(libs);
|
conf->addLib(libs);
|
||||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
|
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
|
||||||
printf("\nWarning: libtorrent-rasterbar v%s was detected. Some feature will be disabled because they require v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
|
printf("\nWarning: libtorrent-rasterbar v%s was detected.\nAlthough it will compile and run, you will be missing some features. Please consider updating to v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
|
||||||
else
|
else
|
||||||
conf->addDefine("LIBTORRENT_0_15");
|
conf->addDefine("LIBTORRENT_0_15");
|
||||||
return true;
|
return true;
|
||||||
@@ -438,15 +409,7 @@ public:
|
|||||||
qc_libnotify(Conf *c) : ConfObj(c) {}
|
qc_libnotify(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
||||||
QString shortname() const { return "libnotify"; }
|
QString shortname() const { return "libnotify"; }
|
||||||
QString checkString() const {
|
|
||||||
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty())
|
|
||||||
return "";
|
|
||||||
return ConfObj::checkString();
|
|
||||||
}
|
|
||||||
bool exec(){
|
bool exec(){
|
||||||
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
QStringList incs;
|
QStringList incs;
|
||||||
QString req_ver = "0.4.2";
|
QString req_ver = "0.4.2";
|
||||||
QString version, libs, other;
|
QString version, libs, other;
|
||||||
@@ -489,15 +452,7 @@ public:
|
|||||||
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "GeoIP Database (optional)"; }
|
QString name() const { return "GeoIP Database (optional)"; }
|
||||||
QString shortname() const { return "GeoIP Database"; }
|
QString shortname() const { return "GeoIP Database"; }
|
||||||
QString checkString() const {
|
|
||||||
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty())
|
|
||||||
return "";
|
|
||||||
return ConfObj::checkString();
|
|
||||||
}
|
|
||||||
bool exec() {
|
bool exec() {
|
||||||
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
||||||
#endif
|
#endif
|
||||||
@@ -519,9 +474,6 @@ cat >$1/modules_new.cpp <<EOT
|
|||||||
o = new qc_qt4(conf);
|
o = new qc_qt4(conf);
|
||||||
o->required = true;
|
o->required = true;
|
||||||
o->disabled = false;
|
o->disabled = false;
|
||||||
o = new qc_pkg_config(conf);
|
|
||||||
o->required = true;
|
|
||||||
o->disabled = false;
|
|
||||||
o = new qc_libtorrent_rasterbar(conf);
|
o = new qc_libtorrent_rasterbar(conf);
|
||||||
o->required = true;
|
o->required = true;
|
||||||
o->disabled = false;
|
o->disabled = false;
|
||||||
@@ -1479,7 +1431,6 @@ export PREFIX
|
|||||||
export BINDIR
|
export BINDIR
|
||||||
export DATADIR
|
export DATADIR
|
||||||
export EX_QTDIR
|
export EX_QTDIR
|
||||||
export QC_DISABLE_GUI
|
|
||||||
export QC_WITH_LIBBOOST_INC
|
export QC_WITH_LIBBOOST_INC
|
||||||
export QC_DISABLE_libnotify
|
export QC_DISABLE_libnotify
|
||||||
export QC_DISABLE_geoip_database
|
export QC_DISABLE_geoip_database
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
.\" This manpage has been automatically generated by docbook2man
|
|
||||||
.\" from a DocBook document. This tool can be found at:
|
|
||||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>.
|
|
||||||
.TH "QBITTORRENT\-NOX" "1" "January 16th 2010" "Command line Bittorrent client written in C++ / Qt4" ""
|
|
||||||
|
|
||||||
.SH "NAME"
|
|
||||||
qBittorrent\-nox \- a command line Bittorrent client written in C++ / Qt4
|
|
||||||
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
|
|
||||||
\fBqbittorrent\-nox\fR [\-\-webui-port=x] [TORRENT_FILE | URL]...
|
|
||||||
|
|
||||||
\fBqbittorrent\-nox\fR \-\-help
|
|
||||||
|
|
||||||
\fBqbittorrent\-nox\fR \-\-version
|
|
||||||
|
|
||||||
.PP
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
|
|
||||||
\fBqBittorrent-nox\fR is an advanced command-line Bittorrent client written in C++ / Qt4,
|
|
||||||
using the \fBlibtorrent-rasterbar\fR library by Arvid Norberg. qBittorrent\-nox aims
|
|
||||||
to be a good alternative to other command line bittorrent clients and provides features similar to popular graphical clients.
|
|
||||||
|
|
||||||
qBittorrent\-nox is fast, stable, light and it supports unicode.
|
|
||||||
It also comes with UPnP port forwarding / NAT-PMP, encryption (Vuze compatible),
|
|
||||||
FAST extension (mainline) and PeX support (utorrent compatible).
|
|
||||||
|
|
||||||
qBittorrent\-nox is meant to be controlled via its feature-rich Web UI which is accessible as a default on http://localhost:8080. The Web UI access is secured and the default account user name is "admin" with "adminadmin" as a password.
|
|
||||||
|
|
||||||
.SH "OPTIONS"
|
|
||||||
|
|
||||||
\fB--help\fR Prints the command line options.
|
|
||||||
|
|
||||||
\fB--version\fR Prints qbittorrent program version number.
|
|
||||||
|
|
||||||
\fB--webui-port=x\fR Changes Web UI port to x (default: 8080).
|
|
||||||
|
|
||||||
.SH "BUGS"
|
|
||||||
|
|
||||||
If you find a bug, please report it at http://bugs.qbittorrent.org
|
|
||||||
|
|
||||||
.SH "AUTHOR"
|
|
||||||
|
|
||||||
Christophe Dumez <chris@qbittorrent.org>
|
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
.\" This manpage has been automatically generated by docbook2man
|
.\" This manpage has been automatically generated by docbook2man
|
||||||
.\" from a DocBook document. This tool can be found at:
|
.\" from a DocBook document. This tool can be found at:
|
||||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>.
|
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>.
|
||||||
.TH "QBITTORRENT" "1" "January 16th 2010" "Bittorrent client written in C++ / Qt4" ""
|
.TH "QBITTORRENT" "1" "September 30th 2009" "Bittorrent client written in C++ / Qt4" ""
|
||||||
|
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
qBittorrent \- a Bittorrent client written in C++ / Qt4
|
qBittorrent \- a Bittorrent client written in C++ / Qt4
|
||||||
|
|
||||||
.SH "SYNOPSIS"
|
.SH "SYNOPSIS"
|
||||||
|
|
||||||
\fBqbittorrent\fR [\-\-no-splash] [\-\-webui-port=x] [TORRENT_FILE | URL]...
|
\fBqbittorrent\fR [\-\-no-splash] [TORRENT_FILE | URL]...
|
||||||
|
|
||||||
\fBqbittorrent\fR \-\-help
|
\fBqbittorrent\fR \-\-help
|
||||||
|
|
||||||
@@ -18,9 +18,10 @@ qBittorrent \- a Bittorrent client written in C++ / Qt4
|
|||||||
.SH "DESCRIPTION"
|
.SH "DESCRIPTION"
|
||||||
|
|
||||||
\fBqBittorrent\fR is an advanced Bittorrent client written in C++ / Qt4,
|
\fBqBittorrent\fR is an advanced Bittorrent client written in C++ / Qt4,
|
||||||
using the \fBlibtorrent-rasterbar\fR library by Arvid Norberg. qBittorrent is similar to uTorrent. qBittorrent
|
using the \fBrblibtorrent\fR library by Arvid Norberg. qBittorrent aims
|
||||||
|
to be a good alternative to all other bittorrent clients out there. qBittorrent
|
||||||
is fast, stable, light, it supports unicode and it provides a good integrated search engine.
|
is fast, stable, light, it supports unicode and it provides a good integrated search engine.
|
||||||
It also comes with UPnP port forwarding / NAT-PMP, encryption (Vuze compatible),
|
It also comes with UPnP port forwarding / NAT-PMP, encryption (Azureus compatible),
|
||||||
FAST extension (mainline) and PeX support (utorrent compatible).
|
FAST extension (mainline) and PeX support (utorrent compatible).
|
||||||
|
|
||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
@@ -31,8 +32,6 @@ FAST extension (mainline) and PeX support (utorrent compatible).
|
|||||||
|
|
||||||
\fB--no-splash\fR Disables splash screen on startup.
|
\fB--no-splash\fR Disables splash screen on startup.
|
||||||
|
|
||||||
\fB--webui-port=x\fR Changes Web UI port to x (default: 8080).
|
|
||||||
|
|
||||||
.SH "BUGS"
|
.SH "BUGS"
|
||||||
|
|
||||||
If you find a bug, please report it at http://bugs.qbittorrent.org
|
If you find a bug, please report it at http://bugs.qbittorrent.org
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
|
include(conf.pri)
|
||||||
|
|
||||||
SUBDIRS += src
|
SUBDIRS += src
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,6 @@
|
|||||||
<dep type='qt4'>
|
<dep type='qt4'>
|
||||||
<required/>
|
<required/>
|
||||||
</dep>
|
</dep>
|
||||||
<dep type='pkg-config'>
|
|
||||||
<required/>
|
|
||||||
</dep>
|
|
||||||
<dep type='libtorrent-rasterbar'>
|
<dep type='libtorrent-rasterbar'>
|
||||||
<required/>
|
<required/>
|
||||||
</dep>
|
</dep>
|
||||||
|
|||||||
@@ -11,15 +11,7 @@ public:
|
|||||||
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "GeoIP Database (optional)"; }
|
QString name() const { return "GeoIP Database (optional)"; }
|
||||||
QString shortname() const { return "GeoIP Database"; }
|
QString shortname() const { return "GeoIP Database"; }
|
||||||
QString checkString() const {
|
|
||||||
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty())
|
|
||||||
return "";
|
|
||||||
return ConfObj::checkString();
|
|
||||||
}
|
|
||||||
bool exec() {
|
bool exec() {
|
||||||
if(!conf->getenv("QC_DISABLE_geoip_database").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -10,15 +10,7 @@ public:
|
|||||||
qc_libnotify(Conf *c) : ConfObj(c) {}
|
qc_libnotify(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
||||||
QString shortname() const { return "libnotify"; }
|
QString shortname() const { return "libnotify"; }
|
||||||
QString checkString() const {
|
|
||||||
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty())
|
|
||||||
return "";
|
|
||||||
return ConfObj::checkString();
|
|
||||||
}
|
|
||||||
bool exec(){
|
bool exec(){
|
||||||
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
QStringList incs;
|
QStringList incs;
|
||||||
QString req_ver = "0.4.2";
|
QString req_ver = "0.4.2";
|
||||||
QString version, libs, other;
|
QString version, libs, other;
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ class qc_libtorrent_rasterbar : public ConfObj
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
|
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libtorrent-rasterbar >= 0.14.4"; }
|
QString name() const { return "libtorrent-rasterbar >= 0.14.0 (>= 0.15.0 advised)"; }
|
||||||
QString shortname() const { return "libtorrent-rasterbar"; }
|
QString shortname() const { return "libtorrent-rasterbar"; }
|
||||||
bool exec(){
|
bool exec(){
|
||||||
QStringList incs;
|
QStringList incs;
|
||||||
QString req_ver = "0.14.4";
|
QString req_ver = "0.14.0";
|
||||||
QString adv_ver = "0.15.0";
|
QString adv_ver = "0.15.0";
|
||||||
QString version, libs, other;
|
QString version, libs, other;
|
||||||
VersionMode mode = VersionMin;
|
VersionMode mode = VersionMin;
|
||||||
@@ -23,7 +23,7 @@ public:
|
|||||||
if(!libs.isEmpty())
|
if(!libs.isEmpty())
|
||||||
conf->addLib(libs);
|
conf->addLib(libs);
|
||||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
|
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
|
||||||
printf("\nWarning: libtorrent-rasterbar v%s was detected. Some feature will be disabled because they require v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
|
printf("\nWarning: libtorrent-rasterbar v%s was detected.\nAlthough it will compile and run, you will be missing some features. Please consider updating to v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
|
||||||
else
|
else
|
||||||
conf->addDefine("LIBTORRENT_0_15");
|
conf->addDefine("LIBTORRENT_0_15");
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
/*
|
|
||||||
-----BEGIN QCMOD-----
|
|
||||||
name: pkg-config
|
|
||||||
-----END QCMOD-----
|
|
||||||
*/
|
|
||||||
#include <QProcess>
|
|
||||||
class qc_pkg_config : public ConfObj
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
qc_pkg_config(Conf *c) : ConfObj(c) {}
|
|
||||||
QString name() const { return "pkg-config executable"; }
|
|
||||||
QString shortname() const { return "pkg-config"; }
|
|
||||||
bool exec(){
|
|
||||||
return !conf->findProgram("pkg-config").isEmpty();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
name: Qt >= 4.4
|
name: Qt >= 4.4
|
||||||
arg: disable-gui, Disable qBittorrent Graphical user interface for headless running
|
|
||||||
-----END QCMOD-----
|
-----END QCMOD-----
|
||||||
*/
|
*/
|
||||||
class qc_qt4 : public ConfObj
|
class qc_qt4 : public ConfObj
|
||||||
@@ -12,9 +11,6 @@ public:
|
|||||||
QString shortname() const { return "Qt 4.4"; }
|
QString shortname() const { return "Qt 4.4"; }
|
||||||
bool exec()
|
bool exec()
|
||||||
{
|
{
|
||||||
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
|
||||||
conf->addDefine("DISABLE_GUI");
|
|
||||||
}
|
|
||||||
if(QT_VERSION >= 0x040500) {
|
if(QT_VERSION >= 0x040500) {
|
||||||
conf->addDefine("QT_4_5");
|
conf->addDefine("QT_4_5");
|
||||||
}
|
}
|
||||||
|
|||||||
53
src/GUI.cpp
53
src/GUI.cpp
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QDesktopWidget>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
@@ -59,8 +60,6 @@
|
|||||||
#include "speedlimitdlg.h"
|
#include "speedlimitdlg.h"
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
#include "console_imp.h"
|
#include "console_imp.h"
|
||||||
#include "trackerlist.h"
|
|
||||||
#include "peerlistwidget.h"
|
|
||||||
#include "torrentpersistentdata.h"
|
#include "torrentpersistentdata.h"
|
||||||
#include "transferlistfilterswidget.h"
|
#include "transferlistfilterswidget.h"
|
||||||
#include "propertieswidget.h"
|
#include "propertieswidget.h"
|
||||||
@@ -79,7 +78,6 @@ using namespace libtorrent;
|
|||||||
// Constructor
|
// Constructor
|
||||||
GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), displaySpeedInTitle(false), force_exit(false) {
|
GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), displaySpeedInTitle(false), force_exit(false) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
||||||
// Setting icons
|
// Setting icons
|
||||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
||||||
@@ -187,15 +185,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
readSettings();
|
readSettings();
|
||||||
properties->readSettings();
|
properties->readSettings();
|
||||||
|
|
||||||
// Limit status filters list height
|
|
||||||
int cur_height = 80;
|
|
||||||
do {
|
|
||||||
transferListFilters->getStatusFilters()->setFixedHeight(cur_height);
|
|
||||||
cur_height += 10;
|
|
||||||
transferListFilters->getStatusFilters()->scrollToBottom();
|
|
||||||
}while(transferListFilters->getStatusFilters()->verticalScrollBar()->sliderPosition() > 0);
|
|
||||||
transferListFilters->getStatusFilters()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
|
||||||
|
|
||||||
if(Preferences::startMinimized()) {
|
if(Preferences::startMinimized()) {
|
||||||
setWindowState(Qt::WindowMinimized);
|
setWindowState(Qt::WindowMinimized);
|
||||||
}
|
}
|
||||||
@@ -355,7 +344,7 @@ void GUI::readSettings() {
|
|||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
settings.beginGroup(QString::fromUtf8("MainWindow"));
|
settings.beginGroup(QString::fromUtf8("MainWindow"));
|
||||||
resize(settings.value(QString::fromUtf8("size"), size()).toSize());
|
resize(settings.value(QString::fromUtf8("size"), size()).toSize());
|
||||||
move(settings.value(QString::fromUtf8("pos"), misc::screenCenter(this)).toPoint());
|
move(settings.value(QString::fromUtf8("pos"), screenCenter()).toPoint());
|
||||||
QStringList sizes_str = settings.value("vSplitterSizes", QStringList()).toStringList();
|
QStringList sizes_str = settings.value("vSplitterSizes", QStringList()).toStringList();
|
||||||
// Splitter size
|
// Splitter size
|
||||||
QList<int> sizes;
|
QList<int> sizes;
|
||||||
@@ -474,6 +463,22 @@ void GUI::toggleVisibility(QSystemTrayIcon::ActivationReason e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Center window
|
||||||
|
QPoint GUI::screenCenter() const{
|
||||||
|
int scrn = 0;
|
||||||
|
QWidget *w = this->topLevelWidget();
|
||||||
|
|
||||||
|
if(w)
|
||||||
|
scrn = QApplication::desktop()->screenNumber(w);
|
||||||
|
else if(QApplication::desktop()->isVirtualDesktop())
|
||||||
|
scrn = QApplication::desktop()->screenNumber(QCursor::pos());
|
||||||
|
else
|
||||||
|
scrn = QApplication::desktop()->screenNumber(this);
|
||||||
|
|
||||||
|
QRect desk(QApplication::desktop()->availableGeometry(scrn));
|
||||||
|
return QPoint((desk.width() - this->frameGeometry().width()) / 2, (desk.height() - this->frameGeometry().height()) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
// Display About Dialog
|
// Display About Dialog
|
||||||
void GUI::on_actionAbout_triggered() {
|
void GUI::on_actionAbout_triggered() {
|
||||||
//About dialog
|
//About dialog
|
||||||
@@ -645,12 +650,8 @@ void GUI::processParams(const QStringList& params) {
|
|||||||
BTSession->downloadFromUrl(param);
|
BTSession->downloadFromUrl(param);
|
||||||
}else{
|
}else{
|
||||||
if(param.startsWith("magnet:", Qt::CaseInsensitive)) {
|
if(param.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||||
if(useTorrentAdditionDialog) {
|
// FIXME: Possibily skipped torrent addition dialog
|
||||||
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
|
BTSession->addMagnetUri(param);
|
||||||
dialog->showLoadMagnetURI(param);
|
|
||||||
} else {
|
|
||||||
BTSession->addMagnetUri(param);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(useTorrentAdditionDialog) {
|
if(useTorrentAdditionDialog) {
|
||||||
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
|
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
|
||||||
@@ -723,10 +724,7 @@ void GUI::loadPreferences(bool configure_session) {
|
|||||||
}
|
}
|
||||||
unsigned int new_refreshInterval = Preferences::getRefreshInterval();
|
unsigned int new_refreshInterval = Preferences::getRefreshInterval();
|
||||||
transferList->setRefreshInterval(new_refreshInterval);
|
transferList->setRefreshInterval(new_refreshInterval);
|
||||||
transferList->setAlternatingRowColors(Preferences::useAlternatingRowColors());
|
|
||||||
properties->getFilesList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
|
|
||||||
properties->getTrackerList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
|
|
||||||
properties->getPeerList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
|
|
||||||
// Queueing System
|
// Queueing System
|
||||||
if(Preferences::isQueueingSystemEnabled()) {
|
if(Preferences::isQueueingSystemEnabled()) {
|
||||||
if(!configure_session || !BTSession->isQueueingEnabled()) {
|
if(!configure_session || !BTSession->isQueueingEnabled()) {
|
||||||
@@ -834,16 +832,9 @@ void GUI::showNotificationBaloon(QString title, QString msg) const {
|
|||||||
*****************************************************/
|
*****************************************************/
|
||||||
|
|
||||||
void GUI::downloadFromURLList(const QStringList& url_list) {
|
void GUI::downloadFromURLList(const QStringList& url_list) {
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
|
||||||
bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
|
|
||||||
foreach(const QString url, url_list) {
|
foreach(const QString url, url_list) {
|
||||||
if(url.startsWith("magnet:", Qt::CaseInsensitive)) {
|
if(url.startsWith("magnet:", Qt::CaseInsensitive)) {
|
||||||
if(useTorrentAdditionDialog) {
|
BTSession->addMagnetUri(url);
|
||||||
torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
|
|
||||||
dialog->showLoadMagnetURI(url);
|
|
||||||
} else {
|
|
||||||
BTSession->addMagnetUri(url);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
BTSession->downloadFromUrl(url);
|
BTSession->downloadFromUrl(url);
|
||||||
}
|
}
|
||||||
|
|||||||
186
src/GUI.h
186
src/GUI.h
@@ -59,104 +59,104 @@ class StatusBar;
|
|||||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Bittorrent
|
// Bittorrent
|
||||||
Bittorrent *BTSession;
|
Bittorrent *BTSession;
|
||||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
|
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
|
||||||
// GUI related
|
// GUI related
|
||||||
QTimer *guiUpdater;
|
QTimer *guiUpdater;
|
||||||
QTabWidget *tabs;
|
QTabWidget *tabs;
|
||||||
StatusBar *status_bar;
|
StatusBar *status_bar;
|
||||||
QPointer<options_imp> options;
|
QPointer<options_imp> options;
|
||||||
QPointer<QSystemTrayIcon> systrayIcon;
|
QPointer<QSystemTrayIcon> systrayIcon;
|
||||||
QPointer<QTimer> systrayCreator;
|
QPointer<QTimer> systrayCreator;
|
||||||
QMenu *myTrayIconMenu;
|
QMenu *myTrayIconMenu;
|
||||||
TransferListWidget *transferList;
|
TransferListWidget *transferList;
|
||||||
TransferListFiltersWidget *transferListFilters;
|
TransferListFiltersWidget *transferListFilters;
|
||||||
PropertiesWidget *properties;
|
PropertiesWidget *properties;
|
||||||
bool displaySpeedInTitle;
|
bool displaySpeedInTitle;
|
||||||
bool force_exit;
|
bool force_exit;
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
QShortcut *switchSearchShortcut;
|
QShortcut *switchSearchShortcut;
|
||||||
QShortcut *switchSearchShortcut2;
|
QShortcut *switchSearchShortcut2;
|
||||||
QShortcut *switchTransferShortcut;
|
QShortcut *switchTransferShortcut;
|
||||||
QShortcut *switchRSSShortcut;
|
QShortcut *switchRSSShortcut;
|
||||||
// Widgets
|
// Widgets
|
||||||
QAction *prioSeparator;
|
QAction *prioSeparator;
|
||||||
QAction *prioSeparator2;
|
QAction *prioSeparator2;
|
||||||
QSplitter *hSplitter;
|
QSplitter *hSplitter;
|
||||||
QSplitter *vSplitter;
|
QSplitter *vSplitter;
|
||||||
// Search
|
// Search
|
||||||
SearchEngine *searchEngine;
|
SearchEngine *searchEngine;
|
||||||
// RSS
|
// RSS
|
||||||
QPointer<RSSImp> rssWidget;
|
QPointer<RSSImp> rssWidget;
|
||||||
// Misc
|
// Misc
|
||||||
QLocalServer *localServer;
|
QLocalServer *localServer;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
// GUI related slots
|
// GUI related slots
|
||||||
void dropEvent(QDropEvent *event);
|
void dropEvent(QDropEvent *event);
|
||||||
void dragEnterEvent(QDragEnterEvent *event);
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
void toggleVisibility(QSystemTrayIcon::ActivationReason e);
|
void toggleVisibility(QSystemTrayIcon::ActivationReason e);
|
||||||
void on_actionAbout_triggered();
|
void on_actionAbout_triggered();
|
||||||
void on_actionCreate_torrent_triggered();
|
void on_actionCreate_torrent_triggered();
|
||||||
void on_actionWebsite_triggered() const;
|
void on_actionWebsite_triggered() const;
|
||||||
void on_actionBugReport_triggered() const;
|
void on_actionBugReport_triggered() const;
|
||||||
void on_actionShow_console_triggered();
|
void on_actionShow_console_triggered();
|
||||||
void readParamsOnSocket();
|
void readParamsOnSocket();
|
||||||
void acceptConnection();
|
void acceptConnection();
|
||||||
void balloonClicked();
|
void balloonClicked();
|
||||||
void writeSettings();
|
void writeSettings();
|
||||||
void readSettings();
|
void readSettings();
|
||||||
void on_actionExit_triggered();
|
void on_actionExit_triggered();
|
||||||
void createTrayIcon();
|
void createTrayIcon();
|
||||||
void fullDiskError(QTorrentHandle& h, QString msg) const;
|
void fullDiskError(QTorrentHandle& h, QString msg) const;
|
||||||
void handleDownloadFromUrlFailure(QString, QString) const;
|
void handleDownloadFromUrlFailure(QString, QString) const;
|
||||||
void createSystrayDelayed();
|
void createSystrayDelayed();
|
||||||
void tab_changed(int);
|
void tab_changed(int);
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
void createKeyboardShortcuts();
|
void createKeyboardShortcuts();
|
||||||
void displayTransferTab() const;
|
void displayTransferTab() const;
|
||||||
void displaySearchTab() const;
|
void displaySearchTab() const;
|
||||||
void displayRSSTab() const;
|
void displayRSSTab() const;
|
||||||
// Torrent actions
|
// Torrent actions
|
||||||
void on_actionSet_global_upload_limit_triggered();
|
void on_actionSet_global_upload_limit_triggered();
|
||||||
void on_actionSet_global_download_limit_triggered();
|
void on_actionSet_global_download_limit_triggered();
|
||||||
void on_actionDocumentation_triggered() const;
|
void on_actionDocumentation_triggered() const;
|
||||||
void on_actionOpen_triggered();
|
void on_actionOpen_triggered();
|
||||||
void updateGUI();
|
void updateGUI();
|
||||||
void loadPreferences(bool configure_session=true);
|
void loadPreferences(bool configure_session=true);
|
||||||
void processParams(const QStringList& params);
|
void processParams(const QStringList& params);
|
||||||
void addTorrent(QString path);
|
void addTorrent(QString path);
|
||||||
void addUnauthenticatedTracker(QPair<QTorrentHandle,QString> tracker);
|
void addUnauthenticatedTracker(QPair<QTorrentHandle,QString> tracker);
|
||||||
void processDownloadedFiles(QString path, QString url);
|
void processDownloadedFiles(QString path, QString url);
|
||||||
void finishedTorrent(QTorrentHandle& h) const;
|
void downloadFromURLList(const QStringList& urls);
|
||||||
// Options slots
|
void finishedTorrent(QTorrentHandle& h) const;
|
||||||
void on_actionOptions_triggered();
|
// Options slots
|
||||||
void optionsSaved();
|
void on_actionOptions_triggered();
|
||||||
// HTTP slots
|
void optionsSaved();
|
||||||
void on_actionDownload_from_URL_triggered();
|
// HTTP slots
|
||||||
|
void on_actionDownload_from_URL_triggered();
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void trackerAuthenticationRequired(QTorrentHandle& h);
|
void trackerAuthenticationRequired(QTorrentHandle& h);
|
||||||
void setTabText(int index, QString text) const;
|
void setTabText(int index, QString text) const;
|
||||||
void showNotificationBaloon(QString title, QString msg) const;
|
void showNotificationBaloon(QString title, QString msg) const;
|
||||||
void downloadFromURLList(const QStringList& urls);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *);
|
void closeEvent(QCloseEvent *);
|
||||||
void showEvent(QShowEvent *);
|
void showEvent(QShowEvent *);
|
||||||
bool event(QEvent * event);
|
bool event(QEvent * event);
|
||||||
void displayRSSTab(bool enable);
|
void displayRSSTab(bool enable);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Construct / Destruct
|
// Construct / Destruct
|
||||||
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
|
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
|
||||||
~GUI();
|
~GUI();
|
||||||
// Methods
|
// Methods
|
||||||
int getCurrentTabIndex() const;
|
int getCurrentTabIndex() const;
|
||||||
TransferListWidget* getTransferList() const { return transferList; }
|
QPoint screenCenter() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 409 B |
Binary file not shown.
|
Before Width: | Height: | Size: 722 B |
@@ -1,6 +1,6 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Categories=Qt;Network;P2P;
|
Categories=Qt;Network;P2P;
|
||||||
Comment=V2.1.4
|
Comment=V2.0.5
|
||||||
Exec=qbittorrent %f
|
Exec=qbittorrent %f
|
||||||
GenericName=Bittorrent client
|
GenericName=Bittorrent client
|
||||||
GenericName[bg]=Торент клиент
|
GenericName[bg]=Торент клиент
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 79 KiB |
2064
src/bittorrent.cpp
2064
src/bittorrent.cpp
File diff suppressed because it is too large
Load Diff
@@ -34,12 +34,8 @@
|
|||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#ifdef DISABLE_GUI
|
|
||||||
#include <QCoreApplication>
|
|
||||||
#else
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPalette>
|
#include <QPalette>
|
||||||
#endif
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
#include <libtorrent/session.hpp>
|
#include <libtorrent/session.hpp>
|
||||||
@@ -94,7 +90,6 @@ private:
|
|||||||
QPointer<QTimer> timerAlerts;
|
QPointer<QTimer> timerAlerts;
|
||||||
QMap<QUrl, QString> savepath_fromurl;
|
QMap<QUrl, QString> savepath_fromurl;
|
||||||
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
||||||
QStringList torrentsToPausedAfterChecking;
|
|
||||||
// Ratio
|
// Ratio
|
||||||
QPointer<QTimer> BigRatioTimer;
|
QPointer<QTimer> BigRatioTimer;
|
||||||
// HTTP
|
// HTTP
|
||||||
@@ -113,19 +108,12 @@ private:
|
|||||||
bool LSDEnabled;
|
bool LSDEnabled;
|
||||||
bool DHTEnabled;
|
bool DHTEnabled;
|
||||||
int current_dht_port;
|
int current_dht_port;
|
||||||
bool PeXEnabled;
|
|
||||||
bool queueingEnabled;
|
bool queueingEnabled;
|
||||||
bool appendLabelToSavePath;
|
|
||||||
#ifdef LIBTORRENT_0_15
|
|
||||||
bool appendqBExtension;
|
|
||||||
#endif
|
|
||||||
QString defaultSavePath;
|
QString defaultSavePath;
|
||||||
QString defaultTempPath;
|
QString defaultTempPath;
|
||||||
// GeoIP
|
// GeoIP
|
||||||
#ifndef DISABLE_GUI
|
|
||||||
bool resolve_countries;
|
bool resolve_countries;
|
||||||
bool geoipDBLoaded;
|
bool geoipDBLoaded;
|
||||||
#endif
|
|
||||||
// ETA Computation
|
// ETA Computation
|
||||||
QPointer<QTimer> timerETA;
|
QPointer<QTimer> timerETA;
|
||||||
QHash<QString, QList<int> > ETA_samples;
|
QHash<QString, QList<int> > ETA_samples;
|
||||||
@@ -181,7 +169,6 @@ public slots:
|
|||||||
void deleteTorrent(QString hash, bool delete_local_files = false);
|
void deleteTorrent(QString hash, bool delete_local_files = false);
|
||||||
void startUpTorrents();
|
void startUpTorrents();
|
||||||
session_proxy asyncDeletion();
|
session_proxy asyncDeletion();
|
||||||
void recheckTorrent(QString hash);
|
|
||||||
/* Needed by Web UI */
|
/* Needed by Web UI */
|
||||||
void pauseAllTorrents();
|
void pauseAllTorrents();
|
||||||
void pauseTorrent(QString hash);
|
void pauseTorrent(QString hash);
|
||||||
@@ -208,18 +195,10 @@ public slots:
|
|||||||
void setGlobalRatio(float ratio);
|
void setGlobalRatio(float ratio);
|
||||||
void setDeleteRatio(float ratio);
|
void setDeleteRatio(float ratio);
|
||||||
void setDHTPort(int dht_port);
|
void setDHTPort(int dht_port);
|
||||||
void setPeerProxySettings(proxy_settings proxySettings);
|
void setProxySettings(proxy_settings proxySettings, bool trackers=true, bool peers=true, bool web_seeds=true, bool dht=true);
|
||||||
void setHTTPProxySettings(proxy_settings proxySettings);
|
|
||||||
void setSessionSettings(session_settings sessionSettings);
|
void setSessionSettings(session_settings sessionSettings);
|
||||||
void startTorrentsInPause(bool b);
|
void startTorrentsInPause(bool b);
|
||||||
void setDefaultTempPath(QString temppath);
|
void setDefaultTempPath(QString temppath);
|
||||||
void setAppendLabelToSavePath(bool append);
|
|
||||||
void appendLabelToTorrentSavePath(QTorrentHandle h);
|
|
||||||
void changeLabelInTorrentSavePath(QTorrentHandle h, QString old_label, QString new_label);
|
|
||||||
#ifdef LIBTORRENT_0_15
|
|
||||||
void appendqBextensionToTorrent(QTorrentHandle h, bool append);
|
|
||||||
void setAppendqBExtension(bool append);
|
|
||||||
#endif
|
|
||||||
void applyEncryptionSettings(pe_settings se);
|
void applyEncryptionSettings(pe_settings se);
|
||||||
void setDownloadLimit(QString hash, long val);
|
void setDownloadLimit(QString hash, long val);
|
||||||
void setUploadLimit(QString hash, long val);
|
void setUploadLimit(QString hash, long val);
|
||||||
@@ -227,11 +206,7 @@ public slots:
|
|||||||
void enableNATPMP(bool b);
|
void enableNATPMP(bool b);
|
||||||
void enableLSD(bool b);
|
void enableLSD(bool b);
|
||||||
bool enableDHT(bool b);
|
bool enableDHT(bool b);
|
||||||
#ifdef DISABLE_GUI
|
|
||||||
void addConsoleMessage(QString msg, QString color=QString::null);
|
|
||||||
#else
|
|
||||||
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
|
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
|
||||||
#endif
|
|
||||||
void addPeerBanMessage(QString msg, bool from_ipfilter);
|
void addPeerBanMessage(QString msg, bool from_ipfilter);
|
||||||
void processDownloadedFile(QString, QString);
|
void processDownloadedFile(QString, QString);
|
||||||
void addMagnetSkipAddDlg(QString uri);
|
void addMagnetSkipAddDlg(QString uri);
|
||||||
@@ -259,8 +234,6 @@ signals:
|
|||||||
void downloadFromUrlFailure(QString url, QString reason);
|
void downloadFromUrlFailure(QString url, QString reason);
|
||||||
void torrentFinishedChecking(QTorrentHandle& h);
|
void torrentFinishedChecking(QTorrentHandle& h);
|
||||||
void metadataReceived(QTorrentHandle &h);
|
void metadataReceived(QTorrentHandle &h);
|
||||||
void savePathChanged(QTorrentHandle &h);
|
|
||||||
void newConsoleMessage(QString msg);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "ui_confirmdeletiondlg.h"
|
#include "ui_confirmdeletiondlg.h"
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -41,7 +40,6 @@ class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
|||||||
public:
|
public:
|
||||||
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
|
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
move(misc::screenCenter(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool shouldDeleteLocalFiles() const {
|
bool shouldDeleteLocalFiles() const {
|
||||||
|
|||||||
@@ -35,8 +35,6 @@
|
|||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
|
|
||||||
enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4, SOCKS4=5};
|
|
||||||
|
|
||||||
/** Download Thread **/
|
/** Download Thread **/
|
||||||
|
|
||||||
downloadThread::downloadThread(QObject* parent) : QObject(parent) {
|
downloadThread::downloadThread(QObject* parent) : QObject(parent) {
|
||||||
@@ -56,18 +54,6 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
|
|||||||
// Failure
|
// Failure
|
||||||
emit downloadFailure(url, errorCodeToString(reply->error()));
|
emit downloadFailure(url, errorCodeToString(reply->error()));
|
||||||
} else {
|
} else {
|
||||||
QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
|
|
||||||
if(redirection.isValid()) {
|
|
||||||
// We should redirect
|
|
||||||
qDebug("Redirecting from %s to %s", url.toLocal8Bit().data(), redirection.toUrl().toString().toLocal8Bit().data());
|
|
||||||
redirect_mapping.insert(redirection.toUrl().toString(), url);
|
|
||||||
downloadUrl(redirection.toUrl().toString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Checking if it was redirecting, restoring initial URL
|
|
||||||
if(redirect_mapping.contains(url)) {
|
|
||||||
url = redirect_mapping.take(url);
|
|
||||||
}
|
|
||||||
// Success
|
// Success
|
||||||
QString filePath;
|
QString filePath;
|
||||||
QTemporaryFile tmpfile;
|
QTemporaryFile tmpfile;
|
||||||
@@ -119,7 +105,7 @@ void downloadThread::applyProxySettings() {
|
|||||||
qDebug("Using proxy: %s", (IP+QString(":")+port).toLocal8Bit().data());
|
qDebug("Using proxy: %s", (IP+QString(":")+port).toLocal8Bit().data());
|
||||||
proxy.setPort(port.toUShort());
|
proxy.setPort(port.toUShort());
|
||||||
// Default proxy type is HTTP, we must change if it is SOCKS5
|
// Default proxy type is HTTP, we must change if it is SOCKS5
|
||||||
if(intValue == SOCKS5 || intValue == SOCKS5_PW) {
|
if(intValue%2==0) {
|
||||||
qDebug("Proxy is SOCKS5, not HTTP");
|
qDebug("Proxy is SOCKS5, not HTTP");
|
||||||
proxy.setType(QNetworkProxy::Socks5Proxy);
|
proxy.setType(QNetworkProxy::Socks5Proxy);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QHash>
|
|
||||||
|
|
||||||
class QNetworkAccessManager;
|
class QNetworkAccessManager;
|
||||||
|
|
||||||
@@ -42,7 +41,6 @@ class downloadThread : public QObject {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkAccessManager *networkManager;
|
QNetworkAccessManager *networkManager;
|
||||||
QHash<QString, QString> redirect_mapping;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void downloadFinished(QString url, QString file_path);
|
void downloadFinished(QString url, QString file_path);
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ void engineSelectDlg::on_actionUninstall_triggered() {
|
|||||||
}else {
|
}else {
|
||||||
// Proceed with uninstall
|
// Proceed with uninstall
|
||||||
// remove it from hard drive
|
// remove it from hard drive
|
||||||
QDir enginesFolder(misc::searchEngineLocation()+QDir::separator()+"engines");
|
QDir enginesFolder(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines");
|
||||||
QStringList filters;
|
QStringList filters;
|
||||||
filters << id+".*";
|
filters << id+".*";
|
||||||
QStringList files = enginesFolder.entryList(filters, QDir::Files, QDir::Unsorted);
|
QStringList files = enginesFolder.entryList(filters, QDir::Files, QDir::Unsorted);
|
||||||
@@ -245,7 +245,7 @@ QTreeWidgetItem* engineSelectDlg::findItemWithID(QString id){
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool engineSelectDlg::isUpdateNeeded(QString plugin_name, float new_version) const {
|
bool engineSelectDlg::isUpdateNeeded(QString plugin_name, float new_version) const {
|
||||||
float old_version = SearchEngine::getPluginVersion(misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py");
|
float old_version = SearchEngine::getPluginVersion(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py");
|
||||||
qDebug("IsUpdate needed? tobeinstalled: %.2f, alreadyinstalled: %.2f", new_version, old_version);
|
qDebug("IsUpdate needed? tobeinstalled: %.2f, alreadyinstalled: %.2f", new_version, old_version);
|
||||||
return (new_version > old_version);
|
return (new_version > old_version);
|
||||||
}
|
}
|
||||||
@@ -260,7 +260,7 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Process with install
|
// Process with install
|
||||||
QString dest_path = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py";
|
QString dest_path = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py";
|
||||||
bool update = false;
|
bool update = false;
|
||||||
if(QFile::exists(dest_path)) {
|
if(QFile::exists(dest_path)) {
|
||||||
// Backup in case install fails
|
// Backup in case install fails
|
||||||
@@ -324,12 +324,12 @@ void engineSelectDlg::addNewEngine(QString engine_name) {
|
|||||||
setRowColor(pluginsTree->indexOfTopLevelItem(item), "red");
|
setRowColor(pluginsTree->indexOfTopLevelItem(item), "red");
|
||||||
}
|
}
|
||||||
// Handle icon
|
// Handle icon
|
||||||
QString iconPath = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+engine->getName()+".png";
|
QString iconPath = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+engine->getName()+".png";
|
||||||
if(QFile::exists(iconPath)) {
|
if(QFile::exists(iconPath)) {
|
||||||
// Good, we already have the icon
|
// Good, we already have the icon
|
||||||
item->setData(ENGINE_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
|
item->setData(ENGINE_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
|
||||||
} else {
|
} else {
|
||||||
iconPath = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+engine->getName()+".ico";
|
iconPath = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+engine->getName()+".ico";
|
||||||
if(QFile::exists(iconPath)) { // ICO support
|
if(QFile::exists(iconPath)) { // ICO support
|
||||||
item->setData(ENGINE_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
|
item->setData(ENGINE_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
|
||||||
} else {
|
} else {
|
||||||
@@ -427,9 +427,9 @@ void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
|
|||||||
QFile icon(filePath);
|
QFile icon(filePath);
|
||||||
icon.open(QIODevice::ReadOnly);
|
icon.open(QIODevice::ReadOnly);
|
||||||
if(ICOHandler::canRead(&icon))
|
if(ICOHandler::canRead(&icon))
|
||||||
iconPath = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+id+".ico";
|
iconPath = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+id+".ico";
|
||||||
else
|
else
|
||||||
iconPath = misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+id+".png";
|
iconPath = misc::qBittorrentPath()+"search_engine"+QDir::separator()+"engines"+QDir::separator()+id+".png";
|
||||||
QFile::copy(filePath, iconPath);
|
QFile::copy(filePath, iconPath);
|
||||||
item->setData(ENGINE_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
|
item->setData(ENGINE_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,12 +33,12 @@
|
|||||||
#include "bittorrent.h"
|
#include "bittorrent.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
//#include "proplistdelegate.h"
|
#include "proplistdelegate.h"
|
||||||
#include "torrentpersistentdata.h"
|
#include "torrentpersistentdata.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
EventManager::EventManager(QObject *parent, Bittorrent *BTSession)
|
EventManager::EventManager(QObject *parent, Bittorrent *BTSession)
|
||||||
: QObject(parent), BTSession(BTSession)
|
: QObject(parent), BTSession(BTSession)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,9 +103,13 @@ QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
|
|||||||
int i=0;
|
int i=0;
|
||||||
for(fi=t.begin_files(); fi != t.end_files(); fi++) {
|
for(fi=t.begin_files(); fi != t.end_files(); fi++) {
|
||||||
QVariantMap file;
|
QVariantMap file;
|
||||||
QString path = QDir::cleanPath(misc::toQString(fi->path.string()));
|
if(h.num_files() == 1) {
|
||||||
QString name = path.split('/').last();
|
file["name"] = h.name();
|
||||||
file["name"] = name;
|
} else {
|
||||||
|
QString path = QDir::cleanPath(misc::toQString(fi->path.string()));
|
||||||
|
QString name = path.split('/').last();
|
||||||
|
file["name"] = name;
|
||||||
|
}
|
||||||
file["size"] = misc::friendlyUnit((double)fi->size);
|
file["size"] = misc::friendlyUnit((double)fi->size);
|
||||||
if(fi->size > 0)
|
if(fi->size > 0)
|
||||||
file["progress"] = fp[i]/(double)fi->size;
|
file["progress"] = fp[i]/(double)fi->size;
|
||||||
@@ -118,162 +122,14 @@ QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
|
|||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventManager::setGlobalPreferences(QVariantMap m) const {
|
|
||||||
// UI
|
|
||||||
if(m.contains("locale"))
|
|
||||||
Preferences::setLocale(m["locale"].toString());
|
|
||||||
// Downloads
|
|
||||||
if(m.contains("save_path"))
|
|
||||||
Preferences::setSavePath(m["save_path"].toString());
|
|
||||||
if(m.contains("temp_path_enabled"))
|
|
||||||
Preferences::setTempPathEnabled(m["temp_path_enabled"].toBool());
|
|
||||||
if(m.contains("temp_path"))
|
|
||||||
Preferences::setTempPath(m["temp_path"].toString());
|
|
||||||
if(m.contains("scan_dir"))
|
|
||||||
Preferences::setScanDir(m["scan_dir"].toString());
|
|
||||||
if(m.contains("preallocate_all"))
|
|
||||||
Preferences::preAllocateAllFiles(m["preallocate_all"].toBool());
|
|
||||||
if(m.contains("queueing_enabled"))
|
|
||||||
Preferences::setQueueingSystemEnabled(m["queueing_enabled"].toBool());
|
|
||||||
if(m.contains("max_active_downloads"))
|
|
||||||
Preferences::setMaxActiveDownloads(m["max_active_downloads"].toInt());
|
|
||||||
if(m.contains("max_active_torrents"))
|
|
||||||
Preferences::setMaxActiveTorrents(m["max_active_torrents"].toInt());
|
|
||||||
if(m.contains("max_active_uploads"))
|
|
||||||
Preferences::setMaxActiveUploads(m["max_active_uploads"].toInt());
|
|
||||||
#ifdef LIBTORRENT_0_15
|
|
||||||
if(m.contains("incomplete_files_ext"))
|
|
||||||
Preferences::useIncompleteFilesExtension(m["incomplete_files_ext"].toBool());
|
|
||||||
#endif
|
|
||||||
// Connection
|
|
||||||
if(m.contains("listen_port"))
|
|
||||||
Preferences::setSessionPort(m["listen_port"].toInt());
|
|
||||||
if(m.contains("upnp"))
|
|
||||||
Preferences::setUPnPEnabled(m["upnp"].toBool());
|
|
||||||
if(m.contains("natpmp"))
|
|
||||||
Preferences::setNATPMPEnabled(m["natpmp"].toBool());
|
|
||||||
if(m.contains("dl_limit"))
|
|
||||||
Preferences::setGlobalDownloadLimit(m["dl_limit"].toInt());
|
|
||||||
if(m.contains("up_limit"))
|
|
||||||
Preferences::setGlobalUploadLimit(m["up_limit"].toInt());
|
|
||||||
if(m.contains("max_connec"))
|
|
||||||
Preferences::setMaxConnecs(m["max_connec"].toInt());
|
|
||||||
if(m.contains("max_connec_per_torrent"))
|
|
||||||
Preferences::setMaxConnecsPerTorrent(m["max_connec_per_torrent"].toInt());
|
|
||||||
if(m.contains("max_uploads_per_torrent"))
|
|
||||||
Preferences::setMaxUploadsPerTorrent(m["max_uploads_per_torrent"].toInt());
|
|
||||||
// Bittorrent
|
|
||||||
if(m.contains("dht"))
|
|
||||||
Preferences::setDHTEnabled(m["dht"].toBool());
|
|
||||||
if(m.contains("pex"))
|
|
||||||
Preferences::setPeXEnabled(m["pex"].toBool());
|
|
||||||
qDebug("Pex support: %d", (int)m["pex"].toBool());
|
|
||||||
if(m.contains("lsd"))
|
|
||||||
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());
|
|
||||||
if(m.contains("proxy_ip"))
|
|
||||||
Preferences::setPeerProxyIp(m["proxy_ip"].toString());
|
|
||||||
if(m.contains("proxy_port"))
|
|
||||||
Preferences::setPeerProxyPort(m["proxy_port"].toUInt());
|
|
||||||
if(m.contains("proxy_auth_enabled"))
|
|
||||||
Preferences::setPeerProxyAuthEnabled(m["proxy_auth_enabled"].toBool());
|
|
||||||
if(m.contains("proxy_username"))
|
|
||||||
Preferences::setPeerProxyUsername(m["proxy_username"].toString());
|
|
||||||
if(m.contains("proxy_password"))
|
|
||||||
Preferences::setPeerProxyPassword(m["proxy_password"].toString());
|
|
||||||
if(m.contains("http_proxy_type"))
|
|
||||||
Preferences::setHTTPProxyType(m["http_proxy_type"].toInt());
|
|
||||||
if(m.contains("http_proxy_ip"))
|
|
||||||
Preferences::setHTTPProxyIp(m["http_proxy_ip"].toString());
|
|
||||||
if(m.contains("http_proxy_port"))
|
|
||||||
Preferences::setHTTPProxyPort(m["http_proxy_port"].toUInt());
|
|
||||||
if(m.contains("http_proxy_auth_enabled"))
|
|
||||||
Preferences::setHTTPProxyAuthEnabled(m["http_proxy_auth_enabled"].toBool());
|
|
||||||
if(m.contains("http_proxy_username"))
|
|
||||||
Preferences::setHTTPProxyUsername(m["http_proxy_username"].toString());
|
|
||||||
if(m.contains("http_proxy_password"))
|
|
||||||
Preferences::setHTTPProxyPassword(m["http_proxy_password"].toString());
|
|
||||||
// IP Filter
|
|
||||||
if(m.contains("ip_filter_enabled"))
|
|
||||||
Preferences::setFilteringEnabled(m["ip_filter_enabled"].toBool());
|
|
||||||
if(m.contains("ip_filter_path"))
|
|
||||||
Preferences::setFilter(m["ip_filter_path"].toString());
|
|
||||||
// Web UI
|
|
||||||
if(m.contains("web_ui_port"))
|
|
||||||
Preferences::setWebUiPort(m["web_ui_port"].toUInt());
|
|
||||||
if(m.contains("web_ui_username"))
|
|
||||||
Preferences::setWebUiUsername(m["web_ui_username"].toString());
|
|
||||||
if(m.contains("web_ui_password"))
|
|
||||||
Preferences::setWebUiPassword(m["web_ui_password"].toString());
|
|
||||||
// Reload preferences
|
|
||||||
BTSession->configureSession();
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariantMap EventManager::getGlobalPreferences() const {
|
QVariantMap EventManager::getGlobalPreferences() const {
|
||||||
QVariantMap data;
|
QVariantMap data;
|
||||||
// UI
|
|
||||||
data["locale"] = Preferences::getLocale();
|
|
||||||
// Downloads
|
|
||||||
data["save_path"] = Preferences::getSavePath();
|
|
||||||
data["temp_path_enabled"] = Preferences::isTempPathEnabled();
|
|
||||||
data["temp_path"] = Preferences::getTempPath();
|
|
||||||
data["scan_dir_enabled"] = Preferences::isDirScanEnabled();
|
|
||||||
data["scan_dir"] = Preferences::getScanDir();
|
|
||||||
data["preallocate_all"] = Preferences::preAllocateAllFiles();
|
|
||||||
data["queueing_enabled"] = Preferences::isQueueingSystemEnabled();
|
|
||||||
data["max_active_downloads"] = Preferences::getMaxActiveDownloads();
|
|
||||||
data["max_active_torrents"] = Preferences::getMaxActiveTorrents();
|
|
||||||
data["max_active_uploads"] = Preferences::getMaxActiveUploads();
|
|
||||||
#ifdef LIBTORRENT_0_15
|
|
||||||
data["incomplete_files_ext"] = Preferences::useIncompleteFilesExtension();
|
|
||||||
#endif
|
|
||||||
// Connection
|
|
||||||
data["listen_port"] = Preferences::getSessionPort();
|
|
||||||
data["upnp"] = Preferences::isUPnPEnabled();
|
|
||||||
data["natpmp"] = Preferences::isNATPMPEnabled();
|
|
||||||
data["dl_limit"] = Preferences::getGlobalDownloadLimit();
|
data["dl_limit"] = Preferences::getGlobalDownloadLimit();
|
||||||
data["up_limit"] = Preferences::getGlobalUploadLimit();
|
data["up_limit"] = Preferences::getGlobalUploadLimit();
|
||||||
|
data["dht"] = Preferences::isDHTEnabled();
|
||||||
data["max_connec"] = Preferences::getMaxConnecs();
|
data["max_connec"] = Preferences::getMaxConnecs();
|
||||||
data["max_connec_per_torrent"] = Preferences::getMaxConnecsPerTorrent();
|
data["max_connec_per_torrent"] = Preferences::getMaxConnecsPerTorrent();
|
||||||
data["max_uploads_per_torrent"] = Preferences::getMaxUploadsPerTorrent();
|
data["max_uploads_per_torrent"] = Preferences::getMaxUploadsPerTorrent();
|
||||||
// Bittorrent
|
|
||||||
data["dht"] = Preferences::isDHTEnabled();
|
|
||||||
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();
|
|
||||||
data["proxy_port"] = Preferences::getPeerProxyPort();
|
|
||||||
data["proxy_auth_enabled"] = Preferences::isPeerProxyAuthEnabled();
|
|
||||||
data["proxy_username"] = Preferences::getPeerProxyUsername();
|
|
||||||
data["proxy_password"] = Preferences::getPeerProxyPassword();
|
|
||||||
data["http_proxy_type"] = Preferences::getHTTPProxyType();
|
|
||||||
data["http_proxy_ip"] = Preferences::getHTTPProxyIp();
|
|
||||||
data["http_proxy_port"] = Preferences::getHTTPProxyPort();
|
|
||||||
data["http_proxy_auth_enabled"] = Preferences::isHTTPProxyAuthEnabled();
|
|
||||||
data["http_proxy_username"] = Preferences::getHTTPProxyUsername();
|
|
||||||
data["http_proxy_password"] = Preferences::getHTTPProxyPassword();
|
|
||||||
// IP Filter
|
|
||||||
data["ip_filter_enabled"] = Preferences::isFilteringEnabled();
|
|
||||||
data["ip_filter_path"] = Preferences::getFilter();
|
|
||||||
// Web UI
|
|
||||||
data["web_ui_port"] = Preferences::getWebUiPort();
|
|
||||||
data["web_ui_username"] = Preferences::getWebUiUsername();
|
|
||||||
data["web_ui_password"] = Preferences::getWebUiPassword();
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,10 +162,10 @@ QVariantMap EventManager::getPropGeneralInfo(QString hash) const {
|
|||||||
data["nb_connections"] = QString::number(h.num_connections())+" ("+tr("%1 max", "e.g. 10 max").arg(QString::number(h.connections_limit()))+")";
|
data["nb_connections"] = QString::number(h.num_connections())+" ("+tr("%1 max", "e.g. 10 max").arg(QString::number(h.connections_limit()))+")";
|
||||||
// Update ratio info
|
// Update ratio info
|
||||||
double ratio = BTSession->getRealRatio(h.hash());
|
double ratio = BTSession->getRealRatio(h.hash());
|
||||||
if(ratio > 100.)
|
if(ratio > 100.)
|
||||||
data["share_ratio"] = QString::fromUtf8("∞");
|
data["share_ratio"] = QString::fromUtf8("∞");
|
||||||
else
|
else
|
||||||
data["share_ratio"] = QString(QByteArray::number(ratio, 'f', 1));
|
data["share_ratio"] = QString(QByteArray::number(ratio, 'f', 1));
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ class EventManager : public QObject
|
|||||||
QList<QVariantMap> getPropTrackersInfo(QString hash) const;
|
QList<QVariantMap> getPropTrackersInfo(QString hash) const;
|
||||||
QList<QVariantMap> getPropFilesInfo(QString hash) const;
|
QList<QVariantMap> getPropFilesInfo(QString hash) const;
|
||||||
QVariantMap getGlobalPreferences() const;
|
QVariantMap getGlobalPreferences() const;
|
||||||
void setGlobalPreferences(QVariantMap m) const;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addedTorrent(QTorrentHandle& h);
|
void addedTorrent(QTorrentHandle& h);
|
||||||
|
|||||||
@@ -47,16 +47,10 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void itemAboutToBeRemoved(QTreeWidgetItem *item) {
|
void itemRemoved(QTreeWidgetItem *item) {
|
||||||
RssFile* file = mapping.take(item);
|
RssFile* file = mapping.take(item);
|
||||||
if(file->getType() == RssFile::STREAM) {
|
if(file->getType() == RssFile::STREAM)
|
||||||
feeds_items.remove(file->getID());
|
feeds_items.remove(file->getID());
|
||||||
} else {
|
|
||||||
QList<RssStream*> feeds = ((RssFolder*)file)->getAllFeeds();
|
|
||||||
foreach(RssStream* feed, feeds) {
|
|
||||||
feeds_items.remove(feed->getID());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasFeed(QString url) const {
|
bool hasFeed(QString url) const {
|
||||||
@@ -154,9 +148,7 @@ signals:
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void updateCurrentFeed(QTreeWidgetItem* new_item) {
|
void updateCurrentFeed(QTreeWidgetItem* new_item) {
|
||||||
if(!new_item) return;
|
if((new_item && getItemType(new_item) == RssFile::STREAM) || new_item == unread_item)
|
||||||
if(!mapping.contains(new_item)) return;
|
|
||||||
if((getItemType(new_item) == RssFile::STREAM) || new_item == unread_item)
|
|
||||||
current_feed = new_item;
|
current_feed = new_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,16 +64,12 @@ public:
|
|||||||
|
|
||||||
bool matches(QString s) {
|
bool matches(QString s) {
|
||||||
QStringList match_tokens = getMatchingTokens();
|
QStringList match_tokens = getMatchingTokens();
|
||||||
//qDebug("Checking matching tokens: \"%s\"", getMatchingTokens_str().toLocal8Bit().data());
|
|
||||||
foreach(const QString& token, match_tokens) {
|
foreach(const QString& token, match_tokens) {
|
||||||
if(token.isEmpty() || token == "")
|
if(token.isEmpty() || token == "")
|
||||||
continue;
|
continue;
|
||||||
//qDebug("Token: %s", token.toLocal8Bit().data());
|
|
||||||
QRegExp reg(token, Qt::CaseInsensitive, QRegExp::Wildcard);
|
QRegExp reg(token, Qt::CaseInsensitive, QRegExp::Wildcard);
|
||||||
//reg.setMinimal(false);
|
|
||||||
if(reg.indexIn(s) < 0) return false;
|
if(reg.indexIn(s) < 0) return false;
|
||||||
}
|
}
|
||||||
qDebug("Checking not matching tokens");
|
|
||||||
// Checking not matching
|
// Checking not matching
|
||||||
QStringList notmatch_tokens = getNotMatchingTokens();
|
QStringList notmatch_tokens = getNotMatchingTokens();
|
||||||
foreach(const QString& token, notmatch_tokens) {
|
foreach(const QString& token, notmatch_tokens) {
|
||||||
@@ -261,7 +257,6 @@ public:
|
|||||||
// Restore saved info
|
// Restore saved info
|
||||||
enableDl_cb->setChecked(filters.isDownloadingEnabled());
|
enableDl_cb->setChecked(filters.isDownloadingEnabled());
|
||||||
fillFiltersList();
|
fillFiltersList();
|
||||||
filtersList->sortItems(Qt::AscendingOrder);
|
|
||||||
if(filters.size() > 0) {
|
if(filters.size() > 0) {
|
||||||
// Select first filter
|
// Select first filter
|
||||||
filtersList->setCurrentItem(filtersList->item(0));
|
filtersList->setCurrentItem(filtersList->item(0));
|
||||||
@@ -272,8 +267,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~FeedDownloaderDlg() {
|
~FeedDownloaderDlg() {
|
||||||
if(enableDl_cb->isChecked())
|
|
||||||
emit filteringEnabled();
|
|
||||||
// Make sure we save everything
|
// Make sure we save everything
|
||||||
saveCurrentFilterSettings();
|
saveCurrentFilterSettings();
|
||||||
filters.save();
|
filters.save();
|
||||||
@@ -381,14 +374,11 @@ protected slots:
|
|||||||
QMessageBox::warning(0, tr("Invalid filter name"), tr("This filter name is already in use."));
|
QMessageBox::warning(0, tr("Invalid filter name"), tr("This filter name is already in use."));
|
||||||
}
|
}
|
||||||
}while(!validated);
|
}while(!validated);
|
||||||
// Save the current filter
|
|
||||||
saveCurrentFilterSettings();
|
|
||||||
// Rename the filter
|
// Rename the filter
|
||||||
filters.rename(current_name, new_name);
|
filters.rename(current_name, new_name);
|
||||||
if(selected_filter == current_name)
|
if(selected_filter == current_name)
|
||||||
selected_filter = new_name;
|
selected_filter = new_name;
|
||||||
item->setText(new_name);
|
item->setText(new_name);
|
||||||
filtersList->sortItems(Qt::AscendingOrder);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,7 +432,6 @@ protected slots:
|
|||||||
}
|
}
|
||||||
}while(!validated);
|
}while(!validated);
|
||||||
QListWidgetItem *it = new QListWidgetItem(filter_name, filtersList);
|
QListWidgetItem *it = new QListWidgetItem(filter_name, filtersList);
|
||||||
filtersList->sortItems(Qt::AscendingOrder);
|
|
||||||
filtersList->setCurrentItem(it);
|
filtersList->setCurrentItem(it);
|
||||||
//showFilterSettings(it);
|
//showFilterSettings(it);
|
||||||
}
|
}
|
||||||
@@ -498,19 +487,16 @@ protected slots:
|
|||||||
// Append file extension
|
// Append file extension
|
||||||
if(!destination.endsWith(".filters"))
|
if(!destination.endsWith(".filters"))
|
||||||
destination += ".filters";
|
destination += ".filters";
|
||||||
/*if(QFile::exists(destination)) {
|
if(QFile::exists(destination)) {
|
||||||
int ret = QMessageBox::question(0, tr("Overwriting confirmation"), tr("Are you sure you want to overwrite existing file?"), QMessageBox::Yes|QMessageBox::No);
|
int ret = QMessageBox::question(0, tr("Overwriting confirmation"), tr("Are you sure you want to overwrite existing file?"), QMessageBox::Yes|QMessageBox::No);
|
||||||
if(ret != QMessageBox::Yes) return;
|
if(ret != QMessageBox::Yes) return;
|
||||||
}*/
|
}
|
||||||
if(filters.serialize(destination))
|
if(filters.serialize(destination))
|
||||||
QMessageBox::information(0, tr("Export successful"), tr("Filters export was successful."));
|
QMessageBox::information(0, tr("Export successful"), tr("Filters export was successful."));
|
||||||
else
|
else
|
||||||
QMessageBox::warning(0, tr("Export failure"), tr("Filters could not be exported due to an I/O error."));
|
QMessageBox::warning(0, tr("Export failure"), tr("Filters could not be exported due to an I/O error."));
|
||||||
}
|
}
|
||||||
|
|
||||||
signals:
|
|
||||||
void filteringEnabled();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef QHash
|
#undef QHash
|
||||||
|
|||||||
@@ -34,8 +34,7 @@
|
|||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QRegExp>
|
#include <QMessageBox>
|
||||||
#include <QStringList>
|
|
||||||
|
|
||||||
#include <libtorrent/session.hpp>
|
#include <libtorrent/session.hpp>
|
||||||
#include <libtorrent/ip_filter.hpp>
|
#include <libtorrent/ip_filter.hpp>
|
||||||
@@ -104,7 +103,7 @@ class FilterParserThread : public QThread {
|
|||||||
QFile file(filePath);
|
QFile file(filePath);
|
||||||
if (file.exists()){
|
if (file.exists()){
|
||||||
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
|
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
|
||||||
std::cerr << "I/O Error: Could not open ip filer file in read mode." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("Couldn't open %1 in read mode.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
unsigned int nbLine = 0;
|
unsigned int nbLine = 0;
|
||||||
@@ -225,7 +224,7 @@ class FilterParserThread : public QThread {
|
|||||||
QStringList IP;
|
QStringList IP;
|
||||||
if (file.exists()){
|
if (file.exists()){
|
||||||
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
|
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
|
||||||
std::cerr << "I/O Error: Could not open ip filer file in read mode." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("Couldn't open %1 in read mode.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
unsigned int nbLine = 0;
|
unsigned int nbLine = 0;
|
||||||
@@ -293,7 +292,7 @@ class FilterParserThread : public QThread {
|
|||||||
QFile file(filePath);
|
QFile file(filePath);
|
||||||
if (file.exists()){
|
if (file.exists()){
|
||||||
if(!file.open(QIODevice::ReadOnly)){
|
if(!file.open(QIODevice::ReadOnly)){
|
||||||
std::cerr << "I/O Error: Could not open ip filer file in read mode." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("Couldn't open %1 in read mode.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QDataStream stream(&file);
|
QDataStream stream(&file);
|
||||||
@@ -305,7 +304,7 @@ class FilterParserThread : public QThread {
|
|||||||
memcmp(buf, "\xFF\xFF\xFF\xFFP2B", 7) ||
|
memcmp(buf, "\xFF\xFF\xFF\xFFP2B", 7) ||
|
||||||
!stream.readRawData((char*)&version, sizeof(version))
|
!stream.readRawData((char*)&version, sizeof(version))
|
||||||
) {
|
) {
|
||||||
std::cerr << "Parsing Error: The filter file is not a valid PeerGuardian P2B file." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("%1 is not a valid PeerGuardian P2B file.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +318,7 @@ class FilterParserThread : public QThread {
|
|||||||
!stream.readRawData((char*)&start, sizeof(start)) ||
|
!stream.readRawData((char*)&start, sizeof(start)) ||
|
||||||
!stream.readRawData((char*)&end, sizeof(end))
|
!stream.readRawData((char*)&end, sizeof(end))
|
||||||
) {
|
) {
|
||||||
std::cerr << "Parsing Error: The filter file is not a valid PeerGuardian P2B file." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("%1 is not a valid PeerGuardian P2B file.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Network byte order to Host byte order
|
// Network byte order to Host byte order
|
||||||
@@ -335,7 +334,7 @@ class FilterParserThread : public QThread {
|
|||||||
qDebug ("p2b version 3");
|
qDebug ("p2b version 3");
|
||||||
unsigned int namecount;
|
unsigned int namecount;
|
||||||
if(!stream.readRawData((char*)&namecount, sizeof(namecount))) {
|
if(!stream.readRawData((char*)&namecount, sizeof(namecount))) {
|
||||||
std::cerr << "Parsing Error: The filter file is not a valid PeerGuardian P2B file." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("%1 is not a valid PeerGuardian P2B file.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
namecount=ntohl(namecount);
|
namecount=ntohl(namecount);
|
||||||
@@ -343,7 +342,7 @@ class FilterParserThread : public QThread {
|
|||||||
for(unsigned int i=0; i<namecount; i++) {
|
for(unsigned int i=0; i<namecount; i++) {
|
||||||
string name;
|
string name;
|
||||||
if(!getlineInStream(stream, name, '\0')) {
|
if(!getlineInStream(stream, name, '\0')) {
|
||||||
std::cerr << "Parsing Error: The filter file is not a valid PeerGuardian P2B file." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("%1 is not a valid PeerGuardian P2B file.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(abort) return;
|
if(abort) return;
|
||||||
@@ -351,7 +350,7 @@ class FilterParserThread : public QThread {
|
|||||||
// Reading the ranges
|
// Reading the ranges
|
||||||
unsigned int rangecount;
|
unsigned int rangecount;
|
||||||
if(!stream.readRawData((char*)&rangecount, sizeof(rangecount))) {
|
if(!stream.readRawData((char*)&rangecount, sizeof(rangecount))) {
|
||||||
std::cerr << "Parsing Error: The filter file is not a valid PeerGuardian P2B file." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("%1 is not a valid PeerGuardian P2B file.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rangecount=ntohl(rangecount);
|
rangecount=ntohl(rangecount);
|
||||||
@@ -364,7 +363,7 @@ class FilterParserThread : public QThread {
|
|||||||
!stream.readRawData((char*)&start, sizeof(start)) ||
|
!stream.readRawData((char*)&start, sizeof(start)) ||
|
||||||
!stream.readRawData((char*)&end, sizeof(end))
|
!stream.readRawData((char*)&end, sizeof(end))
|
||||||
) {
|
) {
|
||||||
std::cerr << "Parsing Error: The filter file is not a valid PeerGuardian P2B file." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("%1 is not a valid PeerGuardian P2B file.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Network byte order to Host byte order
|
// Network byte order to Host byte order
|
||||||
@@ -377,7 +376,7 @@ class FilterParserThread : public QThread {
|
|||||||
if(abort) return;
|
if(abort) return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Parsing Error: The filter file is not a valid PeerGuardian P2B file." << std::endl;
|
QMessageBox::critical(0, tr("I/O Error", "Input/Output Error"), tr("%1 is not a valid PeerGuardian P2B file.").arg(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ protected:
|
|||||||
static QString geoipFolder(bool embedded=false) {
|
static QString geoipFolder(bool embedded=false) {
|
||||||
if(embedded)
|
if(embedded)
|
||||||
return ":/geoip/";
|
return ":/geoip/";
|
||||||
return misc::QDesktopServicesDataLocation()+"geoip"+QDir::separator();
|
return misc::qBittorrentPath()+"geoip"+QDir::separator();
|
||||||
#else
|
#else
|
||||||
static QString geoipFolder(bool) {
|
static QString geoipFolder(bool) {
|
||||||
if(QFile::exists("/usr/local/share/GeoIP/GeoIP.dat"))
|
if(QFile::exists("/usr/local/share/GeoIP/GeoIP.dat"))
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user