Compare commits
359 Commits
release-1.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d31359181 | ||
|
|
efed943366 | ||
|
|
1784c5cecb | ||
|
|
62fad5df87 | ||
|
|
6b04005d08 | ||
|
|
4908458729 | ||
|
|
9ada7c809b | ||
|
|
3c6635cdbe | ||
|
|
90207020f2 | ||
|
|
d22d6468c7 | ||
|
|
893c5e6784 | ||
|
|
77ded75613 | ||
|
|
ce31bef2cf | ||
|
|
45e56c02ee | ||
|
|
e1725e8001 | ||
|
|
d22e932ef7 | ||
|
|
d99dc65b19 | ||
|
|
ae10bc9270 | ||
|
|
3e56cf96a3 | ||
|
|
b6dc5f9675 | ||
|
|
d79cd07d50 | ||
|
|
9a16a9d11b | ||
|
|
52ac94cc73 | ||
|
|
672a83cfc4 | ||
|
|
5d33e3033b | ||
|
|
80a721fd36 | ||
|
|
058430d2cd | ||
|
|
d227e744d9 | ||
|
|
17f712e3e0 | ||
|
|
507b9b149e | ||
|
|
c28217f8fa | ||
|
|
d55553c53f | ||
|
|
01f38b05eb | ||
|
|
91efa0e2d4 | ||
|
|
b80843c602 | ||
|
|
9fa0ff78bc | ||
|
|
5d566bba86 | ||
|
|
5ef888d142 | ||
|
|
92b04b66c7 | ||
|
|
f15973f2c8 | ||
|
|
c075016b51 | ||
|
|
9708b335d8 | ||
|
|
950aa497c6 | ||
|
|
fe62efa145 | ||
|
|
cc2da45c2d | ||
|
|
c212d8beff | ||
|
|
93f3d0b687 | ||
|
|
b88d0e87d9 | ||
|
|
afaf40eee0 | ||
|
|
236c0da563 | ||
|
|
c48a3b55d6 | ||
|
|
6f69ab2b6d | ||
|
|
b2a0ddb9b1 | ||
|
|
aff7824b8d | ||
|
|
6206befbec | ||
|
|
ac2473da6d | ||
|
|
11fd99e2de | ||
|
|
d42ab6120e | ||
|
|
7c1d3dea86 | ||
|
|
e7f6ae3110 | ||
|
|
1c0bc205f0 | ||
|
|
aeb2c06e0f | ||
|
|
d4524993ee | ||
|
|
bf77b186c1 | ||
|
|
d1072afb89 | ||
|
|
a9b49ea3e0 | ||
|
|
33d77ccf39 | ||
|
|
11a41a1652 | ||
|
|
f04b19ddfa | ||
|
|
e35d100769 | ||
|
|
ce6f665a7b | ||
|
|
3958c990a4 | ||
|
|
30b5daaa2a | ||
|
|
f63199f7b7 | ||
|
|
4edab29bfe | ||
|
|
14e94c8971 | ||
|
|
31ca3c1334 | ||
|
|
0c09183f89 | ||
|
|
3eeeb73af4 | ||
|
|
cad6228ae0 | ||
|
|
cb27d530c0 | ||
|
|
bc52863aec | ||
|
|
68092f3b5c | ||
|
|
8650b20904 | ||
|
|
a83744289f | ||
|
|
34ba69e319 | ||
|
|
74f0737903 | ||
|
|
b1bbbd79c4 | ||
|
|
87f93a7a1d | ||
|
|
e187426dd5 | ||
|
|
13e22aef51 | ||
|
|
08710ed822 | ||
|
|
5fc4ff22d9 | ||
|
|
8b41d1973c | ||
|
|
c52e0cf841 | ||
|
|
2f4d27b422 | ||
|
|
508c765991 | ||
|
|
f9399714cc | ||
|
|
d25128e0b3 | ||
|
|
072200c5f9 | ||
|
|
72d82af147 | ||
|
|
581efd0afd | ||
|
|
8b78096366 | ||
|
|
573a18c20f | ||
|
|
b460f67cc4 | ||
|
|
823da52d18 | ||
|
|
c55666996c | ||
|
|
690215e2b0 | ||
|
|
8fe448d35f | ||
|
|
5544f2a138 | ||
|
|
c1d3f719df | ||
|
|
f5fc1884b2 | ||
|
|
002faac042 | ||
|
|
03552c9a1f | ||
|
|
d267d65e57 | ||
|
|
cdce77962a | ||
|
|
0c617f0a03 | ||
|
|
47d545633d | ||
|
|
fb6b40ccd1 | ||
|
|
ac021aaecb | ||
|
|
a4cfc77531 | ||
|
|
480d1b18db | ||
|
|
3827a66a3a | ||
|
|
eb3d7f31e8 | ||
|
|
62f57862e5 | ||
|
|
70c62f6294 | ||
|
|
d6e1dc9020 | ||
|
|
46f081d888 | ||
|
|
ef4c320af7 | ||
|
|
6673273830 | ||
|
|
154673a99b | ||
|
|
62604e32c0 | ||
|
|
873221ec14 | ||
|
|
e645133baf | ||
|
|
8c1851c0bd | ||
|
|
d15a177027 | ||
|
|
5d427d2acf | ||
|
|
aa0c2e611f | ||
|
|
332a4121c8 | ||
|
|
843168bb62 | ||
|
|
4ee47ce2b8 | ||
|
|
262b88930e | ||
|
|
d1646c169d | ||
|
|
c6a9ec7c6f | ||
|
|
ff2fef0dc1 | ||
|
|
b35cc2c9e4 | ||
|
|
98223e54e8 | ||
|
|
e36e500045 | ||
|
|
e2b8aeafa6 | ||
|
|
484a75ad64 | ||
|
|
5a88c1ad46 | ||
|
|
e8fba3e630 | ||
|
|
81412584e1 | ||
|
|
1b82dd315b | ||
|
|
ccdb2a82c3 | ||
|
|
8ada8d33c8 | ||
|
|
ac279979fb | ||
|
|
d5e2905ead | ||
|
|
1b0d2a7d55 | ||
|
|
da080a8979 | ||
|
|
41e18fd245 | ||
|
|
10c40c6485 | ||
|
|
e93fab40fe | ||
|
|
b64919234a | ||
|
|
fb4700907d | ||
|
|
d3c59f0814 | ||
|
|
cedc87a703 | ||
|
|
54f2e66464 | ||
|
|
8160449964 | ||
|
|
e467fd8fab | ||
|
|
5da2e6a9ee | ||
|
|
0cb5993f66 | ||
|
|
54d7c6dc54 | ||
|
|
c30ec7bb6e | ||
|
|
0bc2e9aeeb | ||
|
|
95469756d1 | ||
|
|
aa65cf9547 | ||
|
|
623933e2aa | ||
|
|
db92ffaf92 | ||
|
|
79e139268a | ||
|
|
6c796ff302 | ||
|
|
4ca2d060ea | ||
|
|
b9387cf4c4 | ||
|
|
ff5524475f | ||
|
|
31374d8d30 | ||
|
|
2b5522e165 | ||
|
|
3987d0b5ef | ||
|
|
7c84551150 | ||
|
|
47fc4679d4 | ||
|
|
bf6d7534d5 | ||
|
|
5ffcf5a9dc | ||
|
|
490ef19e64 | ||
|
|
94f3323270 | ||
|
|
bb4dc84824 | ||
|
|
660f478a70 | ||
|
|
f24749bbf8 | ||
|
|
04a3fcb0ed | ||
|
|
9fdc6a2acd | ||
|
|
4e8eaafd53 | ||
|
|
e30268cf3b | ||
|
|
eab216e5a8 | ||
|
|
7578e7404b | ||
|
|
7093c3576b | ||
|
|
c3281a1e8f | ||
|
|
561033d7eb | ||
|
|
f588882a96 | ||
|
|
6b0f855752 | ||
|
|
881c3be58c | ||
|
|
78346a881c | ||
|
|
b3ce32b405 | ||
|
|
3d790d131c | ||
|
|
9e9e6f028c | ||
|
|
cb32ed97a8 | ||
|
|
e9350e66f0 | ||
|
|
d843366c0d | ||
|
|
1b6e282938 | ||
|
|
aeb12e53ee | ||
|
|
31180bb00c | ||
|
|
36748b6729 | ||
|
|
d9cb73634d | ||
|
|
c5c09b09ee | ||
|
|
12106c308e | ||
|
|
f7f4d1333b | ||
|
|
1c08bf054a | ||
|
|
4824637681 | ||
|
|
5962ef79cb | ||
|
|
3762c37517 | ||
|
|
e97b805365 | ||
|
|
6dbd1daa5c | ||
|
|
59f21d592e | ||
|
|
946e2778f8 | ||
|
|
9fbe2ff6c4 | ||
|
|
a4383d1b7f | ||
|
|
131dda2617 | ||
|
|
51ebfadd85 | ||
|
|
0a1ae18412 | ||
|
|
cd50c3299e | ||
|
|
f7c196dbcf | ||
|
|
8260159ca4 | ||
|
|
d8c6e2bcc6 | ||
|
|
bc2a4b622b | ||
|
|
daef9ece75 | ||
|
|
a6f31c7950 | ||
|
|
0e93e8dc9d | ||
|
|
3fa98705bc | ||
|
|
4493752d2f | ||
|
|
6199d6d543 | ||
|
|
f9c8b6a66e | ||
|
|
743d54a745 | ||
|
|
5d09f89a0f | ||
|
|
ea2f5df95f | ||
|
|
a03c1d3d50 | ||
|
|
5fac6ef3b2 | ||
|
|
81658b9648 | ||
|
|
2e2e506162 | ||
|
|
d006327f14 | ||
|
|
21de03ffd4 | ||
|
|
308bd65c8f | ||
|
|
6afb82e2e2 | ||
|
|
5f8f7bdc17 | ||
|
|
611e33bf80 | ||
|
|
998b161696 | ||
|
|
f9da85ecfe | ||
|
|
d86cb62dc0 | ||
|
|
15427619bd | ||
|
|
9bc90fc7b2 | ||
|
|
6ecde51e45 | ||
|
|
bf727c11d3 | ||
|
|
6a028c9efd | ||
|
|
92a9d04568 | ||
|
|
a7da280f57 | ||
|
|
4a33917e89 | ||
|
|
8686ef0892 | ||
|
|
cee9ece4c7 | ||
|
|
c756412ee6 | ||
|
|
75e5a7e3d4 | ||
|
|
707e87f5b8 | ||
|
|
6b8521355f | ||
|
|
a0beccc04b | ||
|
|
6b6181a3ee | ||
|
|
2dddd2b24b | ||
|
|
9f9f6abec1 | ||
|
|
7caed10dc0 | ||
|
|
806eee9404 | ||
|
|
52638a2891 | ||
|
|
33324c190e | ||
|
|
8d59f3c4e1 | ||
|
|
e6465d784d | ||
|
|
31eb902494 | ||
|
|
c818c2dae6 | ||
|
|
23d1aa7691 | ||
|
|
bf7841cdb9 | ||
|
|
d6e90883cb | ||
|
|
ff6e9c0f9b | ||
|
|
be240f72ab | ||
|
|
e3a29d8ebf | ||
|
|
7792b4f849 | ||
|
|
53171c81e1 | ||
|
|
9b4cfa4a3d | ||
|
|
e4be70edec | ||
|
|
7f12bbb783 | ||
|
|
5d1ed7a564 | ||
|
|
92dd4c8c5b | ||
|
|
bc308741b7 | ||
|
|
66590bfa4a | ||
|
|
7fc0b02259 | ||
|
|
061a9c7ecf | ||
|
|
e97a6f5f08 | ||
|
|
fe3a6b8b57 | ||
|
|
92e569fc36 | ||
|
|
edfd93496e | ||
|
|
d8e4732627 | ||
|
|
966367aff6 | ||
|
|
1cc6086468 | ||
|
|
b00eeef04d | ||
|
|
e423285d88 | ||
|
|
74d8a00854 | ||
|
|
c65bf303cf | ||
|
|
24470a7cc3 | ||
|
|
edc25ba52f | ||
|
|
922112fc5b | ||
|
|
b7a26c6676 | ||
|
|
038c326f81 | ||
|
|
148d175ab0 | ||
|
|
3dd9ebc61d | ||
|
|
0485864d38 | ||
|
|
a2792efa72 | ||
|
|
00a17b9447 | ||
|
|
15df7029b9 | ||
|
|
2556346dda | ||
|
|
0433254ad8 | ||
|
|
741d95b33e | ||
|
|
55ff924e60 | ||
|
|
37158a32ad | ||
|
|
095dfe5b9e | ||
|
|
a9686e8c4b | ||
|
|
e2d801d920 | ||
|
|
194eb3ba6e | ||
|
|
8792637634 | ||
|
|
63ad2def91 | ||
|
|
f790b80aa3 | ||
|
|
ab78e5b438 | ||
|
|
05948e2edf | ||
|
|
c9c4f7001a | ||
|
|
6cd185d0d5 | ||
|
|
063219cbe7 | ||
|
|
e324f3792b | ||
|
|
0267ecc342 | ||
|
|
e53c7aaea6 | ||
|
|
3e90e56266 | ||
|
|
1c1b8acd67 | ||
|
|
811846e5fa | ||
|
|
3ba28885b9 | ||
|
|
8ed1c57c29 | ||
|
|
af5d24c5bc | ||
|
|
9dcd572d60 | ||
|
|
e024a3ff35 | ||
|
|
37342e0f0c | ||
|
|
bfbbc1f497 |
8
AUTHORS
@@ -2,8 +2,9 @@ Author:
|
|||||||
* Christophe Dumez <chris@qbittorrent.org>
|
* Christophe Dumez <chris@qbittorrent.org>
|
||||||
|
|
||||||
Contributors:
|
Contributors:
|
||||||
* Arnaud Demaizière <arnaud@qbittorrent.org>
|
* Stefanos Antaris <santaris@csd.auth.gr>
|
||||||
* Ishan Arora <ishan@qbittorrent.org>
|
* Ishan Arora <ishan@qbittorrent.org>
|
||||||
|
* Arnaud Demaizière <arnaud@qbittorrent.org>
|
||||||
* Grigis Gaëtan <cipher16@gmail.com>
|
* Grigis Gaëtan <cipher16@gmail.com>
|
||||||
|
|
||||||
Code from other projects:
|
Code from other projects:
|
||||||
@@ -11,6 +12,11 @@ Code from other projects:
|
|||||||
copyright: Malte Starostik <malte@kde.org>
|
copyright: Malte Starostik <malte@kde.org>
|
||||||
license: LGPL
|
license: LGPL
|
||||||
|
|
||||||
|
GeoIP database author:
|
||||||
|
* files: src/geoip/GeoIP.dat
|
||||||
|
copyright: MaxMind, Inc (http://maxmind.com/)
|
||||||
|
license: Open Data License (see src/geoip/LICENSE.txt)
|
||||||
|
|
||||||
Images Authors:
|
Images Authors:
|
||||||
* files: src/Icons/*.png
|
* files: src/Icons/*.png
|
||||||
copyright: Gnome Icon Theme
|
copyright: Gnome Icon Theme
|
||||||
|
|||||||
57
Changelog
@@ -1,4 +1,56 @@
|
|||||||
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
|
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v2.0.0
|
||||||
|
- FEATURE: Added program option to disable splash screen
|
||||||
|
- FEATURE: Dropped dependency on libcurl and libzzip
|
||||||
|
- FEATURE: Display more information regarding the torrent in its properties
|
||||||
|
- FEATURE: Various optimizations to save CPU and memory
|
||||||
|
- FEATURE: Folder scanning now works with CIFS and NFS mounted folders
|
||||||
|
- FEATURE: Speed up qBittorrent startup
|
||||||
|
- FEATURE: Display per-torrent peer list
|
||||||
|
- FEATURE: Make sure torrent files are always sorted by name
|
||||||
|
- FEATURE: Seeds and Peers columns are now sortable
|
||||||
|
- FEATURE: Torrents can be rechecked from Web UI (Stephanos Antaris)
|
||||||
|
- FEATURE: New peers can manually be added to the torrents
|
||||||
|
- FEATURE: Support per-peer rate limiting
|
||||||
|
- FEATURE: Support peer manual ban
|
||||||
|
- FEATURE: Display total amounts transferred in status bar
|
||||||
|
- FEATURE: Display trackers status as well as error/warning messages
|
||||||
|
- FEATURE: Display the number of peers returned by each tracker & DHT/PeX/LSD
|
||||||
|
- FEATURE: Global upload/download speeds can be capped from status bar (µTorrent behavior)
|
||||||
|
- FEATURE: Added option to download first and last piece of a torrent main file first (for preview)
|
||||||
|
- FEATURE: Graphically display piece availability in torrent properties
|
||||||
|
- FEATURE: Dropped Qt 4.3 support (Qt >= 4.4 is now required)
|
||||||
|
- FEATURE: Display close tab button into the tabs in search engine (Qt >= 4.5 only)
|
||||||
|
- FEATURE: Show official documentation when pressing F1 key
|
||||||
|
- FEATURE: Announce to all trackers specified for a torrent (µTorrent behavior) (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Added per-torrent super seeding mode (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Support for storing symbolic links in .torrent files (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Support for uTorrent interpretation of multi-tracker torrents (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Handle torrents with duplicate filenames (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Support for merkle hash tree torrents (.merkle.torrent) (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Metadata download from swarm is now compatible with µtorrent (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Support tracker exchange between peers (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Better http seed support (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Tracker connections are now also subject to IP filtering (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Include DHT traffic in the rate limiter (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Support for bitcomet padding files (libtorrent >= v0.15 only)
|
||||||
|
- FEATURE: Option to skip file checking and start seeding immediately in torrent addition dialog (Stephanos Antaris) (libtorrent >= v0.15 only)
|
||||||
|
- WEB UI: Remodeled Web UI to match new qBittorrent UI (Properties and preferences available)
|
||||||
|
- WEB UI: Added internationalization support
|
||||||
|
- WEB UI: Reduced computation in Javascript (do this one server side instead)
|
||||||
|
- WEB UI: Fixed Transfer list flickering
|
||||||
|
- COSMETIC: Merged download / upload lists
|
||||||
|
- COSMETIC: Torrents can be filtered based on their status
|
||||||
|
- COSMETIC: Torrent properties are now displayed in main window
|
||||||
|
- COSMETIC: Made program preferences scrollable for usability on small screens (e.g. netbooks)
|
||||||
|
- COSMETIC: Added a "torrent status" column to transfer list
|
||||||
|
- COSMETIC: Display Seeds and Peers in two separate columns
|
||||||
|
- COSMETIC: New deletion confirmation dialog (Merged delete/delete permanently actions)
|
||||||
|
- COSMETIC: Improved status bar layout spacing
|
||||||
|
- COSMETIC: Display speeds with more user friendly units instead of always using KiB/s
|
||||||
|
- COSMETIC: New torrent status icons by Mateusz Tolola
|
||||||
|
- COSMETIC: Make use of libnotify if available for system notifications (Ubuntu, ...)
|
||||||
|
|
||||||
|
* Thu Sep 3 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
|
||||||
- FEATURE: Added Magnet URI support
|
- FEATURE: Added Magnet URI support
|
||||||
- FEATURE: Search engine supports category-based requests
|
- FEATURE: Search engine supports category-based requests
|
||||||
- FEATURE: Make use of torrent enclosure in RSS feeds for direct download
|
- FEATURE: Make use of torrent enclosure in RSS feeds for direct download
|
||||||
@@ -12,10 +64,13 @@
|
|||||||
- FEATURE: If a torrent contains a torrent file, process downloaded torrent file too
|
- FEATURE: If a torrent contains a torrent file, process downloaded torrent file too
|
||||||
- FEATURE: A random listening port can be chosen automatically
|
- FEATURE: A random listening port can be chosen automatically
|
||||||
- BUGFIX: torrent resume code rewrited
|
- BUGFIX: torrent resume code rewrited
|
||||||
|
- BUGFIX: Fixed uTorrent spoofing code
|
||||||
- BUGFIX: Greatly improved column sorting code
|
- BUGFIX: Greatly improved column sorting code
|
||||||
- BUGFIX: Possibility to create trackerless torrents
|
- BUGFIX: Possibility to create trackerless torrents
|
||||||
|
- BUGFIX: Better item coloring in torrent content filtering dialog
|
||||||
- COSMETIC: Redesigned search tab to improve usability
|
- COSMETIC: Redesigned search tab to improve usability
|
||||||
- COSMETIC: Redesigned RSS tab to improve usability
|
- COSMETIC: Redesigned RSS tab to improve usability
|
||||||
|
- COSMETIC: Improved tracker errors readability
|
||||||
|
|
||||||
* Sun Aug 21 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.1
|
* Sun Aug 21 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.1
|
||||||
- BUGFIX: Fix problems when changing save path (if using temporary download folder)
|
- BUGFIX: Fix problems when changing save path (if using temporary download folder)
|
||||||
|
|||||||
25
INSTALL
@@ -1,12 +1,6 @@
|
|||||||
qBittorrent - A BitTorrent client in C++ / Qt4
|
qBittorrent - A BitTorrent client in C++ / Qt4
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
*** Necessary if qt3 is default on your system ***
|
|
||||||
export QTDIR=/usr/include/qt4
|
|
||||||
export PATH=$QTDIR/bin:$PATH
|
|
||||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib
|
|
||||||
*** End ***
|
|
||||||
|
|
||||||
./configure
|
./configure
|
||||||
make && make install
|
make && make install
|
||||||
qbittorrent
|
qbittorrent
|
||||||
@@ -14,29 +8,20 @@ qbittorrent
|
|||||||
will install and execute qBittorrent hopefully without any problems.
|
will install and execute qBittorrent hopefully without any problems.
|
||||||
|
|
||||||
Dependencies:
|
Dependencies:
|
||||||
- Qt >= 4.3.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
|
- Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
|
||||||
Qt >= 4.4.0 is advised
|
|
||||||
|
|
||||||
- libtorrent-rasterbar by Arvid Norberg (>= v0.14.0 REQUIRED)
|
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.0 REQUIRED, >= v0.15.0 ADVISED)
|
||||||
-> http://www.qbittorrent.org/download.php (advised)
|
-> http://www.qbittorrent.org/download.php (advised)
|
||||||
-> http://www.libtorrent.net
|
-> http://www.libtorrent.net
|
||||||
Be careful: another library (the one used by rTorrent) uses a similar name.
|
Be careful: another library (the one used by rTorrent) uses a similar name.
|
||||||
|
|
||||||
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
||||||
|
|
||||||
- libcurl
|
|
||||||
|
|
||||||
- python >= 2.3 (needed by search engine)
|
- python >= 2.3 (needed by search engine)
|
||||||
|
|
||||||
- libmagick++ (advised, not required)
|
- libnotify >= 0.4.2, glib-2.0 (optional)
|
||||||
* Needed for favicons support (RSS / Search plugins)
|
* Can be used for system notifications to replace standard Qt notifications
|
||||||
|
so that it integrates better into the Desktop
|
||||||
- libzzip (advised, not required)
|
|
||||||
* Needed for zip support (Search plugins)
|
|
||||||
|
|
||||||
NOTE FOR NON-KDE USERS:
|
|
||||||
- qt4-qtconfig package is advised when using other systems than KDE.
|
|
||||||
You can also change qBittorrent style to Cleanlooks (GNOME like)
|
|
||||||
|
|
||||||
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.
|
||||||
|
|||||||
6
README
@@ -10,6 +10,9 @@ It aims to be a good alternative to all other bittorrent clients
|
|||||||
out there. qBittorrent is fast, stable and provides unicode
|
out there. qBittorrent is fast, stable and provides unicode
|
||||||
support as well as many features.
|
support as well as many features.
|
||||||
|
|
||||||
|
This product includes GeoLite data created by MaxMind, available from
|
||||||
|
http://maxmind.com/
|
||||||
|
|
||||||
Installation:
|
Installation:
|
||||||
********************************
|
********************************
|
||||||
For installation, follow the instructions from INSTALL file, but simple:
|
For installation, follow the instructions from INSTALL file, but simple:
|
||||||
@@ -23,6 +26,9 @@ will install and execute qBittorrent hopefully without any problem.
|
|||||||
For more information please visit:
|
For more information please visit:
|
||||||
http://www.qbittorrent.org
|
http://www.qbittorrent.org
|
||||||
|
|
||||||
|
or our wiki here:
|
||||||
|
http://wiki.qbittorrent.org
|
||||||
|
|
||||||
Please report any bug (or feature request) to:
|
Please report any bug (or feature request) to:
|
||||||
http://bugs.qbittorrent.org
|
http://bugs.qbittorrent.org
|
||||||
|
|
||||||
|
|||||||
215
configure
vendored
@@ -19,11 +19,7 @@ Main options:
|
|||||||
|
|
||||||
Dependency options:
|
Dependency options:
|
||||||
--with-libboost-inc=[path] Path to libboost include files
|
--with-libboost-inc=[path] Path to libboost include files
|
||||||
--with-libcurl-inc=[path] Path to libcurl include files
|
--disable-libnotify Disable use of libnotify
|
||||||
--with-libcurl-lib=[path] Path to libcurl library files
|
|
||||||
--disable-libzzip Disable use of libzzip
|
|
||||||
--with-libzzip-inc=[path] Path to libzzip++ include files
|
|
||||||
--with-libzzip-lib=[path] Path to libzzip++ library files
|
|
||||||
|
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
@@ -145,28 +141,8 @@ while [ $# -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--with-libcurl-inc=*)
|
--disable-libnotify)
|
||||||
QC_WITH_LIBCURL_INC=$optarg
|
QC_DISABLE_libnotify="Y"
|
||||||
shift
|
|
||||||
;;
|
|
||||||
|
|
||||||
--with-libcurl-lib=*)
|
|
||||||
QC_WITH_LIBCURL_LIB=$optarg
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
|
|
||||||
--disable-libzzip)
|
|
||||||
QC_DISABLE_libzzip="Y"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
|
|
||||||
--with-libzzip-inc=*)
|
|
||||||
QC_WITH_LIBZZIP_INC=$optarg
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
|
|
||||||
--with-libzzip-lib=*)
|
|
||||||
QC_WITH_LIBZZIP_LIB=$optarg
|
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -192,11 +168,7 @@ echo BINDIR=$BINDIR
|
|||||||
echo DATADIR=$DATADIR
|
echo DATADIR=$DATADIR
|
||||||
echo EX_QTDIR=$EX_QTDIR
|
echo EX_QTDIR=$EX_QTDIR
|
||||||
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
||||||
echo QC_WITH_LIBCURL_INC=$QC_WITH_LIBCURL_INC
|
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
|
||||||
echo QC_WITH_LIBCURL_LIB=$QC_WITH_LIBCURL_LIB
|
|
||||||
echo QC_DISABLE_libzzip=$QC_DISABLE_libzzip
|
|
||||||
echo QC_WITH_LIBZZIP_INC=$QC_WITH_LIBZZIP_INC
|
|
||||||
echo QC_WITH_LIBZZIP_LIB=$QC_WITH_LIBZZIP_LIB
|
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -301,21 +273,21 @@ cat >$1/modules.cpp <<EOT
|
|||||||
#line 1 "qt4.qcm"
|
#line 1 "qt4.qcm"
|
||||||
/*
|
/*
|
||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
name: Qt >= 4.3
|
name: Qt >= 4.4
|
||||||
-----END QCMOD-----
|
-----END QCMOD-----
|
||||||
*/
|
*/
|
||||||
class qc_qt4 : public ConfObj
|
class qc_qt4 : public ConfObj
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
qc_qt4(Conf *c) : ConfObj(c) {}
|
qc_qt4(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "Qt >= 4.3"; }
|
QString name() const { return "Qt >= 4.4"; }
|
||||||
QString shortname() const { return "Qt 4.3"; }
|
QString shortname() const { return "Qt 4.4"; }
|
||||||
bool exec()
|
bool exec()
|
||||||
{
|
{
|
||||||
if(QT_VERSION >= 0x040400) {
|
if(QT_VERSION >= 0x040500) {
|
||||||
conf->addDefine("QT_4_4");
|
conf->addDefine("QT_4_5");
|
||||||
}
|
}
|
||||||
return(QT_VERSION >= 0x040300);
|
return(QT_VERSION >= 0x040400);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -330,12 +302,12 @@ 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.0 (>= 0.14.4 advised)"; }
|
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.0";
|
QString req_ver = "0.14.0";
|
||||||
QString adv_ver = "0.14.4";
|
QString adv_ver = "0.15.0";
|
||||||
QString version, libs, other;
|
QString version, libs, other;
|
||||||
VersionMode mode = VersionMin;
|
VersionMode mode = VersionMin;
|
||||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
||||||
@@ -345,7 +317,9 @@ 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. Although it will compile and run, you will probably experience some bugs. Please consider updating to v%s!\n", version.toUtf8().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
|
||||||
|
conf->addDefine("LIBTORRENT_0_15");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -406,137 +380,45 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#line 1 "libcurl.qcm"
|
#line 1 "libnotify.qcm"
|
||||||
/*
|
/*
|
||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
name: libcommoncpp2
|
name: libnotify
|
||||||
arg: with-libcurl-inc=[path], Path to libcurl include files
|
|
||||||
arg: with-libcurl-lib=[path], Path to libcurl library files
|
|
||||||
-----END QCMOD-----
|
-----END QCMOD-----
|
||||||
*/
|
*/
|
||||||
class qc_libcurl : public ConfObj
|
// see Conf::findPkgConfig
|
||||||
|
class qc_libnotify : public ConfObj
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
qc_libcurl(Conf *c) : ConfObj(c) {}
|
qc_libnotify(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libcurl"; }
|
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
||||||
QString shortname() const { return "libcurl"; }
|
QString shortname() const { return "libnotify"; }
|
||||||
bool exec(){
|
bool exec(){
|
||||||
QString s;
|
QStringList incs;
|
||||||
s = conf->getenv("QC_WITH_LIBCURL_INC");
|
QString req_ver = "0.4.2";
|
||||||
if(!s.isEmpty()) {
|
QString version, libs, other;
|
||||||
if(!conf->checkHeader(s, "curl/curl.h")) {
|
VersionMode mode = VersionMin;
|
||||||
|
if(conf->findPkgConfig("libnotify", mode, req_ver, &version, &incs, &libs, &other)) {
|
||||||
|
conf->addDefine("WITH_LIBNOTIFY");
|
||||||
|
for(int n = 0; n < incs.count(); ++n)
|
||||||
|
conf->addIncludePath(incs[n]);
|
||||||
|
if(!libs.isEmpty())
|
||||||
|
conf->addLib(libs);
|
||||||
|
QStringList incs2;
|
||||||
|
QString req_ver2 = "2.0";
|
||||||
|
QString version2, libs2, other2;
|
||||||
|
if(conf->findPkgConfig("glib-2.0", mode, req_ver2, &version2, &incs2, &libs2, &other2)) {
|
||||||
|
for(int n = 0; n < incs2.count(); ++n)
|
||||||
|
conf->addIncludePath(incs2[n]);
|
||||||
|
if(!libs2.isEmpty())
|
||||||
|
conf->addLib(libs2);
|
||||||
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/include";
|
|
||||||
sl << "/usr/local/include";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(conf->checkHeader(s, "curl/curl.h")){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(!found) {
|
} else {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
conf->addIncludePath(s);
|
|
||||||
|
|
||||||
s = conf->getenv("QC_WITH_LIBCURL_LIB");
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
if(!QFile::exists(s+QString("/libcurl.so")))
|
|
||||||
return false;
|
|
||||||
conf->addLib(QString("-L") + s);
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/lib/";
|
|
||||||
sl << "/usr/lib64/";
|
|
||||||
sl << "/usr/local/lib/";
|
|
||||||
sl << "/usr/local/lib64/";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(QFile::exists(s+QString("libcurl.so"))){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found) return false;
|
|
||||||
conf->addLib(QString("-L") + s);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#line 1 "libzzip.qcm"
|
|
||||||
/*
|
|
||||||
-----BEGIN QCMOD-----
|
|
||||||
name: libzzip
|
|
||||||
arg: with-libzzip-inc=[path], Path to libzzip++ include files
|
|
||||||
arg: with-libzzip-lib=[path], Path to libzzip++ library files
|
|
||||||
-----END QCMOD-----
|
|
||||||
*/
|
|
||||||
#include <QProcess>
|
|
||||||
class qc_libzzip : public ConfObj
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
qc_libzzip(Conf *c) : ConfObj(c) {}
|
|
||||||
QString name() const { return "Zzip library (libzzip)"; }
|
|
||||||
QString shortname() const { return "libzzip"; }
|
|
||||||
QString checkString() const {
|
|
||||||
if(!conf->getenv("QC_DISABLE_LIBZZIP").isEmpty())
|
|
||||||
return "";
|
|
||||||
return ConfObj::checkString();
|
|
||||||
}
|
|
||||||
bool exec(){
|
|
||||||
if(!conf->getenv("QC_DISABLE_LIBZZIP").isEmpty())
|
|
||||||
return false;
|
return false;
|
||||||
QString s;
|
|
||||||
s = conf->getenv("QC_WITH_LIBZZIP_INC");
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
if(!conf->checkHeader(s, "zzip/zzip.h")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/include";
|
|
||||||
sl << "/usr/local/include";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(conf->checkHeader(s, "zzip/zzip.h")){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found)
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
conf->addIncludePath(s);
|
|
||||||
|
|
||||||
s = conf->getenv("QC_WITH_LIBZZIP_LIB");
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
if(!QFile::exists(s+QString("/libzzip.so"))){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/lib/";
|
|
||||||
sl << "/usr/lib64/";
|
|
||||||
sl << "/usr/local/lib/";
|
|
||||||
sl << "/usr/local/lib64/";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(QFile::exists(s+QString("libzzip.so"))){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
conf->addLib(QString("-L") + s);
|
|
||||||
conf->addLib("-lzzip");
|
|
||||||
conf->addDefine("HAVE_ZZIP");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -552,10 +434,7 @@ cat >$1/modules_new.cpp <<EOT
|
|||||||
o = new qc_libboost(conf);
|
o = new qc_libboost(conf);
|
||||||
o->required = true;
|
o->required = true;
|
||||||
o->disabled = false;
|
o->disabled = false;
|
||||||
o = new qc_libcurl(conf);
|
o = new qc_libnotify(conf);
|
||||||
o->required = true;
|
|
||||||
o->disabled = false;
|
|
||||||
o = new qc_libzzip(conf);
|
|
||||||
o->required = false;
|
o->required = false;
|
||||||
o->disabled = false;
|
o->disabled = false;
|
||||||
|
|
||||||
@@ -1504,11 +1383,7 @@ export BINDIR
|
|||||||
export DATADIR
|
export DATADIR
|
||||||
export EX_QTDIR
|
export EX_QTDIR
|
||||||
export QC_WITH_LIBBOOST_INC
|
export QC_WITH_LIBBOOST_INC
|
||||||
export QC_WITH_LIBCURL_INC
|
export QC_DISABLE_libnotify
|
||||||
export QC_WITH_LIBCURL_LIB
|
|
||||||
export QC_DISABLE_libzzip
|
|
||||||
export QC_WITH_LIBZZIP_INC
|
|
||||||
export QC_WITH_LIBZZIP_LIB
|
|
||||||
export QC_VERBOSE
|
export QC_VERBOSE
|
||||||
rm -rf .qconftemp
|
rm -rf .qconftemp
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
.\" 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" "September 1st 2007" "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
|
|
||||||
|
|
||||||
\fBqbittorrent\fR [FILE | URL] [FILE | URL...]
|
.SH "SYNOPSIS"
|
||||||
|
|
||||||
|
\fBqbittorrent\fR [\-\-no-splash] [TORRENT_FILE | URL]...
|
||||||
|
|
||||||
\fBqbittorrent\fR \-\-help
|
\fBqbittorrent\fR \-\-help
|
||||||
|
|
||||||
\fBqbittorrent\fR \-\-version
|
\fBqbittorrent\fR \-\-version
|
||||||
|
|
||||||
.PP
|
.PP
|
||||||
.SH "DESCRIPTION"
|
.SH "DESCRIPTION"
|
||||||
|
|
||||||
@@ -19,10 +21,21 @@ qBittorrent \- a Bittorrent client written in C++ / Qt4
|
|||||||
using the \fBrblibtorrent\fR library by Arvid Norberg. qBittorrent aims
|
using the \fBrblibtorrent\fR library by Arvid Norberg. qBittorrent aims
|
||||||
to be a good alternative to all other bittorrent clients out there. qBittorrent
|
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 (Azureus compatible), FAST extension (mainline) and PeX support (utorrent compatible).
|
It also comes with UPnP port forwarding / NAT-PMP, encryption (Azureus compatible),
|
||||||
|
FAST extension (mainline) and PeX support (utorrent compatible).
|
||||||
|
|
||||||
|
.SH "OPTIONS"
|
||||||
|
|
||||||
|
\fB--help\fR Prints the command line options.
|
||||||
|
|
||||||
|
\fB--version\fR Prints qbittorrent program version number.
|
||||||
|
|
||||||
|
\fB--no-splash\fR Disables splash screen on startup.
|
||||||
|
|
||||||
|
.SH "BUGS"
|
||||||
|
|
||||||
|
If you find a bug, please report it at http://bugs.qbittorrent.org
|
||||||
|
|
||||||
Please report any problem to http://bugs.qbittorrent.org
|
|
||||||
.PP
|
|
||||||
.SH "AUTHOR"
|
.SH "AUTHOR"
|
||||||
|
|
||||||
Christophe Dumez <chris@qbittorrent.org>
|
Christophe Dumez <chris@qbittorrent.org>
|
||||||
|
|||||||
@@ -12,8 +12,6 @@
|
|||||||
<dep type='libboost'>
|
<dep type='libboost'>
|
||||||
<required/>
|
<required/>
|
||||||
</dep>
|
</dep>
|
||||||
<dep type='libcurl'>
|
<dep type='libnotify'>
|
||||||
<required/>
|
|
||||||
</dep>
|
</dep>
|
||||||
<dep type='libzzip'/>
|
|
||||||
</qconf>
|
</qconf>
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
-----BEGIN QCMOD-----
|
|
||||||
name: libcommoncpp2
|
|
||||||
arg: with-libcurl-inc=[path], Path to libcurl include files
|
|
||||||
arg: with-libcurl-lib=[path], Path to libcurl library files
|
|
||||||
-----END QCMOD-----
|
|
||||||
*/
|
|
||||||
class qc_libcurl : public ConfObj
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
qc_libcurl(Conf *c) : ConfObj(c) {}
|
|
||||||
QString name() const { return "libcurl"; }
|
|
||||||
QString shortname() const { return "libcurl"; }
|
|
||||||
bool exec(){
|
|
||||||
QString s;
|
|
||||||
s = conf->getenv("QC_WITH_LIBCURL_INC");
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
if(!conf->checkHeader(s, "curl/curl.h")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/include";
|
|
||||||
sl << "/usr/local/include";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(conf->checkHeader(s, "curl/curl.h")){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
conf->addIncludePath(s);
|
|
||||||
|
|
||||||
s = conf->getenv("QC_WITH_LIBCURL_LIB");
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
if(!QFile::exists(s+QString("/libcurl.so")))
|
|
||||||
return false;
|
|
||||||
conf->addLib(QString("-L") + s);
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/lib/";
|
|
||||||
sl << "/usr/lib64/";
|
|
||||||
sl << "/usr/local/lib/";
|
|
||||||
sl << "/usr/local/lib64/";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(QFile::exists(s+QString("libcurl.so"))){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found) return false;
|
|
||||||
conf->addLib(QString("-L") + s);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
41
qcm/libnotify.qcm
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
-----BEGIN QCMOD-----
|
||||||
|
name: libnotify
|
||||||
|
-----END QCMOD-----
|
||||||
|
*/
|
||||||
|
// see Conf::findPkgConfig
|
||||||
|
class qc_libnotify : public ConfObj
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
qc_libnotify(Conf *c) : ConfObj(c) {}
|
||||||
|
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
||||||
|
QString shortname() const { return "libnotify"; }
|
||||||
|
bool exec(){
|
||||||
|
QStringList incs;
|
||||||
|
QString req_ver = "0.4.2";
|
||||||
|
QString version, libs, other;
|
||||||
|
VersionMode mode = VersionMin;
|
||||||
|
if(conf->findPkgConfig("libnotify", mode, req_ver, &version, &incs, &libs, &other)) {
|
||||||
|
conf->addDefine("WITH_LIBNOTIFY");
|
||||||
|
for(int n = 0; n < incs.count(); ++n)
|
||||||
|
conf->addIncludePath(incs[n]);
|
||||||
|
if(!libs.isEmpty())
|
||||||
|
conf->addLib(libs);
|
||||||
|
QStringList incs2;
|
||||||
|
QString req_ver2 = "2.0";
|
||||||
|
QString version2, libs2, other2;
|
||||||
|
if(conf->findPkgConfig("glib-2.0", mode, req_ver2, &version2, &incs2, &libs2, &other2)) {
|
||||||
|
for(int n = 0; n < incs2.count(); ++n)
|
||||||
|
conf->addIncludePath(incs2[n]);
|
||||||
|
if(!libs2.isEmpty())
|
||||||
|
conf->addLib(libs2);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -8,12 +8,12 @@ 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.0 (>= 0.14.4 advised)"; }
|
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.0";
|
QString req_ver = "0.14.0";
|
||||||
QString adv_ver = "0.14.4";
|
QString adv_ver = "0.15.0";
|
||||||
QString version, libs, other;
|
QString version, libs, other;
|
||||||
VersionMode mode = VersionMin;
|
VersionMode mode = VersionMin;
|
||||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
||||||
@@ -23,7 +23,9 @@ 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. Although it will compile and run, you will probably experience some bugs. Please consider updating to 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
|
||||||
|
conf->addDefine("LIBTORRENT_0_15");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
-----BEGIN QCMOD-----
|
|
||||||
name: libzzip
|
|
||||||
arg: with-libzzip-inc=[path], Path to libzzip++ include files
|
|
||||||
arg: with-libzzip-lib=[path], Path to libzzip++ library files
|
|
||||||
-----END QCMOD-----
|
|
||||||
*/
|
|
||||||
#include <QProcess>
|
|
||||||
class qc_libzzip : public ConfObj
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
qc_libzzip(Conf *c) : ConfObj(c) {}
|
|
||||||
QString name() const { return "Zzip library (libzzip)"; }
|
|
||||||
QString shortname() const { return "libzzip"; }
|
|
||||||
QString checkString() const {
|
|
||||||
if(!conf->getenv("QC_DISABLE_LIBZZIP").isEmpty())
|
|
||||||
return "";
|
|
||||||
return ConfObj::checkString();
|
|
||||||
}
|
|
||||||
bool exec(){
|
|
||||||
if(!conf->getenv("QC_DISABLE_LIBZZIP").isEmpty())
|
|
||||||
return false;
|
|
||||||
QString s;
|
|
||||||
s = conf->getenv("QC_WITH_LIBZZIP_INC");
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
if(!conf->checkHeader(s, "zzip/zzip.h")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/include";
|
|
||||||
sl << "/usr/local/include";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(conf->checkHeader(s, "zzip/zzip.h")){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
conf->addIncludePath(s);
|
|
||||||
|
|
||||||
s = conf->getenv("QC_WITH_LIBZZIP_LIB");
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
if(!QFile::exists(s+QString("/libzzip.so"))){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/lib/";
|
|
||||||
sl << "/usr/lib64/";
|
|
||||||
sl << "/usr/local/lib/";
|
|
||||||
sl << "/usr/local/lib64/";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(QFile::exists(s+QString("libzzip.so"))){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
conf->addLib(QString("-L") + s);
|
|
||||||
conf->addLib("-lzzip");
|
|
||||||
conf->addDefine("HAVE_ZZIP");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
14
qcm/qt4.qcm
@@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
name: Qt >= 4.3
|
name: Qt >= 4.4
|
||||||
-----END QCMOD-----
|
-----END QCMOD-----
|
||||||
*/
|
*/
|
||||||
class qc_qt4 : public ConfObj
|
class qc_qt4 : public ConfObj
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
qc_qt4(Conf *c) : ConfObj(c) {}
|
qc_qt4(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "Qt >= 4.3"; }
|
QString name() const { return "Qt >= 4.4"; }
|
||||||
QString shortname() const { return "Qt 4.3"; }
|
QString shortname() const { return "Qt 4.4"; }
|
||||||
bool exec()
|
bool exec()
|
||||||
{
|
{
|
||||||
if(QT_VERSION >= 0x040400) {
|
if(QT_VERSION >= 0x040500) {
|
||||||
conf->addDefine("QT_4_4");
|
conf->addDefine("QT_4_5");
|
||||||
}
|
}
|
||||||
return(QT_VERSION >= 0x040300);
|
return(QT_VERSION >= 0x040400);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
/*
|
|
||||||
* Bittorrent Client using Qt4 and libtorrent.
|
|
||||||
* Copyright (C) 2006 Christophe Dumez
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* In addition, as a special exception, the copyright holders give permission to
|
|
||||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
||||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
||||||
* and distribute the linked executables. You must obey the GNU General Public
|
|
||||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
||||||
* modify file(s), you may extend this exception to your version of the file(s),
|
|
||||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
||||||
* exception statement from your version.
|
|
||||||
*
|
|
||||||
* Contact : chris@qbittorrent.org
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef DLLISTDELEGATE_H
|
|
||||||
#define DLLISTDELEGATE_H
|
|
||||||
|
|
||||||
#include <QItemDelegate>
|
|
||||||
#include <QModelIndex>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QStyleOptionProgressBarV2>
|
|
||||||
#include <QStyleOptionViewItemV2>
|
|
||||||
#include <QProgressBar>
|
|
||||||
#include <QApplication>
|
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
// Defines for download list list columns
|
|
||||||
#define NAME 0
|
|
||||||
#define SIZE 1
|
|
||||||
#define PROGRESS 2
|
|
||||||
#define DLSPEED 3
|
|
||||||
#define UPSPEED 4
|
|
||||||
#define SEEDSLEECH 5
|
|
||||||
#define RATIO 6
|
|
||||||
#define ETA 7
|
|
||||||
#define PRIORITY 8
|
|
||||||
#define HASH 9
|
|
||||||
|
|
||||||
class DLListDelegate: public QItemDelegate {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
DLListDelegate(QObject *parent) : QItemDelegate(parent){}
|
|
||||||
|
|
||||||
~DLListDelegate(){}
|
|
||||||
|
|
||||||
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const{
|
|
||||||
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
|
|
||||||
switch(index.column()){
|
|
||||||
case SIZE:
|
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong()));
|
|
||||||
break;
|
|
||||||
case ETA:
|
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::userFriendlyDuration(index.data().toLongLong()));
|
|
||||||
break;
|
|
||||||
case UPSPEED:
|
|
||||||
case DLSPEED:{
|
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
double speed = index.data().toDouble();
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(speed/1024., 'f', 1))+QString::fromUtf8(" ")+tr("KiB/s"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case RATIO:{
|
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
double ratio = index.data().toDouble();
|
|
||||||
if(ratio > 100.)
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8("∞"));
|
|
||||||
else
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(ratio, 'f', 1)));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PROGRESS:{
|
|
||||||
QStyleOptionProgressBarV2 newopt;
|
|
||||||
double progress = index.data().toDouble()*100.;
|
|
||||||
newopt.rect = opt.rect;
|
|
||||||
newopt.text = QString(QByteArray::number(progress, 'f', 1))+QString::fromUtf8("%");
|
|
||||||
newopt.progress = (int)progress;
|
|
||||||
newopt.maximum = 100;
|
|
||||||
newopt.minimum = 0;
|
|
||||||
newopt.state |= QStyle::State_Enabled;
|
|
||||||
newopt.textVisible = true;
|
|
||||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
|
|
||||||
painter);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
QItemDelegate::paint(painter, option, index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QWidget* createEditor(QWidget*, const QStyleOptionViewItem &, const QModelIndex &) const {
|
|
||||||
// No editor here
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
/*
|
|
||||||
* Bittorrent Client using Qt4 and libtorrent.
|
|
||||||
* Copyright (C) 2006 Christophe Dumez
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* In addition, as a special exception, the copyright holders give permission to
|
|
||||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
||||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
||||||
* and distribute the linked executables. You must obey the GNU General Public
|
|
||||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
||||||
* modify file(s), you may extend this exception to your version of the file(s),
|
|
||||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
||||||
* exception statement from your version.
|
|
||||||
*
|
|
||||||
* Contact : chris@qbittorrent.org
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef FINISHEDLISTDELEGATE_H
|
|
||||||
#define FINISHEDLISTDELEGATE_H
|
|
||||||
|
|
||||||
#include <QItemDelegate>
|
|
||||||
#include <QModelIndex>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QStyleOptionProgressBarV2>
|
|
||||||
#include <QStyleOptionViewItemV2>
|
|
||||||
#include <QProgressBar>
|
|
||||||
#include <QApplication>
|
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
// Defines for download list list columns
|
|
||||||
#define F_NAME 0
|
|
||||||
#define F_SIZE 1
|
|
||||||
#define F_UPSPEED 2
|
|
||||||
#define F_SWARM 3
|
|
||||||
#define F_PEERS 4
|
|
||||||
#define F_UPLOAD 5
|
|
||||||
#define F_RATIO 6
|
|
||||||
#define F_HASH 7
|
|
||||||
|
|
||||||
#define MAX_RATIO 100.
|
|
||||||
|
|
||||||
class FinishedListDelegate: public QItemDelegate {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
FinishedListDelegate(QObject *parent) : QItemDelegate(parent){}
|
|
||||||
|
|
||||||
~FinishedListDelegate(){}
|
|
||||||
|
|
||||||
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const{
|
|
||||||
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
|
|
||||||
switch(index.column()){
|
|
||||||
case F_SIZE:
|
|
||||||
case F_UPLOAD:
|
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong()));
|
|
||||||
break;
|
|
||||||
case F_UPSPEED:{
|
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
double speed = index.data().toDouble();
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(speed/1024., 'f', 1))+QString::fromUtf8(" ")+tr("KiB/s"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case F_RATIO:{
|
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
double ratio = index.data().toDouble();
|
|
||||||
if(ratio > MAX_RATIO)
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8("∞"));
|
|
||||||
else
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(ratio, 'f', 1)));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
QItemDelegate::paint(painter, option, index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QWidget* createEditor(QWidget*, const QStyleOptionViewItem &, const QModelIndex &) const {
|
|
||||||
// No editor here
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,626 +0,0 @@
|
|||||||
/*
|
|
||||||
* Bittorrent Client using Qt4 and libtorrent.
|
|
||||||
* Copyright (C) 2006 Christophe Dumez
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* In addition, as a special exception, the copyright holders give permission to
|
|
||||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
||||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
||||||
* and distribute the linked executables. You must obey the GNU General Public
|
|
||||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
||||||
* modify file(s), you may extend this exception to your version of the file(s),
|
|
||||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
||||||
* exception statement from your version.
|
|
||||||
*
|
|
||||||
* Contact : chris@qbittorrent.org
|
|
||||||
*/
|
|
||||||
#include "FinishedTorrents.h"
|
|
||||||
#include "misc.h"
|
|
||||||
#include "properties_imp.h"
|
|
||||||
#include "bittorrent.h"
|
|
||||||
#include "allocationDlg.h"
|
|
||||||
#include "FinishedListDelegate.h"
|
|
||||||
#include "GUI.h"
|
|
||||||
|
|
||||||
#include <QFile>
|
|
||||||
#include <QSettings>
|
|
||||||
#include <QStandardItemModel>
|
|
||||||
#include <QSortFilterProxyModel>
|
|
||||||
#include <QHeaderView>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : parent(parent), BTSession(BTSession), nbFinished(0){
|
|
||||||
setupUi(this);
|
|
||||||
actionStart->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/play.png")));
|
|
||||||
actionPause->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/pause.png")));
|
|
||||||
finishedListModel = new QStandardItemModel(0,8);
|
|
||||||
finishedListModel->setHeaderData(F_NAME, Qt::Horizontal, tr("Name", "i.e: file name"));
|
|
||||||
finishedListModel->setHeaderData(F_SIZE, Qt::Horizontal, tr("Size", "i.e: file size"));
|
|
||||||
finishedListModel->setHeaderData(F_UPSPEED, Qt::Horizontal, tr("UP Speed", "i.e: Upload speed"));
|
|
||||||
finishedListModel->setHeaderData(F_SWARM, Qt::Horizontal, tr("Seeds / Leechers"));
|
|
||||||
finishedListModel->setHeaderData(F_PEERS, Qt::Horizontal, tr("Connected peers"));
|
|
||||||
finishedListModel->setHeaderData(F_UPLOAD, Qt::Horizontal, tr("Total uploaded", "i.e: Total amount of uploaded data"));
|
|
||||||
finishedListModel->setHeaderData(F_RATIO, Qt::Horizontal, tr("Ratio"));
|
|
||||||
|
|
||||||
proxyModel = new QSortFilterProxyModel();
|
|
||||||
proxyModel->setDynamicSortFilter(true);
|
|
||||||
proxyModel->setSourceModel(finishedListModel);
|
|
||||||
finishedList->setModel(proxyModel);
|
|
||||||
|
|
||||||
finishedList->setRootIsDecorated(false);
|
|
||||||
finishedList->setAllColumnsShowFocus(true);
|
|
||||||
finishedList->setSortingEnabled(true);
|
|
||||||
|
|
||||||
loadHiddenColumns();
|
|
||||||
// Hide hash column
|
|
||||||
finishedList->hideColumn(F_HASH);
|
|
||||||
// Load last columns width for download list
|
|
||||||
if(!loadColWidthFinishedList()){
|
|
||||||
finishedList->header()->resizeSection(0, 200);
|
|
||||||
}
|
|
||||||
// Connect BTSession signals
|
|
||||||
connect(BTSession, SIGNAL(metadataReceived(QTorrentHandle&)), this, SLOT(updateMetadata(QTorrentHandle&)));
|
|
||||||
// Make download list header clickable for sorting
|
|
||||||
finishedList->header()->setClickable(true);
|
|
||||||
finishedList->header()->setSortIndicatorShown(true);
|
|
||||||
finishedListDelegate = new FinishedListDelegate(finishedList);
|
|
||||||
finishedList->setItemDelegate(finishedListDelegate);
|
|
||||||
connect(finishedList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayFinishedListMenu(const QPoint&)));
|
|
||||||
finishedList->header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
||||||
connect(finishedList->header(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayFinishedHoSMenu(const QPoint&)));
|
|
||||||
connect(finishedList, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(notifyTorrentDoubleClicked(const QModelIndex&)));
|
|
||||||
actionDelete->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete.png")));
|
|
||||||
actionPreview_file->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/preview.png")));
|
|
||||||
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
|
|
||||||
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
|
|
||||||
actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
|
|
||||||
actionCopy_magnet_link->setIcon(QIcon(QString::fromUtf8(":/Icons/magnet.png")));
|
|
||||||
|
|
||||||
connect(actionPause, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPause_triggered()));
|
|
||||||
connect(actionStart, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionStart_triggered()));
|
|
||||||
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_triggered()));
|
|
||||||
connect(actionPreview_file, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPreview_file_triggered()));
|
|
||||||
connect(actionDelete_Permanently, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_Permanently_triggered()));
|
|
||||||
connect(actionOpen_destination_folder, SIGNAL(triggered()), (GUI*)parent, SLOT(openDestinationFolder()));
|
|
||||||
connect(actionBuy_it, SIGNAL(triggered()), (GUI*)parent, SLOT(goBuyPage()));
|
|
||||||
connect(actionTorrent_Properties, SIGNAL(triggered()), this, SLOT(propertiesSelection()));
|
|
||||||
connect(actionForce_recheck, SIGNAL(triggered()), this, SLOT(forceRecheck()));
|
|
||||||
connect(actionCopy_magnet_link, SIGNAL(triggered()), (GUI*)parent, SLOT(copyMagnetURI()));
|
|
||||||
|
|
||||||
connect(actionHOSColName, SIGNAL(triggered()), this, SLOT(hideOrShowColumnName()));
|
|
||||||
connect(actionHOSColSize, SIGNAL(triggered()), this, SLOT(hideOrShowColumnSize()));
|
|
||||||
connect(actionHOSColUpSpeed, SIGNAL(triggered()), this, SLOT(hideOrShowColumnUpSpeed()));
|
|
||||||
connect(actionHOSColSwarm, SIGNAL(triggered()), this, SLOT(hideOrShowColumnSwarm()));
|
|
||||||
connect(actionHOSColPeers, SIGNAL(triggered()), this, SLOT(hideOrShowColumnPeers()));
|
|
||||||
connect(actionHOSColUpload, SIGNAL(triggered()), this, SLOT(hideOrShowColumnUpload()));
|
|
||||||
connect(actionHOSColRatio, SIGNAL(triggered()), this, SLOT(hideOrShowColumnRatio()));
|
|
||||||
}
|
|
||||||
|
|
||||||
FinishedTorrents::~FinishedTorrents(){
|
|
||||||
saveLastSortedColumn();
|
|
||||||
saveColWidthFinishedList();
|
|
||||||
saveHiddenColumns();
|
|
||||||
delete finishedListDelegate;
|
|
||||||
delete proxyModel;
|
|
||||||
delete finishedListModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::notifyTorrentDoubleClicked(const QModelIndex& index) {
|
|
||||||
unsigned int row = index.row();
|
|
||||||
QString hash = getHashFromRow(row);
|
|
||||||
emit torrentDoubleClicked(hash, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::addTorrent(QString hash){
|
|
||||||
int row = getRowFromHash(hash);
|
|
||||||
if(row != -1) return;
|
|
||||||
row = finishedListModel->rowCount();
|
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
|
||||||
// Adding torrent to download list
|
|
||||||
finishedListModel->insertRow(row);
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(h.name()));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_SIZE), QVariant((qlonglong)h.actual_size()));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_UPSPEED), QVariant((double)0.));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_SWARM), QVariant("-1/-1"));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_PEERS), QVariant("0"));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_UPLOAD), QVariant((qlonglong)h.all_time_upload()));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_RATIO), QVariant(QString::fromUtf8(misc::toString(BTSession->getRealRatio(hash)).c_str())));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_HASH), QVariant(hash));
|
|
||||||
if(h.is_paused()) {
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QIcon(":/Icons/skin/paused.png"), Qt::DecorationRole);
|
|
||||||
setRowColor(row, "red");
|
|
||||||
}else{
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(":/Icons/skin/seeding.png")), Qt::DecorationRole);
|
|
||||||
setRowColor(row, "orange");
|
|
||||||
}
|
|
||||||
// Update the number of finished torrents
|
|
||||||
++nbFinished;
|
|
||||||
emit finishedTorrentsNumberChanged(nbFinished);
|
|
||||||
|
|
||||||
loadLastSortedColumn();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the color of a row in data model
|
|
||||||
void FinishedTorrents::setRowColor(int row, QString color){
|
|
||||||
unsigned int nbColumns = finishedListModel->columnCount()-1;
|
|
||||||
for(unsigned int i=0; i<nbColumns; ++i){
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, i), QVariant(QColor(color)), Qt::ForegroundRole);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList FinishedTorrents::getSelectedTorrents(bool only_one) const{
|
|
||||||
QStringList res;
|
|
||||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
|
||||||
foreach(const QModelIndex &index, selectedIndexes) {
|
|
||||||
if(index.column() == F_NAME) {
|
|
||||||
// Get the file hash
|
|
||||||
QString hash = getHashFromRow(index.row());
|
|
||||||
res << hash;
|
|
||||||
if(only_one) break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int FinishedTorrents::getNbTorrentsInList() const {
|
|
||||||
return nbFinished;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load columns width in a file that were saved previously
|
|
||||||
// (finished list)
|
|
||||||
bool FinishedTorrents::loadColWidthFinishedList(){
|
|
||||||
qDebug("Loading columns width for finished list");
|
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
|
||||||
QString line = settings.value("FinishedListColsWidth", QString()).toString();
|
|
||||||
if(line.isEmpty())
|
|
||||||
return false;
|
|
||||||
QStringList width_list = line.split(' ');
|
|
||||||
if(width_list.size() < finishedListModel->columnCount()-1)
|
|
||||||
return false;
|
|
||||||
unsigned int listSize = width_list.size();
|
|
||||||
for(unsigned int i=0; i<listSize; ++i){
|
|
||||||
finishedList->header()->resizeSection(i, width_list.at(i).toInt());
|
|
||||||
}
|
|
||||||
loadLastSortedColumn();
|
|
||||||
QVariantList visualIndexes = settings.value(QString::fromUtf8("FinishedListVisualIndexes"), QVariantList()).toList();
|
|
||||||
if(visualIndexes.size() != finishedListModel->columnCount()-1) {
|
|
||||||
qDebug("Corrupted values for download list columns sizes");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bool change = false;
|
|
||||||
do {
|
|
||||||
change = false;
|
|
||||||
for(int i=0;i<visualIndexes.size(); ++i) {
|
|
||||||
int new_visual_index = visualIndexes.at(finishedList->header()->logicalIndex(i)).toInt();
|
|
||||||
if(i != new_visual_index) {
|
|
||||||
qDebug("Moving column from %d to %d", finishedList->header()->logicalIndex(i), new_visual_index);
|
|
||||||
finishedList->header()->moveSection(i, new_visual_index);
|
|
||||||
change = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}while(change);
|
|
||||||
qDebug("Finished list columns width loaded");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::saveLastSortedColumn() {
|
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
|
||||||
Qt::SortOrder sortOrder = finishedList->header()->sortIndicatorOrder();
|
|
||||||
QString sortOrderLetter;
|
|
||||||
if(sortOrder == Qt::AscendingOrder)
|
|
||||||
sortOrderLetter = QString::fromUtf8("a");
|
|
||||||
else
|
|
||||||
sortOrderLetter = QString::fromUtf8("d");
|
|
||||||
int index = finishedList->header()->sortIndicatorSection();
|
|
||||||
settings.setValue(QString::fromUtf8("FinishedListSortedCol"), misc::toQString(index)+sortOrderLetter);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::loadLastSortedColumn() {
|
|
||||||
// Loading last sorted column
|
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
|
||||||
QString sortedCol = settings.value(QString::fromUtf8("FinishedListSortedCol"), QString()).toString();
|
|
||||||
if(!sortedCol.isEmpty()) {
|
|
||||||
Qt::SortOrder sortOrder;
|
|
||||||
if(sortedCol.endsWith(QString::fromUtf8("d")))
|
|
||||||
sortOrder = Qt::DescendingOrder;
|
|
||||||
else
|
|
||||||
sortOrder = Qt::AscendingOrder;
|
|
||||||
sortedCol = sortedCol.left(sortedCol.size()-1);
|
|
||||||
int index = sortedCol.toInt();
|
|
||||||
finishedList->sortByColumn(index, sortOrder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save columns width in a file to remember them
|
|
||||||
// (finished list)
|
|
||||||
void FinishedTorrents::saveColWidthFinishedList() const{
|
|
||||||
qDebug("Saving columns width in finished list");
|
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
|
||||||
QStringList width_list;
|
|
||||||
QStringList new_width_list;
|
|
||||||
short nbColumns = finishedListModel->columnCount()-1;
|
|
||||||
|
|
||||||
QString line = settings.value("FinishedListColsWidth", QString()).toString();
|
|
||||||
if(!line.isEmpty()) {
|
|
||||||
width_list = line.split(' ');
|
|
||||||
}
|
|
||||||
for(short i=0; i<nbColumns; ++i){
|
|
||||||
if(finishedList->columnWidth(i)<1 && width_list.size() == nbColumns && width_list.at(i).toInt()>=1) {
|
|
||||||
// load the former width
|
|
||||||
new_width_list << width_list.at(i);
|
|
||||||
} else if(finishedList->columnWidth(i)>=1) {
|
|
||||||
// usual case, save the current width
|
|
||||||
new_width_list << QString::fromUtf8(misc::toString(finishedList->columnWidth(i)).c_str());
|
|
||||||
} else {
|
|
||||||
// default width
|
|
||||||
finishedList->resizeColumnToContents(i);
|
|
||||||
new_width_list << QString::fromUtf8(misc::toString(finishedList->columnWidth(i)).c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
settings.setValue("FinishedListColsWidth", new_width_list.join(" "));
|
|
||||||
QVariantList visualIndexes;
|
|
||||||
for(int i=0; i<nbColumns; ++i) {
|
|
||||||
visualIndexes.append(finishedList->header()->visualIndex(i));
|
|
||||||
}
|
|
||||||
settings.setValue(QString::fromUtf8("FinishedListVisualIndexes"), visualIndexes);
|
|
||||||
qDebug("Finished list columns width saved");
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::on_actionSet_upload_limit_triggered(){
|
|
||||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
|
||||||
QStringList hashes;
|
|
||||||
foreach(const QModelIndex &index, selectedIndexes){
|
|
||||||
if(index.column() == F_NAME){
|
|
||||||
// Get the file hash
|
|
||||||
hashes << getHashFromRow(index.row());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new BandwidthAllocationDialog(this, true, BTSession, hashes);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::updateMetadata(QTorrentHandle &h) {
|
|
||||||
QString hash = h.hash();
|
|
||||||
int row = getRowFromHash(hash);
|
|
||||||
if(row != -1) {
|
|
||||||
qDebug("Updating torrent metadata in download list");
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(h.name()));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_SIZE), QVariant((qlonglong)h.actual_size()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::updateTorrent(QTorrentHandle h) {
|
|
||||||
if(!h.is_valid()) return;
|
|
||||||
QString hash = h.hash();
|
|
||||||
int row = getRowFromHash(hash);
|
|
||||||
if(row == -1){
|
|
||||||
qDebug("Cannot find torrent in finished list, adding it");
|
|
||||||
addTorrent(hash);
|
|
||||||
row = getRowFromHash(hash);
|
|
||||||
}
|
|
||||||
Q_ASSERT(row != -1);
|
|
||||||
if(!finishedList->isColumnHidden(F_SWARM)) {
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_SWARM), misc::toQString(h.num_complete())+QString("/")+misc::toQString(h.num_incomplete()));
|
|
||||||
}
|
|
||||||
if(h.is_paused()) return;
|
|
||||||
// Update queued torrent
|
|
||||||
if(BTSession->isQueueingEnabled() && h.is_queued()) {
|
|
||||||
if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking){
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/oxygen/time.png"))), Qt::DecorationRole);
|
|
||||||
} else {
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/queued.png"))), Qt::DecorationRole);
|
|
||||||
}
|
|
||||||
// Reset upload speed and seeds/leech
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_UPSPEED), 0.);
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_PEERS), "0");
|
|
||||||
setRowColor(row, QString::fromUtf8("grey"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking){
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/oxygen/time.png"))), Qt::DecorationRole);
|
|
||||||
setRowColor(row, QString::fromUtf8("grey"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setRowColor(row, QString::fromUtf8("orange"));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png"))), Qt::DecorationRole);
|
|
||||||
if(!finishedList->isColumnHidden(F_UPSPEED)) {
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_UPSPEED), QVariant((double)h.upload_payload_rate()));
|
|
||||||
}
|
|
||||||
if(!finishedList->isColumnHidden(F_PEERS)) {
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_PEERS), misc::toQString(h.num_peers() - h.num_seeds(), true));
|
|
||||||
}
|
|
||||||
if(!finishedList->isColumnHidden(F_UPLOAD)) {
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_UPLOAD), QVariant((double)h.all_time_upload()));
|
|
||||||
}
|
|
||||||
if(!finishedList->isColumnHidden(F_RATIO)) {
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_RATIO), QVariant(misc::toQString(BTSession->getRealRatio(hash))));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int FinishedTorrents::getRowFromHash(QString hash) const{
|
|
||||||
unsigned int nbRows = finishedListModel->rowCount();
|
|
||||||
for(unsigned int i=0; i<nbRows; ++i){
|
|
||||||
if(finishedListModel->data(finishedListModel->index(i, F_HASH)) == hash){
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note: does not actually pause the torrent in BT Session
|
|
||||||
void FinishedTorrents::pauseTorrent(QString hash) {
|
|
||||||
int row = getRowFromHash(hash);
|
|
||||||
if(row == -1)
|
|
||||||
return;
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_UPSPEED), QVariant((double)0.0));
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QIcon(QString::fromUtf8(":/Icons/skin/paused.png")), Qt::DecorationRole);
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_PEERS), QVariant(QString::fromUtf8("0")));
|
|
||||||
setRowColor(row, QString::fromUtf8("red"));
|
|
||||||
}
|
|
||||||
|
|
||||||
QString FinishedTorrents::getHashFromRow(unsigned int row) const {
|
|
||||||
Q_ASSERT(row < (unsigned int)proxyModel->rowCount());
|
|
||||||
return proxyModel->data(proxyModel->index(row, F_HASH)).toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Will move it to download tab
|
|
||||||
void FinishedTorrents::deleteTorrent(QString hash){
|
|
||||||
int row = getRowFromHash(hash);
|
|
||||||
if(row == -1){
|
|
||||||
qDebug("Torrent is not in finished list, nothing to delete");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
finishedListModel->removeRow(row);
|
|
||||||
--nbFinished;
|
|
||||||
emit finishedTorrentsNumberChanged(nbFinished);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show torrent properties dialog
|
|
||||||
void FinishedTorrents::showProperties(const QModelIndex &index){
|
|
||||||
showPropertiesFromHash(getHashFromRow(index.row()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::showPropertiesFromHash(QString hash){
|
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
|
||||||
properties *prop = new properties(this, BTSession, h);
|
|
||||||
connect(prop, SIGNAL(filteredFilesChanged(QString)), this, SLOT(updateFileSize(QString)));
|
|
||||||
connect(prop, SIGNAL(trackersChanged(QString)), BTSession, SLOT(saveTrackerFile(QString)));
|
|
||||||
prop->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::updateFileSize(QString hash){
|
|
||||||
int row = getRowFromHash(hash);
|
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_SIZE), QVariant((qlonglong)h.actual_size()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// display properties of selected items
|
|
||||||
void FinishedTorrents::propertiesSelection(){
|
|
||||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
|
||||||
foreach(const QModelIndex &index, selectedIndexes){
|
|
||||||
if(index.column() == F_NAME){
|
|
||||||
showProperties(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::forceRecheck(){
|
|
||||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
|
||||||
foreach(const QModelIndex &index, selectedIndexes){
|
|
||||||
if(index.column() == F_NAME){
|
|
||||||
QString hash = getHashFromRow(index.row());
|
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
|
||||||
qDebug("Forcing recheck for torrent %s", hash.toLocal8Bit().data());
|
|
||||||
h.force_recheck();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::displayFinishedListMenu(const QPoint&){
|
|
||||||
QMenu myFinishedListMenu(this);
|
|
||||||
// Enable/disable pause/start action given the DL state
|
|
||||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
|
||||||
bool has_pause = false, has_start = false, has_preview = false;
|
|
||||||
foreach(const QModelIndex &index, selectedIndexes) {
|
|
||||||
if(index.column() == F_NAME) {
|
|
||||||
// Get the file name
|
|
||||||
QString hash = getHashFromRow(index.row());
|
|
||||||
// Get handle and pause the torrent
|
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
|
||||||
if(!h.is_valid()) continue;
|
|
||||||
if(h.is_paused()) {
|
|
||||||
if(!has_start) {
|
|
||||||
myFinishedListMenu.addAction(actionStart);
|
|
||||||
has_start = true;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(!has_pause) {
|
|
||||||
myFinishedListMenu.addAction(actionPause);
|
|
||||||
has_pause = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(BTSession->isFilePreviewPossible(hash) && !has_preview) {
|
|
||||||
myFinishedListMenu.addAction(actionPreview_file);
|
|
||||||
has_preview = true;
|
|
||||||
}
|
|
||||||
if(has_pause && has_start && has_preview) break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
myFinishedListMenu.addSeparator();
|
|
||||||
myFinishedListMenu.addAction(actionDelete);
|
|
||||||
myFinishedListMenu.addAction(actionDelete_Permanently);
|
|
||||||
myFinishedListMenu.addSeparator();
|
|
||||||
myFinishedListMenu.addAction(actionSet_upload_limit);
|
|
||||||
myFinishedListMenu.addSeparator();
|
|
||||||
myFinishedListMenu.addAction(actionForce_recheck);
|
|
||||||
myFinishedListMenu.addSeparator();
|
|
||||||
myFinishedListMenu.addAction(actionOpen_destination_folder);
|
|
||||||
myFinishedListMenu.addAction(actionTorrent_Properties);
|
|
||||||
myFinishedListMenu.addSeparator();
|
|
||||||
myFinishedListMenu.addAction(actionCopy_magnet_link);
|
|
||||||
myFinishedListMenu.addAction(actionBuy_it);
|
|
||||||
|
|
||||||
// Call menu
|
|
||||||
myFinishedListMenu.exec(QCursor::pos());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Hiding Columns functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
// hide/show columns menu
|
|
||||||
void FinishedTorrents::displayFinishedHoSMenu(const QPoint&){
|
|
||||||
QMenu hideshowColumn(this);
|
|
||||||
hideshowColumn.setTitle(tr("Hide or Show Column"));
|
|
||||||
int lastCol = F_RATIO;
|
|
||||||
for(int i=0; i<=lastCol; i++) {
|
|
||||||
hideshowColumn.addAction(getActionHoSCol(i));
|
|
||||||
}
|
|
||||||
// Call menu
|
|
||||||
hideshowColumn.exec(QCursor::pos());
|
|
||||||
}
|
|
||||||
|
|
||||||
// toggle hide/show a column
|
|
||||||
void FinishedTorrents::hideOrShowColumn(int index) {
|
|
||||||
unsigned int nbVisibleColumns = 0;
|
|
||||||
unsigned int nbCols = finishedListModel->columnCount();
|
|
||||||
// Count visible columns
|
|
||||||
for(unsigned int i=0; i<nbCols; ++i) {
|
|
||||||
if(!finishedList->isColumnHidden(i))
|
|
||||||
++nbVisibleColumns;
|
|
||||||
}
|
|
||||||
if(!finishedList->isColumnHidden(index)) {
|
|
||||||
// User wants to hide the column
|
|
||||||
// Is there at least one other visible column?
|
|
||||||
if(nbVisibleColumns <= 1) return;
|
|
||||||
// User can hide the column, do it.
|
|
||||||
finishedList->setColumnHidden(index, true);
|
|
||||||
getActionHoSCol(index)->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/button_cancel.png")));
|
|
||||||
--nbVisibleColumns;
|
|
||||||
} else {
|
|
||||||
// User want to display the column
|
|
||||||
finishedList->setColumnHidden(index, false);
|
|
||||||
getActionHoSCol(index)->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/button_ok.png")));
|
|
||||||
++nbVisibleColumns;
|
|
||||||
}
|
|
||||||
//resize all others non-hidden columns
|
|
||||||
for(unsigned int i=0; i<nbCols; ++i) {
|
|
||||||
if(!finishedList->isColumnHidden(i)) {
|
|
||||||
finishedList->setColumnWidth(i, (int)ceil(finishedList->columnWidth(i)+(finishedList->columnWidth(index)/nbVisibleColumns)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::hideOrShowColumnName() {
|
|
||||||
hideOrShowColumn(F_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::hideOrShowColumnSize() {
|
|
||||||
hideOrShowColumn(F_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::hideOrShowColumnUpSpeed() {
|
|
||||||
hideOrShowColumn(F_UPSPEED);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::hideOrShowColumnSwarm() {
|
|
||||||
hideOrShowColumn(F_SWARM);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::hideOrShowColumnPeers() {
|
|
||||||
hideOrShowColumn(F_PEERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::hideOrShowColumnUpload() {
|
|
||||||
hideOrShowColumn(F_UPLOAD);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FinishedTorrents::hideOrShowColumnRatio() {
|
|
||||||
hideOrShowColumn(F_RATIO);
|
|
||||||
}
|
|
||||||
|
|
||||||
// load the previous settings, and hide the columns
|
|
||||||
bool FinishedTorrents::loadHiddenColumns() {
|
|
||||||
bool loaded = false;
|
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
|
||||||
QString line = settings.value("FinishedListColsHoS", QString()).toString();
|
|
||||||
QStringList ishidden_list;
|
|
||||||
if(!line.isEmpty()) {
|
|
||||||
ishidden_list = line.split(' ');
|
|
||||||
if(ishidden_list.size() == finishedListModel->columnCount()-1) {
|
|
||||||
unsigned int listSize = ishidden_list.size();
|
|
||||||
for(unsigned int i=0; i<listSize; ++i){
|
|
||||||
finishedList->header()->resizeSection(i, ishidden_list.at(i).toInt());
|
|
||||||
}
|
|
||||||
loaded = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(int i=0; i<finishedListModel->columnCount()-1; i++) {
|
|
||||||
if(loaded && ishidden_list.at(i) == "0") {
|
|
||||||
finishedList->setColumnHidden(i, true);
|
|
||||||
getActionHoSCol(i)->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/button_cancel.png")));
|
|
||||||
} else {
|
|
||||||
getActionHoSCol(i)->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/button_ok.png")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return loaded;
|
|
||||||
}
|
|
||||||
|
|
||||||
// save the hidden columns in settings
|
|
||||||
void FinishedTorrents::saveHiddenColumns() {
|
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
|
||||||
QStringList ishidden_list;
|
|
||||||
short nbColumns = finishedListModel->columnCount()-1;
|
|
||||||
|
|
||||||
for(short i=0; i<nbColumns; ++i){
|
|
||||||
if(finishedList->isColumnHidden(i)) {
|
|
||||||
ishidden_list << QString::fromUtf8(misc::toString(0).c_str());
|
|
||||||
} else {
|
|
||||||
ishidden_list << QString::fromUtf8(misc::toString(1).c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
settings.setValue("FinishedListColsHoS", ishidden_list.join(" "));
|
|
||||||
}
|
|
||||||
|
|
||||||
// getter, return the action hide or show whose id is index
|
|
||||||
QAction* FinishedTorrents::getActionHoSCol(int index) {
|
|
||||||
switch(index) {
|
|
||||||
case F_NAME :
|
|
||||||
return actionHOSColName;
|
|
||||||
break;
|
|
||||||
case F_SIZE :
|
|
||||||
return actionHOSColSize;
|
|
||||||
break;
|
|
||||||
case F_UPSPEED :
|
|
||||||
return actionHOSColUpSpeed;
|
|
||||||
break;
|
|
||||||
case F_SWARM :
|
|
||||||
return actionHOSColSwarm;
|
|
||||||
break;
|
|
||||||
case F_PEERS :
|
|
||||||
return actionHOSColPeers;
|
|
||||||
break;
|
|
||||||
case F_UPLOAD :
|
|
||||||
return actionHOSColUpload;
|
|
||||||
break;
|
|
||||||
case F_RATIO :
|
|
||||||
return actionHOSColRatio;
|
|
||||||
break;
|
|
||||||
default :
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
/*
|
|
||||||
* Bittorrent Client using Qt4 and libtorrent.
|
|
||||||
* Copyright (C) 2006 Christophe Dumez
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* In addition, as a special exception, the copyright holders give permission to
|
|
||||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
||||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
||||||
* and distribute the linked executables. You must obey the GNU General Public
|
|
||||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
||||||
* modify file(s), you may extend this exception to your version of the file(s),
|
|
||||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
||||||
* exception statement from your version.
|
|
||||||
*
|
|
||||||
* Contact : chris@qbittorrent.org
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SEEDING_H
|
|
||||||
#define SEEDING_H
|
|
||||||
|
|
||||||
#include "ui_seeding.h"
|
|
||||||
#include "qtorrenthandle.h"
|
|
||||||
|
|
||||||
class QStandardItemModel;
|
|
||||||
class QSortFilterProxyModel;
|
|
||||||
class bittorrent;
|
|
||||||
class FinishedListDelegate;
|
|
||||||
|
|
||||||
using namespace libtorrent;
|
|
||||||
|
|
||||||
class FinishedTorrents : public QWidget, public Ui::seeding {
|
|
||||||
Q_OBJECT
|
|
||||||
private:
|
|
||||||
QObject *parent;
|
|
||||||
bittorrent *BTSession;
|
|
||||||
FinishedListDelegate *finishedListDelegate;
|
|
||||||
QStandardItemModel *finishedListModel;
|
|
||||||
QSortFilterProxyModel *proxyModel;
|
|
||||||
unsigned int nbFinished;
|
|
||||||
void hideOrShowColumn(int index);
|
|
||||||
bool loadHiddenColumns();
|
|
||||||
void saveHiddenColumns();
|
|
||||||
QAction* getActionHoSCol(int index);
|
|
||||||
|
|
||||||
public:
|
|
||||||
FinishedTorrents(QObject *parent, bittorrent *BTSession);
|
|
||||||
~FinishedTorrents();
|
|
||||||
// Methods
|
|
||||||
bool loadColWidthFinishedList();
|
|
||||||
int getRowFromHash(QString hash) const;
|
|
||||||
QStringList getSelectedTorrents(bool only_one=false) const;
|
|
||||||
unsigned int getNbTorrentsInList() const;
|
|
||||||
QString getHashFromRow(unsigned int row) const;
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void showProperties(const QModelIndex &index);
|
|
||||||
void displayFinishedListMenu(const QPoint&);
|
|
||||||
void displayFinishedHoSMenu(const QPoint&);
|
|
||||||
void setRowColor(int row, QString color);
|
|
||||||
void saveColWidthFinishedList() const;
|
|
||||||
void updateFileSize(QString hash);
|
|
||||||
void on_actionSet_upload_limit_triggered();
|
|
||||||
void notifyTorrentDoubleClicked(const QModelIndex& index);
|
|
||||||
void hideOrShowColumnName();
|
|
||||||
void hideOrShowColumnSize();
|
|
||||||
void hideOrShowColumnUpSpeed();
|
|
||||||
void hideOrShowColumnSwarm();
|
|
||||||
void hideOrShowColumnPeers();
|
|
||||||
void hideOrShowColumnUpload();
|
|
||||||
void hideOrShowColumnRatio();
|
|
||||||
void forceRecheck();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void addTorrent(QString hash);
|
|
||||||
void updateTorrent(QTorrentHandle h);
|
|
||||||
void pauseTorrent(QString hash);
|
|
||||||
void propertiesSelection();
|
|
||||||
void deleteTorrent(QString hash);
|
|
||||||
void showPropertiesFromHash(QString hash);
|
|
||||||
void loadLastSortedColumn();
|
|
||||||
void saveLastSortedColumn();
|
|
||||||
void updateMetadata(QTorrentHandle &h);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void torrentMovedFromFinishedList(QString);
|
|
||||||
void torrentDoubleClicked(QString hash, bool finished);
|
|
||||||
void finishedTorrentsNumberChanged(unsigned int);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
2126
src/GUI.cpp
111
src/GUI.h
@@ -34,88 +34,64 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include "ui_MainWindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "qtorrenthandle.h"
|
#include "qtorrenthandle.h"
|
||||||
|
|
||||||
class bittorrent;
|
enum TabIndex{TAB_TRANSFER, TAB_SEARCH, TAB_RSS};
|
||||||
class createtorrent;
|
|
||||||
|
class Bittorrent;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
class DownloadingTorrents;
|
|
||||||
class FinishedTorrents;
|
|
||||||
class downloadFromURL;
|
class downloadFromURL;
|
||||||
class SearchEngine;
|
class SearchEngine;
|
||||||
#ifdef QT_4_4
|
class QLocalServer;
|
||||||
class QLocalServer;
|
|
||||||
class QLocalSocket;
|
|
||||||
#else
|
|
||||||
class QTcpServer;
|
|
||||||
class QTcpSocket;
|
|
||||||
#endif
|
|
||||||
class QCloseEvent;
|
class QCloseEvent;
|
||||||
class RSSImp;
|
class RSSImp;
|
||||||
class QShortcut;
|
class QShortcut;
|
||||||
class about;
|
class about;
|
||||||
class previewSelect;
|
|
||||||
class options_imp;
|
class options_imp;
|
||||||
class QTabWidget;
|
class QTabWidget;
|
||||||
class QLabel;
|
class TransferListWidget;
|
||||||
class QModelIndex;
|
class TransferListFiltersWidget;
|
||||||
class HttpServer;
|
class QSplitter;
|
||||||
class QFrame;
|
class PropertiesWidget;
|
||||||
|
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;
|
||||||
QTimer *checkConnect;
|
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
|
||||||
QTimer *scrapeTimer;
|
|
||||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers;
|
|
||||||
// GUI related
|
// GUI related
|
||||||
|
QTimer *guiUpdater;
|
||||||
QTabWidget *tabs;
|
QTabWidget *tabs;
|
||||||
|
StatusBar *status_bar;
|
||||||
QPointer<options_imp> options;
|
QPointer<options_imp> options;
|
||||||
QSystemTrayIcon *myTrayIcon;
|
QPointer<QSystemTrayIcon> systrayIcon;
|
||||||
QPointer<QTimer> systrayCreator;
|
QPointer<QTimer> systrayCreator;
|
||||||
QMenu *myTrayIconMenu;
|
QMenu *myTrayIconMenu;
|
||||||
DownloadingTorrents *downloadingTorrentTab;
|
TransferListWidget *transferList;
|
||||||
FinishedTorrents *finishedTorrentTab;
|
TransferListFiltersWidget *transferListFilters;
|
||||||
QLabel *connecStatusLblIcon;
|
PropertiesWidget *properties;
|
||||||
bool systrayIntegration;
|
|
||||||
bool displaySpeedInTitle;
|
bool displaySpeedInTitle;
|
||||||
bool force_exit;
|
bool force_exit;
|
||||||
unsigned int refreshInterval;
|
|
||||||
QTimer *refresher;
|
|
||||||
QLabel *dlSpeedLbl;
|
|
||||||
QLabel *upSpeedLbl;
|
|
||||||
QLabel *ratioLbl;
|
|
||||||
QLabel *DHTLbl;
|
|
||||||
QFrame *statusSep1;
|
|
||||||
QFrame *statusSep2;
|
|
||||||
QFrame *statusSep3;
|
|
||||||
QFrame *statusSep4;
|
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
QShortcut *switchSearchShortcut;
|
QShortcut *switchSearchShortcut;
|
||||||
QShortcut *switchSearchShortcut2;
|
QShortcut *switchSearchShortcut2;
|
||||||
QShortcut *switchDownShortcut;
|
QShortcut *switchTransferShortcut;
|
||||||
QShortcut *switchUpShortcut;
|
|
||||||
QShortcut *switchRSSShortcut;
|
QShortcut *switchRSSShortcut;
|
||||||
|
// Widgets
|
||||||
QAction *prioSeparator;
|
QAction *prioSeparator;
|
||||||
QAction *prioSeparator2;
|
QAction *prioSeparator2;
|
||||||
|
QSplitter *hSplitter;
|
||||||
|
QSplitter *vSplitter;
|
||||||
// Search
|
// Search
|
||||||
SearchEngine *searchEngine;
|
SearchEngine *searchEngine;
|
||||||
// RSS
|
// RSS
|
||||||
RSSImp *rssWidget;
|
QPointer<RSSImp> rssWidget;
|
||||||
// Web UI
|
|
||||||
QPointer<HttpServer> httpServer;
|
|
||||||
// Misc
|
// Misc
|
||||||
#ifdef QT_4_4
|
|
||||||
QLocalServer *localServer;
|
QLocalServer *localServer;
|
||||||
QLocalSocket *clientConnection;
|
|
||||||
#else
|
|
||||||
QTcpServer *localServer;
|
|
||||||
QTcpSocket *clientConnection;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
// GUI related slots
|
// GUI related slots
|
||||||
@@ -129,60 +105,36 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||||||
void on_actionShow_console_triggered();
|
void on_actionShow_console_triggered();
|
||||||
void readParamsOnSocket();
|
void readParamsOnSocket();
|
||||||
void acceptConnection();
|
void acceptConnection();
|
||||||
void togglePausedState(QString hash);
|
|
||||||
void torrentDoubleClicked(QString hash, bool finished);
|
|
||||||
void on_actionPreview_file_triggered();
|
|
||||||
void previewFile(QString filePath);
|
|
||||||
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 updateUnfinishedTorrentNumber(unsigned int nb);
|
|
||||||
void updateFinishedTorrentNumber(unsigned int nb);
|
|
||||||
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 setPaused(QTorrentHandle &h) const;
|
void tab_changed(int);
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
void createKeyboardShortcuts();
|
void createKeyboardShortcuts();
|
||||||
void displayDownTab() const;
|
void displayTransferTab() const;
|
||||||
void displayUpTab() const;
|
|
||||||
void displaySearchTab() const;
|
void displaySearchTab() const;
|
||||||
void displayRSSTab() const;
|
void displayRSSTab() const;
|
||||||
// Torrent actions
|
// Torrent actions
|
||||||
void on_actionTorrent_Properties_triggered();
|
|
||||||
void on_actionPause_triggered();
|
|
||||||
void on_actionPause_All_triggered();
|
|
||||||
void on_actionStart_triggered();
|
|
||||||
void on_actionStart_All_triggered();
|
|
||||||
void on_actionOpen_triggered();
|
|
||||||
void on_actionDelete_Permanently_triggered();
|
|
||||||
void on_actionDelete_triggered();
|
|
||||||
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 checkConnectionStatus();
|
void on_actionOpen_triggered();
|
||||||
void configureSession(bool deleteOptions);
|
void updateGUI();
|
||||||
|
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 downloadFromURLList(const QStringList& urls);
|
void downloadFromURLList(const QStringList& urls);
|
||||||
void deleteTorrent(QString hash);
|
|
||||||
void finishedTorrent(QTorrentHandle& h) const;
|
void finishedTorrent(QTorrentHandle& h) const;
|
||||||
void addedTorrent(QTorrentHandle& h) const;
|
|
||||||
void checkedTorrent(QTorrentHandle& h) const;
|
|
||||||
void pausedTorrent(QTorrentHandle& h) const;
|
|
||||||
void resumedTorrent(QTorrentHandle& h) const;
|
|
||||||
void updateLists(bool force=false);
|
|
||||||
bool initWebUi(QString username, QString password, int port);
|
|
||||||
void on_actionIncreasePriority_triggered();
|
|
||||||
void on_actionDecreasePriority_triggered();
|
|
||||||
void scrapeTrackers();
|
|
||||||
// Options slots
|
// Options slots
|
||||||
void on_actionOptions_triggered();
|
void on_actionOptions_triggered();
|
||||||
void OptionsSaved(bool deleteOptions);
|
void optionsSaved();
|
||||||
// HTTP slots
|
// HTTP slots
|
||||||
void on_actionDownload_from_URL_triggered();
|
void on_actionDownload_from_URL_triggered();
|
||||||
|
|
||||||
@@ -190,10 +142,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||||||
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 openDestinationFolder() const;
|
void showNotificationBaloon(QString title, QString msg) const;
|
||||||
void goBuyPage() const;
|
|
||||||
void copyMagnetURI() const;
|
|
||||||
void updateRatio();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *);
|
void closeEvent(QCloseEvent *);
|
||||||
|
|||||||
BIN
src/Icons/flags/algeria.png
Normal file
|
After Width: | Height: | Size: 473 B |
BIN
src/Icons/flags/argentina.png
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
src/Icons/flags/australia.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/Icons/flags/austria.png
Normal file
|
After Width: | Height: | Size: 285 B |
BIN
src/Icons/flags/belarus.png
Normal file
|
After Width: | Height: | Size: 373 B |
BIN
src/Icons/flags/belgium.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
src/Icons/flags/bosnia.png
Normal file
|
After Width: | Height: | Size: 583 B |
BIN
src/Icons/flags/canada.png
Normal file
|
After Width: | Height: | Size: 686 B |
BIN
src/Icons/flags/costa_rica.png
Normal file
|
After Width: | Height: | Size: 203 B |
BIN
src/Icons/flags/croatia.png
Normal file
|
After Width: | Height: | Size: 479 B |
BIN
src/Icons/flags/egypt.png
Normal file
|
After Width: | Height: | Size: 314 B |
BIN
src/Icons/flags/georgia.png
Normal file
|
After Width: | Height: | Size: 680 B |
BIN
src/Icons/flags/iceland.png
Normal file
|
After Width: | Height: | Size: 439 B |
BIN
src/Icons/flags/india.png
Normal file
|
After Width: | Height: | Size: 400 B |
BIN
src/Icons/flags/indonesia.png
Normal file
|
After Width: | Height: | Size: 290 B |
BIN
src/Icons/flags/ireland.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
src/Icons/flags/israel.png
Normal file
|
After Width: | Height: | Size: 476 B |
BIN
src/Icons/flags/luxembourg.png
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
src/Icons/flags/malaysia.png
Normal file
|
After Width: | Height: | Size: 643 B |
BIN
src/Icons/flags/mexico.png
Normal file
|
After Width: | Height: | Size: 402 B |
BIN
src/Icons/flags/morocco.png
Normal file
|
After Width: | Height: | Size: 373 B |
BIN
src/Icons/flags/newzealand.png
Normal file
|
After Width: | Height: | Size: 679 B |
BIN
src/Icons/flags/pakistan.png
Normal file
|
After Width: | Height: | Size: 833 B |
BIN
src/Icons/flags/philippines.png
Normal file
|
After Width: | Height: | Size: 680 B |
BIN
src/Icons/flags/serbia.png
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
src/Icons/flags/singapore.png
Normal file
|
After Width: | Height: | Size: 372 B |
BIN
src/Icons/flags/slovenia.png
Normal file
|
After Width: | Height: | Size: 361 B |
BIN
src/Icons/flags/south_africa.png
Normal file
|
After Width: | Height: | Size: 773 B |
BIN
src/Icons/flags/suisse.png
Normal file
|
After Width: | Height: | Size: 293 B |
BIN
src/Icons/flags/thailand.png
Normal file
|
After Width: | Height: | Size: 198 B |
BIN
src/Icons/flags/united_arab_emirates.png
Normal file
|
After Width: | Height: | Size: 248 B |
BIN
src/Icons/flags/usa.png
Normal file
|
After Width: | Height: | Size: 657 B |
BIN
src/Icons/oxygen/application-x-kgetlist-no.png
Normal file
|
After Width: | Height: | Size: 743 B |
BIN
src/Icons/oxygen/dialog-warning.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/Icons/oxygen/folder-remote.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
src/Icons/oxygen/folder-remote16.png
Normal file
|
After Width: | Height: | Size: 675 B |
BIN
src/Icons/oxygen/help-about.png
Normal file
|
After Width: | Height: | Size: 734 B |
BIN
src/Icons/oxygen/mail-queue.png
Normal file
|
After Width: | Height: | Size: 860 B |
BIN
src/Icons/oxygen/network-server.png
Normal file
|
After Width: | Height: | Size: 491 B |
BIN
src/Icons/oxygen/peer.png
Normal file
|
After Width: | Height: | Size: 409 B |
BIN
src/Icons/oxygen/run-build.png
Normal file
|
After Width: | Height: | Size: 942 B |
|
Before Width: | Height: | Size: 856 B |
BIN
src/Icons/oxygen/urlseed.png
Normal file
|
After Width: | Height: | Size: 901 B |
BIN
src/Icons/oxygen/user-group-delete.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/Icons/oxygen/user-group-new.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
@@ -1,23 +1,31 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Categories=Qt;Network;P2P;
|
Categories=Qt;Network;P2P;
|
||||||
Comment=V1.5.0
|
Comment=V2.0.0
|
||||||
Exec=qbittorrent %f
|
Exec=qbittorrent %f
|
||||||
GenericName=Bittorrent client
|
GenericName=Bittorrent client
|
||||||
GenericName[bg]=Торент клиент
|
GenericName[bg]=Торент клиент
|
||||||
|
GenericName[cs]=Bittorrent klient
|
||||||
GenericName[de]=Bittorren Client
|
GenericName[de]=Bittorren Client
|
||||||
GenericName[el]=Τορεντ πελάτης
|
GenericName[el]=Bittorrent πελάτης
|
||||||
GenericName[es]=Cliente Bittorrent
|
GenericName[es]=Cliente Bittorrent
|
||||||
|
GenericName[fi]=Bittorrent-ohjelma
|
||||||
GenericName[fr]=Client Bittorrent
|
GenericName[fr]=Client Bittorrent
|
||||||
|
GenericName[hu]=Bittorrent kliens
|
||||||
GenericName[it]=Client Bittorrent
|
GenericName[it]=Client Bittorrent
|
||||||
GenericName[ja]=Bittorrent クライアント
|
GenericName[ja]=Bittorrent クライアント
|
||||||
GenericName[ko]=비토렌트 클라이언트
|
GenericName[ko]=비토렌트 클라이언트
|
||||||
GenericName[nl]=Bittorrent client
|
GenericName[nl]=Bittorrent-cliënt
|
||||||
GenericName[pl]=Klient Bittorrent
|
GenericName[pl]=Klient Bittorrent
|
||||||
|
GenericName[pt]=Cliente Bittorrent
|
||||||
|
GenericName[pt_BR]=Cliente Bittorrent
|
||||||
|
GenericName[ro]=Client Bittorrent
|
||||||
GenericName[ru]=клиент Bittorrent
|
GenericName[ru]=клиент Bittorrent
|
||||||
|
GenericName[sk]=Klient siete Bittorrent
|
||||||
GenericName[sv]=Bittorrent-klient
|
GenericName[sv]=Bittorrent-klient
|
||||||
GenericName[tr]=Bittorrent istemcisi
|
GenericName[tr]=Bittorrent istemcisi
|
||||||
GenericName[uk]=Bittorrent-клієнт
|
GenericName[uk]=Bittorrent-клієнт
|
||||||
GenericName[zh]=Bittorrent之用户
|
GenericName[zh]=Bittorrent之用户
|
||||||
|
GenericName[zh_TW]=Bittorrent客戶端
|
||||||
Icon=qbittorrent
|
Icon=qbittorrent
|
||||||
MimeType=application/x-bittorrent;
|
MimeType=application/x-bittorrent;
|
||||||
Name=qBittorrent
|
Name=qBittorrent
|
||||||
|
|||||||
BIN
src/Icons/skin/bg-handle-horizontal.gif
Normal file
|
After Width: | Height: | Size: 57 B |
BIN
src/Icons/skin/checkingDL.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/Icons/skin/checkingUP.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/Icons/skin/delete22.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/Icons/skin/delete_perm22.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/Icons/skin/download.png
Executable file
|
After Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 3.1 KiB |
BIN
src/Icons/skin/filteractive.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/Icons/skin/filterall.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/Icons/skin/filterinactive.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/Icons/skin/handle-icon-horizontal.gif
Normal file
|
After Width: | Height: | Size: 46 B |
BIN
src/Icons/skin/handle-icon.gif
Normal file
|
After Width: | Height: | Size: 46 B |
BIN
src/Icons/skin/knob.gif
Normal file
|
After Width: | Height: | Size: 198 B |
BIN
src/Icons/skin/pause22.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/Icons/skin/pausedDL.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/Icons/skin/pausedUP.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/Icons/skin/play22.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 493 B |
BIN
src/Icons/skin/queuedDL.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/Icons/skin/queuedUP.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/Icons/skin/slider-area.gif
Normal file
|
After Width: | Height: | Size: 78 B |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 78 KiB |
BIN
src/Icons/skin/stalledDL.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/Icons/skin/stalledUP.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/Icons/skin/toolbox-divider.gif
Normal file
|
After Width: | Height: | Size: 48 B |
BIN
src/Icons/skin/uploading.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
@@ -1,235 +0,0 @@
|
|||||||
/*
|
|
||||||
* Bittorrent Client using Qt4 and libtorrent.
|
|
||||||
* Copyright (C) 2006 Christophe Dumez
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* In addition, as a special exception, the copyright holders give permission to
|
|
||||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
||||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
||||||
* and distribute the linked executables. You must obey the GNU General Public
|
|
||||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
||||||
* modify file(s), you may extend this exception to your version of the file(s),
|
|
||||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
||||||
* exception statement from your version.
|
|
||||||
*
|
|
||||||
* Contact : chris@qbittorrent.org
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef PROPLISTDELEGATE_H
|
|
||||||
#define PROPLISTDELEGATE_H
|
|
||||||
|
|
||||||
#include <QItemDelegate>
|
|
||||||
#include <QStyleOptionProgressBarV2>
|
|
||||||
#include <QStyleOptionViewItemV2>
|
|
||||||
#include <QStyleOptionComboBox>
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QModelIndex>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QProgressBar>
|
|
||||||
#include <QApplication>
|
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
// Defines for properties list columns
|
|
||||||
#define NAME 0
|
|
||||||
#define SIZE 1
|
|
||||||
#define PROGRESS 2
|
|
||||||
#define PRIORITY 3
|
|
||||||
#define INDEX 4
|
|
||||||
|
|
||||||
#define IGNORED 0
|
|
||||||
#define NORMAL 1
|
|
||||||
#define HIGH 2
|
|
||||||
#define MAXIMUM 7
|
|
||||||
|
|
||||||
class PropListDelegate: public QItemDelegate {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool* filteredFilesChanged;
|
|
||||||
|
|
||||||
public:
|
|
||||||
PropListDelegate(QObject *parent=0, bool* filteredFilesChanged=0) : QItemDelegate(parent){
|
|
||||||
this->filteredFilesChanged = filteredFilesChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
~PropListDelegate(){}
|
|
||||||
|
|
||||||
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const{
|
|
||||||
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
|
|
||||||
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
|
|
||||||
switch(index.column()){
|
|
||||||
case SIZE:
|
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong()));
|
|
||||||
break;
|
|
||||||
case PROGRESS:{
|
|
||||||
QStyleOptionProgressBarV2 newopt;
|
|
||||||
float progress = index.data().toDouble()*100.;
|
|
||||||
newopt.rect = opt.rect;
|
|
||||||
newopt.text = QString(QByteArray::number(progress, 'f', 1))+QString::fromUtf8("%");
|
|
||||||
newopt.progress = (int)progress;
|
|
||||||
newopt.maximum = 100;
|
|
||||||
newopt.minimum = 0;
|
|
||||||
newopt.state |= QStyle::State_Enabled;
|
|
||||||
newopt.textVisible = true;
|
|
||||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PRIORITY:{
|
|
||||||
QStyleOptionComboBox newopt;
|
|
||||||
newopt.rect = opt.rect;
|
|
||||||
switch(index.data().toInt()){
|
|
||||||
case IGNORED:
|
|
||||||
newopt.currentText = tr("Ignored");
|
|
||||||
break;
|
|
||||||
case NORMAL:
|
|
||||||
newopt.currentText = tr("Normal", "Normal (priority)");
|
|
||||||
break;
|
|
||||||
case HIGH:
|
|
||||||
newopt.currentText = tr("High", "High (priority)");
|
|
||||||
break;
|
|
||||||
case MAXIMUM:
|
|
||||||
newopt.currentText = tr("Maximum", "Maximum (priority)");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
qDebug("Unhandled priority, setting NORMAL");
|
|
||||||
newopt.currentText = tr("Normal", "Normal (priority)");
|
|
||||||
}
|
|
||||||
newopt.state |= QStyle::State_Enabled;
|
|
||||||
QApplication::style()->drawComplexControl(QStyle::CC_ComboBox, &newopt,
|
|
||||||
painter);
|
|
||||||
opt.palette.setColor(QPalette::Text, QColor("black"));
|
|
||||||
painter->setPen(opt.palette.color(cg, QPalette::Text));
|
|
||||||
painter->drawText(option.rect, Qt::AlignLeft, QString::fromUtf8(" ")+newopt.currentText);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
QItemDelegate::paint(painter, option, index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &/* option */, const QModelIndex & index) const {
|
|
||||||
if(index.column() != PRIORITY) return 0;
|
|
||||||
QComboBox* editor = new QComboBox(parent);
|
|
||||||
editor->setFocusPolicy(Qt::StrongFocus);
|
|
||||||
editor->addItem(tr("Ignored"));
|
|
||||||
editor->addItem(tr("Normal", "Normal (priority)"));
|
|
||||||
editor->addItem(tr("High", "High (priority)"));
|
|
||||||
editor->addItem(tr("Maximum", "Maximum (priority)"));
|
|
||||||
return editor;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setEditorData(QWidget *editor, const QModelIndex &index) const {
|
|
||||||
unsigned short val = index.model()->data(index, Qt::DisplayRole).toInt();
|
|
||||||
QComboBox *combobox = static_cast<QComboBox*>(editor);
|
|
||||||
qDebug("Set Editor data: Prio is %d", val);
|
|
||||||
switch(val){
|
|
||||||
case IGNORED:
|
|
||||||
combobox->setCurrentIndex(0);
|
|
||||||
break;
|
|
||||||
case NORMAL:
|
|
||||||
combobox->setCurrentIndex(1);
|
|
||||||
break;
|
|
||||||
case HIGH:
|
|
||||||
combobox->setCurrentIndex(2);
|
|
||||||
break;
|
|
||||||
case MAXIMUM:
|
|
||||||
combobox->setCurrentIndex(3);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
qDebug("Unhandled priority, setting to NORMAL");
|
|
||||||
combobox->setCurrentIndex(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const{
|
|
||||||
QVariant value = index.data(Qt::FontRole);
|
|
||||||
QFont fnt = value.isValid() ? qvariant_cast<QFont>(value) : option.font;
|
|
||||||
QFontMetrics fontMetrics(fnt);
|
|
||||||
const QString text = index.data(Qt::DisplayRole).toString();
|
|
||||||
QRect textRect = QRect(0, 0, 0, fontMetrics.lineSpacing() * (text.count(QLatin1Char('\n')) + 1));
|
|
||||||
return textRect.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const {
|
|
||||||
QComboBox *combobox = static_cast<QComboBox*>(editor);
|
|
||||||
int value = combobox->currentIndex();
|
|
||||||
qDebug("Setting combobox value in index: %d", value);
|
|
||||||
unsigned short old_val = index.model()->data(index, Qt::DisplayRole).toInt();
|
|
||||||
switch(value){
|
|
||||||
case 0:
|
|
||||||
if(old_val != IGNORED){
|
|
||||||
model->setData(index, QVariant(IGNORED));
|
|
||||||
if(filteredFilesChanged != 0)
|
|
||||||
*filteredFilesChanged = true;
|
|
||||||
} else {
|
|
||||||
// XXX: hack to force the model to send the itemChanged() signal
|
|
||||||
model->setData(index, QVariant(NORMAL));
|
|
||||||
model->setData(index, QVariant(IGNORED));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
// if(old_val != NORMAL){
|
|
||||||
// model->setData(index, QVariant(NORMAL));
|
|
||||||
// if(filteredFilesChanged != 0)
|
|
||||||
// *filteredFilesChanged = true;
|
|
||||||
// } else {
|
|
||||||
model->setData(index, QVariant(HIGH));
|
|
||||||
model->setData(index, QVariant(NORMAL));
|
|
||||||
if(filteredFilesChanged != 0)
|
|
||||||
*filteredFilesChanged = true;
|
|
||||||
// }
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if(old_val != HIGH){
|
|
||||||
model->setData(index, QVariant(HIGH));
|
|
||||||
if(filteredFilesChanged != 0)
|
|
||||||
*filteredFilesChanged = true;
|
|
||||||
} else {
|
|
||||||
model->setData(index, QVariant(NORMAL));
|
|
||||||
model->setData(index, QVariant(HIGH));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
if(old_val != MAXIMUM){
|
|
||||||
model->setData(index, QVariant(MAXIMUM));
|
|
||||||
if(filteredFilesChanged != 0)
|
|
||||||
*filteredFilesChanged = true;
|
|
||||||
} else {
|
|
||||||
model->setData(index, QVariant(HIGH));
|
|
||||||
model->setData(index, QVariant(MAXIMUM));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if(old_val != NORMAL){
|
|
||||||
model->setData(index, QVariant(NORMAL));
|
|
||||||
if(filteredFilesChanged != 0)
|
|
||||||
*filteredFilesChanged = true;
|
|
||||||
} else {
|
|
||||||
model->setData(index, QVariant(HIGH));
|
|
||||||
model->setData(index, QVariant(NORMAL));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/* index */) const {
|
|
||||||
editor->setGeometry(option.rect);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -52,10 +52,10 @@ class about : public QDialog, private Ui::AboutDlg{
|
|||||||
lb_name->setText(QString::fromUtf8("<b><h1>")+tr("qBittorrent")+QString::fromUtf8(" "VERSION"</h1></b>"));
|
lb_name->setText(QString::fromUtf8("<b><h1>")+tr("qBittorrent")+QString::fromUtf8(" "VERSION"</h1></b>"));
|
||||||
// Thanks
|
// Thanks
|
||||||
te_thanks->append(QString::fromUtf8("<a name='top'></a>"));
|
te_thanks->append(QString::fromUtf8("<a name='top'></a>"));
|
||||||
te_thanks->append(QString::fromUtf8("<ul><li>I would like to thank sourceforge.net for hosting qBittorrent project.</li>"));
|
te_thanks->append(QString::fromUtf8("<ul><li>I would first like to thank sourceforge.net for hosting qBittorrent project and for their support.</li>"));
|
||||||
te_thanks->append(QString::fromUtf8("<li>I am happy that Ishan Arora and Arnaud Demaizière are contributing to the project as developers. Their help is greatly appreciated</li>"));
|
te_thanks->append(QString::fromUtf8("<li>I am pleased that people from all over the world are contributing to qBittorrent: Ishan Arora (India), Arnaud Demaizière (France) and Stephanos Antaris (Greece). Their help is greatly appreciated</li>"));
|
||||||
te_thanks->append(QString::fromUtf8("<li>I also want to thank Jeffery Fernandez (jeffery@qbittorrent.org), project consultant, RPM packager, for his help and support.</li>"));
|
te_thanks->append(QString::fromUtf8("<li>I also want to thank Jeffery Fernandez (jeffery@qbittorrent.org), project consultant, for his help and support since the beginning of this project.</li>"));
|
||||||
te_thanks->append(QString::fromUtf8("<li>I am grateful to Peter Koeleman (peter@qbittorrent.org) who is helping port qBittorrent to Windows.</li>"));
|
te_thanks->append(QString::fromUtf8("<li>I am grateful to Peter Koeleman (peter@qbittorrent.org) for working on qBittorrent port to Windows.</li>"));
|
||||||
te_thanks->append(QString::fromUtf8("<li>Thanks a lot to our graphist Mateusz Toboła (tobejodok@qbittorrent.org) for his great work.</li></ul><br><br>"));
|
te_thanks->append(QString::fromUtf8("<li>Thanks a lot to our graphist Mateusz Toboła (tobejodok@qbittorrent.org) for his great work.</li></ul><br><br>"));
|
||||||
te_thanks->scrollToAnchor(QString::fromUtf8("top"));
|
te_thanks->scrollToAnchor(QString::fromUtf8("top"));
|
||||||
// Translation
|
// Translation
|
||||||
|
|||||||
@@ -1,188 +0,0 @@
|
|||||||
/*
|
|
||||||
* Bittorrent Client using Qt4 and libtorrent.
|
|
||||||
* Copyright (C) 2006 Christophe Dumez
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* In addition, as a special exception, the copyright holders give permission to
|
|
||||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
||||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
||||||
* and distribute the linked executables. You must obey the GNU General Public
|
|
||||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
||||||
* modify file(s), you may extend this exception to your version of the file(s),
|
|
||||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
||||||
* exception statement from your version.
|
|
||||||
*
|
|
||||||
* Contact : chris@qbittorrent.org
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BANDWIDTH_ALLOCATION_H
|
|
||||||
#define BANDWIDTH_ALLOCATION_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QList>
|
|
||||||
#include <QSettings>
|
|
||||||
#include "ui_bandwidth_limit.h"
|
|
||||||
#include "misc.h"
|
|
||||||
#include "bittorrent.h"
|
|
||||||
|
|
||||||
using namespace libtorrent;
|
|
||||||
|
|
||||||
class BandwidthAllocationDialog : public QDialog, private Ui_bandwidth_dlg {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
BandwidthAllocationDialog(QWidget *parent, bool uploadMode, bittorrent *BTSession, QStringList hashes): QDialog(parent), uploadMode(uploadMode), hashes(hashes){
|
|
||||||
setupUi(this);
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
|
||||||
qDebug("Bandwidth allocation dialog creation");
|
|
||||||
this->BTSession = BTSession;
|
|
||||||
if(hashes.size() == 0)
|
|
||||||
global = true;
|
|
||||||
else
|
|
||||||
global = false;
|
|
||||||
if(uploadMode)
|
|
||||||
lblTitle->setText(tr("Upload limit:"));
|
|
||||||
else
|
|
||||||
lblTitle->setText(tr("Download limit:"));
|
|
||||||
connect(bandwidthSlider, SIGNAL(valueChanged(int)), this, SLOT(updateBandwidthLabel(int)));
|
|
||||||
if(!global){
|
|
||||||
unsigned int nbTorrents = hashes.size();
|
|
||||||
if(!nbTorrents) close();
|
|
||||||
int val = 0;
|
|
||||||
int max = -1;
|
|
||||||
if(nbTorrents == 1){
|
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hashes.at(0));
|
|
||||||
if(uploadMode){
|
|
||||||
if(h.upload_limit() > 0)
|
|
||||||
val = (int)(h.upload_limit() / 1024.);
|
|
||||||
if(BTSession->getSession()->upload_rate_limit() > 0)
|
|
||||||
max = (int)(BTSession->getSession()->upload_rate_limit() / 1024.);
|
|
||||||
}else{
|
|
||||||
if(h.download_limit() > 0)
|
|
||||||
val = (int)(h.download_limit() / 1024.);
|
|
||||||
if(BTSession->getSession()->download_rate_limit() > 0){
|
|
||||||
qDebug("there is a global download rate limit at: %d kb/s", (int)(BTSession->getSession()->download_rate_limit() / 1024.));
|
|
||||||
max = (int)(BTSession->getSession()->download_rate_limit() / 1024.);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(max != -1)
|
|
||||||
bandwidthSlider->setMaximum(max);
|
|
||||||
qDebug("Bandwidth limit: %d", val);
|
|
||||||
if(val > bandwidthSlider->maximum())
|
|
||||||
val = bandwidthSlider->maximum();
|
|
||||||
else if(val < bandwidthSlider->minimum())
|
|
||||||
val = 0;
|
|
||||||
bandwidthSlider->setValue(val);
|
|
||||||
if(val == 0) {
|
|
||||||
limit_lbl->setText(tr("Unlimited", "Unlimited (bandwidth)"));
|
|
||||||
kb_lbl->setText(QString::fromUtf8(""));
|
|
||||||
} else {
|
|
||||||
limit_lbl->setText(misc::toQString(val));
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
qDebug("More than one torrent selected, no initilization");
|
|
||||||
bandwidthSlider->setValue(0);
|
|
||||||
limit_lbl->setText(tr("Unlimited", "Unlimited (bandwidth)"));
|
|
||||||
kb_lbl->setText(QString::fromUtf8(""));
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
// Global limit
|
|
||||||
int val = 0;
|
|
||||||
session *s = BTSession->getSession();
|
|
||||||
if(uploadMode){
|
|
||||||
if(s->upload_rate_limit() > 0)
|
|
||||||
val = (int)(s->upload_rate_limit()/1024.);
|
|
||||||
}else{
|
|
||||||
if(s->download_rate_limit() > 0)
|
|
||||||
val = (int)(s->download_rate_limit()/1024.);
|
|
||||||
}
|
|
||||||
if(val == 0){
|
|
||||||
bandwidthSlider->setValue(0);
|
|
||||||
limit_lbl->setText(tr("Unlimited", "Unlimited (bandwidth)"));
|
|
||||||
kb_lbl->setText(QString::fromUtf8(""));
|
|
||||||
}else{
|
|
||||||
bandwidthSlider->setValue(val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(setBandwidth()));
|
|
||||||
show();
|
|
||||||
}
|
|
||||||
|
|
||||||
~BandwidthAllocationDialog(){
|
|
||||||
qDebug("Deleting bandwidth allocation dialog");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void updateBandwidthLabel(int val){
|
|
||||||
if(val == 0){
|
|
||||||
limit_lbl->setText(tr("Unlimited", "Unlimited (bandwidth)"));
|
|
||||||
kb_lbl->setText(QString::fromUtf8(""));
|
|
||||||
}else{
|
|
||||||
limit_lbl->setText(misc::toQString(val));
|
|
||||||
kb_lbl->setText(tr("KiB/s"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBandwidth(){
|
|
||||||
qDebug("setBandwidth called");
|
|
||||||
int val = bandwidthSlider->value();
|
|
||||||
if(!global){
|
|
||||||
QString hash;
|
|
||||||
if(uploadMode) {
|
|
||||||
foreach(hash, hashes) {
|
|
||||||
if(!val)
|
|
||||||
BTSession->setUploadLimit(hash, -1);
|
|
||||||
else
|
|
||||||
BTSession->setUploadLimit(hash, val*1024);
|
|
||||||
qDebug("Setting upload limit");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach(hash, hashes) {
|
|
||||||
if(!val)
|
|
||||||
BTSession->setDownloadLimit(hash, -1);
|
|
||||||
else
|
|
||||||
BTSession->setDownloadLimit(hash, val*1024);
|
|
||||||
qDebug("Setting download limit");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
|
||||||
session *s = BTSession->getSession();
|
|
||||||
if(uploadMode){
|
|
||||||
if(!val)
|
|
||||||
s->set_upload_rate_limit(-1);
|
|
||||||
else
|
|
||||||
s->set_upload_rate_limit(val*1024);
|
|
||||||
settings.setValue(QString::fromUtf8("Preferences/Connection/GlobalUPLimit"), val);
|
|
||||||
}else{
|
|
||||||
if(!val)
|
|
||||||
s->set_download_rate_limit(-1);
|
|
||||||
else
|
|
||||||
s->set_download_rate_limit(val*1024);
|
|
||||||
settings.setValue(QString::fromUtf8("Preferences/Connection/GlobalDLLimit"), val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool uploadMode;
|
|
||||||
bool global;
|
|
||||||
bittorrent *BTSession;
|
|
||||||
QStringList hashes;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,270 +0,0 @@
|
|||||||
/*
|
|
||||||
* Bittorrent Client using Qt4 and libtorrent.
|
|
||||||
* Copyright (C) 2006 Christophe Dumez
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* In addition, as a special exception, the copyright holders give permission to
|
|
||||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
||||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
||||||
* and distribute the linked executables. You must obey the GNU General Public
|
|
||||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
||||||
* modify file(s), you may extend this exception to your version of the file(s),
|
|
||||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
||||||
* exception statement from your version.
|
|
||||||
*
|
|
||||||
* Contact : chris@qbittorrent.org
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ARBORESCENCE_H
|
|
||||||
#define ARBORESCENCE_H
|
|
||||||
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QDir>
|
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
class torrent_file {
|
|
||||||
private:
|
|
||||||
torrent_file *parent;
|
|
||||||
bool is_dir;
|
|
||||||
QString rel_path;
|
|
||||||
QList<const torrent_file*> children;
|
|
||||||
size_type size;
|
|
||||||
float progress;
|
|
||||||
int priority;
|
|
||||||
int index; // Index in torrent_info
|
|
||||||
|
|
||||||
public:
|
|
||||||
torrent_file(torrent_file *parent, QString path, bool dir, size_type size=0, int index=-1, float progress=0., int priority=1): parent(parent), is_dir(dir), size(size), progress(progress), priority(priority), index(index){
|
|
||||||
qDebug("created a file with index %d", index);
|
|
||||||
rel_path = QDir::cleanPath(path);
|
|
||||||
Q_ASSERT(progress >= 0.);
|
|
||||||
Q_ASSERT(progress <= 1.);
|
|
||||||
if(parent) {
|
|
||||||
parent->updateProgress();
|
|
||||||
parent->updatePriority(priority);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~torrent_file() {
|
|
||||||
qDeleteAll(children);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString path() const {
|
|
||||||
return rel_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString name() const {
|
|
||||||
return rel_path.split(QDir::separator()).last();
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateProgress() {
|
|
||||||
Q_ASSERT(is_dir);
|
|
||||||
if(children.isEmpty()) {
|
|
||||||
progress = 0.;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
double wanted = 0.;
|
|
||||||
double done = 0.;
|
|
||||||
foreach(const torrent_file *child, children) {
|
|
||||||
wanted += child->getSize();
|
|
||||||
done += child->getSize()*child->getProgress();
|
|
||||||
}
|
|
||||||
progress = done / wanted;
|
|
||||||
Q_ASSERT(progress >= 0.);
|
|
||||||
Q_ASSERT(progress <= 1.);
|
|
||||||
}
|
|
||||||
|
|
||||||
void updatePriority(int prio) {
|
|
||||||
Q_ASSERT(is_dir);
|
|
||||||
foreach(const torrent_file *child, children) {
|
|
||||||
if(child->getPriority() != prio) return;
|
|
||||||
}
|
|
||||||
priority = prio;
|
|
||||||
}
|
|
||||||
|
|
||||||
int getPriority() const {
|
|
||||||
return priority;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_type getSize() const {
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
float getProgress() const {
|
|
||||||
return progress;
|
|
||||||
}
|
|
||||||
|
|
||||||
int getIndex() const {
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isDir() const {
|
|
||||||
return is_dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasChildren() const {
|
|
||||||
return (!children.isEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<const torrent_file*> getChildren() const {
|
|
||||||
return children;
|
|
||||||
}
|
|
||||||
|
|
||||||
const torrent_file* getChild(QString fileName) const {
|
|
||||||
Q_ASSERT(is_dir);
|
|
||||||
foreach(const torrent_file *f, children) {
|
|
||||||
if(f->name() == fileName) return f;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBytes(size_type b) {
|
|
||||||
size += b;
|
|
||||||
if(parent)
|
|
||||||
parent->addBytes(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
torrent_file* addChild(QString fileName, bool dir, size_type size=0, int index = -1, float progress=0., int priority=1) {
|
|
||||||
Q_ASSERT(is_dir);
|
|
||||||
qDebug("Adding a new child of size: %ld", (long)size);
|
|
||||||
torrent_file *f = new torrent_file(this, QDir::cleanPath(rel_path+QDir::separator()+fileName), dir, size, index, progress, priority);
|
|
||||||
children << f;
|
|
||||||
if(size) {
|
|
||||||
addBytes(size);
|
|
||||||
}
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool removeFromFS(QString saveDir) const {
|
|
||||||
QString full_path = saveDir + QDir::separator() + rel_path;
|
|
||||||
if(!QFile::exists(full_path)) {
|
|
||||||
qDebug("%s does not exist, no need to remove it", full_path.toLocal8Bit().data());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
bool success = true;
|
|
||||||
qDebug("We have %d children", children.size());
|
|
||||||
foreach(const torrent_file *f, children) {
|
|
||||||
bool s = f->removeFromFS(saveDir);
|
|
||||||
success = s && success;
|
|
||||||
}
|
|
||||||
if(is_dir) {
|
|
||||||
qDebug("trying to remove directory: %s", full_path.toLocal8Bit().data());
|
|
||||||
QDir dir(full_path);
|
|
||||||
dir.rmdir(full_path);
|
|
||||||
} else {
|
|
||||||
qDebug("trying to remove file: %s", full_path.toLocal8Bit().data());
|
|
||||||
bool s = QFile::remove(full_path);
|
|
||||||
success = s && success;
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class arborescence {
|
|
||||||
private:
|
|
||||||
torrent_file *root;
|
|
||||||
|
|
||||||
public:
|
|
||||||
arborescence(boost::intrusive_ptr<torrent_info> t) {
|
|
||||||
torrent_info::file_iterator fi = t->begin_files();
|
|
||||||
if(t->num_files() > 1) {
|
|
||||||
root = new torrent_file(0, misc::toQString(t->name()), true);
|
|
||||||
} else {
|
|
||||||
// XXX: Will crash if there is no file in torrent
|
|
||||||
root = new torrent_file(0, misc::toQString(t->name()), false, fi->size, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int i = 0;
|
|
||||||
while(fi != t->end_files()) {
|
|
||||||
QString path = QDir::cleanPath(misc::toQString(fi->path.string()));
|
|
||||||
addFile(path, fi->size, i);
|
|
||||||
fi++;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
qDebug("real size: %ld, tree size: %ld", (long)t->total_size(), (long)root->getSize());
|
|
||||||
Q_ASSERT(root->getSize() == t->total_size());
|
|
||||||
}
|
|
||||||
|
|
||||||
arborescence(torrent_info const& t, std::vector<size_type> fp, std::vector<int> files_priority) {
|
|
||||||
torrent_info::file_iterator fi = t.begin_files();
|
|
||||||
if(t.num_files() > 1) {
|
|
||||||
qDebug("More than one file in the torrent, setting a folder as root");
|
|
||||||
root = new torrent_file(0, misc::toQString(t.name()), true);
|
|
||||||
} else {
|
|
||||||
// XXX: Will crash if there is no file in torrent
|
|
||||||
qDebug("one file in the torrent, setting it as root with index 0");
|
|
||||||
root = new torrent_file(0, misc::toQString(t.name()), false, fi->size, 0, ((double)fp[0])/t.file_at(0).size, files_priority.at(0));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int i = 0;
|
|
||||||
while(fi != t.end_files()) {
|
|
||||||
QString path = QDir::cleanPath(misc::toQString(fi->path.string()));
|
|
||||||
addFile(path, fi->size, i, ((double)fp[i])/t.file_at(i).size, files_priority.at(i));
|
|
||||||
fi++;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
qDebug("real size: %ld, tree size: %ld", (long)t.total_size(), (long)root->getSize());
|
|
||||||
Q_ASSERT(root->getSize() == t.total_size());
|
|
||||||
}
|
|
||||||
|
|
||||||
~arborescence() {
|
|
||||||
delete root;
|
|
||||||
}
|
|
||||||
|
|
||||||
torrent_file* getRoot() const {
|
|
||||||
return root;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool removeFromFS(QString saveDir) {
|
|
||||||
if(!QFile::exists(saveDir+QDir::separator()+root->path())) return true;
|
|
||||||
bool success = root->removeFromFS(saveDir);
|
|
||||||
QDir root_dir(root->path());
|
|
||||||
root_dir.rmdir(saveDir+QDir::separator()+root->path());
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void addFile(QString path, size_type file_size, int index, float progress=0., int priority=1) {
|
|
||||||
Q_ASSERT(root->isDir());
|
|
||||||
path = QDir::cleanPath(path);
|
|
||||||
//Q_ASSERT(path.startsWith(root->path()));
|
|
||||||
QString relative_path = path.remove(0, root->path().size());
|
|
||||||
if(relative_path.at(0) ==QDir::separator())
|
|
||||||
relative_path.remove(0, 1);
|
|
||||||
QStringList fileNames = relative_path.split(QDir::separator());
|
|
||||||
torrent_file *dad = root;
|
|
||||||
unsigned int nb_i = 0;
|
|
||||||
unsigned int size = fileNames.size();
|
|
||||||
foreach(const QString &fileName, fileNames) {
|
|
||||||
++nb_i;
|
|
||||||
if(fileName == ".") continue;
|
|
||||||
const torrent_file* child = dad->getChild(fileName);
|
|
||||||
if(!child) {
|
|
||||||
if(nb_i != size) {
|
|
||||||
// Folder
|
|
||||||
child = dad->addChild(fileName, true);
|
|
||||||
} else {
|
|
||||||
// File
|
|
||||||
child = dad->addChild(fileName, false, file_size, index, progress, priority);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dad = (torrent_file*)child;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
<ui version="4.0" >
|
|
||||||
<class>bandwidth_dlg</class>
|
|
||||||
<widget class="QDialog" name="bandwidth_dlg" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>222</width>
|
|
||||||
<height>129</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle" >
|
|
||||||
<string>Bandwidth allocation</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lblTitle" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="limit_lbl" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="kb_lbl" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>KiB/s</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSlider" name="bandwidthSlider" >
|
|
||||||
<property name="minimum" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum" >
|
|
||||||
<number>1000</number>
|
|
||||||
</property>
|
|
||||||
<property name="sliderPosition" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons" >
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>buttonBox</sender>
|
|
||||||
<signal>rejected()</signal>
|
|
||||||
<receiver>bandwidth_dlg</receiver>
|
|
||||||
<slot>reject()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel" >
|
|
||||||
<x>212</x>
|
|
||||||
<y>83</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel" >
|
|
||||||
<x>221</x>
|
|
||||||
<y>98</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
||||||
1106
src/bittorrent.cpp
314
src/bittorrent.h
@@ -42,156 +42,192 @@
|
|||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
|
#define MAX_SAMPLES 20
|
||||||
|
|
||||||
class downloadThread;
|
class downloadThread;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
class QFileSystemWatcher;
|
class FileSystemWatcher;
|
||||||
class QMutex;
|
|
||||||
class FilterParserThread;
|
class FilterParserThread;
|
||||||
|
class HttpServer;
|
||||||
|
|
||||||
class bittorrent : public QObject {
|
class TrackerInfos {
|
||||||
|
public:
|
||||||
|
QString name_or_url;
|
||||||
|
QString last_message;
|
||||||
|
unsigned long num_peers;
|
||||||
|
#ifndef LIBTORRENT_0_15
|
||||||
|
bool verified;
|
||||||
|
uint fail_count;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//TrackerInfos() {}
|
||||||
|
TrackerInfos(const TrackerInfos &b) {
|
||||||
|
name_or_url = b.name_or_url;
|
||||||
|
Q_ASSERT(!name_or_url.isEmpty());
|
||||||
|
last_message = b.last_message;
|
||||||
|
num_peers = b.num_peers;
|
||||||
|
#ifndef LIBTORRENT_0_15
|
||||||
|
verified = b.verified;
|
||||||
|
fail_count = b.fail_count;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
TrackerInfos(QString name_or_url): name_or_url(name_or_url), last_message(""), num_peers(0) {
|
||||||
|
#ifndef LIBTORRENT_0_15
|
||||||
|
fail_count = 0;
|
||||||
|
verified = false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class Bittorrent : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
session *s;
|
// Bittorrent
|
||||||
QPointer<QFileSystemWatcher> FSWatcher;
|
session *s;
|
||||||
QMutex* FSMutex;
|
QPointer<QTimer> timerAlerts;
|
||||||
QPointer<QTimer> timerAlerts;
|
QHash<QString, QString> savepath_fromurl;
|
||||||
QPointer<QTimer> BigRatioTimer;
|
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
||||||
bool DHTEnabled;
|
// Ratio
|
||||||
QPointer<downloadThread> downloader;
|
QPointer<QTimer> BigRatioTimer;
|
||||||
QString defaultSavePath;
|
// HTTP
|
||||||
QString defaultTempPath;
|
QPointer<downloadThread> downloader;
|
||||||
QHash<QString, QHash<QString, QString> > trackersErrors;
|
// File System
|
||||||
QStringList consoleMessages;
|
QPointer<FileSystemWatcher> FSWatcher;
|
||||||
QStringList peerBanMessages;
|
// Console / Log
|
||||||
bool preAllocateAll;
|
QStringList consoleMessages;
|
||||||
bool addInPause;
|
QStringList peerBanMessages;
|
||||||
int maxConnecsPerTorrent;
|
// Settings
|
||||||
int maxUploadsPerTorrent;
|
bool preAllocateAll;
|
||||||
float ratio_limit;
|
bool addInPause;
|
||||||
bool UPnPEnabled;
|
float ratio_limit;
|
||||||
bool NATPMPEnabled;
|
bool UPnPEnabled;
|
||||||
bool LSDEnabled;
|
bool NATPMPEnabled;
|
||||||
QPointer<FilterParserThread> filterParser;
|
bool LSDEnabled;
|
||||||
QString filterPath;
|
bool DHTEnabled;
|
||||||
bool queueingEnabled;
|
bool queueingEnabled;
|
||||||
QStringList url_skippingDlg;
|
QString defaultSavePath;
|
||||||
QHash<QString, QString> savepath_fromurl;
|
QString defaultTempPath;
|
||||||
|
// GeoIP
|
||||||
|
bool resolve_countries;
|
||||||
|
bool geoipDBLoaded;
|
||||||
|
// ETA Computation
|
||||||
|
QPointer<QTimer> timerETA;
|
||||||
|
QHash<QString, QList<int> > ETA_samples;
|
||||||
|
// IP filtering
|
||||||
|
QPointer<FilterParserThread> filterParser;
|
||||||
|
QString filterPath;
|
||||||
|
// Web UI
|
||||||
|
QPointer<HttpServer> httpServer;
|
||||||
|
QStringList url_skippingDlg;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString getSavePath(QString hash);
|
QString getSavePath(QString hash);
|
||||||
|
bool initWebUi(QString username, QString password, int port);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor / Destructor
|
// Constructor / Destructor
|
||||||
bittorrent();
|
Bittorrent();
|
||||||
~bittorrent();
|
~Bittorrent();
|
||||||
QTorrentHandle getTorrentHandle(QString hash) const;
|
QTorrentHandle getTorrentHandle(QString hash) const;
|
||||||
std::vector<torrent_handle> getTorrents() const;
|
std::vector<torrent_handle> getTorrents() const;
|
||||||
bool isFilePreviewPossible(QString fileHash) const;
|
bool isFilePreviewPossible(QString fileHash) const;
|
||||||
bool isDHTEnabled() const;
|
bool isDHTEnabled() const;
|
||||||
float getPayloadDownloadRate() const;
|
bool isLSDEnabled() const;
|
||||||
float getPayloadUploadRate() const;
|
float getPayloadDownloadRate() const;
|
||||||
session_status getSessionStatus() const;
|
float getPayloadUploadRate() const;
|
||||||
int getListenPort() const;
|
session_status getSessionStatus() const;
|
||||||
float getRealRatio(QString hash) const;
|
int getListenPort() const;
|
||||||
session* getSession() const;
|
float getRealRatio(QString hash) const;
|
||||||
QHash<QString, QString> getTrackersErrors(QString hash) const;
|
session* getSession() const;
|
||||||
bool has_filtered_files(QString hash) const;
|
QHash<QString, TrackerInfos> getTrackersInfo(QString hash) const;
|
||||||
unsigned int getFinishedPausedTorrentsNb() const;
|
bool hasActiveTorrents() const;
|
||||||
unsigned int getUnfinishedPausedTorrentsNb() const;
|
bool isQueueingEnabled() const;
|
||||||
bool isQueueingEnabled() const;
|
int getMaximumActiveDownloads() const;
|
||||||
int getDlTorrentPriority(QString hash) const;
|
int getMaximumActiveTorrents() const;
|
||||||
int getUpTorrentPriority(QString hash) const;
|
int loadTorrentPriority(QString hash);
|
||||||
int getMaximumActiveDownloads() const;
|
QStringList getConsoleMessages() const;
|
||||||
int getMaximumActiveTorrents() const;
|
QStringList getPeerBanMessages() const;
|
||||||
int loadTorrentPriority(QString hash);
|
qlonglong getETA(QString hash);
|
||||||
QStringList getConsoleMessages() const;
|
bool useTemporaryFolder() const;
|
||||||
QStringList getPeerBanMessages() const;
|
QString getDefaultSavePath() const;
|
||||||
qlonglong getETA(QString hash) const;
|
|
||||||
bool useTemporaryFolder() const;
|
|
||||||
QString getDefaultSavePath() const;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
||||||
QTorrentHandle addMagnetUri(QString magnet_uri, bool resumed=false);
|
QTorrentHandle addMagnetUri(QString magnet_uri, bool resumed=false);
|
||||||
void importOldTorrents();
|
void importOldTorrents();
|
||||||
void applyFormerAttributeFiles(QTorrentHandle h);
|
void applyFormerAttributeFiles(QTorrentHandle h);
|
||||||
void importOldTempData(QString torrent_path);
|
void importOldTempData(QString torrent_path);
|
||||||
void loadSessionState();
|
void loadSessionState();
|
||||||
void saveSessionState();
|
void saveSessionState();
|
||||||
void downloadFromUrl(QString url);
|
void downloadFromUrl(QString url);
|
||||||
void deleteTorrent(QString hash, bool permanent = false);
|
void deleteTorrent(QString hash, bool delete_local_files = false);
|
||||||
void startUpTorrents();
|
void startUpTorrents();
|
||||||
/* Needed by Web UI */
|
/* Needed by Web UI */
|
||||||
void pauseAllTorrents();
|
void pauseAllTorrents();
|
||||||
void pauseTorrent(QString hash);
|
void pauseTorrent(QString hash);
|
||||||
void resumeTorrent(QString hash);
|
void resumeTorrent(QString hash);
|
||||||
void resumeAllTorrents();
|
void resumeAllTorrents();
|
||||||
/* End Web UI */
|
/* End Web UI */
|
||||||
void saveDHTEntry();
|
void saveDHTEntry();
|
||||||
void preAllocateAllFiles(bool b);
|
void preAllocateAllFiles(bool b);
|
||||||
void saveFastResumeData();
|
void saveFastResumeData();
|
||||||
void enableDirectoryScanning(QString scan_dir);
|
void enableDirectoryScanning(QString scan_dir);
|
||||||
void disableDirectoryScanning();
|
void disableDirectoryScanning();
|
||||||
void enableIPFilter(QString filter);
|
void enableIPFilter(QString filter);
|
||||||
void disableIPFilter();
|
void disableIPFilter();
|
||||||
void setQueueingEnabled(bool enable);
|
void setQueueingEnabled(bool enable);
|
||||||
void loadTorrentSpeedLimits(QString hash);
|
void handleDownloadFailure(QString url, QString reason);
|
||||||
void handleDownloadFailure(QString url, QString reason);
|
void downloadUrlAndSkipDialog(QString url, QString save_path=QString::null);
|
||||||
void loadWebSeeds(QString fileHash);
|
// Session configuration - Setters
|
||||||
void increaseDlTorrentPriority(QString hash);
|
void setListeningPort(int port);
|
||||||
void decreaseDlTorrentPriority(QString hash);
|
void setMaxConnections(int maxConnec);
|
||||||
void downloadUrlAndSkipDialog(QString url, QString save_path=QString::null);
|
void setMaxConnectionsPerTorrent(int max);
|
||||||
// Session configuration - Setters
|
void setMaxUploadsPerTorrent(int max);
|
||||||
void setListeningPort(int port);
|
void setDownloadRateLimit(long rate);
|
||||||
void setMaxConnections(int maxConnec);
|
void setUploadRateLimit(long rate);
|
||||||
void setMaxConnectionsPerTorrent(int max);
|
void setGlobalRatio(float ratio);
|
||||||
void setMaxUploadsPerTorrent(int max);
|
void setDeleteRatio(float ratio);
|
||||||
void setDownloadRateLimit(long rate);
|
void setDHTPort(int dht_port);
|
||||||
void setUploadRateLimit(long rate);
|
void setProxySettings(proxy_settings proxySettings, bool trackers=true, bool peers=true, bool web_seeds=true, bool dht=true);
|
||||||
void setGlobalRatio(float ratio);
|
void setSessionSettings(session_settings sessionSettings);
|
||||||
void setDeleteRatio(float ratio);
|
void startTorrentsInPause(bool b);
|
||||||
void setDHTPort(int dht_port);
|
void setDefaultTempPath(QString temppath);
|
||||||
void setProxySettings(proxy_settings proxySettings, bool trackers=true, bool peers=true, bool web_seeds=true, bool dht=true);
|
void applyEncryptionSettings(pe_settings se);
|
||||||
void setSessionSettings(session_settings sessionSettings);
|
void setDownloadLimit(QString hash, long val);
|
||||||
void startTorrentsInPause(bool b);
|
void setUploadLimit(QString hash, long val);
|
||||||
void setDefaultSavePath(QString savepath);
|
void enableUPnP(bool b);
|
||||||
void setDefaultTempPath(QString temppath);
|
void enableNATPMP(bool b);
|
||||||
void applyEncryptionSettings(pe_settings se);
|
void enableLSD(bool b);
|
||||||
void loadFilesPriorities(QTorrentHandle& h);
|
bool enableDHT(bool b);
|
||||||
void setDownloadLimit(QString hash, long val);
|
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
|
||||||
void setUploadLimit(QString hash, long val);
|
void addPeerBanMessage(QString msg, bool from_ipfilter);
|
||||||
void enableUPnP(bool b);
|
void processDownloadedFile(QString, QString);
|
||||||
void enableNATPMP(bool b);
|
void addMagnetSkipAddDlg(QString uri);
|
||||||
void enableLSD(bool b);
|
void downloadFromURLList(const QStringList& urls);
|
||||||
bool enableDHT(bool b);
|
void configureSession();
|
||||||
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
|
void banIP(QString ip);
|
||||||
void addPeerBanMessage(QString msg, bool from_ipfilter);
|
|
||||||
void processDownloadedFile(QString, QString);
|
|
||||||
void saveTrackerFile(QString hash);
|
|
||||||
void addMagnetSkipAddDlg(QString uri);
|
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void scanDirectory(QString);
|
void addTorrentsFromScanFolder(QStringList&);
|
||||||
void readAlerts();
|
void readAlerts();
|
||||||
void loadTrackerFile(QString hash);
|
void deleteBigRatios();
|
||||||
void deleteBigRatios();
|
void takeETASamples();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void addedTorrent(QTorrentHandle& h);
|
void addedTorrent(QTorrentHandle& h);
|
||||||
void deletedTorrent(QString hash);
|
void deletedTorrent(QString hash);
|
||||||
void pausedTorrent(QTorrentHandle& h);
|
void pausedTorrent(QTorrentHandle& h);
|
||||||
void resumedTorrent(QTorrentHandle& h);
|
void resumedTorrent(QTorrentHandle& h);
|
||||||
void finishedTorrent(QTorrentHandle& h);
|
void finishedTorrent(QTorrentHandle& h);
|
||||||
void fullDiskError(QTorrentHandle& h, QString msg);
|
void fullDiskError(QTorrentHandle& h, QString msg);
|
||||||
void trackerError(QString hash, QString time, QString msg);
|
void trackerError(QString hash, QString time, QString msg);
|
||||||
void trackerAuthenticationRequired(QTorrentHandle& h);
|
void trackerAuthenticationRequired(QTorrentHandle& h);
|
||||||
void newDownloadedTorrent(QString path, QString url);
|
void newDownloadedTorrent(QString path, QString url);
|
||||||
void updateFileSize(QString hash);
|
void updateFileSize(QString hash);
|
||||||
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 torrentPaused(QTorrentHandle &h);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ class consoleDlg : public QDialog, private Ui_ConsoleDlg{
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bittorrent *BTSession;
|
Bittorrent *BTSession;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
consoleDlg(QWidget *parent, bittorrent* _BTSession) : QDialog(parent) {
|
consoleDlg(QWidget *parent, Bittorrent* _BTSession) : QDialog(parent) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
BTSession = _BTSession;
|
BTSession = _BTSession;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Bittorrent Client using Qt4 and libtorrent.
|
* Bittorrent Client using Qt4 and libtorrent.
|
||||||
* Copyright (C) 2006 Christophe Dumez, Arnaud Demaiziere
|
* Copyright (C) 2006 Christophe Dumez
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@@ -25,17 +25,36 @@
|
|||||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*
|
*
|
||||||
* Contact : chris@qbittorrent.org, arnaud@qbittorrent.org
|
* Contact : chris@qbittorrent.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QREALARRAY_H
|
#ifndef DELETIONCONFIRMATIONDLG_H
|
||||||
#define QREALARRAY_H
|
#define DELETIONCONFIRMATIONDLG_H
|
||||||
|
|
||||||
#include <QVarLengthArray>
|
#include <QDialog>
|
||||||
#include <QMetaType>
|
#include "ui_confirmdeletiondlg.h"
|
||||||
|
|
||||||
typedef QVarLengthArray<qreal, 256> QRealArray;
|
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QRealArray)
|
public:
|
||||||
|
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
|
||||||
|
setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
bool shouldDeleteLocalFiles() const {
|
||||||
|
return checkPermDelete->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool askForDeletionConfirmation(bool *delete_local_files) {
|
||||||
|
DeletionConfirmationDlg dlg;
|
||||||
|
if(dlg.exec() == QDialog::Accepted) {
|
||||||
|
*delete_local_files = dlg.shouldDeleteLocalFiles();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DELETIONCONFIRMATIONDLG_H
|
||||||
193
src/download.ui
@@ -1,193 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>downloading</class>
|
|
||||||
<widget class="QWidget" name="downloading">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>811</width>
|
|
||||||
<height>453</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Search</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QTreeView" name="downloadList">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="contextMenuPolicy">
|
|
||||||
<enum>Qt::CustomContextMenu</enum>
|
|
||||||
</property>
|
|
||||||
<property name="autoScroll">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
|
||||||
</property>
|
|
||||||
<property name="indentation">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="itemsExpandable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
<action name="actionStart">
|
|
||||||
<property name="text">
|
|
||||||
<string>Start</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionPause">
|
|
||||||
<property name="text">
|
|
||||||
<string>Pause</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionDelete">
|
|
||||||
<property name="text">
|
|
||||||
<string>Delete</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionPreview_file">
|
|
||||||
<property name="text">
|
|
||||||
<string>Preview file</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionSet_upload_limit">
|
|
||||||
<property name="text">
|
|
||||||
<string>Set upload limit</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionSet_download_limit">
|
|
||||||
<property name="text">
|
|
||||||
<string>Set download limit</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionDelete_Permanently">
|
|
||||||
<property name="text">
|
|
||||||
<string>Delete Permanently</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionTorrent_Properties">
|
|
||||||
<property name="text">
|
|
||||||
<string>Torrent Properties</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionOpen_destination_folder">
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="icons.qrc">
|
|
||||||
<normaloff>:/Icons/oxygen/folder.png</normaloff>:/Icons/oxygen/folder.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Open destination folder</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionHOSColName">
|
|
||||||
<property name="text">
|
|
||||||
<string>Name</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionHOSColSize">
|
|
||||||
<property name="text">
|
|
||||||
<string>Size</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionHOSColProgress">
|
|
||||||
<property name="text">
|
|
||||||
<string>Progress</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionHOSColDownSpeed">
|
|
||||||
<property name="text">
|
|
||||||
<string>DLSpeed</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionHOSColUpSpeed">
|
|
||||||
<property name="text">
|
|
||||||
<string>UpSpeed</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionHOSColSeedersLeechers">
|
|
||||||
<property name="text">
|
|
||||||
<string>Seeds/Leechs</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionHOSColRatio">
|
|
||||||
<property name="text">
|
|
||||||
<string>Ratio</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionHOSColEta">
|
|
||||||
<property name="text">
|
|
||||||
<string>ETA</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionBuy_it">
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="icons.qrc">
|
|
||||||
<normaloff>:/Icons/oxygen/wallet.png</normaloff>:/Icons/oxygen/wallet.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Buy it</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionHOSColPriority">
|
|
||||||
<property name="text">
|
|
||||||
<string>Priority</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionIncreasePriority">
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="icons.qrc">
|
|
||||||
<normaloff>:/Icons/skin/increase.png</normaloff>:/Icons/skin/increase.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Increase priority</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionDecreasePriority">
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="icons.qrc">
|
|
||||||
<normaloff>:/Icons/skin/decrease.png</normaloff>:/Icons/skin/decrease.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Decrease priority</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionForce_recheck">
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="icons.qrc">
|
|
||||||
<normaloff>:/Icons/oxygen/gear.png</normaloff>:/Icons/oxygen/gear.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Force recheck</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionCopy_magnet_link">
|
|
||||||
<property name="text">
|
|
||||||
<string>Copy magnet link</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
</widget>
|
|
||||||
<resources>
|
|
||||||
<include location="icons.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||