Compare commits

..

136 Commits

Author SHA1 Message Date
Christophe Dumez
7c79537176 Tagged v2.4.11 release 2010-11-21 17:48:37 +00:00
Christophe Dumez
2b45e1baa3 Fix HTTP redirect issue that would cause the torrent addition to show up for automated RSS downloads (Closes #677565) 2010-11-21 17:38:48 +00:00
Christophe Dumez
476b395166 Fix possible crash when setting RSS proxy (closes #676288) 2010-11-17 17:20:13 +00:00
Christophe Dumez
7157996dc2 Fix RSS refresh interval saving 2010-11-16 20:18:41 +00:00
Christophe Dumez
218f386502 BUGFIX: Fix possible incorrect behavior with queueing 2010-11-15 17:53:25 +00:00
Christophe Dumez
b492051d32 Updated Italian translation 2010-11-14 15:33:07 +00:00
Christophe Dumez
39c7d884c9 Updated italian translation 2010-11-14 15:30:54 +00:00
Christophe Dumez
4d2d0bf08d BUGFIX: Do not report a progress of 100% in the Web UI unless the
torrent is really complete (closes #674349)
2010-11-12 17:15:33 +00:00
Christophe Dumez
34c1fd759b Fix compilation warning 2010-11-11 21:11:33 +00:00
Christophe Dumez
922aebec9a Fix compilation error on Mac 2010-11-11 21:08:41 +00:00
Christophe Dumez
4d39b3accd Fix failure to build on Windows 2010-11-11 17:33:55 +00:00
Christophe Dumez
c713bd56e0 Bump to v2.4.10 2010-11-10 17:45:10 +00:00
Christophe Dumez
efcd652e3d - BUGFIX: Do not create the torrent root folder at final destination if
torrent is in the temp dir (closes #673271)
2010-11-10 17:39:21 +00:00
Christophe Dumez
8d6df1f15f More reliable folder scanning for torrents 2010-11-09 19:17:08 +00:00
Christophe Dumez
ca835a105b BUGFIX: Use a pointing cursor over status bar buttons 2010-11-08 18:25:21 +00:00
Christophe Dumez
2de1a7cc30 Updated Changelog 2010-11-07 11:38:54 +00:00
Christophe Dumez
3de83319a8 Improved IP address parsing 2010-11-07 11:38:02 +00:00
Christophe Dumez
cfc75905a2 Improved IPv6 support (thanks ver) 2010-11-07 10:43:26 +00:00
Christophe Dumez
2c30d5a1ca Fix compilation with libnotify v0.7.0 2010-11-06 09:28:49 +00:00
Christophe Dumez
d162d0c3c6 Draw the qBittorrent version on the splash screen at run time 2010-11-04 19:40:14 +00:00
Christophe Dumez
509eb9bcf0 Added qBittorrent version number to the debug stack trace 2010-11-02 18:16:33 +00:00
Christophe Dumez
1766877605 BUGFIX: Fix possible crash when selecting a RSS item (really closes #575624) 2010-11-02 18:06:20 +00:00
Christophe Dumez
fa78fba559 Updated Italian translation 2010-10-31 20:05:31 +00:00
Christophe Dumez
44ff7161aa BUGFIX: Fix and improve file priorities editing (closes #669084) 2010-10-31 16:14:11 +00:00
Christophe Dumez
96837a3658 Updated Changelog 2010-10-31 14:20:15 +00:00
Christophe Dumez
e4d93a96e7 Updated Changelog 2010-10-31 14:12:12 +00:00
Christophe Dumez
ccb2ed9a69 Fix possible crash on torrent removal 2010-10-31 14:11:11 +00:00
Christophe Dumez
ae5693544d Updated Changelog 2010-10-31 13:57:19 +00:00
Christophe Dumez
3a72c11e39 Fix torrent size update in torrent addition dialog 2010-10-31 13:56:22 +00:00
Christophe Dumez
4176abd18a Fix Arabic translation 2010-10-31 12:26:16 +00:00
Christophe Dumez
cba36fcb14 Added a donate link to the Help menu 2010-10-31 12:13:06 +00:00
Christophe Dumez
9f33656e61 Updated Changelog 2010-10-31 11:19:04 +00:00
Christophe Dumez
a4123a6462 Updated the name of the Italian translator 2010-10-31 11:13:06 +00:00
Christophe Dumez
313b2630bd Updated Croatian translation 2010-10-31 11:11:28 +00:00
Christophe Dumez
87b0ae9a79 Updated Italian translation 2010-10-31 11:09:20 +00:00
Christophe Dumez
81778a0090 Some more issues with virtual 2010-10-31 08:55:15 +00:00
Christophe Dumez
5d0d63d89a Declared function as virtual when it shouldn't 2010-10-31 08:49:36 +00:00
Christophe Dumez
764e8a365b BUGFIX: Make listening on a particular interface more reliable 2010-10-30 21:51:06 +00:00
Christophe Dumez
e302042520 Display the splash screen for 2 seconds instead 2010-10-30 21:18:38 +00:00
Christophe Dumez
e453eb9a91 Updated Italian translation 2010-10-30 20:34:41 +00:00
Christophe Dumez
98fcb91dae Make sure the splash screen is displayed for 3 seconds (Thanks Leigh) 2010-10-30 14:38:41 +00:00
Christophe Dumez
c8a1f625f0 Bump to v2.4.9 (release is planned for Halloween) 2010-10-30 14:04:40 +00:00
Christophe Dumez
b70cf7c049 BUGFIX: Correctly update total number of torrents when a torrent is automatically removed (closes #668726) 2010-10-30 13:59:07 +00:00
Christophe Dumez
ecdfe63d00 Updated language files 2010-10-28 17:11:48 +00:00
Christophe Dumez
7635fe51f7 BUGFIX: Fix possible crash on clicking a RSS article (closes #575624) 2010-10-28 17:09:00 +00:00
Christophe Dumez
8cba38ac62 - BUGFIX: Fix crash when deleting a torrent with no metadata (closes #667528)
- BUGFIX: Correctly display the hash of torrents with no metadata
2010-10-28 16:57:30 +00:00
Christophe Dumez
fab63e6ffc Fix properties display for torrents without metadata 2010-10-28 16:17:59 +00:00
Christophe Dumez
27f257ba03 BUGFIX: Elide status bar text if it is too wide 2010-10-26 17:57:07 +00:00
Christophe Dumez
a2aa462030 BUGFIX: Fix crash when pressing enter in save path field in torrent addition dialog 2010-10-26 16:39:14 +00:00
Christophe Dumez
0f44804225 Updated Arabic translation 2010-10-25 20:25:55 +00:00
Christophe Dumez
de78fc495b Fix compiling error 2010-10-24 10:12:37 +00:00
Christophe Dumez
93731f1b3f Bump to v2.2.8 2010-10-24 09:40:22 +00:00
Christophe Dumez
2e9e10299c Peers can now be sorted by country 2010-10-24 09:34:31 +00:00
Christophe Dumez
9f627b5ec9 BUGFIX: Better fix for save path editing issues in torrent addition dialog 2010-10-24 08:32:39 +00:00
Christophe Dumez
ad252f432a BUGFIX: Fix issue when altering files priorities of a seeding torrent (closes #665799) 2010-10-24 08:07:17 +00:00
Christophe Dumez
eb1feddea6 BUGFIX: Fix rounding issue in torrent progress display (closes #617733) 2010-10-23 19:14:01 +00:00
Christophe Dumez
1634014dde Fix status list widget height issue on style change (closes #603342) 2010-10-23 17:00:58 +00:00
Christophe Dumez
e863772159 Fix possible string encoding problem 2010-10-23 15:26:08 +00:00
Christophe Dumez
7c34f4e93c Update search plugin update URL 2010-10-22 20:14:21 +00:00
Christophe Dumez
91032056e1 Remember the current property tab on startup 2010-10-22 17:32:04 +00:00
Christophe Dumez
f427d267b6 BUGFIX: Auto-disable the shutdown feature 2010-10-21 16:55:44 +00:00
Christophe Dumez
a7a8265053 BUGFIX: Several search plugins fixed 2010-10-20 20:29:30 +00:00
Christophe Dumez
827fceca83 Fix torrentreactor search plugin 2010-10-20 19:51:47 +00:00
Christophe Dumez
7aaa3e8f51 Fix searching for something with {*} in it 2010-10-20 19:44:23 +00:00
Christophe Dumez
1fe49198d1 Improved hostname resolution code 2010-10-20 17:21:29 +00:00
Christophe Dumez
c582aff563 Updated Changelog 2010-10-20 16:17:49 +00:00
Christophe Dumez
5272f1cba3 Fix possible crash on manual peer ban 2010-10-20 16:17:11 +00:00
Christophe Dumez
b72d356083 Bump to v2.4.7 2010-10-19 17:05:06 +00:00
Christophe Dumez
fbd6533eee Update changelog 2010-10-19 16:54:53 +00:00
Christophe Dumez
2998dbd0a1 Fix possible transfer list refresh problem 2010-10-19 16:47:47 +00:00
Christophe Dumez
cb8da634f4 BUGFIX: Improved "Set Location" and "Change save path" dialogs 2010-10-18 19:25:58 +00:00
Christophe Dumez
e8f229816e BUGFIX: Fix issues when marking a file as 'not downloaded' causes the torrent to complete 2010-10-18 18:21:00 +00:00
Christophe Dumez
fe0fc952e8 - BUGFIX: Fix encoding problem in file renaming
- BUGFIX: Delete uneeded files on torrent "soft" deletion
2010-10-18 17:48:18 +00:00
Christophe Dumez
29a76ae600 BUGFIX: Display the priority column when the queueing system gets enabled 2010-10-18 17:08:25 +00:00
Christophe Dumez
5471600dfb Fix to German translation 2010-10-18 16:25:41 +00:00
Christophe Dumez
df42c4d59f Bump to v2.4.6 2010-10-17 15:27:25 +00:00
Christophe Dumez
8047495b2e BUGFIX: Fix moving of a torrent to an unexisting directory 2010-10-17 15:16:25 +00:00
Christophe Dumez
de04b47c29 BUGFIX: Fix detection of files at final destination when temp dir is used 2010-10-17 14:53:03 +00:00
Christophe Dumez
b709bec24d Fix compilation error with libtorrent v0.14 2010-10-17 11:47:16 +00:00
Christophe Dumez
35f93e8e16 BUGFIX: The properties panel data would sometimes not match the selected torrent 2010-10-17 09:12:24 +00:00
Christophe Dumez
554a84f8b0 Improvement to last commit 2010-10-17 09:01:34 +00:00
Christophe Dumez
f26fcabde1 BUGFIX: Fix "torrent seeding after creation" feature 2010-10-17 08:48:32 +00:00
Christophe Dumez
75b91c204d Forgot to commit this file 2010-10-17 08:42:34 +00:00
Christophe Dumez
0837c25602 Updated Changelog 2010-10-12 16:09:03 +00:00
Christophe Dumez
34f8937b8d Code optimization 2010-10-12 16:08:09 +00:00
Christophe Dumez
4a7f3ee415 Some more code optimization 2010-10-11 21:30:11 +00:00
Christophe Dumez
b218531ff7 BUGFIX: Piece availability/downloaded widgets performance improvement 2010-10-11 21:08:49 +00:00
Christophe Dumez
e96dee2038 Fix possible variable overflow 2010-10-11 20:01:56 +00:00
Christophe Dumez
080105c088 Bump to v2.4.5 2010-10-11 19:43:50 +00:00
Christophe Dumez
5d2535c1c1 BUGFIX: Improved peer hostname resolution with caching 2010-10-10 21:06:07 +00:00
Christophe Dumez
49b21059fa BUGFIX: Fix display of URL seeds in the UI 2010-10-10 15:43:53 +00:00
Christophe Dumez
c1af948649 Fix issues introduced recently related to torrent completion 2010-10-09 15:04:15 +00:00
Christophe Dumez
36ad3df9e7 Fix feature to keep incomplete torrents in a separate folder 2010-10-09 08:57:26 +00:00
Christophe Dumez
e607d721a2 Forgot to commit gpl.html 2010-10-08 17:52:10 +00:00
Christophe Dumez
5bfbfeb665 Fix some cosmetic issues in about dlg 2010-10-08 17:50:45 +00:00
Ishan Arora
1f1eabb1e9 moved windows path configs from src/src.pro to winconf.pri 2010-10-05 01:12:29 +00:00
Christophe Dumez
762050f8fc Remember torrent seeding date correctly 2010-10-02 12:55:39 +00:00
Christophe Dumez
e3c1270205 Code cleanup 2010-10-02 12:14:29 +00:00
Christophe Dumez
414685910b Fix to last commit 2010-10-01 20:52:53 +00:00
Christophe Dumez
d61b9c5d4d Bump to v2.4.4 2010-10-01 20:22:20 +00:00
Christophe Dumez
cf86a1cecd BUGFIX: Fix possible search engine plugin update 2010-10-01 20:19:17 +00:00
Christophe Dumez
a3f3287e24 Clean program exit on system shutdown/log out 2010-10-01 20:05:54 +00:00
Christophe Dumez
6e18d780ba Updated Changelog 2010-09-28 16:57:31 +00:00
Christophe Dumez
7dde763fc6 Fix wrong mapping to source model 2010-09-28 16:56:49 +00:00
Christophe Dumez
8c85ffca5f Fix tiny memory leak 2010-09-27 20:47:26 +00:00
Christophe Dumez
321e568d86 TorrentDownloads performance improvement 2010-09-27 19:48:58 +00:00
Christophe Dumez
e0649a7e78 Bump to v2.4.3 2010-09-27 17:49:33 +00:00
Christophe Dumez
4cd3233cd0 Better fix for encoding issue 2010-09-27 17:36:42 +00:00
Christophe Dumez
c554528afe BUGFIX: Fix possible crash when changing the save path in addition dialog 2010-09-27 17:35:34 +00:00
Christophe Dumez
7ab7f4b0fc BUGFIX: Fix encoding issue in command line parameters processing 2010-09-27 17:19:27 +00:00
Christophe Dumez
58c0ac7638 BUGFIX: Really fix manual editing of save path in torrent addition dialog 2010-09-26 17:10:21 +00:00
Christophe Dumez
2514224a3a Bump to v2.4.2 2010-09-26 16:57:04 +00:00
Christophe Dumez
247f6b4a8e BUGFIX: Fix display of torrent content in addition dialog 2010-09-26 16:53:20 +00:00
Christophe Dumez
3d89864b75 Fix deprecation warning 2010-09-26 11:15:00 +00:00
Christophe Dumez
7ac75ad772 Fix to last commit 2010-09-25 19:41:12 +00:00
Christophe Dumez
caa628371f BUGFIX: Limit torrent addition dialog width to fit the screen 2010-09-25 19:40:29 +00:00
Christophe Dumez
fd31f632d9 BUGFIX: Fix saving to drive root on Windows 2010-09-25 17:38:20 +00:00
Christophe Dumez
a25b6e087b Bump to v2.4.1 (release is nearing) 2010-09-25 17:08:21 +00:00
Christophe Dumez
1626d938d1 Fix save path encoding on non-utf8 systems (e.g. Windows)
Fix progress bar style on Windows
2010-09-25 17:02:40 +00:00
Christophe Dumez
a4c7640499 BUGFIX: Use AND operator for torrentdownloads.net searches 2010-09-25 13:12:02 +00:00
Christophe Dumez
2c1b93a12b BUGFIX: Fix locale switching from Web UI 2010-09-25 12:44:31 +00:00
Christophe Dumez
8f19025c2a Remove obsolete strings from language files 2010-09-25 12:12:08 +00:00
Christophe Dumez
20d41bcff2 Fix Web Ui for spanish users 2010-09-25 11:44:44 +00:00
Christophe Dumez
1ad77e00ff BUGFIX: Added support for | (OR) operator in RSS feed downloader 2010-09-25 11:31:33 +00:00
Christophe Dumez
0b65c02666 BUGFIX: Fix possible issue with temporary download path persistence 2010-09-25 11:05:02 +00:00
Christophe Dumez
294095367a BUGFIX: Add .torrent extension only when missing (torrent creator) 2010-09-25 10:49:13 +00:00
Christophe Dumez
05a6ffd554 Fix download in scan dir persistence (closes #633396) 2010-09-25 10:41:17 +00:00
Christophe Dumez
e0a30dc40c BUGFIX: Save path can now be edited in torrent addition dialog 2010-09-25 09:14:00 +00:00
Christophe Dumez
1940bc4e73 Higher maximum download limit 2010-09-25 08:04:36 +00:00
Christophe Dumez
a7e4e0273a Detect OGV as a previewable format 2010-09-25 07:42:55 +00:00
Christophe Dumez
29a9d57cdc Updated Changelog 2010-09-19 08:40:44 +00:00
Christophe Dumez
9c7a4e4983 Fixes to German translation 2010-09-19 08:39:14 +00:00
Christophe Dumez
35ead5bcf2 Updated Spanish and Catalan translations 2010-08-27 07:43:42 +00:00
Christophe Dumez
645bd58d79 Updated Arabic translation 2010-08-25 06:34:50 +00:00
Christophe Dumez
6c47a552ab Updated release date in Changelog 2010-08-24 18:28:56 +00:00
Christophe Dumez
f54bc8bea4 Branched v2.4.x 2010-08-24 18:27:18 +00:00
573 changed files with 42565 additions and 64257 deletions

View File

@@ -36,9 +36,9 @@ Images Authors:
url: http://www.oxygen-icons.org url: http://www.oxygen-icons.org
* files: src/Icons/flags/*.png * files: src/Icons/flags/*.png
copyright: Mark James <mjames@gmail.com> copyright: Open Clip Art Library
license: Public Domain license: Creative Commons Public Domain Dedication
url: http://www.famfamfam.com url: http://www.openclipart.org
* files: src/Icons/skin/*.png * files: src/Icons/skin/*.png
files: src/menuicons/YYxYY/*.png files: src/menuicons/YYxYY/*.png

114
Changelog
View File

@@ -1,21 +1,99 @@
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.5.0 * Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.4.11
- FEATURE: qBittorrent can now act as a tracker - BUGFIX: Do not report a progress of 100% in the Web UI unless the
- FEATURE: New and improved RSS feed automated downloader torrent is really complete (closes #674349)
- FEATURE: Added feature to shutdown qbittorrent on torrents completion - BUGFIX: Fix possible incorrect behavior with queueing
- FEATURE: Added a torrent import assistant to seed or keep downloading outside torrents - BUGFIX: Fix RSS refresh interval saving
- FEATURE: qBittorrent can update itself from Sourceforge (Windows/Mac OS X only) - BUGFIX: Fix possible crash when setting RSS proxy (closes #676288)
- FEATURE: Added a transfer list column to display the current tracker - BUGFIX: Fix HTTP redirect issue that would cause the torrent addition to
- FEATURE: Remember the last trackers used in the torrent creation tool show up for automated RSS downloads (Closes #677565)
- FEATURE: The optimal piece size is now automatically computed in the torrent creation tool
- FEATURE: Bring up the connection settings when clicking on the connection status icon * Wed Nov 10 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.10
- FEATURE: Major code refactoring and optimization - BUGFIX: Fix possible crash when selecting a RSS item (really closes #575624)
- FEATURE: Added "Amount downloaded/left" columns to transfer list - BUGFIX: Improved IPv6 support (IP filter and Peer list)
- FEATURE: Simplified proxy settings - BUGFIX: Make IP filter more tolerant towards strangely formatted IPs
- FEATURE: Optimized and improved the peer country resolution code - BUGFIX: More reliable folder scanning
- COSMETIC: Replaced message box by on-screen notification for download errors - BUGFIX: Do not create the torrent root folder at final destination if
- COSMETIC: Improved the torrent creation tool appearance torrent is in the temp dir (closes #673271)
- COSMETIC: Use country flags by Mark James (Thanks to Dmytro Pukha) - BUGFIX: Fix compilation with libnotify v0.7.0 (closes #671769)
- OTHERS: Dropped support for Qt <= 4.4 - BUGFIX: Use a pointing cursor over status bar buttons
* Sun Oct 31 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.9
- BUGFIX: Fix crash when pressing enter in save path field in torrent addition dialog
- BUGFIX: Fix crash when deleting a torrent with no metadata (closes #667528)
- BUGFIX: Fix possible crash on clicking a RSS article (closes #575624)
- BUGFIX: Correctly update total number of torrents when a torrent is automatically removed (closes #668726)
- BUGFIX: Correctly display the hash of torrents with no metadata
- BUGFIX: Elide status bar text if it is too wide
- BUGFIX: Make sure the splash screen is displayed for 2 seconds
- BUGFIX: Make listening on a particular interface more reliable
- BUGFIX: Fix torrent size update in torrent addition dialog
- BUGFIX: Fix possible crash on qBittorrent shutdown
- BUGFIX: Fix and improve file priorities editing (closes #669084)
- I18N: Updated Arabic, Italian and Croatian translations
* Sun Oct 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.8
- BUGFIX: Fix possible crash on manual peer ban
- BUGFIX: Improved hostname resolution code
- BUGFIX: Several search plugins fixed
- BUGFIX: Auto-disable the shutdown feature
- BUGFIX: Remember the current property tab on startup
- BUGFIX: Fix status list widget height issue on style change
- BUGFIX: Fix rounding issue in torrent progress display
- BUGFIX: Fix issue when altering files priorities of a seeding torrent
- BUGFIX: Better fix for save path editing issues in torrent addition dialog
- BUGFIX: Peers can now be sorted by country
* Tue Oct 19 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.7
- BUGFIX: Display the priority column when the queueing system gets enabled
- BUGFIX: Fix encoding problem in file renaming
- BUGFIX: Delete uneeded files on torrent "soft" deletion
- BUGFIX: Fix issues when marking a file as 'not downloaded' causes the torrent to complete
- BUGFIX: Improved "Set Location" and "Change save path" dialogs
- BUGFIX: Fix display of queued seeding torrents
* Sun Oct 17 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.6
- BUGFIX: Fix "torrent seeding after creation" feature
- BUGFIX: The properties panel data would sometimes not match the selected torrent
- BUGFIX: Fix detection of files at final destination when temp dir is used
- BUGFIX: Fix moving of a torrent to an unexisting directory
* Tue Oct 12 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.5
- BUGFIX: Remember torrent completion date correctly
- BUGFIX: Fix feature to keep incomplete torrents in a separate folder
- BUGFIX: Fix display of URL seeds in the UI
- BUGFIX: Improved peer hostname resolution with caching
- BUGFIX: Piece availability/downloaded widgets performance improvement
* Fri Oct 1 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.4
- BUGFIX: Clean program exit on system shutdown/logout
- BUGFIX: Fix possible search engine plugin update
* Tue Sep 28 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.3
- BUGFIX: Fix encoding issue in command line parameters processing
- BUGFIX: Fix possible crash when changing the save path in addition dialog
- BUGFIX: Fix wrong mapping to source model
* Sun Sep 26 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.2
- BUGFIX: Fix display of torrent content in addition dialog
- BUGFIX: Really fix manual editing of save path in torrent addition dialog
* Sun Sep 26 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.1
- I18N: Updated Arabic translation
- I18N: Fixes to German translation
- BUGFIX: Save path can now be edited in torrent addition dialog
- BUGFIX: Fix save path encoding on non-utf8 systems
- BUGFIX: Fix saving to drive root on Windows
- BUGFIX: OGV can now be previewed
- BUGFIX: Maximum download limit is now 10MB/s
- BUGFIX: Fix 'download in scan dir' persistence
- BUGFIX: Add .torrent extension only when missing (torrent creator)
- BUGFIX: Fix possible issue with temporary download path persistence
- BUGFIX: Added support for | (OR) operator in RSS feed downloader
- BUGFIX: Fix Web UI for spanish users
- BUGFIX: Fix locale switching from Web UI
- BUGFIX: Use AND operator for torrentdownloads.net searches
- BUGFIX: Limit torrent addition dialog width to fit the screen
- COSMETIC: Fix progress bars style on Windows
* Tue Aug 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.0 * Tue Aug 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.0
- FEATURE: Added actions to "Move to top/bottom" of priority queue - FEATURE: Added actions to "Move to top/bottom" of priority queue

View File

@@ -10,7 +10,7 @@ qBittorrent - A BitTorrent client in C++ / Qt4
will install and execute qBittorrent hopefully without any problems. will install and execute qBittorrent hopefully without any problems.
Dependencies: Dependencies:
- Qt >= 4.5.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml) - Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
- pkg-config executable - pkg-config executable

32
configure vendored
View File

@@ -325,7 +325,7 @@ cat >$1/modules.cpp <<EOT
#line 1 "qt4.qcm" #line 1 "qt4.qcm"
/* /*
-----BEGIN QCMOD----- -----BEGIN QCMOD-----
name: Qt >= 4.5 name: Qt >= 4.4
arg: disable-gui, Disable qBittorrent Graphical user interface for headless running arg: disable-gui, Disable qBittorrent Graphical user interface for headless running
-----END QCMOD----- -----END QCMOD-----
*/ */
@@ -333,14 +333,14 @@ class qc_qt4 : public ConfObj
{ {
public: public:
qc_qt4(Conf *c) : ConfObj(c) {} qc_qt4(Conf *c) : ConfObj(c) {}
QString name() const { return "Qt >= 4.5"; } QString name() const { return "Qt >= 4.4"; }
QString shortname() const { return "Qt 4.5"; } QString shortname() const { return "Qt 4.4"; }
bool exec() bool exec()
{ {
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) { if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
conf->addExtra("CONFIG += nox"); conf->addDefine("DISABLE_GUI");
} }
return(QT_VERSION >= 0x040500); return(QT_VERSION >= 0x040400);
} }
}; };
#line 1 "pkg-config.qcm" #line 1 "pkg-config.qcm"
@@ -534,7 +534,7 @@ public:
QString version, libs, other; QString version, libs, other;
VersionMode mode = VersionMin; VersionMode mode = VersionMin;
if(conf->findPkgConfig("libnotify", mode, req_ver, &version, &incs, &libs, &other)) { if(conf->findPkgConfig("libnotify", mode, req_ver, &version, &incs, &libs, &other)) {
conf->addExtra("CONFIG += libnotify"); conf->addDefine("WITH_LIBNOTIFY");
for(int n = 0; n < incs.count(); ++n) for(int n = 0; n < incs.count(); ++n)
conf->addIncludePath(incs[n]); conf->addIncludePath(incs[n]);
if(!libs.isEmpty()) if(!libs.isEmpty())
@@ -616,22 +616,22 @@ arg: with-qtsingleapplication=[system|shipped], Use the shipped qtsingleapplicat
class qc_qtsingleapplication : public ConfObj class qc_qtsingleapplication : public ConfObj
{ {
public: public:
qc_qtsingleapplication(Conf *c) : ConfObj(c) {} qc_qtsingleapplication(Conf *c) : ConfObj(c) {}
QString name() const { return "qtsingleapplication library"; } QString name() const { return "qtsingleapplication library"; }
QString shortname() const { return "qtsingleapplication"; } QString shortname() const { return "qtsingleapplication"; }
bool exec(){ bool exec(){
QString s; QString s;
s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION"); s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION");
if(s.compare("system", Qt::CaseInsensitive) == 0) { if(s.compare("system", Qt::CaseInsensitive) == 0) {
// System // System
conf->addExtra("CONFIG += usesystemqtsingleapplication"); conf->addDefine("USE_SYSTEM_QTSINGLEAPPLICATION");
printf(" [system] "); printf(" [system] ");
} else { } else {
printf(" [shipped] "); printf(" [shipped] ");
} }
return true; return true;
} }
}; };
EOT EOT

View File

@@ -1,16 +0,0 @@
PREFIX = /usr/local
BINDIR = /usr/local/bin
DATADIR = /usr/local/share
INCLUDEPATH += /usr/local/include/libtorrent /usr/include/openssl /usr/include /opt/local/include/boost /opt/local/include
LIBS += -ltorrent-rasterbar -lcrypto -L/opt/local/lib -lboost_system-mt -lboost_filesystem-mt -lboost_thread-mt -framework Cocoa -framework Carbon
document_icon.path = Contents/Resources
document_icon.files = Icons/qBitTorrentDocument.icns
QMAKE_BUNDLE_DATA += document_icon
ICON = Icons/qbittorrent_mac.icns
QMAKE_INFO_PLIST = Info.plist
DEFINES += WITH_GEOIP_EMBEDDED
message("On Mac OS X, GeoIP database must be embedded.")

View File

@@ -1,10 +0,0 @@
LIBS += -ltorrent-rasterbar \
-lboost_thread \
-lboost_system \
-lboost_filesystem \
-lssl -lcrypto -lidn -lpthread
RC_FILE = qbittorrent_os2.rc
DEFINES += WITH_GEOIP_EMBEDDED
message("On eCS(OS/2), GeoIP database must be embedded.")

199
qBittorrent.kdevelop Normal file
View File

@@ -0,0 +1,199 @@
<?xml version = '1.0'?>
<kdevelop>
<general>
<author>Christophe Dumez</author>
<email>chris@qbittorrent.org</email>
<version>1.0.0</version>
<projectmanagement>KDevTrollProject</projectmanagement>
<primarylanguage>C++</primarylanguage>
<keywords>
<keyword>Qt</keyword>
</keywords>
<projectname>qBittorrent</projectname>
<ignoreparts/>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description/>
<defaultencoding/>
<versioncontrol>kdevsubversion</versioncontrol>
</general>
<kdevfileview>
<groups>
<group pattern="*.cpp;*.cxx;*.h" name="Sources" />
<group pattern="*.ui" name="User Interface" />
<group pattern="*.png" name="Icons" />
<group pattern="*" name="Others" />
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidenonlocation>false</hidenonlocation>
</groups>
<tree>
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
<hidenonprojectfiles>false</hidenonprojectfiles>
<showvcsfields>false</showvcsfields>
</tree>
</kdevfileview>
<kdevdoctreeview>
<ignoretocs>
<toc>bash</toc>
<toc>bash_bugs</toc>
<toc>clanlib</toc>
<toc>w3c-dom-level2-html</toc>
<toc>fortran_bugs_gcc</toc>
<toc>gnome1</toc>
<toc>gnustep</toc>
<toc>gtk</toc>
<toc>gtk_bugs</toc>
<toc>haskell</toc>
<toc>haskell_bugs_ghc</toc>
<toc>java_bugs_gcc</toc>
<toc>java_bugs_sun</toc>
<toc>kde2book</toc>
<toc>opengl</toc>
<toc>pascal_bugs_fp</toc>
<toc>php</toc>
<toc>php_bugs</toc>
<toc>perl</toc>
<toc>perl_bugs</toc>
<toc>python</toc>
<toc>python_bugs</toc>
<toc>qt-kdev3</toc>
<toc>ruby</toc>
<toc>ruby_bugs</toc>
<toc>sdl</toc>
<toc>stl</toc>
<toc>w3c-svg</toc>
<toc>sw</toc>
<toc>w3c-uaag10</toc>
<toc>wxwidgets_bugs</toc>
</ignoretocs>
<ignoredoxygen>
<toc>KDE Libraries (Doxygen)</toc>
</ignoredoxygen>
</kdevdoctreeview>
<kdevdebugger>
<general>
<dbgshell/>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
</general>
<display>
<staticmembers>false</staticmembers>
<demanglenames>true</demanglenames>
<outputradix>10</outputradix>
</display>
</kdevdebugger>
<kdevcppsupport>
<qt>
<version>4</version>
<used>true</used>
<includestyle>4</includestyle>
<designerintegration>ExternalDesigner</designerintegration>
<root>/usr/lib/qt4</root>
<qmake>/usr/bin/qmake</qmake>
<designer>/usr/bin/designer</designer>
<designerpluginpaths/>
</qt>
<references>
<pcs>automatic_%2Fhome%2Fishanarora%2Fprojects%2Fqbittorrent</pcs>
</references>
<codecompletion>
<automaticCodeCompletion>true</automaticCodeCompletion>
<automaticArgumentsHint>true</automaticArgumentsHint>
<automaticHeaderCompletion>true</automaticHeaderCompletion>
<codeCompletionDelay>250</codeCompletionDelay>
<argumentsHintDelay>400</argumentsHintDelay>
<headerCompletionDelay>250</headerCompletionDelay>
<showOnlyAccessibleItems>false</showOnlyAccessibleItems>
<completionBoxItemOrder>0</completionBoxItemOrder>
<howEvaluationContextMenu>true</howEvaluationContextMenu>
<showCommentWithArgumentHint>true</showCommentWithArgumentHint>
<statusBarTypeEvaluation>false</statusBarTypeEvaluation>
<namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
<processPrimaryTypes>true</processPrimaryTypes>
<processFunctionArguments>true</processFunctionArguments>
<preProcessAllHeaders>true</preProcessAllHeaders>
<parseMissingHeadersExperimental>true</parseMissingHeadersExperimental>
<resolveIncludePathsUsingMakeExperimental>true</resolveIncludePathsUsingMakeExperimental>
<alwaysParseInBackground>true</alwaysParseInBackground>
<usePermanentCaching>true</usePermanentCaching>
<alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
<includePaths>.;</includePaths>
</codecompletion>
<creategettersetter>
<prefixGet>get</prefixGet>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
<inlineGet>true</inlineGet>
<inlineSet>true</inlineSet>
</creategettersetter>
<splitheadersource>
<enabled>false</enabled>
<synchronize>true</synchronize>
<orientation>Vertical</orientation>
</splitheadersource>
</kdevcppsupport>
<kdevfilecreate>
<filetypes/>
<useglobaltypes>
<type ext="ui" />
<type ext="cpp" />
<type ext="h" />
</useglobaltypes>
</kdevfilecreate>
<kdevtrollproject>
<general>
<activedir>src</activedir>
</general>
<run>
<directoryradio>executable</directoryradio>
<mainprogram>/home/ishanarora/projects/qbittorrent/src/qbittorrent</mainprogram>
<programargs/>
<globaldebugarguments/>
<globalcwd>/home/ishanarora/projects/qbittorrent</globalcwd>
<useglobalprogram>true</useglobalprogram>
<terminal>false</terminal>
<autocompile>true</autocompile>
<autoinstall>false</autoinstall>
<autokdesu>false</autokdesu>
<envvars/>
</run>
<make>
<abortonerror>true</abortonerror>
<runmultiplejobs>false</runmultiplejobs>
<numberofjobs>1</numberofjobs>
<dontact>false</dontact>
<makebin/>
<prio>0</prio>
<envvars/>
</make>
<qmake>
<savebehaviour>2</savebehaviour>
<replacePaths>false</replacePaths>
<disableDefaultOpts>true</disableDefaultOpts>
</qmake>
</kdevtrollproject>
<cppsupportpart>
<filetemplates>
<interfacesuffix>.h</interfacesuffix>
<implementationsuffix>.cpp</implementationsuffix>
</filetemplates>
</cppsupportpart>
<ctagspart>
<customArguments/>
<customTagfilePath>/home/ishanarora/projects/qbittorrent/tags</customTagfilePath>
<activeTagsFiles/>
</ctagspart>
<kdevdocumentation>
<projectdoc>
<docsystem/>
<docurl/>
<usermanualurl/>
</projectdoc>
</kdevdocumentation>
</kdevelop>

View File

@@ -24,7 +24,7 @@ public:
QString version, libs, other; QString version, libs, other;
VersionMode mode = VersionMin; VersionMode mode = VersionMin;
if(conf->findPkgConfig("libnotify", mode, req_ver, &version, &incs, &libs, &other)) { if(conf->findPkgConfig("libnotify", mode, req_ver, &version, &incs, &libs, &other)) {
conf->addExtra("CONFIG += libnotify"); conf->addDefine("WITH_LIBNOTIFY");
for(int n = 0; n < incs.count(); ++n) for(int n = 0; n < incs.count(); ++n)
conf->addIncludePath(incs[n]); conf->addIncludePath(incs[n]);
if(!libs.isEmpty()) if(!libs.isEmpty())

View File

@@ -1,6 +1,6 @@
/* /*
-----BEGIN QCMOD----- -----BEGIN QCMOD-----
name: Qt >= 4.5 name: Qt >= 4.4
arg: disable-gui, Disable qBittorrent Graphical user interface for headless running arg: disable-gui, Disable qBittorrent Graphical user interface for headless running
-----END QCMOD----- -----END QCMOD-----
*/ */
@@ -8,13 +8,13 @@ class qc_qt4 : public ConfObj
{ {
public: public:
qc_qt4(Conf *c) : ConfObj(c) {} qc_qt4(Conf *c) : ConfObj(c) {}
QString name() const { return "Qt >= 4.5"; } QString name() const { return "Qt >= 4.4"; }
QString shortname() const { return "Qt 4.5"; } QString shortname() const { return "Qt 4.4"; }
bool exec() bool exec()
{ {
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) { if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
conf->addExtra("CONFIG += nox"); conf->addDefine("DISABLE_GUI");
} }
return(QT_VERSION >= 0x040500); return(QT_VERSION >= 0x040400);
} }
}; };

View File

@@ -16,7 +16,7 @@ public:
s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION"); s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION");
if(s.compare("system", Qt::CaseInsensitive) == 0) { if(s.compare("system", Qt::CaseInsensitive) == 0) {
// System // System
conf->addExtra("CONFIG += usesystemqtsingleapplication"); conf->addDefine("USE_SYSTEM_QTSINGLEAPPLICATION");
printf(" [system] "); printf(" [system] ");
} else { } else {
printf(" [shipped] "); printf(" [shipped] ");

View File

@@ -44,15 +44,15 @@
#include <QShortcut> #include <QShortcut>
#include <QScrollBar> #include <QScrollBar>
#include "mainwindow.h" #include "GUI.h"
#include "transferlistwidget.h" #include "transferlistwidget.h"
#include "misc.h" #include "misc.h"
#include "torrentcreatordlg.h" #include "createtorrent_imp.h"
#include "downloadfromurldlg.h" #include "downloadfromurldlg.h"
#include "torrentadditiondlg.h" #include "torrentadditiondlg.h"
#include "searchengine.h" #include "searchengine.h"
#include "rss_imp.h" #include "rss_imp.h"
#include "qbtsession.h" #include "bittorrent.h"
#include "about_imp.h" #include "about_imp.h"
#include "trackerlogin.h" #include "trackerlogin.h"
#include "options_imp.h" #include "options_imp.h"
@@ -67,18 +67,12 @@
#include "statusbar.h" #include "statusbar.h"
#include "hidabletabwidget.h" #include "hidabletabwidget.h"
#include "qinisettings.h" #include "qinisettings.h"
#include "torrentimportdlg.h"
#include "rsssettings.h"
#include "torrentmodel.h"
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
#include "qmacapplication.h" #include "qmacapplication.h"
void qt_mac_set_dock_menu(QMenu *menu); void qt_mac_set_dock_menu(QMenu *menu);
#endif #endif
#include "lineedit.h" #include "lineedit.h"
#include "sessionapplication.h" #include "sessionapplication.h"
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
#include "programupdater.h"
#endif
using namespace libtorrent; using namespace libtorrent;
@@ -91,12 +85,11 @@ using namespace libtorrent;
*****************************************************/ *****************************************************/
// Constructor // Constructor
MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), force_exit(false) { GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), force_exit(false) {
setupUi(this); setupUi(this);
Preferences pref; ui_locked = Preferences::isUILocked();
ui_locked = pref.isUILocked();
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION))); setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
displaySpeedInTitle = pref.speedInTitleBar(); displaySpeedInTitle = Preferences::speedInTitleBar();
// Clean exit on log out // Clean exit on log out
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession())); connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
// Setting icons // Setting icons
@@ -133,7 +126,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
// Fix Tool bar layout // Fix Tool bar layout
toolBar->layout()->setSpacing(7); toolBar->layout()->setSpacing(7);
// Creating Bittorrent session // Creating Bittorrent session
BTSession = QBtSession::instance(); BTSession = new Bittorrent();
connect(BTSession, SIGNAL(fullDiskError(QTorrentHandle&, QString)), this, SLOT(fullDiskError(QTorrentHandle&, QString))); connect(BTSession, SIGNAL(fullDiskError(QTorrentHandle&, QString)), this, SLOT(fullDiskError(QTorrentHandle&, QString)));
connect(BTSession, SIGNAL(finishedTorrent(QTorrentHandle&)), this, SLOT(finishedTorrent(QTorrentHandle&))); connect(BTSession, SIGNAL(finishedTorrent(QTorrentHandle&)), this, SLOT(finishedTorrent(QTorrentHandle&)));
connect(BTSession, SIGNAL(trackerAuthenticationRequired(QTorrentHandle&)), this, SLOT(trackerAuthenticationRequired(QTorrentHandle&))); connect(BTSession, SIGNAL(trackerAuthenticationRequired(QTorrentHandle&)), this, SLOT(trackerAuthenticationRequired(QTorrentHandle&)));
@@ -155,7 +148,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
// Transfer List tab // Transfer List tab
transferList = new TransferListWidget(hSplitter, this, BTSession); transferList = new TransferListWidget(hSplitter, this, BTSession);
properties = new PropertiesWidget(hSplitter, this, transferList); properties = new PropertiesWidget(hSplitter, this, transferList, BTSession);
transferListFilters = new TransferListFiltersWidget(vSplitter, transferList); transferListFilters = new TransferListFiltersWidget(vSplitter, transferList);
hSplitter->addWidget(transferList); hSplitter->addWidget(transferList);
hSplitter->addWidget(properties); hSplitter->addWidget(properties);
@@ -164,9 +157,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
vSplitter->setCollapsible(0, true); vSplitter->setCollapsible(0, true);
vSplitter->setCollapsible(1, false); vSplitter->setCollapsible(1, false);
tabs->addTab(vSplitter, QIcon(QString::fromUtf8(":/Icons/oxygen/folder-remote.png")), tr("Transfers")); tabs->addTab(vSplitter, QIcon(QString::fromUtf8(":/Icons/oxygen/folder-remote.png")), tr("Transfers"));
connect(transferList->getSourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(updateNbTorrents())); connect(transferList, SIGNAL(torrentStatusUpdate(uint,uint,uint,uint,uint)), this, SLOT(updateNbTorrents(uint,uint,uint,uint,uint)));
connect(transferList->getSourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(updateNbTorrents()));
vboxLayout->addWidget(tabs); vboxLayout->addWidget(tabs);
// Name filter // Name filter
@@ -178,9 +169,9 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
// Transfer list slots // Transfer list slots
connect(actionStart, SIGNAL(triggered()), transferList, SLOT(startSelectedTorrents())); connect(actionStart, SIGNAL(triggered()), transferList, SLOT(startSelectedTorrents()));
connect(actionStart_All, SIGNAL(triggered()), BTSession, SLOT(resumeAllTorrents())); connect(actionStart_All, SIGNAL(triggered()), transferList, SLOT(startAllTorrents()));
connect(actionPause, SIGNAL(triggered()), transferList, SLOT(pauseSelectedTorrents())); connect(actionPause, SIGNAL(triggered()), transferList, SLOT(pauseSelectedTorrents()));
connect(actionPause_All, SIGNAL(triggered()), BTSession, SLOT(pauseAllTorrents())); connect(actionPause_All, SIGNAL(triggered()), transferList, SLOT(pauseAllTorrents()));
connect(actionDelete, SIGNAL(triggered()), transferList, SLOT(deleteSelectedTorrents())); connect(actionDelete, SIGNAL(triggered()), transferList, SLOT(deleteSelectedTorrents()));
connect(actionIncreasePriority, SIGNAL(triggered()), transferList, SLOT(increasePrioSelectedTorrents())); connect(actionIncreasePriority, SIGNAL(triggered()), transferList, SLOT(increasePrioSelectedTorrents()));
connect(actionDecreasePriority, SIGNAL(triggered()), transferList, SLOT(decreasePrioSelectedTorrents())); connect(actionDecreasePriority, SIGNAL(triggered()), transferList, SLOT(decreasePrioSelectedTorrents()));
@@ -196,8 +187,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
setAcceptDrops(true); setAcceptDrops(true);
createKeyboardShortcuts(); createKeyboardShortcuts();
// Create status bar // Create status bar
status_bar = new StatusBar(QMainWindow::statusBar()); status_bar = new StatusBar(QMainWindow::statusBar(), BTSession);
connect(status_bar->connectionStatusButton(), SIGNAL(clicked()), SLOT(showConnectionSettings()));
connect(actionUse_alternative_speed_limits, SIGNAL(triggered()), status_bar, SLOT(toggleAlternativeSpeeds())); connect(actionUse_alternative_speed_limits, SIGNAL(triggered()), status_bar, SLOT(toggleAlternativeSpeeds()));
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
@@ -205,14 +195,13 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
#endif #endif
// View settings // View settings
actionTop_tool_bar->setChecked(pref.isToolbarDisplayed()); actionTop_tool_bar->setChecked(Preferences::isToolbarDisplayed());
actionSpeed_in_title_bar->setChecked(pref.speedInTitleBar()); actionSpeed_in_title_bar->setChecked(Preferences::speedInTitleBar());
actionRSS_Reader->setChecked(RssSettings().isRSSEnabled()); actionRSS_Reader->setChecked(Preferences::isRSSEnabled());
actionSearch_engine->setChecked(pref.isSearchEnabled()); actionSearch_engine->setChecked(Preferences::isSearchEnabled());
displaySearchTab(actionSearch_engine->isChecked()); displaySearchTab(actionSearch_engine->isChecked());
displayRSSTab(actionRSS_Reader->isChecked()); displayRSSTab(actionRSS_Reader->isChecked());
actionShutdown_when_downloads_complete->setChecked(pref.shutdownWhenDownloadsComplete()); actionShutdown_when_downloads_complete->setChecked(Preferences::shutdownWhenDownloadsComplete());
actionShutdown_qBittorrent_when_downloads_complete->setChecked(pref.shutdownqBTWhenDownloadsComplete());
show(); show();
@@ -226,7 +215,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
if(ui_locked) { if(ui_locked) {
hide(); hide();
} else { } else {
if(pref.startMinimized()) if(Preferences::startMinimized())
showMinimized(); showMinimized();
} }
@@ -240,33 +229,24 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
// Add torrent given on command line // Add torrent given on command line
processParams(torrentCmdLine); processParams(torrentCmdLine);
// Populate the transfer list
transferList->getSourceModel()->populate();
qDebug("GUI Built"); qDebug("GUI Built");
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
if(!pref.neverCheckFileAssoc() && !Preferences::isFileAssocOk()) { if(!Preferences::neverCheckFileAssoc() && !Preferences::isFileAssocOk()) {
if(QMessageBox::question(0, tr("Torrent file association"), if(QMessageBox::question(0, tr("Torrent file association"),
tr("qBittorrent is not the default application to open torrent files or Magnet links.\nDo you want to associate qBittorrent to torrent files and Magnet links?"), tr("qBittorrent is not the default application to open torrent files or Magnet links.\nDo you want to associate qBittorrent to torrent files and Magnet links?"),
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) { QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) {
Preferences::setFileAssoc(); Preferences::setFileAssoc();
} else { } else {
pref.setNeverCheckFileAssoc(); Preferences::setNeverCheckFileAssoc();
} }
} }
#endif #endif
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
qt_mac_set_dock_menu(getTrayIconMenu()); qt_mac_set_dock_menu(getTrayIconMenu());
#endif #endif
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
// Check for update
ProgramUpdater *updater = new ProgramUpdater(this);
connect(updater, SIGNAL(updateCheckFinished(bool, QString)), SLOT(handleUpdateCheckFinished(bool, QString)));
updater->checkForUpdates();
#endif
} }
void MainWindow::deleteBTSession() { void GUI::deleteBTSession() {
guiUpdater->stop(); guiUpdater->stop();
status_bar->stopTimer(); status_bar->stopTimer();
if(BTSession) { if(BTSession) {
@@ -277,13 +257,18 @@ void MainWindow::deleteBTSession() {
} }
// Destructor // Destructor
MainWindow::~MainWindow() { GUI::~GUI() {
qDebug("GUI destruction"); qDebug("GUI destruction");
hide(); hide();
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
// Workaround to avoid bug http://bugreports.qt.nokia.com/browse/QTBUG-7305 // Workaround to avoid bug http://bugreports.qt.nokia.com/browse/QTBUG-7305
setUnifiedTitleAndToolBarOnMac(false); setUnifiedTitleAndToolBarOnMac(false);
#endif #endif
// Async deletion of Bittorrent session as early as possible
// in order to speed up exit
session_proxy sp;
if(BTSession)
sp = BTSession->asyncDeletion();
// Some saving // Some saving
properties->saveSettings(); properties->saveSettings();
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tab_changed(int))); disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tab_changed(int)));
@@ -330,7 +315,7 @@ MainWindow::~MainWindow() {
delete switchRSSShortcut; delete switchRSSShortcut;
// Delete BTSession objects // Delete BTSession objects
qDebug("Deleting BTSession"); qDebug("Deleting BTSession");
QBtSession::drop(); delete BTSession;
// May freeze for a few seconds after the next line // May freeze for a few seconds after the next line
// because the Bittorrent session proxy will // because the Bittorrent session proxy will
// actually be deleted now and destruction // actually be deleted now and destruction
@@ -338,41 +323,40 @@ MainWindow::~MainWindow() {
qDebug("Exiting GUI destructor..."); qDebug("Exiting GUI destructor...");
} }
void MainWindow::defineUILockPassword() { void GUI::defineUILockPassword() {
QString old_pass_md5 = Preferences().getUILockPasswordMD5(); QString old_pass_md5 = Preferences::getUILockPasswordMD5();
if(old_pass_md5.isNull()) old_pass_md5 = ""; if(old_pass_md5.isNull()) old_pass_md5 = "";
bool ok = false; bool ok = false;
QString new_clear_password = QInputDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, old_pass_md5, &ok); QString new_clear_password = QInputDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, old_pass_md5, &ok);
if(ok) { if(ok) {
if(new_clear_password != old_pass_md5) { if(new_clear_password != old_pass_md5) {
Preferences().setUILockPassword(new_clear_password); Preferences::setUILockPassword(new_clear_password);
} }
QMessageBox::information(this, tr("Password update"), tr("The UI lock password has been successfully updated")); QMessageBox::information(this, tr("Password update"), tr("The UI lock password has been successfully updated"));
} }
} }
void MainWindow::on_actionLock_qBittorrent_triggered() { void GUI::on_actionLock_qBittorrent_triggered() {
Preferences pref;
// Check if there is a password // Check if there is a password
if(pref.getUILockPasswordMD5().isEmpty()) { if(Preferences::getUILockPasswordMD5().isEmpty()) {
// Ask for a password // Ask for a password
bool ok = false; bool ok = false;
QString clear_password = QInputDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, "", &ok); QString clear_password = QInputDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, "", &ok);
if(!ok) return; if(!ok) return;
pref.setUILockPassword(clear_password); Preferences::setUILockPassword(clear_password);
} }
// Lock the interface // Lock the interface
ui_locked = true; ui_locked = true;
pref.setUILocked(true); Preferences::setUILocked(true);
myTrayIconMenu->setEnabled(false); myTrayIconMenu->setEnabled(false);
hide(); hide();
} }
void MainWindow::displayRSSTab(bool enable) { void GUI::displayRSSTab(bool enable) {
if(enable) { if(enable) {
// RSS tab // RSS tab
if(!rssWidget) { if(!rssWidget) {
rssWidget = new RSSImp(tabs); rssWidget = new RSSImp(BTSession);
int index_tab = tabs->addTab(rssWidget, tr("RSS")); int index_tab = tabs->addTab(rssWidget, tr("RSS"));
tabs->setTabIcon(index_tab, QIcon(QString::fromUtf8(":/Icons/rss32.png"))); tabs->setTabIcon(index_tab, QIcon(QString::fromUtf8(":/Icons/rss32.png")));
} }
@@ -386,11 +370,11 @@ void MainWindow::displayRSSTab(bool enable) {
} }
} }
void MainWindow::displaySearchTab(bool enable) { void GUI::displaySearchTab(bool enable) {
if(enable) { if(enable) {
// RSS tab // RSS tab
if(!searchEngine) { if(!searchEngine) {
searchEngine = new SearchEngine(this); searchEngine = new SearchEngine(this, BTSession);
tabs->insertTab(1, searchEngine, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")), tr("Search")); tabs->insertTab(1, searchEngine, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")), tr("Search"));
} }
tabs->showTabBar(true); tabs->showTabBar(true);
@@ -403,28 +387,32 @@ void MainWindow::displaySearchTab(bool enable) {
} }
} }
void MainWindow::updateNbTorrents() { void GUI::updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused) {
tabs->setTabText(0, tr("Transfers (%1)").arg(transferList->getSourceModel()->rowCount())); Q_UNUSED(nb_downloading);
Q_UNUSED(nb_seeding);
Q_UNUSED(nb_paused);
tabs->setTabText(0, tr("Transfers (%1)").arg(QString::number(nb_inactive+nb_active)));
} }
void MainWindow::on_actionWebsite_triggered() const { void GUI::on_actionWebsite_triggered() const {
QDesktopServices::openUrl(QUrl(QString::fromUtf8("http://www.qbittorrent.org"))); QDesktopServices::openUrl(QUrl(QString::fromUtf8("http://www.qbittorrent.org")));
} }
void MainWindow::on_actionDocumentation_triggered() const { void GUI::on_actionDocumentation_triggered() const {
QDesktopServices::openUrl(QUrl(QString::fromUtf8("http://doc.qbittorrent.org"))); QDesktopServices::openUrl(QUrl(QString::fromUtf8("http://doc.qbittorrent.org")));
} }
void MainWindow::on_actionBugReport_triggered() const { void GUI::on_actionBugReport_triggered() const {
QDesktopServices::openUrl(QUrl(QString::fromUtf8("http://bugs.qbittorrent.org"))); QDesktopServices::openUrl(QUrl(QString::fromUtf8("http://bugs.qbittorrent.org")));
} }
void MainWindow::tab_changed(int new_tab) { void GUI::tab_changed(int new_tab) {
Q_UNUSED(new_tab); Q_UNUSED(new_tab);
// We cannot rely on the index new_tab // We cannot rely on the index new_tab
// because the tab order is undetermined now // because the tab order is undetermined now
if(tabs->currentWidget() == vSplitter) { if(tabs->currentWidget() == vSplitter) {
qDebug("Changed tab to transfer list, refreshing the list"); qDebug("Changed tab to transfer list, refreshing the list");
transferList->refreshList();
properties->loadDynamicData(); properties->loadDynamicData();
return; return;
} }
@@ -434,7 +422,7 @@ void MainWindow::tab_changed(int new_tab) {
} }
} }
void MainWindow::writeSettings() { void GUI::writeSettings() {
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
settings.beginGroup(QString::fromUtf8("MainWindow")); settings.beginGroup(QString::fromUtf8("MainWindow"));
settings.setValue("geometry", saveGeometry()); settings.setValue("geometry", saveGeometry());
@@ -447,18 +435,18 @@ void MainWindow::writeSettings() {
} }
// called when a torrent has finished // called when a torrent has finished
void MainWindow::finishedTorrent(QTorrentHandle& h) const { void GUI::finishedTorrent(QTorrentHandle& h) const {
if(!TorrentPersistentData::isSeed(h.hash())) if(!TorrentPersistentData::isSeed(h.hash()))
showNotificationBaloon(tr("Download completion"), tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(h.name())); showNotificationBaloon(tr("Download completion"), tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(h.name()));
} }
// Notification when disk is full // Notification when disk is full
void MainWindow::fullDiskError(QTorrentHandle& h, QString msg) const { void GUI::fullDiskError(QTorrentHandle& h, QString msg) const {
if(!h.is_valid()) return; if(!h.is_valid()) return;
showNotificationBaloon(tr("I/O Error", "i.e: Input/Output Error"), tr("An I/O error occured for torrent %1.\n Reason: %2", "e.g: An error occured for torrent xxx.avi.\n Reason: disk is full.").arg(h.name()).arg(msg)); showNotificationBaloon(tr("I/O Error", "i.e: Input/Output Error"), tr("An I/O error occured for torrent %1.\n Reason: %2", "e.g: An error occured for torrent xxx.avi.\n Reason: disk is full.").arg(h.name()).arg(msg));
} }
void MainWindow::createKeyboardShortcuts() { void GUI::createKeyboardShortcuts() {
actionCreate_torrent->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+N"))); actionCreate_torrent->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+N")));
actionOpen->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+O"))); actionOpen->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+O")));
actionExit->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Q"))); actionExit->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Q")));
@@ -482,23 +470,23 @@ void MainWindow::createKeyboardShortcuts() {
} }
// Keyboard shortcuts slots // Keyboard shortcuts slots
void MainWindow::displayTransferTab() const { void GUI::displayTransferTab() const {
tabs->setCurrentWidget(transferList); tabs->setCurrentWidget(transferList);
} }
void MainWindow::displaySearchTab() const { void GUI::displaySearchTab() const {
if(searchEngine) if(searchEngine)
tabs->setCurrentWidget(searchEngine); tabs->setCurrentWidget(searchEngine);
} }
void MainWindow::displayRSSTab() const { void GUI::displayRSSTab() const {
if(rssWidget) if(rssWidget)
tabs->setCurrentWidget(rssWidget); tabs->setCurrentWidget(rssWidget);
} }
// End of keyboard shortcuts slots // End of keyboard shortcuts slots
void MainWindow::readSettings() { void GUI::readSettings() {
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
settings.beginGroup(QString::fromUtf8("MainWindow")); settings.beginGroup(QString::fromUtf8("MainWindow"));
restoreGeometry(settings.value("geometry").toByteArray()); restoreGeometry(settings.value("geometry").toByteArray());
@@ -517,7 +505,7 @@ void MainWindow::readSettings() {
settings.endGroup(); settings.endGroup();
} }
void MainWindow::balloonClicked() { void GUI::balloonClicked() {
if(isHidden()) { if(isHidden()) {
show(); show();
if(isMinimized()) { if(isMinimized()) {
@@ -528,30 +516,29 @@ void MainWindow::balloonClicked() {
} }
} }
void MainWindow::askRecursiveTorrentDownloadConfirmation(QTorrentHandle &h) { void GUI::askRecursiveTorrentDownloadConfirmation(QTorrentHandle &h) {
Preferences pref; if(Preferences::recursiveDownloadDisabled()) return;
if(pref.recursiveDownloadDisabled()) return;
QMessageBox confirmBox(QMessageBox::Question, tr("Recursive download confirmation"), tr("The torrent %1 contains torrent files, do you want to proceed with their download?").arg(h.name())); QMessageBox confirmBox(QMessageBox::Question, tr("Recursive download confirmation"), tr("The torrent %1 contains torrent files, do you want to proceed with their download?").arg(h.name()));
QPushButton *yes = confirmBox.addButton(tr("Yes"), QMessageBox::YesRole); QPushButton *yes = confirmBox.addButton(tr("Yes"), QMessageBox::YesRole);
/*QPushButton *no = */confirmBox.addButton(tr("No"), QMessageBox::NoRole); /*QPushButton *no = */confirmBox.addButton(tr("No"), QMessageBox::NoRole);
QPushButton *never = confirmBox.addButton(tr("Never"), QMessageBox::NoRole); QPushButton *never = confirmBox.addButton(tr("Never"), QMessageBox::NoRole);
confirmBox.exec(); confirmBox.exec();
if(confirmBox.clickedButton() == 0) return; if(confirmBox.clickedButton() == 0) return;
if(confirmBox.clickedButton() == yes) { if(confirmBox.clickedButton() == yes) {
BTSession->recursiveTorrentDownload(h); BTSession->recursiveTorrentDownload(h);
return; return;
} }
if(confirmBox.clickedButton() == never) { if(confirmBox.clickedButton() == never) {
pref.disableRecursiveDownload(); Preferences::disableRecursiveDownload();
} }
} }
void MainWindow::handleDownloadFromUrlFailure(QString url, QString reason) const{ void GUI::handleDownloadFromUrlFailure(QString url, QString reason) const{
// Display a message box // Display a message box
showNotificationBaloon(tr("Url download error"), tr("Couldn't download file at url: %1, reason: %2.").arg(url).arg(reason)); QMessageBox::critical(0, tr("Url download error"), tr("Couldn't download file at url: %1, reason: %2.").arg(url).arg(reason));
} }
void MainWindow::on_actionSet_global_upload_limit_triggered() { void GUI::on_actionSet_global_upload_limit_triggered() {
qDebug("actionSet_global_upload_limit_triggered"); qDebug("actionSet_global_upload_limit_triggered");
bool ok; bool ok;
const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Global Upload Speed Limit"), BTSession->getSession()->upload_rate_limit()); const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Global Upload Speed Limit"), BTSession->getSession()->upload_rate_limit());
@@ -559,21 +546,21 @@ void MainWindow::on_actionSet_global_upload_limit_triggered() {
qDebug("Setting global upload rate limit to %.1fKb/s", new_limit/1024.); qDebug("Setting global upload rate limit to %.1fKb/s", new_limit/1024.);
BTSession->getSession()->set_upload_rate_limit(new_limit); BTSession->getSession()->set_upload_rate_limit(new_limit);
if(new_limit <= 0) if(new_limit <= 0)
Preferences().setGlobalUploadLimit(-1); Preferences::setGlobalUploadLimit(-1);
else else
Preferences().setGlobalUploadLimit(new_limit/1024.); Preferences::setGlobalUploadLimit(new_limit/1024.);
} }
} }
void MainWindow::on_actionShow_console_triggered() { void GUI::on_actionShow_console_triggered() {
if(!console) { if(!console) {
console = new consoleDlg(this); console = new consoleDlg(this, BTSession);
} else { } else {
console->setFocus(); console->setFocus();
} }
} }
void MainWindow::on_actionSet_global_download_limit_triggered() { void GUI::on_actionSet_global_download_limit_triggered() {
qDebug("actionSet_global_download_limit_triggered"); qDebug("actionSet_global_download_limit_triggered");
bool ok; bool ok;
const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Global Download Speed Limit"), BTSession->getSession()->download_rate_limit()); const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Global Download Speed Limit"), BTSession->getSession()->download_rate_limit());
@@ -581,20 +568,20 @@ void MainWindow::on_actionSet_global_download_limit_triggered() {
qDebug("Setting global download rate limit to %.1fKb/s", new_limit/1024.); qDebug("Setting global download rate limit to %.1fKb/s", new_limit/1024.);
BTSession->getSession()->set_download_rate_limit(new_limit); BTSession->getSession()->set_download_rate_limit(new_limit);
if(new_limit <= 0) if(new_limit <= 0)
Preferences().setGlobalDownloadLimit(-1); Preferences::setGlobalDownloadLimit(-1);
else else
Preferences().setGlobalDownloadLimit(new_limit/1024.); Preferences::setGlobalDownloadLimit(new_limit/1024.);
} }
} }
// Necessary if we want to close the window // Necessary if we want to close the window
// in one time if "close to systray" is enabled // in one time if "close to systray" is enabled
void MainWindow::on_actionExit_triggered() { void GUI::on_actionExit_triggered() {
force_exit = true; force_exit = true;
close(); close();
} }
QWidget* MainWindow::getCurrentTabWidget() const { QWidget* GUI::getCurrentTabWidget() const {
if(isMinimized() || !isVisible()) if(isMinimized() || !isVisible())
return 0; return 0;
if(tabs->currentIndex() == 0) if(tabs->currentIndex() == 0)
@@ -602,22 +589,21 @@ QWidget* MainWindow::getCurrentTabWidget() const {
return tabs->currentWidget(); return tabs->currentWidget();
} }
void MainWindow::setTabText(int index, QString text) const { void GUI::setTabText(int index, QString text) const {
tabs->setTabText(index, text); tabs->setTabText(index, text);
} }
bool MainWindow::unlockUI() { bool GUI::unlockUI() {
bool ok = false; bool ok = false;
QString clear_password = QInputDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, "", &ok); QString clear_password = QInputDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, "", &ok);
if(!ok) return false; if(!ok) return false;
Preferences pref; QString real_pass_md5 = Preferences::getUILockPasswordMD5();
QString real_pass_md5 = pref.getUILockPasswordMD5();
QCryptographicHash md5(QCryptographicHash::Md5); QCryptographicHash md5(QCryptographicHash::Md5);
md5.addData(clear_password.toLocal8Bit()); md5.addData(clear_password.toLocal8Bit());
QString password_md5 = md5.result().toHex(); QString password_md5 = md5.result().toHex();
if(real_pass_md5 == password_md5) { if(real_pass_md5 == password_md5) {
ui_locked = false; ui_locked = false;
pref.setUILocked(false); Preferences::setUILocked(false);
myTrayIconMenu->setEnabled(true); myTrayIconMenu->setEnabled(true);
return true; return true;
} }
@@ -625,7 +611,7 @@ bool MainWindow::unlockUI() {
return false; return false;
} }
void MainWindow::notifyOfUpdate(QString) { void GUI::notifyOfUpdate(QString) {
// Show restart message // Show restart message
status_bar->showRestartRequired(); status_bar->showRestartRequired();
// Delete the executable watcher // Delete the executable watcher
@@ -634,7 +620,7 @@ void MainWindow::notifyOfUpdate(QString) {
} }
// Toggle Main window visibility // Toggle Main window visibility
void MainWindow::toggleVisibility(QSystemTrayIcon::ActivationReason e) { void GUI::toggleVisibility(QSystemTrayIcon::ActivationReason e) {
if(e == QSystemTrayIcon::Trigger || e == QSystemTrayIcon::DoubleClick) { if(e == QSystemTrayIcon::Trigger || e == QSystemTrayIcon::DoubleClick) {
if(isHidden()) { if(isHidden()) {
if(ui_locked) { if(ui_locked) {
@@ -659,7 +645,7 @@ void MainWindow::toggleVisibility(QSystemTrayIcon::ActivationReason e) {
} }
// Display About Dialog // Display About Dialog
void MainWindow::on_actionAbout_triggered() { void GUI::on_actionAbout_triggered() {
//About dialog //About dialog
if(aboutDlg) { if(aboutDlg) {
aboutDlg->setFocus(); aboutDlg->setFocus();
@@ -668,16 +654,18 @@ void MainWindow::on_actionAbout_triggered() {
} }
} }
void MainWindow::showEvent(QShowEvent *e) { void GUI::showEvent(QShowEvent *e) {
qDebug("** Show Event **"); qDebug("** Show Event **");
if(getCurrentTabWidget() == transferList) { if(getCurrentTabWidget() == transferList) {
qDebug("-> Refreshing transfer list");
transferList->refreshList();
properties->loadDynamicData(); properties->loadDynamicData();
} }
e->accept(); e->accept();
} }
// Called when we close the program // Called when we close the program
void MainWindow::closeEvent(QCloseEvent *e) { void GUI::closeEvent(QCloseEvent *e) {
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
const bool goToSystrayOnExit = settings.value(QString::fromUtf8("Preferences/General/CloseToTray"), false).toBool(); const bool goToSystrayOnExit = settings.value(QString::fromUtf8("Preferences/General/CloseToTray"), false).toBool();
if(!force_exit && systrayIcon && goToSystrayOnExit && !this->isHidden()) { if(!force_exit && systrayIcon && goToSystrayOnExit && !this->isHidden()) {
@@ -705,7 +693,7 @@ void MainWindow::closeEvent(QCloseEvent *e) {
} }
if(confirmBox.clickedButton() == alwaysBtn) { if(confirmBox.clickedButton() == alwaysBtn) {
// Remember choice // Remember choice
Preferences().setConfirmOnExit(false); Preferences::setConfirmOnExit(false);
} }
} }
} }
@@ -722,53 +710,54 @@ void MainWindow::closeEvent(QCloseEvent *e) {
} }
// Display window to create a torrent // Display window to create a torrent
void MainWindow::on_actionCreate_torrent_triggered() { void GUI::on_actionCreate_torrent_triggered() {
if(createTorrentDlg) { if(createTorrentDlg) {
createTorrentDlg->setFocus(); createTorrentDlg->setFocus();
} else { } else {
createTorrentDlg = new TorrentCreatorDlg(this); createTorrentDlg = new createtorrent(this);
connect(createTorrentDlg, SIGNAL(torrent_to_seed(QString)), this, SLOT(addTorrent(QString))); connect(createTorrentDlg, SIGNAL(torrent_to_seed(QString)), this, SLOT(addTorrent(QString)));
} }
} }
bool MainWindow::event(QEvent * e) { bool GUI::event(QEvent * e) {
switch(e->type()) { switch(e->type()) {
case QEvent::WindowStateChange: { case QEvent::WindowStateChange: {
qDebug("Window change event"); qDebug("Window change event");
//Now check to see if the window is minimised //Now check to see if the window is minimised
if(isMinimized()) { if(isMinimized()) {
qDebug("minimisation"); qDebug("minimisation");
if(systrayIcon && Preferences().minimizeToTray()) { QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
qDebug("Has active window: %d", (int)(qApp->activeWindow() != 0)); if(systrayIcon && settings.value(QString::fromUtf8("Preferences/General/MinimizeToTray"), false).toBool()) {
// Check if there is a modal window qDebug("Has active window: %d", (int)(qApp->activeWindow() != 0));
bool has_modal_window = false; // Check if there is a modal window
foreach (QWidget *widget, QApplication::allWidgets()) { bool has_modal_window = false;
if(widget->isModal()) { foreach (QWidget *widget, QApplication::allWidgets()) {
has_modal_window = true; if(widget->isModal()) {
break; has_modal_window = true;
break;
}
}
// Iconify if there is no modal window
if(!has_modal_window) {
qDebug("Minimize to Tray enabled, hiding!");
e->accept();
QTimer::singleShot(0, this, SLOT(hide()));
return true;
} }
} }
// Iconify if there is no modal window
if(!has_modal_window) {
qDebug("Minimize to Tray enabled, hiding!");
e->accept();
QTimer::singleShot(0, this, SLOT(hide()));
return true;
}
} }
break;
} }
break;
}
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
case QEvent::ToolBarChange: { case QEvent::ToolBarChange: {
qDebug("MAC: Received a toolbar change event!"); qDebug("MAC: Received a toolbar change event!");
bool ret = QMainWindow::event(e); bool ret = QMainWindow::event(e);
qDebug("MAC: new toolbar visibility is %d", !actionTop_tool_bar->isChecked()); qDebug("MAC: new toolbar visibility is %d", !actionTop_tool_bar->isChecked());
actionTop_tool_bar->toggle(); actionTop_tool_bar->toggle();
Preferences().setToolbarDisplayed(actionTop_tool_bar->isChecked()); Preferences::setToolbarDisplayed(actionTop_tool_bar->isChecked());
return ret; return ret;
} }
#endif #endif
default: default:
break; break;
@@ -777,7 +766,7 @@ bool MainWindow::event(QEvent * e) {
} }
// Action executed when a file is dropped // Action executed when a file is dropped
void MainWindow::dropEvent(QDropEvent *event) { void GUI::dropEvent(QDropEvent *event) {
event->acceptProposedAction(); event->acceptProposedAction();
QStringList files; QStringList files;
if(event->mimeData()->hasUrls()) { if(event->mimeData()->hasUrls()) {
@@ -814,7 +803,7 @@ void MainWindow::dropEvent(QDropEvent *event) {
continue; continue;
} }
if(useTorrentAdditionDialog) { if(useTorrentAdditionDialog) {
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
dialog->showLoad(file); dialog->showLoad(file);
}else{ }else{
BTSession->addTorrent(file); BTSession->addTorrent(file);
@@ -823,7 +812,7 @@ void MainWindow::dropEvent(QDropEvent *event) {
} }
// Decode if we accept drag 'n drop or not // Decode if we accept drag 'n drop or not
void MainWindow::dragEnterEvent(QDragEnterEvent *event) { void GUI::dragEnterEvent(QDragEnterEvent *event) {
foreach(const QString &mime, event->mimeData()->formats()){ foreach(const QString &mime, event->mimeData()->formats()){
qDebug("mimeData: %s", mime.toLocal8Bit().data()); qDebug("mimeData: %s", mime.toLocal8Bit().data());
} }
@@ -840,7 +829,7 @@ void MainWindow::dragEnterEvent(QDragEnterEvent *event) {
// Display a dialog to allow user to add // Display a dialog to allow user to add
// torrents to download list // torrents to download list
void MainWindow::on_actionOpen_triggered() { void GUI::on_actionOpen_triggered() {
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
// Open File Open Dialog // Open File Open Dialog
// Note: it is possible to select more than one file // Note: it is possible to select more than one file
@@ -852,7 +841,7 @@ void MainWindow::on_actionOpen_triggered() {
const uint listSize = pathsList.size(); const uint listSize = pathsList.size();
for(uint i=0; i<listSize; ++i) { for(uint i=0; i<listSize; ++i) {
if(useTorrentAdditionDialog) { if(useTorrentAdditionDialog) {
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
dialog->showLoad(pathsList.at(i)); dialog->showLoad(pathsList.at(i));
}else{ }else{
BTSession->addTorrent(pathsList.at(i)); BTSession->addTorrent(pathsList.at(i));
@@ -869,11 +858,11 @@ void MainWindow::on_actionOpen_triggered() {
// This function parse the parameters and call // This function parse the parameters and call
// the right addTorrent function, considering // the right addTorrent function, considering
// the parameter type. // the parameter type.
void MainWindow::processParams(const QString& params_str) { void GUI::processParams(const QString& params_str) {
processParams(params_str.split("|", QString::SkipEmptyParts)); processParams(params_str.split("|", QString::SkipEmptyParts));
} }
void MainWindow::processParams(const QStringList& params) { void GUI::processParams(const QStringList& params) {
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool(); const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
foreach(QString param, params) { foreach(QString param, params) {
@@ -887,14 +876,14 @@ void MainWindow::processParams(const QStringList& params) {
} }
if(param.startsWith("magnet:", Qt::CaseInsensitive)) { if(param.startsWith("magnet:", Qt::CaseInsensitive)) {
if(useTorrentAdditionDialog) { if(useTorrentAdditionDialog) {
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
dialog->showLoadMagnetURI(param); dialog->showLoadMagnetURI(param);
} else { } else {
BTSession->addMagnetUri(param); BTSession->addMagnetUri(param);
} }
} else { } else {
if(useTorrentAdditionDialog) { if(useTorrentAdditionDialog) {
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
dialog->showLoad(param); dialog->showLoad(param);
}else{ }else{
BTSession->addTorrent(param); BTSession->addTorrent(param);
@@ -904,30 +893,30 @@ void MainWindow::processParams(const QStringList& params) {
} }
} }
void MainWindow::addTorrent(QString path) { void GUI::addTorrent(QString path) {
BTSession->addTorrent(path); BTSession->addTorrent(path);
} }
void MainWindow::processDownloadedFiles(QString path, QString url) { void GUI::processDownloadedFiles(QString path, QString url) {
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool(); const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
if(useTorrentAdditionDialog) { if(useTorrentAdditionDialog) {
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
dialog->showLoad(path, url); dialog->showLoad(path, url);
}else{ }else{
BTSession->addTorrent(path, false, url); BTSession->addTorrent(path, false, url);
} }
} }
void MainWindow::optionsSaved() { void GUI::optionsSaved() {
loadPreferences(); loadPreferences();
} }
// Load program preferences // Load program preferences
void MainWindow::loadPreferences(bool configure_session) { void GUI::loadPreferences(bool configure_session) {
BTSession->addConsoleMessage(tr("Options were saved successfully.")); BTSession->addConsoleMessage(tr("Options were saved successfully."));
const Preferences pref; #ifndef Q_WS_MAC
const bool newSystrayIntegration = pref.systrayIntegration(); const bool newSystrayIntegration = Preferences::systrayIntegration();
actionLock_qBittorrent->setEnabled(newSystrayIntegration); actionLock_qBittorrent->setEnabled(newSystrayIntegration);
if(newSystrayIntegration != (systrayIcon!=0)) { if(newSystrayIntegration != (systrayIcon!=0)) {
if(newSystrayIntegration) { if(newSystrayIntegration) {
@@ -951,8 +940,9 @@ void MainWindow::loadPreferences(bool configure_session) {
delete myTrayIconMenu; delete myTrayIconMenu;
} }
} }
#endif
// General // General
if(pref.isToolbarDisplayed()) { if(Preferences::isToolbarDisplayed()) {
toolBar->setVisible(true); toolBar->setVisible(true);
toolBar->layout()->setSpacing(7); toolBar->layout()->setSpacing(7);
} else { } else {
@@ -960,14 +950,14 @@ void MainWindow::loadPreferences(bool configure_session) {
search_filter->clear(); search_filter->clear();
toolBar->setVisible(false); toolBar->setVisible(false);
} }
const uint new_refreshInterval = pref.getRefreshInterval(); const uint new_refreshInterval = Preferences::getRefreshInterval();
transferList->setRefreshInterval(new_refreshInterval); transferList->setRefreshInterval(new_refreshInterval);
transferList->setAlternatingRowColors(pref.useAlternatingRowColors()); transferList->setAlternatingRowColors(Preferences::useAlternatingRowColors());
properties->getFilesList()->setAlternatingRowColors(pref.useAlternatingRowColors()); properties->getFilesList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
properties->getTrackerList()->setAlternatingRowColors(pref.useAlternatingRowColors()); properties->getTrackerList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
properties->getPeerList()->setAlternatingRowColors(pref.useAlternatingRowColors()); properties->getPeerList()->setAlternatingRowColors(Preferences::useAlternatingRowColors());
// Queueing System // Queueing System
if(pref.isQueueingSystemEnabled()) { if(Preferences::isQueueingSystemEnabled()) {
if(!actionDecreasePriority->isVisible()) { if(!actionDecreasePriority->isVisible()) {
transferList->hidePriorityColumn(false); transferList->hidePriorityColumn(false);
actionDecreasePriority->setVisible(true); actionDecreasePriority->setVisible(true);
@@ -996,7 +986,7 @@ void MainWindow::loadPreferences(bool configure_session) {
qDebug("GUI settings loaded"); qDebug("GUI settings loaded");
} }
void MainWindow::addUnauthenticatedTracker(const QPair<QTorrentHandle,QString> &tracker) { void GUI::addUnauthenticatedTracker(const QPair<QTorrentHandle,QString> &tracker) {
// Trackers whose authentication was cancelled // Trackers whose authentication was cancelled
if(unauthenticated_trackers.indexOf(tracker) < 0) { if(unauthenticated_trackers.indexOf(tracker) < 0) {
unauthenticated_trackers << tracker; unauthenticated_trackers << tracker;
@@ -1004,7 +994,7 @@ void MainWindow::addUnauthenticatedTracker(const QPair<QTorrentHandle,QString> &
} }
// Called when a tracker requires authentication // Called when a tracker requires authentication
void MainWindow::trackerAuthenticationRequired(QTorrentHandle& h) { void GUI::trackerAuthenticationRequired(QTorrentHandle& h) {
if(unauthenticated_trackers.indexOf(QPair<QTorrentHandle,QString>(h, h.current_tracker())) < 0) { if(unauthenticated_trackers.indexOf(QPair<QTorrentHandle,QString>(h, h.current_tracker())) < 0) {
// Tracker login // Tracker login
new trackerLogin(this, h); new trackerLogin(this, h);
@@ -1012,10 +1002,11 @@ void MainWindow::trackerAuthenticationRequired(QTorrentHandle& h) {
} }
// Check connection status and display right icon // Check connection status and display right icon
void MainWindow::updateGUI() { void GUI::updateGUI() {
// update global informations // update global informations
#ifndef Q_WS_MAC
if(systrayIcon) { if(systrayIcon) {
#if defined(Q_WS_X11) || defined(Q_WS_MAC) #if defined(Q_WS_X11)
QString html = "<div style='background-color: #678db2; color: #fff;height: 18px; font-weight: bold; margin-bottom: 5px;'>"; QString html = "<div style='background-color: #678db2; color: #fff;height: 18px; font-weight: bold; margin-bottom: 5px;'>";
html += tr("qBittorrent"); html += tr("qBittorrent");
html += "</div>"; html += "</div>";
@@ -1033,13 +1024,14 @@ void MainWindow::updateGUI() {
#endif #endif
systrayIcon->setToolTip(html); // tray icon systrayIcon->setToolTip(html); // tray icon
} }
#endif
if(displaySpeedInTitle) { if(displaySpeedInTitle) {
setWindowTitle(tr("qBittorrent %1 (Down: %2/s, Up: %3/s)", "%1 is qBittorrent version").arg(QString::fromUtf8(VERSION)).arg(misc::friendlyUnit(BTSession->getSessionStatus().payload_download_rate)).arg(misc::friendlyUnit(BTSession->getSessionStatus().payload_upload_rate))); setWindowTitle(tr("qBittorrent %1 (Down: %2/s, Up: %3/s)", "%1 is qBittorrent version").arg(QString::fromUtf8(VERSION)).arg(misc::friendlyUnit(BTSession->getSessionStatus().payload_download_rate)).arg(misc::friendlyUnit(BTSession->getSessionStatus().payload_upload_rate)));
} }
} }
void MainWindow::showNotificationBaloon(QString title, QString msg) const { void GUI::showNotificationBaloon(QString title, QString msg) const {
if(!Preferences().useProgramNotification()) return; if(!Preferences::useProgramNotification()) return;
#ifdef WITH_LIBNOTIFY #ifdef WITH_LIBNOTIFY
if (notify_init ("summary-body")) { if (notify_init ("summary-body")) {
NotifyNotification* notification; NotifyNotification* notification;
@@ -1057,8 +1049,10 @@ void MainWindow::showNotificationBaloon(QString title, QString msg) const {
} }
} }
#endif #endif
#ifndef Q_WS_MAC
if(systrayIcon && QSystemTrayIcon::supportsMessages()) if(systrayIcon && QSystemTrayIcon::supportsMessages())
systrayIcon->showMessage(title, msg, QSystemTrayIcon::Information, TIME_TRAY_BALLOON); systrayIcon->showMessage(title, msg, QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
#endif
} }
/***************************************************** /*****************************************************
@@ -1067,7 +1061,7 @@ void MainWindow::showNotificationBaloon(QString title, QString msg) const {
* * * *
*****************************************************/ *****************************************************/
void MainWindow::downloadFromURLList(const QStringList& url_list) { void GUI::downloadFromURLList(const QStringList& url_list) {
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool(); const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
foreach(QString url, url_list) { foreach(QString url, url_list) {
@@ -1077,7 +1071,7 @@ void MainWindow::downloadFromURLList(const QStringList& url_list) {
} }
if(url.startsWith("magnet:", Qt::CaseInsensitive)) { if(url.startsWith("magnet:", Qt::CaseInsensitive)) {
if(useTorrentAdditionDialog) { if(useTorrentAdditionDialog) {
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this, BTSession);
dialog->showLoadMagnetURI(url); dialog->showLoadMagnetURI(url);
} else { } else {
BTSession->addMagnetUri(url); BTSession->addMagnetUri(url);
@@ -1094,7 +1088,8 @@ void MainWindow::downloadFromURLList(const QStringList& url_list) {
* * * *
*****************************************************/ *****************************************************/
void MainWindow::createSystrayDelayed() { void GUI::createSystrayDelayed() {
#ifndef Q_WS_MAC
static int timeout = 20; static int timeout = 20;
if(QSystemTrayIcon::isSystemTrayAvailable()) { if(QSystemTrayIcon::isSystemTrayAvailable()) {
// Ok, systray integration is now supported // Ok, systray integration is now supported
@@ -1112,16 +1107,17 @@ void MainWindow::createSystrayDelayed() {
delete systrayCreator; delete systrayCreator;
// Disable it in program preferences to // Disable it in program preferences to
// avoid trying at earch startup // avoid trying at earch startup
Preferences().setSystrayIntegration(false); Preferences::setSystrayIntegration(false);
} }
} }
#endif
} }
void MainWindow::updateAltSpeedsBtn(bool alternative) { void GUI::updateAltSpeedsBtn(bool alternative) {
actionUse_alternative_speed_limits->setChecked(alternative); actionUse_alternative_speed_limits->setChecked(alternative);
} }
QMenu* MainWindow::getTrayIconMenu() { QMenu* GUI::getTrayIconMenu() {
if(myTrayIconMenu) if(myTrayIconMenu)
return myTrayIconMenu; return myTrayIconMenu;
// Tray icon Menu // Tray icon Menu
@@ -1129,9 +1125,8 @@ QMenu* MainWindow::getTrayIconMenu() {
myTrayIconMenu->addAction(actionOpen); myTrayIconMenu->addAction(actionOpen);
myTrayIconMenu->addAction(actionDownload_from_URL); myTrayIconMenu->addAction(actionDownload_from_URL);
myTrayIconMenu->addSeparator(); myTrayIconMenu->addSeparator();
const bool isAltBWEnabled = Preferences().isAltBandwidthEnabled(); updateAltSpeedsBtn(Preferences::isAltBandwidthEnabled());
updateAltSpeedsBtn(isAltBWEnabled); actionUse_alternative_speed_limits->setChecked(Preferences::isAltBandwidthEnabled());
actionUse_alternative_speed_limits->setChecked(isAltBWEnabled);
myTrayIconMenu->addAction(actionUse_alternative_speed_limits); myTrayIconMenu->addAction(actionUse_alternative_speed_limits);
myTrayIconMenu->addAction(actionSet_global_download_limit); myTrayIconMenu->addAction(actionSet_global_download_limit);
myTrayIconMenu->addAction(actionSet_global_upload_limit); myTrayIconMenu->addAction(actionSet_global_upload_limit);
@@ -1145,7 +1140,7 @@ QMenu* MainWindow::getTrayIconMenu() {
return myTrayIconMenu; return myTrayIconMenu;
} }
void MainWindow::createTrayIcon() { void GUI::createTrayIcon() {
// Tray icon // Tray icon
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
systrayIcon = new QSystemTrayIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent16.png")), this); systrayIcon = new QSystemTrayIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent16.png")), this);
@@ -1161,7 +1156,7 @@ void MainWindow::createTrayIcon() {
} }
// Display Program Options // Display Program Options
void MainWindow::on_actionOptions_triggered() { void GUI::on_actionOptions_triggered() {
if(options) { if(options) {
// Get focus // Get focus
options->setFocus(); options->setFocus();
@@ -1171,46 +1166,36 @@ void MainWindow::on_actionOptions_triggered() {
} }
} }
void MainWindow::on_actionTop_tool_bar_triggered() { void GUI::on_actionTop_tool_bar_triggered() {
bool is_visible = static_cast<QAction*>(sender())->isChecked(); bool is_visible = static_cast<QAction*>(sender())->isChecked();
toolBar->setVisible(is_visible); toolBar->setVisible(is_visible);
Preferences().setToolbarDisplayed(is_visible); Preferences::setToolbarDisplayed(is_visible);
} }
void MainWindow::on_actionShutdown_when_downloads_complete_triggered() { void GUI::on_actionShutdown_when_downloads_complete_triggered() {
bool is_checked = static_cast<QAction*>(sender())->isChecked(); bool is_checked = static_cast<QAction*>(sender())->isChecked();
Preferences().setShutdownWhenDownloadsComplete(is_checked); Preferences::setShutdownWhenDownloadsComplete(is_checked);
} }
void MainWindow::on_actionShutdown_qBittorrent_when_downloads_complete_triggered() { void GUI::on_actionSpeed_in_title_bar_triggered() {
bool is_checked = static_cast<QAction*>(sender())->isChecked();
Preferences().setShutdownqBTWhenDownloadsComplete(is_checked);
}
void MainWindow::on_actionSpeed_in_title_bar_triggered() {
displaySpeedInTitle = static_cast<QAction*>(sender())->isChecked(); displaySpeedInTitle = static_cast<QAction*>(sender())->isChecked();
Preferences().showSpeedInTitleBar(displaySpeedInTitle); Preferences::showSpeedInTitleBar(displaySpeedInTitle);
if(displaySpeedInTitle) if(displaySpeedInTitle)
updateGUI(); updateGUI();
else else
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION))); setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
} }
void MainWindow::on_actionRSS_Reader_triggered() { void GUI::on_actionRSS_Reader_triggered() {
RssSettings().setRSSEnabled(actionRSS_Reader->isChecked()); Preferences::setRSSEnabled(actionRSS_Reader->isChecked());
displayRSSTab(actionRSS_Reader->isChecked()); displayRSSTab(actionRSS_Reader->isChecked());
} }
void MainWindow::on_actionSearch_engine_triggered() { void GUI::on_actionSearch_engine_triggered() {
Preferences().setSearchEnabled(actionSearch_engine->isChecked()); Preferences::setSearchEnabled(actionSearch_engine->isChecked());
displaySearchTab(actionSearch_engine->isChecked()); displaySearchTab(actionSearch_engine->isChecked());
} }
void MainWindow::on_action_Import_Torrent_triggered()
{
TorrentImportDlg::importTorrent();
}
/***************************************************** /*****************************************************
* * * *
* HTTP Downloader * * HTTP Downloader *
@@ -1219,47 +1204,15 @@ void MainWindow::on_action_Import_Torrent_triggered()
// Display an input dialog to prompt user for // Display an input dialog to prompt user for
// an url // an url
void MainWindow::on_actionDownload_from_URL_triggered() { void GUI::on_actionDownload_from_URL_triggered() {
if(!downloadFromURLDialog) { if(!downloadFromURLDialog) {
downloadFromURLDialog = new downloadFromURL(this); downloadFromURLDialog = new downloadFromURL(this);
connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&))); connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&)));
} }
} }
#if defined(Q_WS_WIN) || defined(Q_WS_MAC) void GUI::on_actionDonate_money_triggered()
void GUI::handleUpdateCheckFinished(bool update_available, QString new_version)
{ {
if(update_available) { QDesktopServices::openUrl(QUrl("http://sourceforge.net/donate/index.php?group_id=163414"));
if(QMessageBox::question(this, tr("A newer version is available"),
tr("A newer version of qBittorrent is available on Sourceforge.\nWould you like to update qBittorrent to version %1?").arg(new_version),
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) {
// The user want to update, let's download the update
ProgramUpdater* updater = dynamic_cast<ProgramUpdater*>(sender());
connect(updater, SIGNAL(updateInstallFinished(QString)), SLOT(handleUpdateInstalled(QString)));
updater->updateProgram();
return;
}
}
sender()->deleteLater();
} }
void GUI::handleUpdateInstalled(QString error_msg)
{
if(!error_msg.isEmpty()) {
QMessageBox::critical(this, tr("Impossible to update qBittorrent"), tr("qBittorrent failed to update, reason: %1").arg(error_msg));
}
}
#endif
void MainWindow::on_actionDonate_money_triggered()
{
QDesktopServices::openUrl(QUrl("http://sourceforge.net/donate/index.php?group_id=163414"));
}
void MainWindow::showConnectionSettings()
{
on_actionOptions_triggered();
options->showConnectionTab();
}

View File

@@ -37,7 +37,7 @@
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "qtorrenthandle.h" #include "qtorrenthandle.h"
class QBtSession; class Bittorrent;
class QTimer; class QTimer;
class downloadFromURL; class downloadFromURL;
class SearchEngine; class SearchEngine;
@@ -54,19 +54,19 @@ class PropertiesWidget;
class StatusBar; class StatusBar;
class consoleDlg; class consoleDlg;
class about; class about;
class TorrentCreatorDlg; class createtorrent;
class downloadFromURL; class downloadFromURL;
class HidableTabWidget; class HidableTabWidget;
class LineEdit; class LineEdit;
class QFileSystemWatcher; class QFileSystemWatcher;
class MainWindow : public QMainWindow, private Ui::MainWindow{ class GUI : public QMainWindow, private Ui::MainWindow{
Q_OBJECT Q_OBJECT
public: public:
// Construct / Destruct // Construct / Destruct
MainWindow(QWidget *parent=0, QStringList torrentCmdLine=QStringList()); GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
~MainWindow(); ~GUI();
// Methods // Methods
QWidget* getCurrentTabWidget() const; QWidget* getCurrentTabWidget() const;
TransferListWidget* getTransferList() const { return transferList; } TransferListWidget* getTransferList() const { return transferList; }
@@ -79,7 +79,7 @@ public slots:
void showNotificationBaloon(QString title, QString msg) const; void showNotificationBaloon(QString title, QString msg) const;
void downloadFromURLList(const QStringList& urls); void downloadFromURLList(const QStringList& urls);
void updateAltSpeedsBtn(bool alternative); void updateAltSpeedsBtn(bool alternative);
void updateNbTorrents(); void updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused);
void deleteBTSession(); void deleteBTSession();
protected slots: protected slots:
@@ -105,7 +105,6 @@ protected slots:
void defineUILockPassword(); void defineUILockPassword();
bool unlockUI(); bool unlockUI();
void notifyOfUpdate(QString); void notifyOfUpdate(QString);
void showConnectionSettings();
// Keyboard shortcuts // Keyboard shortcuts
void createKeyboardShortcuts(); void createKeyboardShortcuts();
void displayTransferTab() const; void displayTransferTab() const;
@@ -130,10 +129,6 @@ protected slots:
void optionsSaved(); void optionsSaved();
// HTTP slots // HTTP slots
void on_actionDownload_from_URL_triggered(); void on_actionDownload_from_URL_triggered();
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
void handleUpdateCheckFinished(bool update_available, QString new_version);
void handleUpdateInstalled(QString error_msg);
#endif
protected: protected:
void closeEvent(QCloseEvent *); void closeEvent(QCloseEvent *);
@@ -145,7 +140,7 @@ protected:
private: private:
QFileSystemWatcher *executable_watcher; QFileSystemWatcher *executable_watcher;
// Bittorrent // Bittorrent
QBtSession *BTSession; Bittorrent *BTSession;
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed? QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
// GUI related // GUI related
QTimer *guiUpdater; QTimer *guiUpdater;
@@ -154,7 +149,7 @@ private:
QPointer<options_imp> options; QPointer<options_imp> options;
QPointer<consoleDlg> console; QPointer<consoleDlg> console;
QPointer<about> aboutDlg; QPointer<about> aboutDlg;
QPointer<TorrentCreatorDlg> createTorrentDlg; QPointer<createtorrent> createTorrentDlg;
QPointer<downloadFromURL> downloadFromURLDialog; QPointer<downloadFromURL> downloadFromURLDialog;
QPointer<QSystemTrayIcon> systrayIcon; QPointer<QSystemTrayIcon> systrayIcon;
QPointer<QTimer> systrayCreator; QPointer<QTimer> systrayCreator;
@@ -188,8 +183,6 @@ private slots:
void on_actionSpeed_in_title_bar_triggered(); void on_actionSpeed_in_title_bar_triggered();
void on_actionTop_tool_bar_triggered(); void on_actionTop_tool_bar_triggered();
void on_actionShutdown_when_downloads_complete_triggered(); void on_actionShutdown_when_downloads_complete_triggered();
void on_actionShutdown_qBittorrent_when_downloads_complete_triggered();
void on_action_Import_Torrent_triggered();
void on_actionDonate_money_triggered(); void on_actionDonate_money_triggered();
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 600 B

BIN
src/Icons/flags/algeria.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/Icons/flags/austria.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

BIN
src/Icons/flags/belarus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

BIN
src/Icons/flags/belgium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

BIN
src/Icons/flags/bosnia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

BIN
src/Icons/flags/brazil.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

BIN
src/Icons/flags/canada.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

BIN
src/Icons/flags/china.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

BIN
src/Icons/flags/croatia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

BIN
src/Icons/flags/czech.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

BIN
src/Icons/flags/denmark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 B

BIN
src/Icons/flags/egypt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

BIN
src/Icons/flags/finland.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 B

Some files were not shown because too many files have changed in this diff Show More