Compare commits
494 Commits
release-1.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42574242ef | ||
|
|
d5c174a6f8 | ||
|
|
173999e504 | ||
|
|
1ed928bc39 | ||
|
|
b85d51ba79 | ||
|
|
779b53722b | ||
|
|
76780c4c46 | ||
|
|
da74f24a71 | ||
|
|
01c56865db | ||
|
|
b541c9fa4c | ||
|
|
aac0fbcbe4 | ||
|
|
b315551edd | ||
|
|
58a885cb87 | ||
|
|
d19282285c | ||
|
|
32a8dec0e7 | ||
|
|
e0d8ca39a5 | ||
|
|
2dd5bccd49 | ||
|
|
ec3169c9b0 | ||
|
|
18d0283463 | ||
|
|
7bfd7e9cda | ||
|
|
459bb8c51d | ||
|
|
9fe807b6f1 | ||
|
|
9159a9f25d | ||
|
|
84f00bf3f6 | ||
|
|
8ea8f8a9f7 | ||
|
|
d3687fd863 | ||
|
|
d1a549a6cc | ||
|
|
c1552ff254 | ||
|
|
54a396bc6e | ||
|
|
ed732bca63 | ||
|
|
02a4464e8f | ||
|
|
7f97df4462 | ||
|
|
9d20af02a2 | ||
|
|
cbaef050f0 | ||
|
|
148139c2c4 | ||
|
|
793f8a103d | ||
|
|
ffa48b64ac | ||
|
|
59a8e651f9 | ||
|
|
fb9f2a01b5 | ||
|
|
944e25a5d8 | ||
|
|
ad597c72d2 | ||
|
|
abbbf1e562 | ||
|
|
d2dd29c35a | ||
|
|
906f2bab1e | ||
|
|
bb6468005d | ||
|
|
a2423e97eb | ||
|
|
ed1d75ecb1 | ||
|
|
1e4200345a | ||
|
|
be11f4e039 | ||
|
|
22ec528cdf | ||
|
|
ebf341a6de | ||
|
|
68ba6322e1 | ||
|
|
968a5f3017 | ||
|
|
8df1708491 | ||
|
|
da51ce1b71 | ||
|
|
95a6de9b00 | ||
|
|
269bbdf01d | ||
|
|
df03b042d6 | ||
|
|
3ec118d59b | ||
|
|
bce575ee68 | ||
|
|
83da56b0eb | ||
|
|
fa2891c225 | ||
|
|
c4bf42524c | ||
|
|
a096105f18 | ||
|
|
51f842aaef | ||
|
|
76c4466fb6 | ||
|
|
facd02a7ec | ||
|
|
ed8da2ef66 | ||
|
|
998352f9f1 | ||
|
|
8c1a135d16 | ||
|
|
b976d39207 | ||
|
|
f0a18ec1f5 | ||
|
|
f9a5afe446 | ||
|
|
b13c7abca0 | ||
|
|
1f104f62f5 | ||
|
|
f8f7729e77 | ||
|
|
eca262f5f4 | ||
|
|
df5f5a943b | ||
|
|
497cb07852 | ||
|
|
10ab8f107c | ||
|
|
3a6ff19418 | ||
|
|
ab317a3a62 | ||
|
|
617724c2b1 | ||
|
|
422c03b4ec | ||
|
|
4af05dc63c | ||
|
|
ac92287b43 | ||
|
|
c7634b3828 | ||
|
|
5d1d26b285 | ||
|
|
644fea69a1 | ||
|
|
4dc8959f67 | ||
|
|
63be5ffc74 | ||
|
|
c5a9e27cb3 | ||
|
|
ecf48b3a7b | ||
|
|
63e5339690 | ||
|
|
d8c27ac8c4 | ||
|
|
925597c43a | ||
|
|
ba8fd62900 | ||
|
|
3f61e176f0 | ||
|
|
542338972a | ||
|
|
fe91599eb4 | ||
|
|
d9817795ed | ||
|
|
6ede368f63 | ||
|
|
6885f46f4b | ||
|
|
9323660c79 | ||
|
|
88b77a63ed | ||
|
|
4d1ef40f6e | ||
|
|
9a68e0cc25 | ||
|
|
396427e3b6 | ||
|
|
e460f1c365 | ||
|
|
b9531c8245 | ||
|
|
27aff04f11 | ||
|
|
08fe5814c5 | ||
|
|
5af8b7c0e2 | ||
|
|
c1acbda38f | ||
|
|
afa5213c94 | ||
|
|
17b8ba27b3 | ||
|
|
3f9b74430a | ||
|
|
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 | ||
|
|
5d31dcdb15 | ||
|
|
6f89b1f131 | ||
|
|
9d35bda43c | ||
|
|
e780d83fd0 | ||
|
|
7a59d5e47c | ||
|
|
f2ea524be9 | ||
|
|
a33094519c | ||
|
|
e313ae808f | ||
|
|
dc9802fe1e | ||
|
|
64f1d306f4 | ||
|
|
f3af4867fd | ||
|
|
4fe22dbc57 | ||
|
|
1d9b524b77 | ||
|
|
63761afd0a | ||
|
|
8da148ffa1 | ||
|
|
e2dc2207d8 | ||
|
|
6e87d6655a | ||
|
|
d72485a955 | ||
|
|
04c6760892 |
12
AUTHORS
@@ -2,8 +2,9 @@ Author:
|
||||
* Christophe Dumez <chris@qbittorrent.org>
|
||||
|
||||
Contributors:
|
||||
* Arnaud Demaizière <arnaud@qbittorrent.org>
|
||||
* Stefanos Antaris <santaris@csd.auth.gr>
|
||||
* Ishan Arora <ishan@qbittorrent.org>
|
||||
* Arnaud Demaizière <arnaud@qbittorrent.org>
|
||||
* Grigis Gaëtan <cipher16@gmail.com>
|
||||
|
||||
Code from other projects:
|
||||
@@ -66,19 +67,20 @@ Translations authors:
|
||||
- Finnish: Niklas Laxström (nikerabbit@users.sourceforge.net)
|
||||
- French: Christophe Dumez (chris@qbittorrent.org)
|
||||
- German: Niels Hoffmann (zentralmaschine@users.sourceforge.net)
|
||||
- Greek: Tsvetan Bankov (emerge_life@users.sourceforge.net)
|
||||
- Greek: Tsvetan Bankov (emerge_life@users.sourceforge.net) and Stephanos Antaris (santaris@csd.auth.gr)
|
||||
- Hungarian: Majoros Péter (majoros.j.p@t-online.hu)
|
||||
- Italian: Mirko Ferrari (mirkoferrari@gmail.com) and Ferraro Luciano (luciano.ferraro@gmail.com)
|
||||
- Japanese: Nardog (nardog@e2umail.com)
|
||||
- Japanese: Nardog (alphisation@gmail.com)
|
||||
- Korean: Jin Woo Sin (jin828sin@users.sourceforge.net)
|
||||
- Norwegian: Lars-Erik Labori (hamil@users.sourceforge.net)
|
||||
- Polish: Jarek Smieja (ajep9691@wp.pl)
|
||||
- Polish: Mariusz Fik (fisiu@opensuse.org)
|
||||
- Portuguese: Nick Marinho (nickmarinho@gmail.com)
|
||||
- Romanian: Obada Denis (obadadenis@users.sourceforge.net)
|
||||
- Russian: Nick Khazov (m2k3d0n at users.sourceforge.net)
|
||||
- Serbian: Anaximandar Milet (anaximandar at operamail.com)
|
||||
- Slovak: helix84
|
||||
- Spanish: Vicente Raul Plata Fonseca (silverxnt@users.sourceforge.net)
|
||||
- Swedish: Daniel Nylander (po@danielnylander.se)
|
||||
- Turkish: Erdem Bingöl (erdem84@gmail.com)
|
||||
- Turkish: Hasan Yilmaz (iletisim@hedefturkce.com)
|
||||
- Ukrainian: Andrey Shpachenko (masterfix@users.sourceforge.net)
|
||||
license: GPLv2
|
||||
|
||||
125
Changelog
@@ -1,4 +1,124 @@
|
||||
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
|
||||
* Fri Dec 18 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.2
|
||||
- BUGFIX: Fix .qbittorrent folder not being created (critical bug introduced in v2.0.1 that makes qBittorrent unusuable for new users)
|
||||
- BUGFIX: Fix RSS Feed downloader for some feeds
|
||||
- BUGFIX: Do not use home folder as a fallback when the save path is not accessible
|
||||
- BUGFIX: Fix Mininova, ThePirateBay search engine plugins
|
||||
- BUGFIX: Read RSS articles are remembered on restart for feeds with no torrents attached
|
||||
|
||||
* Sun Dec 13 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.1
|
||||
- BUGFIX: µTorrent user-agent is now spoofed correctly
|
||||
- BUGFIX: Fix column hiding behavior when queueing system is disabled
|
||||
- BUGFIX: Fix link to plugins.qbittorrent.org in plugins dialog
|
||||
- BUGFIX: ~/qBT_dir is created only when it is actually used
|
||||
- BUGFIX: Fix possible missing slot message (toggleSelectedTorrentsSuperSeeding)
|
||||
- BUGFIX: Fix possible crash in torrent properties (files)
|
||||
- BUGFIX: Added Hex Magnet Links support (Thanks Haypo)
|
||||
|
||||
* Thu Dec 10 2009 - 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 and shutdown
|
||||
- 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: Search engine plugins now handle HTTP protocol gzip compression
|
||||
- FEATURE: Enabled lazy bitfield as a counter-measure for ISP speed throttling
|
||||
- FEATURE: Fall back to a random port if qBittorrent could not listen on the chosen port
|
||||
- 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)
|
||||
- BUGFIX: Made sure qBittorrent does not scrape the tracker too frequently (libtorrent >= 0.15 only)
|
||||
- BUGFIX: Fix Paste action in search engine field
|
||||
- BUGFIX: Fix possible double free in search engine destructor
|
||||
- BUGFIX: Properly handle trackers error messages
|
||||
- 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
|
||||
- WEB UI: Password is now stored as md5
|
||||
- I18N: Added Serbian translation (By Anaximandar Milet)
|
||||
- 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, ...)
|
||||
|
||||
* Tue Nov 17 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.6
|
||||
- BUGFIX: RSS feed articles can now be displayed using keyboard arrows
|
||||
- BUGFIX: RSS feed downloader can only process unread articles now
|
||||
- BUGFIX: Fixed memory leak in RSS parser
|
||||
- BUGFIX: Fixed possible crash in search autocompletion
|
||||
- BUGFIX: Improved ETA calculation for big torrents
|
||||
- BUGFIX: Fixed per-torrent speed limiting
|
||||
|
||||
* Wed Nov 4 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.5
|
||||
- BUGFIX: Fixed man page
|
||||
- BUGFIX: Fix crash on torrent addition (if libtorrent-rasterbar has debug enabled)
|
||||
- BUGFIX: Fix trackers addition to torrents (bug introduced in v1.5.4)
|
||||
- BUGFIX: Suppress compilation warning regarding sortNewsList() not being used
|
||||
- BUGFIX: Make sure scan folder is different than qBittorrent backup directory to avoid torrents deletion
|
||||
- BUGFIX: Added safety mecanism which adds the torrents back to the list in case qbittorrent-resume.conf gets deleted or corrupted.
|
||||
|
||||
* Sun Oct 25 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.4
|
||||
- BUGFIX: Updated man page
|
||||
- BUGFIX: Fixed possible crash with torrents containing unicode characters
|
||||
- BUGFIX: Fixed problem when disabling systray integration and starting minimized
|
||||
- BUGFIX: Fixed PirateBay search plugin
|
||||
- BUGFIX: Using Download button in search results list now downloads the right torrents
|
||||
- BUGFIX: The search results list is no longer sorted automatically when a row color is updated
|
||||
|
||||
* Wed Sep 30 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.3
|
||||
- BUGFIX: Fix a possible crash when pausing then deleting a torrent quickly
|
||||
- BUGFIX: Fix a race condition in folder scanning and torrent downloader
|
||||
- BUGFIX: Hide download url column in search results
|
||||
- BUGFIX: Fix a crash when scanned directory does not exist
|
||||
- BUGFIX: Fix compilation on Mac OS
|
||||
- BUGFIX: Added a command line parameter to disable splash screen
|
||||
- BUGFIX: Ignore permanent deletion button when no torrent is selected
|
||||
- BUGFIX: When a selected torrent is deleted, select next suitable torrent
|
||||
|
||||
* Sun Sep 20 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.2
|
||||
- BUGFIX: Some torrents were pausing for no reason
|
||||
- I18N: Updated Korean translation
|
||||
|
||||
* Thu Sep 7 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.1
|
||||
- BUGFIX: Fix crash in torrent addition dialog when save path does not exist (closes #425227)
|
||||
- BUGFIX: Fix downloading from URL (broken in v1.5.0)
|
||||
- BUGFIX: Pause torrents in error state
|
||||
|
||||
* Thu Sep 3 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
|
||||
- FEATURE: Added Magnet URI support
|
||||
- FEATURE: Search engine supports category-based requests
|
||||
- FEATURE: Make use of torrent enclosure in RSS feeds for direct download
|
||||
@@ -12,10 +132,13 @@
|
||||
- FEATURE: If a torrent contains a torrent file, process downloaded torrent file too
|
||||
- FEATURE: A random listening port can be chosen automatically
|
||||
- BUGFIX: torrent resume code rewrited
|
||||
- BUGFIX: Fixed uTorrent spoofing code
|
||||
- BUGFIX: Greatly improved column sorting code
|
||||
- BUGFIX: Possibility to create trackerless torrents
|
||||
- BUGFIX: Better item coloring in torrent content filtering dialog
|
||||
- COSMETIC: Redesigned search 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
|
||||
- BUGFIX: Fix problems when changing save path (if using temporary download folder)
|
||||
|
||||
28
INSTALL
@@ -1,12 +1,6 @@
|
||||
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
|
||||
make && make install
|
||||
qbittorrent
|
||||
@@ -14,29 +8,25 @@ qbittorrent
|
||||
will install and execute qBittorrent hopefully without any problems.
|
||||
|
||||
Dependencies:
|
||||
- Qt >= 4.3.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
|
||||
Qt >= 4.4.0 is advised
|
||||
- Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
|
||||
|
||||
- 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.libtorrent.net
|
||||
Be careful: another library (the one used by rTorrent) uses a similar name.
|
||||
|
||||
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
||||
|
||||
- libcurl
|
||||
|
||||
- python >= 2.3 (needed by search engine)
|
||||
* Run time only dependency
|
||||
|
||||
- libmagick++ (advised, not required)
|
||||
* Needed for favicons support (RSS / Search plugins)
|
||||
- libnotify >= 0.4.2, glib-2.0 (optional)
|
||||
* Can be used for system notifications to replace standard Qt notifications
|
||||
so that it integrates better into the Desktop
|
||||
|
||||
- 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)
|
||||
- geoip-database (optional)
|
||||
* If qBittorrent cannot find this database, it will try to resolve countries using the Internet but it will be a lot slower.
|
||||
* Run time only dependency
|
||||
|
||||
DOCUMENTATION:
|
||||
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
|
||||
support as well as many features.
|
||||
|
||||
This product includes GeoLite data created by MaxMind, available from
|
||||
http://maxmind.com/
|
||||
|
||||
Installation:
|
||||
********************************
|
||||
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:
|
||||
http://www.qbittorrent.org
|
||||
|
||||
or our wiki here:
|
||||
http://wiki.qbittorrent.org
|
||||
|
||||
Please report any bug (or feature request) to:
|
||||
http://bugs.qbittorrent.org
|
||||
|
||||
|
||||
238
configure
vendored
@@ -18,12 +18,12 @@ Main options:
|
||||
--help This help text.
|
||||
|
||||
Dependency options:
|
||||
--with-libboost-inc=[path] Path to libboost include files
|
||||
--with-libcurl-inc=[path] Path to libcurl include files
|
||||
--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
|
||||
--with-libboost-inc=[path] Path to libboost include files
|
||||
--disable-libnotify Disable use of libnotify
|
||||
--disable-geoip-database Disable use of geoip-database
|
||||
--with-geoip-database-embedded Geoip Database will be embedded in
|
||||
qBittorrent executable (please follow
|
||||
instructions in src/geoip/README)
|
||||
|
||||
EOT
|
||||
}
|
||||
@@ -145,28 +145,18 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
;;
|
||||
|
||||
--with-libcurl-inc=*)
|
||||
QC_WITH_LIBCURL_INC=$optarg
|
||||
--disable-libnotify)
|
||||
QC_DISABLE_libnotify="Y"
|
||||
shift
|
||||
;;
|
||||
|
||||
--with-libcurl-lib=*)
|
||||
QC_WITH_LIBCURL_LIB=$optarg
|
||||
--disable-geoip-database)
|
||||
QC_DISABLE_geoip_database="Y"
|
||||
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
|
||||
--with-geoip-database-embedded)
|
||||
QC_WITH_GEOIP_DATABASE_EMBEDDED="Y"
|
||||
shift
|
||||
;;
|
||||
|
||||
@@ -192,11 +182,9 @@ echo BINDIR=$BINDIR
|
||||
echo DATADIR=$DATADIR
|
||||
echo EX_QTDIR=$EX_QTDIR
|
||||
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
||||
echo QC_WITH_LIBCURL_INC=$QC_WITH_LIBCURL_INC
|
||||
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 QC_DISABLE_libnotify=$QC_DISABLE_libnotify
|
||||
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
|
||||
echo QC_WITH_GEOIP_DATABASE_EMBEDDED=$QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||
echo
|
||||
fi
|
||||
|
||||
@@ -301,21 +289,21 @@ cat >$1/modules.cpp <<EOT
|
||||
#line 1 "qt4.qcm"
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: Qt >= 4.3
|
||||
name: Qt >= 4.4
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
class qc_qt4 : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_qt4(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "Qt >= 4.3"; }
|
||||
QString shortname() const { return "Qt 4.3"; }
|
||||
QString name() const { return "Qt >= 4.4"; }
|
||||
QString shortname() const { return "Qt 4.4"; }
|
||||
bool exec()
|
||||
{
|
||||
if(QT_VERSION >= 0x040400) {
|
||||
conf->addDefine("QT_4_4");
|
||||
}
|
||||
return(QT_VERSION >= 0x040300);
|
||||
if(QT_VERSION >= 0x040500) {
|
||||
conf->addDefine("QT_4_5");
|
||||
}
|
||||
return(QT_VERSION >= 0x040400);
|
||||
|
||||
}
|
||||
};
|
||||
@@ -330,12 +318,12 @@ class qc_libtorrent_rasterbar : public ConfObj
|
||||
{
|
||||
public:
|
||||
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"; }
|
||||
bool exec(){
|
||||
QStringList incs;
|
||||
QString req_ver = "0.14.0";
|
||||
QString adv_ver = "0.14.4";
|
||||
QString adv_ver = "0.15.0";
|
||||
QString version, libs, other;
|
||||
VersionMode mode = VersionMin;
|
||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
||||
@@ -345,7 +333,9 @@ public:
|
||||
if(!libs.isEmpty())
|
||||
conf->addLib(libs);
|
||||
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;
|
||||
}
|
||||
};
|
||||
@@ -406,138 +396,76 @@ public:
|
||||
return true;
|
||||
}
|
||||
};
|
||||
#line 1 "libcurl.qcm"
|
||||
#line 1 "libnotify.qcm"
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: libcommoncpp2
|
||||
arg: with-libcurl-inc=[path], Path to libcurl include files
|
||||
arg: with-libcurl-lib=[path], Path to libcurl library files
|
||||
name: libnotify
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
class qc_libcurl : public ConfObj
|
||||
// see Conf::findPkgConfig
|
||||
class qc_libnotify : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_libcurl(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "libcurl"; }
|
||||
QString shortname() const { return "libcurl"; }
|
||||
qc_libnotify(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
||||
QString shortname() const { return "libnotify"; }
|
||||
bool exec(){
|
||||
QString s;
|
||||
s = conf->getenv("QC_WITH_LIBCURL_INC");
|
||||
if(!s.isEmpty()) {
|
||||
if(!conf->checkHeader(s, "curl/curl.h")) {
|
||||
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{
|
||||
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;
|
||||
}
|
||||
} 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"
|
||||
#line 1 "geoip-database.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
|
||||
name: geoip-database
|
||||
arg: with-geoip-database-embedded, Geoip Database will be embedded in qBittorrent executable (please follow instructions in src/geoip/README)
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
#include <QProcess>
|
||||
class qc_libzzip : public ConfObj
|
||||
// see Conf::findPkgConfig
|
||||
class qc_geoip_database : 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;
|
||||
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "GeoIP Database (optional)"; }
|
||||
QString shortname() const { return "GeoIP Database"; }
|
||||
bool exec() {
|
||||
#ifdef Q_WS_X11
|
||||
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
||||
#endif
|
||||
conf->addDefine("WITH_GEOIP_EMBEDDED");
|
||||
printf(" embedded and");
|
||||
return true;
|
||||
#ifdef Q_WS_X11
|
||||
}
|
||||
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;
|
||||
if(QFile::exists("/usr/share/GeoIP/GeoIP.dat") || QFile::exists("/usr/local/share/GeoIP/GeoIP.dat") || QFile::exists("/var/lib/GeoIP/GeoIP.dat"))
|
||||
return true;
|
||||
printf("\nWarning: GeoIP database was not found at /usr/share/GeoIP/GeoIP.dat or /var/lib/GeoIP/GeoIP.dat\nCountry resolution will be slow.");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
@@ -552,10 +480,10 @@ cat >$1/modules_new.cpp <<EOT
|
||||
o = new qc_libboost(conf);
|
||||
o->required = true;
|
||||
o->disabled = false;
|
||||
o = new qc_libcurl(conf);
|
||||
o->required = true;
|
||||
o = new qc_libnotify(conf);
|
||||
o->required = false;
|
||||
o->disabled = false;
|
||||
o = new qc_libzzip(conf);
|
||||
o = new qc_geoip_database(conf);
|
||||
o->required = false;
|
||||
o->disabled = false;
|
||||
|
||||
@@ -1504,11 +1432,9 @@ export BINDIR
|
||||
export DATADIR
|
||||
export EX_QTDIR
|
||||
export QC_WITH_LIBBOOST_INC
|
||||
export QC_WITH_LIBCURL_INC
|
||||
export QC_WITH_LIBCURL_LIB
|
||||
export QC_DISABLE_libzzip
|
||||
export QC_WITH_LIBZZIP_INC
|
||||
export QC_WITH_LIBZZIP_LIB
|
||||
export QC_DISABLE_libnotify
|
||||
export QC_DISABLE_geoip_database
|
||||
export QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||
export QC_VERBOSE
|
||||
rm -rf .qconftemp
|
||||
(
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
.\" This manpage has been automatically generated by docbook2man
|
||||
.\" from a DocBook document. This tool can be found at:
|
||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>.
|
||||
.TH "QBITTORRENT" "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
|
||||
.SH SYNOPSIS
|
||||
|
||||
\fBqbittorrent\fR [FILE | URL] [FILE | URL...]
|
||||
.SH "SYNOPSIS"
|
||||
|
||||
\fBqbittorrent\fR [\-\-no-splash] [TORRENT_FILE | URL]...
|
||||
|
||||
\fBqbittorrent\fR \-\-help
|
||||
|
||||
\fBqbittorrent\fR \-\-version
|
||||
|
||||
.PP
|
||||
.SH "DESCRIPTION"
|
||||
|
||||
@@ -19,10 +21,21 @@ qBittorrent \- a Bittorrent client written in C++ / Qt4
|
||||
using the \fBrblibtorrent\fR library by Arvid Norberg. qBittorrent aims
|
||||
to be a good alternative to all other bittorrent clients out there. qBittorrent
|
||||
is fast, stable, light, it supports unicode and it provides a good integrated search engine.
|
||||
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"
|
||||
|
||||
Christophe Dumez <chris@qbittorrent.org>
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
<dep type='libboost'>
|
||||
<required/>
|
||||
</dep>
|
||||
<dep type='libcurl'>
|
||||
<required/>
|
||||
<dep type='libnotify'>
|
||||
</dep>
|
||||
<dep type='geoip-database'>
|
||||
</dep>
|
||||
<dep type='libzzip'/>
|
||||
</qconf>
|
||||
|
||||
29
qcm/geoip-database.qcm
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: geoip-database
|
||||
arg: with-geoip-database-embedded, Geoip Database will be embedded in qBittorrent executable (please follow instructions in src/geoip/README)
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
// see Conf::findPkgConfig
|
||||
class qc_geoip_database : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_geoip_database(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "GeoIP Database (optional)"; }
|
||||
QString shortname() const { return "GeoIP Database"; }
|
||||
bool exec() {
|
||||
#ifdef Q_WS_X11
|
||||
if(!conf->getenv("QC_WITH_GEOIP_DATABASE_EMBEDDED").isEmpty()) {
|
||||
#endif
|
||||
conf->addDefine("WITH_GEOIP_EMBEDDED");
|
||||
printf(" embedded and");
|
||||
return true;
|
||||
#ifdef Q_WS_X11
|
||||
}
|
||||
if(QFile::exists("/usr/share/GeoIP/GeoIP.dat") || QFile::exists("/usr/local/share/GeoIP/GeoIP.dat") || QFile::exists("/var/lib/GeoIP/GeoIP.dat"))
|
||||
return true;
|
||||
printf("\nWarning: GeoIP database was not found at /usr/share/GeoIP/GeoIP.dat or /var/lib/GeoIP/GeoIP.dat\nCountry resolution will be slow.");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
@@ -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:
|
||||
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"; }
|
||||
bool exec(){
|
||||
QStringList incs;
|
||||
QString req_ver = "0.14.0";
|
||||
QString adv_ver = "0.14.4";
|
||||
QString adv_ver = "0.15.0";
|
||||
QString version, libs, other;
|
||||
VersionMode mode = VersionMin;
|
||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
||||
@@ -23,7 +23,9 @@ public:
|
||||
if(!libs.isEmpty())
|
||||
conf->addLib(libs);
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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-----
|
||||
name: Qt >= 4.3
|
||||
name: Qt >= 4.4
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
class qc_qt4 : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_qt4(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "Qt >= 4.3"; }
|
||||
QString shortname() const { return "Qt 4.3"; }
|
||||
QString name() const { return "Qt >= 4.4"; }
|
||||
QString shortname() const { return "Qt 4.4"; }
|
||||
bool exec()
|
||||
{
|
||||
if(QT_VERSION >= 0x040400) {
|
||||
conf->addDefine("QT_4_4");
|
||||
}
|
||||
return(QT_VERSION >= 0x040300);
|
||||
if(QT_VERSION >= 0x040500) {
|
||||
conf->addDefine("QT_4_5");
|
||||
}
|
||||
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,627 +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);
|
||||
connect(finishedList->header(), SIGNAL(sectionPressed(int)), this, SLOT(toggleFinishedListSortOrder(int)));
|
||||
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
|
||||
2136
src/GUI.cpp
111
src/GUI.h
@@ -34,88 +34,64 @@
|
||||
#include <QProcess>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QPointer>
|
||||
#include "ui_MainWindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "qtorrenthandle.h"
|
||||
|
||||
class bittorrent;
|
||||
class createtorrent;
|
||||
enum TabIndex{TAB_TRANSFER, TAB_SEARCH, TAB_RSS};
|
||||
|
||||
class Bittorrent;
|
||||
class QTimer;
|
||||
class DownloadingTorrents;
|
||||
class FinishedTorrents;
|
||||
class downloadFromURL;
|
||||
class SearchEngine;
|
||||
#ifdef QT_4_4
|
||||
class QLocalServer;
|
||||
class QLocalSocket;
|
||||
#else
|
||||
class QTcpServer;
|
||||
class QTcpSocket;
|
||||
#endif
|
||||
class QLocalServer;
|
||||
class QCloseEvent;
|
||||
class RSSImp;
|
||||
class QShortcut;
|
||||
class about;
|
||||
class previewSelect;
|
||||
class options_imp;
|
||||
class QTabWidget;
|
||||
class QLabel;
|
||||
class QModelIndex;
|
||||
class HttpServer;
|
||||
class QFrame;
|
||||
class TransferListWidget;
|
||||
class TransferListFiltersWidget;
|
||||
class QSplitter;
|
||||
class PropertiesWidget;
|
||||
class StatusBar;
|
||||
|
||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
// Bittorrent
|
||||
bittorrent *BTSession;
|
||||
QTimer *checkConnect;
|
||||
QTimer *scrapeTimer;
|
||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers;
|
||||
Bittorrent *BTSession;
|
||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
|
||||
// GUI related
|
||||
QTimer *guiUpdater;
|
||||
QTabWidget *tabs;
|
||||
StatusBar *status_bar;
|
||||
QPointer<options_imp> options;
|
||||
QSystemTrayIcon *myTrayIcon;
|
||||
QPointer<QSystemTrayIcon> systrayIcon;
|
||||
QPointer<QTimer> systrayCreator;
|
||||
QMenu *myTrayIconMenu;
|
||||
DownloadingTorrents *downloadingTorrentTab;
|
||||
FinishedTorrents *finishedTorrentTab;
|
||||
QLabel *connecStatusLblIcon;
|
||||
bool systrayIntegration;
|
||||
TransferListWidget *transferList;
|
||||
TransferListFiltersWidget *transferListFilters;
|
||||
PropertiesWidget *properties;
|
||||
bool displaySpeedInTitle;
|
||||
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
|
||||
QShortcut *switchSearchShortcut;
|
||||
QShortcut *switchSearchShortcut2;
|
||||
QShortcut *switchDownShortcut;
|
||||
QShortcut *switchUpShortcut;
|
||||
QShortcut *switchTransferShortcut;
|
||||
QShortcut *switchRSSShortcut;
|
||||
// Widgets
|
||||
QAction *prioSeparator;
|
||||
QAction *prioSeparator2;
|
||||
QSplitter *hSplitter;
|
||||
QSplitter *vSplitter;
|
||||
// Search
|
||||
SearchEngine *searchEngine;
|
||||
// RSS
|
||||
RSSImp *rssWidget;
|
||||
// Web UI
|
||||
QPointer<HttpServer> httpServer;
|
||||
QPointer<RSSImp> rssWidget;
|
||||
// Misc
|
||||
#ifdef QT_4_4
|
||||
QLocalServer *localServer;
|
||||
QLocalSocket *clientConnection;
|
||||
#else
|
||||
QTcpServer *localServer;
|
||||
QTcpSocket *clientConnection;
|
||||
#endif
|
||||
|
||||
protected slots:
|
||||
// GUI related slots
|
||||
@@ -129,60 +105,36 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
void on_actionShow_console_triggered();
|
||||
void readParamsOnSocket();
|
||||
void acceptConnection();
|
||||
void togglePausedState(QString hash);
|
||||
void torrentDoubleClicked(QString hash, bool finished);
|
||||
void on_actionPreview_file_triggered();
|
||||
void previewFile(QString filePath);
|
||||
void balloonClicked();
|
||||
void writeSettings();
|
||||
void readSettings();
|
||||
void on_actionExit_triggered();
|
||||
void createTrayIcon();
|
||||
void updateUnfinishedTorrentNumber(unsigned int nb);
|
||||
void updateFinishedTorrentNumber(unsigned int nb);
|
||||
void fullDiskError(QTorrentHandle& h, QString msg) const;
|
||||
void handleDownloadFromUrlFailure(QString, QString) const;
|
||||
void createSystrayDelayed();
|
||||
void setPaused(QTorrentHandle &h) const;
|
||||
void tab_changed(int);
|
||||
// Keyboard shortcuts
|
||||
void createKeyboardShortcuts();
|
||||
void displayDownTab() const;
|
||||
void displayUpTab() const;
|
||||
void displayTransferTab() const;
|
||||
void displaySearchTab() const;
|
||||
void displayRSSTab() const;
|
||||
// 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_download_limit_triggered();
|
||||
void on_actionDocumentation_triggered() const;
|
||||
void checkConnectionStatus();
|
||||
void configureSession(bool deleteOptions);
|
||||
void on_actionOpen_triggered();
|
||||
void updateGUI();
|
||||
void loadPreferences(bool configure_session=true);
|
||||
void processParams(const QStringList& params);
|
||||
void addTorrent(QString path);
|
||||
void addUnauthenticatedTracker(QPair<QTorrentHandle,QString> tracker);
|
||||
void processDownloadedFiles(QString path, QString url);
|
||||
void downloadFromURLList(const QStringList& urls);
|
||||
void deleteTorrent(QString hash);
|
||||
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
|
||||
void on_actionOptions_triggered();
|
||||
void OptionsSaved(bool deleteOptions);
|
||||
void optionsSaved();
|
||||
// HTTP slots
|
||||
void on_actionDownload_from_URL_triggered();
|
||||
|
||||
@@ -190,10 +142,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
public slots:
|
||||
void trackerAuthenticationRequired(QTorrentHandle& h);
|
||||
void setTabText(int index, QString text) const;
|
||||
void openDestinationFolder() const;
|
||||
void goBuyPage() const;
|
||||
void copyMagnetURI() const;
|
||||
void updateRatio();
|
||||
void showNotificationBaloon(QString title, QString msg) const;
|
||||
|
||||
protected:
|
||||
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: 459 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/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,32 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;Network;P2P
|
||||
Comment=V1.5.0
|
||||
Categories=Qt;Network;P2P;
|
||||
Comment=V2.0.2
|
||||
Exec=qbittorrent %f
|
||||
GenericName=Bittorrent client
|
||||
GenericName[bg]=Торент клиент
|
||||
GenericName[cs]=Bittorrent klient
|
||||
GenericName[de]=Bittorren Client
|
||||
GenericName[el]=Τορεντ πελάτης
|
||||
GenericName[el]=Bittorrent πελάτης
|
||||
GenericName[es]=Cliente Bittorrent
|
||||
GenericName[fi]=Bittorrent-ohjelma
|
||||
GenericName[fr]=Client Bittorrent
|
||||
GenericName[hu]=Bittorrent kliens
|
||||
GenericName[it]=Client Bittorrent
|
||||
GenericName[ja]=Bittorrent クライアント
|
||||
GenericName[ko]=비토렌트 클라이언트
|
||||
GenericName[nl]=Bittorrent client
|
||||
GenericName[nl]=Bittorrent-cliënt
|
||||
GenericName[pl]=Klient Bittorrent
|
||||
GenericName[pt]=Cliente Bittorrent
|
||||
GenericName[pt_BR]=Cliente Bittorrent
|
||||
GenericName[ro]=Client Bittorrent
|
||||
GenericName[ru]=клиент Bittorrent
|
||||
GenericName[sk]=Klient siete Bittorrent
|
||||
GenericName[sr]=Bittorrent-клијент
|
||||
GenericName[sv]=Bittorrent-klient
|
||||
GenericName[tr]=Bittorrent istemcisi
|
||||
GenericName[uk]=Bittorrent-клієнт
|
||||
GenericName[zh]=Bittorrent之用户
|
||||
GenericName[zh_TW]=Bittorrent客戶端
|
||||
Icon=qbittorrent
|
||||
MimeType=application/x-bittorrent;
|
||||
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.2 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: 2.9 KiB |
BIN
src/Icons/skin/queuedUP.png
Normal file
|
After Width: | Height: | Size: 2.9 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: 79 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.2 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.1 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
|
||||
@@ -1,186 +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 <QDir>
|
||||
#include <QTreeView>
|
||||
#include <QStandardItemModel>
|
||||
#include <QHeaderView>
|
||||
#include <QSettings>
|
||||
|
||||
#include "SearchTab.h"
|
||||
#include "SearchListDelegate.h"
|
||||
#include "misc.h"
|
||||
#include "searchEngine.h"
|
||||
|
||||
#define SEARCH_NAME 0
|
||||
#define SEARCH_SIZE 1
|
||||
#define SEARCH_SEEDERS 2
|
||||
#define SEARCH_LEECHERS 3
|
||||
#define SEARCH_ENGINE 4
|
||||
|
||||
SearchTab::SearchTab(SearchEngine *parent) : QWidget()
|
||||
{
|
||||
box=new QVBoxLayout();
|
||||
results_lbl=new QLabel();
|
||||
resultsBrowser = new QTreeView();
|
||||
resultsBrowser->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
box->addWidget(results_lbl);
|
||||
box->addWidget(resultsBrowser);
|
||||
|
||||
setLayout(box);
|
||||
// Set Search results list model
|
||||
SearchListModel = new QStandardItemModel(0,6);
|
||||
SearchListModel->setHeaderData(SEARCH_NAME, Qt::Horizontal, tr("Name", "i.e: file name"));
|
||||
SearchListModel->setHeaderData(SEARCH_SIZE, Qt::Horizontal, tr("Size", "i.e: file size"));
|
||||
SearchListModel->setHeaderData(SEARCH_SEEDERS, Qt::Horizontal, tr("Seeders", "i.e: Number of full sources"));
|
||||
SearchListModel->setHeaderData(SEARCH_LEECHERS, Qt::Horizontal, tr("Leechers", "i.e: Number of partial sources"));
|
||||
SearchListModel->setHeaderData(SEARCH_ENGINE, Qt::Horizontal, tr("Search engine"));
|
||||
resultsBrowser->setModel(SearchListModel);
|
||||
resultsBrowser->hideColumn(URL_COLUMN); // Hide url column
|
||||
SearchDelegate = new SearchListDelegate();
|
||||
resultsBrowser->setItemDelegate(SearchDelegate);
|
||||
// Make search list header clickable for sorting
|
||||
resultsBrowser->header()->setClickable(true);
|
||||
resultsBrowser->header()->setSortIndicatorShown(true);
|
||||
|
||||
// Connect signals to slots (search part)
|
||||
connect(resultsBrowser, SIGNAL(doubleClicked(const QModelIndex&)), parent, SLOT(downloadSelectedItem(const QModelIndex&)));
|
||||
connect(resultsBrowser->header(), SIGNAL(sectionPressed(int)), this, SLOT(sortSearchList(int)));
|
||||
|
||||
// Load last columns width for search results list
|
||||
if(!loadColWidthResultsList()){
|
||||
resultsBrowser->header()->resizeSection(0, 275);
|
||||
}
|
||||
}
|
||||
|
||||
SearchTab::~SearchTab() {
|
||||
delete resultsBrowser;
|
||||
delete SearchListModel;
|
||||
delete SearchDelegate;
|
||||
}
|
||||
|
||||
QHeaderView* SearchTab::header() const {
|
||||
return resultsBrowser->header();
|
||||
}
|
||||
|
||||
bool SearchTab::loadColWidthResultsList() {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
QString line = settings.value("SearchResultsColsWidth", QString()).toString();
|
||||
if(line.isEmpty())
|
||||
return false;
|
||||
QStringList width_list = line.split(' ');
|
||||
if(width_list.size() < SearchListModel->columnCount())
|
||||
return false;
|
||||
unsigned int listSize = width_list.size();
|
||||
for(unsigned int i=0; i<listSize; ++i){
|
||||
resultsBrowser->header()->resizeSection(i, width_list.at(i).toInt());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QLabel* SearchTab::getCurrentLabel()
|
||||
{
|
||||
return results_lbl;
|
||||
}
|
||||
|
||||
QTreeView* SearchTab::getCurrentTreeView()
|
||||
{
|
||||
return resultsBrowser;
|
||||
}
|
||||
|
||||
QStandardItemModel* SearchTab::getCurrentSearchListModel()
|
||||
{
|
||||
return SearchListModel;
|
||||
}
|
||||
|
||||
// Set the color of a row in data model
|
||||
void SearchTab::setRowColor(int row, QString color){
|
||||
for(int i=0; i<SearchListModel->columnCount(); ++i){
|
||||
SearchListModel->setData(SearchListModel->index(row, i), QVariant(QColor(color)), Qt::ForegroundRole);
|
||||
}
|
||||
}
|
||||
|
||||
void SearchTab::sortSearchList(int index){
|
||||
static Qt::SortOrder sortOrder = Qt::AscendingOrder;
|
||||
if(resultsBrowser->header()->sortIndicatorSection() == index){
|
||||
sortOrder = (sortOrder == Qt::DescendingOrder) ? Qt::AscendingOrder : Qt::DescendingOrder; ;
|
||||
}
|
||||
resultsBrowser->header()->setSortIndicator(index, sortOrder);
|
||||
switch(index){
|
||||
case SEEDERS:
|
||||
case LEECHERS:
|
||||
case SIZE:
|
||||
sortSearchListInt(index, sortOrder);
|
||||
break;
|
||||
default:
|
||||
sortSearchListString(index, sortOrder);
|
||||
}
|
||||
}
|
||||
|
||||
void SearchTab::sortSearchListInt(int index, Qt::SortOrder sortOrder){
|
||||
QList<QPair<int, qlonglong> > lines;
|
||||
// Insertion sorting
|
||||
for(int i=0; i<SearchListModel->rowCount(); ++i){
|
||||
misc::insertSort(lines, QPair<int,qlonglong>(i, SearchListModel->data(SearchListModel->index(i, index)).toLongLong()), sortOrder);
|
||||
}
|
||||
// Insert items in new model, in correct order
|
||||
int nbRows_old = lines.size();
|
||||
for(int row=0; row<lines.size(); ++row){
|
||||
SearchListModel->insertRow(SearchListModel->rowCount());
|
||||
int sourceRow = lines[row].first;
|
||||
for(int col=0; col<6; ++col){
|
||||
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col)));
|
||||
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole);
|
||||
}
|
||||
}
|
||||
// Remove old rows
|
||||
SearchListModel->removeRows(0, nbRows_old);
|
||||
}
|
||||
|
||||
void SearchTab::sortSearchListString(int index, Qt::SortOrder sortOrder){
|
||||
QList<QPair<int, QString> > lines;
|
||||
// Insetion sorting
|
||||
for(int i=0; i<SearchListModel->rowCount(); ++i){
|
||||
misc::insertSortString(lines, QPair<int, QString>(i, SearchListModel->data(SearchListModel->index(i, index)).toString()), sortOrder);
|
||||
}
|
||||
// Insert items in new model, in correct order
|
||||
int nbRows_old = lines.size();
|
||||
for(int row=0; row<nbRows_old; ++row){
|
||||
SearchListModel->insertRow(SearchListModel->rowCount());
|
||||
int sourceRow = lines[row].first;
|
||||
for(int col=0; col<6; ++col){
|
||||
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col)));
|
||||
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole);
|
||||
}
|
||||
}
|
||||
// Remove old rows
|
||||
SearchListModel->removeRows(0, nbRows_old);
|
||||
}
|
||||
|
||||
@@ -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>"));
|
||||
// Thanks
|
||||
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("<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 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 am grateful to Peter Koeleman (peter@qbittorrent.org) who is helping port qBittorrent to Windows.</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 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, 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) 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->scrollToAnchor(QString::fromUtf8("top"));
|
||||
// Translation
|
||||
@@ -75,13 +75,14 @@ class about : public QDialog, private Ui::AboutDlg{
|
||||
- <u>Greek:</u> Tsvetan Bankov (emerge_life@users.sourceforge.net)<br>\
|
||||
- <u>Hungarian:</u> Majoros Péter (majoros.peterj@gmail.com)<br>\
|
||||
- <u>Italian:</u> Mirko Ferrari (mirkoferrari@gmail.com) and Ferraro Luciano (luciano.ferraro@gmail.com)<br>\
|
||||
- <u>Japanese:</u> Nardog (nardog@e2umail.com)<br>\
|
||||
- <u>Japanese:</u> Nardog (alphisation@gmail.com)<br>\
|
||||
- <u>Korean:</u> Jin Woo Sin (jin828sin@users.sourceforge.net)<br>\
|
||||
- <u>Norwegian:</u> Lars-Erik Labori (hamil@users.sourceforge.net)<br>\
|
||||
- <u>Polish:</u> Jarek Smieja (ajep9691@wp.pl)<br>\
|
||||
- <u>Polish:</u> Mariusz Fik (fisiu@opensuse.org)<br>\
|
||||
- <u>Portuguese:</u> Nick Marinho (nickmarinho@gmail.com)<br>\
|
||||
- <u>Romanian:</u> Obada Denis (obadadenis@users.sourceforge.net)<br>\
|
||||
- <u>Russian:</u> Nick Khazov (m2k3d0n@users.sourceforge.net) and Alexey Morsov (samurai@ricom.ru)<br>\
|
||||
- <u>Serbian:</u> Anaximandar Milet (anaximandar@operamail.com)<br>\
|
||||
- <u>Slovak:</u> helix84<br>\
|
||||
- <u>Spanish:</u> Vicente Raul Plata Fonseca (silverxnt@users.sourceforge.net) and Gabriel de Oliveira (deadloop@hotmail.com)<br>\
|
||||
- <u>Swedish:</u> Daniel Nylander (po@danielnylander.se)<br>\
|
||||
|
||||
@@ -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>
|
||||
1368
src/bittorrent.cpp
319
src/bittorrent.h
@@ -31,6 +31,8 @@
|
||||
#define __BITTORRENT_H__
|
||||
|
||||
#include <QHash>
|
||||
#include <QMap>
|
||||
#include <QUrl>
|
||||
#include <QStringList>
|
||||
#include <QApplication>
|
||||
#include <QPalette>
|
||||
@@ -42,156 +44,195 @@
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
#define MAX_SAMPLES 20
|
||||
|
||||
class downloadThread;
|
||||
class QTimer;
|
||||
class QFileSystemWatcher;
|
||||
class QMutex;
|
||||
class FileSystemWatcher;
|
||||
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
|
||||
|
||||
private:
|
||||
session *s;
|
||||
QPointer<QFileSystemWatcher> FSWatcher;
|
||||
QMutex* FSMutex;
|
||||
QPointer<QTimer> timerAlerts;
|
||||
QPointer<QTimer> BigRatioTimer;
|
||||
bool DHTEnabled;
|
||||
QPointer<downloadThread> downloader;
|
||||
QString defaultSavePath;
|
||||
QString defaultTempPath;
|
||||
QHash<QString, QHash<QString, QString> > trackersErrors;
|
||||
QStringList consoleMessages;
|
||||
QStringList peerBanMessages;
|
||||
bool preAllocateAll;
|
||||
bool addInPause;
|
||||
int maxConnecsPerTorrent;
|
||||
int maxUploadsPerTorrent;
|
||||
float ratio_limit;
|
||||
bool UPnPEnabled;
|
||||
bool NATPMPEnabled;
|
||||
bool LSDEnabled;
|
||||
QPointer<FilterParserThread> filterParser;
|
||||
QString filterPath;
|
||||
bool queueingEnabled;
|
||||
QStringList url_skippingDlg;
|
||||
QHash<QString, QString> savepath_fromurl;
|
||||
private:
|
||||
// Bittorrent
|
||||
session *s;
|
||||
QPointer<QTimer> timerAlerts;
|
||||
QMap<QUrl, QString> savepath_fromurl;
|
||||
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
||||
// Ratio
|
||||
QPointer<QTimer> BigRatioTimer;
|
||||
// HTTP
|
||||
QPointer<downloadThread> downloader;
|
||||
// File System
|
||||
QPointer<FileSystemWatcher> FSWatcher;
|
||||
// Console / Log
|
||||
QStringList consoleMessages;
|
||||
QStringList peerBanMessages;
|
||||
// Settings
|
||||
bool preAllocateAll;
|
||||
bool addInPause;
|
||||
float ratio_limit;
|
||||
bool UPnPEnabled;
|
||||
bool NATPMPEnabled;
|
||||
bool LSDEnabled;
|
||||
bool DHTEnabled;
|
||||
bool queueingEnabled;
|
||||
QString defaultSavePath;
|
||||
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;
|
||||
QList<QUrl> url_skippingDlg;
|
||||
// Fast exit (async)
|
||||
bool exiting;
|
||||
|
||||
protected:
|
||||
QString getSavePath(QString hash);
|
||||
protected:
|
||||
QString getSavePath(QString hash);
|
||||
bool initWebUi(QString username, QString password, int port);
|
||||
|
||||
public:
|
||||
// Constructor / Destructor
|
||||
bittorrent();
|
||||
~bittorrent();
|
||||
QTorrentHandle getTorrentHandle(QString hash) const;
|
||||
std::vector<torrent_handle> getTorrents() const;
|
||||
bool isFilePreviewPossible(QString fileHash) const;
|
||||
bool isDHTEnabled() const;
|
||||
float getPayloadDownloadRate() const;
|
||||
float getPayloadUploadRate() const;
|
||||
session_status getSessionStatus() const;
|
||||
int getListenPort() const;
|
||||
float getRealRatio(QString hash) const;
|
||||
session* getSession() const;
|
||||
QHash<QString, QString> getTrackersErrors(QString hash) const;
|
||||
bool has_filtered_files(QString hash) const;
|
||||
unsigned int getFinishedPausedTorrentsNb() const;
|
||||
unsigned int getUnfinishedPausedTorrentsNb() const;
|
||||
bool isQueueingEnabled() const;
|
||||
int getDlTorrentPriority(QString hash) const;
|
||||
int getUpTorrentPriority(QString hash) const;
|
||||
int getMaximumActiveDownloads() const;
|
||||
int getMaximumActiveTorrents() const;
|
||||
int loadTorrentPriority(QString hash);
|
||||
QStringList getConsoleMessages() const;
|
||||
QStringList getPeerBanMessages() const;
|
||||
qlonglong getETA(QString hash) const;
|
||||
bool useTemporaryFolder() const;
|
||||
QString getDefaultSavePath() const;
|
||||
public:
|
||||
// Constructor / Destructor
|
||||
Bittorrent();
|
||||
~Bittorrent();
|
||||
QTorrentHandle getTorrentHandle(QString hash) const;
|
||||
std::vector<torrent_handle> getTorrents() const;
|
||||
bool isFilePreviewPossible(QString fileHash) const;
|
||||
bool isDHTEnabled() const;
|
||||
bool isLSDEnabled() const;
|
||||
float getPayloadDownloadRate() const;
|
||||
float getPayloadUploadRate() const;
|
||||
session_status getSessionStatus() const;
|
||||
int getListenPort() const;
|
||||
float getRealRatio(QString hash) const;
|
||||
session* getSession() const;
|
||||
QHash<QString, TrackerInfos> getTrackersInfo(QString hash) const;
|
||||
bool hasActiveTorrents() const;
|
||||
bool isQueueingEnabled() const;
|
||||
int getMaximumActiveDownloads() const;
|
||||
int getMaximumActiveTorrents() const;
|
||||
int loadTorrentPriority(QString hash);
|
||||
QStringList getConsoleMessages() const;
|
||||
QStringList getPeerBanMessages() const;
|
||||
qlonglong getETA(QString hash);
|
||||
bool useTemporaryFolder() const;
|
||||
QString getDefaultSavePath() const;
|
||||
|
||||
public slots:
|
||||
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
||||
QTorrentHandle addMagnetUri(QString magnet_uri, bool resumed=false);
|
||||
void importOldTorrents();
|
||||
void importOldTempData(QString torrent_path);
|
||||
void loadSessionState();
|
||||
void saveSessionState();
|
||||
void downloadFromUrl(QString url);
|
||||
void deleteTorrent(QString hash, bool permanent = false);
|
||||
void startUpTorrents();
|
||||
/* Needed by Web UI */
|
||||
void pauseAllTorrents();
|
||||
void pauseTorrent(QString hash);
|
||||
void resumeTorrent(QString hash);
|
||||
void resumeAllTorrents();
|
||||
/* End Web UI */
|
||||
void saveDHTEntry();
|
||||
void preAllocateAllFiles(bool b);
|
||||
void saveFastResumeData();
|
||||
void enableDirectoryScanning(QString scan_dir);
|
||||
void disableDirectoryScanning();
|
||||
void enableIPFilter(QString filter);
|
||||
void disableIPFilter();
|
||||
void setQueueingEnabled(bool enable);
|
||||
void saveTorrentSpeedLimits(QString hash);
|
||||
void loadTorrentSpeedLimits(QString hash);
|
||||
void handleDownloadFailure(QString url, QString reason);
|
||||
void loadWebSeeds(QString fileHash);
|
||||
void increaseDlTorrentPriority(QString hash);
|
||||
void decreaseDlTorrentPriority(QString hash);
|
||||
void downloadUrlAndSkipDialog(QString url, QString save_path=QString::null);
|
||||
// Session configuration - Setters
|
||||
void setListeningPort(int port);
|
||||
void setMaxConnections(int maxConnec);
|
||||
void setMaxConnectionsPerTorrent(int max);
|
||||
void setMaxUploadsPerTorrent(int max);
|
||||
void setDownloadRateLimit(long rate);
|
||||
void setUploadRateLimit(long rate);
|
||||
void setGlobalRatio(float ratio);
|
||||
void setDeleteRatio(float ratio);
|
||||
void setDHTPort(int dht_port);
|
||||
void setProxySettings(proxy_settings proxySettings, bool trackers=true, bool peers=true, bool web_seeds=true, bool dht=true);
|
||||
void setSessionSettings(session_settings sessionSettings);
|
||||
void startTorrentsInPause(bool b);
|
||||
void setDefaultSavePath(QString savepath);
|
||||
void setDefaultTempPath(QString temppath);
|
||||
void applyEncryptionSettings(pe_settings se);
|
||||
void loadFilesPriorities(QTorrentHandle& h);
|
||||
void setDownloadLimit(QString hash, long val);
|
||||
void setUploadLimit(QString hash, long val);
|
||||
void enableUPnP(bool b);
|
||||
void enableNATPMP(bool b);
|
||||
void enableLSD(bool b);
|
||||
bool enableDHT(bool b);
|
||||
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
|
||||
void addPeerBanMessage(QString msg, bool from_ipfilter);
|
||||
void processDownloadedFile(QString, QString);
|
||||
void saveTrackerFile(QString hash);
|
||||
void addMagnetSkipAddDlg(QString uri);
|
||||
public slots:
|
||||
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
||||
QTorrentHandle addMagnetUri(QString magnet_uri, bool resumed=false);
|
||||
void importOldTorrents();
|
||||
void applyFormerAttributeFiles(QTorrentHandle h);
|
||||
void importOldTempData(QString torrent_path);
|
||||
void loadSessionState();
|
||||
void saveSessionState();
|
||||
void downloadFromUrl(QString url);
|
||||
void deleteTorrent(QString hash, bool delete_local_files = false);
|
||||
void startUpTorrents();
|
||||
session_proxy asyncDeletion();
|
||||
/* Needed by Web UI */
|
||||
void pauseAllTorrents();
|
||||
void pauseTorrent(QString hash);
|
||||
void resumeTorrent(QString hash);
|
||||
void resumeAllTorrents();
|
||||
/* End Web UI */
|
||||
void saveDHTEntry();
|
||||
void preAllocateAllFiles(bool b);
|
||||
void saveFastResumeData();
|
||||
void enableDirectoryScanning(QString scan_dir);
|
||||
void disableDirectoryScanning();
|
||||
void enableIPFilter(QString filter);
|
||||
void disableIPFilter();
|
||||
void setQueueingEnabled(bool enable);
|
||||
void handleDownloadFailure(QString url, QString reason);
|
||||
void downloadUrlAndSkipDialog(QString url, QString save_path=QString::null);
|
||||
// Session configuration - Setters
|
||||
void setListeningPort(int port);
|
||||
void setMaxConnections(int maxConnec);
|
||||
void setMaxConnectionsPerTorrent(int max);
|
||||
void setMaxUploadsPerTorrent(int max);
|
||||
void setDownloadRateLimit(long rate);
|
||||
void setUploadRateLimit(long rate);
|
||||
void setGlobalRatio(float ratio);
|
||||
void setDeleteRatio(float ratio);
|
||||
void setDHTPort(int dht_port);
|
||||
void setProxySettings(proxy_settings proxySettings, bool trackers=true, bool peers=true, bool web_seeds=true, bool dht=true);
|
||||
void setSessionSettings(session_settings sessionSettings);
|
||||
void startTorrentsInPause(bool b);
|
||||
void setDefaultTempPath(QString temppath);
|
||||
void applyEncryptionSettings(pe_settings se);
|
||||
void setDownloadLimit(QString hash, long val);
|
||||
void setUploadLimit(QString hash, long val);
|
||||
void enableUPnP(bool b);
|
||||
void enableNATPMP(bool b);
|
||||
void enableLSD(bool b);
|
||||
bool enableDHT(bool b);
|
||||
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
|
||||
void addPeerBanMessage(QString msg, bool from_ipfilter);
|
||||
void processDownloadedFile(QString, QString);
|
||||
void addMagnetSkipAddDlg(QString uri);
|
||||
void downloadFromURLList(const QStringList& urls);
|
||||
void configureSession();
|
||||
void banIP(QString ip);
|
||||
|
||||
protected slots:
|
||||
void scanDirectory(QString);
|
||||
void readAlerts();
|
||||
void loadTrackerFile(QString hash);
|
||||
void deleteBigRatios();
|
||||
protected slots:
|
||||
void addTorrentsFromScanFolder(QStringList&);
|
||||
void readAlerts();
|
||||
void deleteBigRatios();
|
||||
void takeETASamples();
|
||||
|
||||
signals:
|
||||
void addedTorrent(QTorrentHandle& h);
|
||||
void deletedTorrent(QString hash);
|
||||
void pausedTorrent(QTorrentHandle& h);
|
||||
void resumedTorrent(QTorrentHandle& h);
|
||||
void finishedTorrent(QTorrentHandle& h);
|
||||
void fullDiskError(QTorrentHandle& h, QString msg);
|
||||
void trackerError(QString hash, QString time, QString msg);
|
||||
void trackerAuthenticationRequired(QTorrentHandle& h);
|
||||
void newDownloadedTorrent(QString path, QString url);
|
||||
void updateFileSize(QString hash);
|
||||
void downloadFromUrlFailure(QString url, QString reason);
|
||||
void torrentFinishedChecking(QTorrentHandle& h);
|
||||
void metadataReceived(QTorrentHandle &h);
|
||||
void torrentPaused(QTorrentHandle &h);
|
||||
signals:
|
||||
void addedTorrent(QTorrentHandle& h);
|
||||
void deletedTorrent(QString hash);
|
||||
void pausedTorrent(QTorrentHandle& h);
|
||||
void resumedTorrent(QTorrentHandle& h);
|
||||
void finishedTorrent(QTorrentHandle& h);
|
||||
void fullDiskError(QTorrentHandle& h, QString msg);
|
||||
void trackerError(QString hash, QString time, QString msg);
|
||||
void trackerAuthenticationRequired(QTorrentHandle& h);
|
||||
void newDownloadedTorrent(QString path, QString url);
|
||||
void updateFileSize(QString hash);
|
||||
void downloadFromUrlFailure(QString url, QString reason);
|
||||
void torrentFinishedChecking(QTorrentHandle& h);
|
||||
void metadataReceived(QTorrentHandle &h);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,10 +40,10 @@ class consoleDlg : public QDialog, private Ui_ConsoleDlg{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
bittorrent *BTSession;
|
||||
Bittorrent *BTSession;
|
||||
|
||||
public:
|
||||
consoleDlg(QWidget *parent, bittorrent* _BTSession) : QDialog(parent) {
|
||||
consoleDlg(QWidget *parent, Bittorrent* _BTSession) : QDialog(parent) {
|
||||
setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
BTSession = _BTSession;
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <libtorrent/file_pool.hpp>
|
||||
#include <libtorrent/create_torrent.hpp>
|
||||
|
||||
#include "torrentpersistentdata.h"
|
||||
#include "createtorrent_imp.h"
|
||||
#include "misc.h"
|
||||
|
||||
@@ -56,9 +57,9 @@ using namespace boost::filesystem;
|
||||
// name starts with a .
|
||||
bool file_filter(boost::filesystem::path const& filename)
|
||||
{
|
||||
if (filename.leaf()[0] == '.') return false;
|
||||
std::cerr << filename << std::endl;
|
||||
return true;
|
||||
if (filename.leaf()[0] == '.') return false;
|
||||
std::cerr << filename << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
createtorrent::createtorrent(QWidget *parent): QDialog(parent){
|
||||
@@ -98,30 +99,30 @@ void createtorrent::on_removeTracker_button_clicked() {
|
||||
|
||||
int createtorrent::getPieceSize() const {
|
||||
switch(comboPieceSize->currentIndex()) {
|
||||
case 0:
|
||||
return 32*1024;
|
||||
case 1:
|
||||
return 64*1024;
|
||||
case 2:
|
||||
return 128*1024;
|
||||
case 3:
|
||||
return 256*1024;
|
||||
case 4:
|
||||
return 512*1024;
|
||||
case 5:
|
||||
return 1024*1024;
|
||||
case 6:
|
||||
return 2048*1024;
|
||||
default:
|
||||
return 256*1024;
|
||||
case 0:
|
||||
return 32*1024;
|
||||
case 1:
|
||||
return 64*1024;
|
||||
case 2:
|
||||
return 128*1024;
|
||||
case 3:
|
||||
return 256*1024;
|
||||
case 4:
|
||||
return 512*1024;
|
||||
case 5:
|
||||
return 1024*1024;
|
||||
case 6:
|
||||
return 2048*1024;
|
||||
default:
|
||||
return 256*1024;
|
||||
}
|
||||
}
|
||||
|
||||
void createtorrent::on_addTracker_button_clicked() {
|
||||
bool ok;
|
||||
QString URL = QInputDialog::getText(this, tr("Please type an announce URL"),
|
||||
tr("Announce URL:", "Tracker URL"), QLineEdit::Normal,
|
||||
"http://", &ok);
|
||||
tr("Announce URL:", "Tracker URL"), QLineEdit::Normal,
|
||||
"http://", &ok);
|
||||
if(ok){
|
||||
if(trackers_list->findItems(URL, Qt::MatchFixedString).size() == 0)
|
||||
trackers_list->addItem(URL);
|
||||
@@ -139,8 +140,8 @@ void createtorrent::on_removeURLSeed_button_clicked(){
|
||||
void createtorrent::on_addURLSeed_button_clicked(){
|
||||
bool ok;
|
||||
QString URL = QInputDialog::getText(this, tr("Please type a web seed url"),
|
||||
tr("Web seed URL:"), QLineEdit::Normal,
|
||||
"http://", &ok);
|
||||
tr("Web seed URL:"), QLineEdit::Normal,
|
||||
"http://", &ok);
|
||||
if(ok){
|
||||
if(URLSeeds_list->findItems(URL, Qt::MatchFixedString).size() == 0)
|
||||
URLSeeds_list->addItem(URL);
|
||||
@@ -187,24 +188,25 @@ void createtorrent::handleCreationFailure(QString msg) {
|
||||
}
|
||||
|
||||
void createtorrent::handleCreationSuccess(QString path, const char* branch_path) {
|
||||
if(checkStartSeeding->isChecked()) {
|
||||
// Create save path file
|
||||
boost::intrusive_ptr<torrent_info> t;
|
||||
try {
|
||||
t = new torrent_info(path.toLocal8Bit().data());
|
||||
} catch(std::exception&) {
|
||||
QMessageBox::critical(0, tr("Torrent creation"), tr("Created torrent file is invalid. It won't be added to download list."));
|
||||
return;
|
||||
}
|
||||
QString hash = misc::toQString(t->info_hash());
|
||||
QFile savepath_file(misc::qBittorrentPath()+QString::fromUtf8("BT_backup")+QDir::separator()+hash+QString::fromUtf8(".savepath"));
|
||||
savepath_file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
savepath_file.write(branch_path);
|
||||
savepath_file.close();
|
||||
emit torrent_to_seed(path);
|
||||
if(checkStartSeeding->isChecked()) {
|
||||
// Create save path temp data
|
||||
boost::intrusive_ptr<torrent_info> t;
|
||||
try {
|
||||
t = new torrent_info(path.toLocal8Bit().data());
|
||||
} catch(std::exception&) {
|
||||
QMessageBox::critical(0, tr("Torrent creation"), tr("Created torrent file is invalid. It won't be added to download list."));
|
||||
return;
|
||||
}
|
||||
QMessageBox::information(0, tr("Torrent creation"), tr("Torrent was created successfully:")+" "+path);
|
||||
close();
|
||||
QString hash = misc::toQString(t->info_hash());
|
||||
TorrentTempData::setSavePath(hash, QString(branch_path));
|
||||
#ifdef LIBTORRENT_0_15
|
||||
// Enable seeding mode (do not recheck the files)
|
||||
TorrentTempData::setSeedingMode(hash, true);
|
||||
#endif
|
||||
emit torrent_to_seed(path);
|
||||
}
|
||||
QMessageBox::information(0, tr("Torrent creation"), tr("Torrent was created successfully:")+" "+path);
|
||||
close();
|
||||
}
|
||||
|
||||
void createtorrent::updateProgressBar(int progress) {
|
||||
@@ -228,7 +230,7 @@ void torrentCreatorThread::create(QString _input_path, QString _save_path, QStri
|
||||
}
|
||||
|
||||
void sendProgressUpdateSignal(int i, int num, torrentCreatorThread *parent){
|
||||
parent->sendProgressSignal((int)(i*100./(float)num));
|
||||
parent->sendProgressSignal((int)(i*100./(float)num));
|
||||
}
|
||||
|
||||
void torrentCreatorThread::sendProgressSignal(int progress) {
|
||||
|
||||