Compare commits
185 Commits
release-2.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fd3e278284 | ||
![]() |
c713bd56e0 | ||
![]() |
efcd652e3d | ||
![]() |
8d6df1f15f | ||
![]() |
ca835a105b | ||
![]() |
2de1a7cc30 | ||
![]() |
3de83319a8 | ||
![]() |
cfc75905a2 | ||
![]() |
2c30d5a1ca | ||
![]() |
d162d0c3c6 | ||
![]() |
509eb9bcf0 | ||
![]() |
1766877605 | ||
![]() |
fa78fba559 | ||
![]() |
44ff7161aa | ||
![]() |
96837a3658 | ||
![]() |
e4d93a96e7 | ||
![]() |
ccb2ed9a69 | ||
![]() |
ae5693544d | ||
![]() |
3a72c11e39 | ||
![]() |
4176abd18a | ||
![]() |
cba36fcb14 | ||
![]() |
9f33656e61 | ||
![]() |
a4123a6462 | ||
![]() |
313b2630bd | ||
![]() |
87b0ae9a79 | ||
![]() |
81778a0090 | ||
![]() |
5d0d63d89a | ||
![]() |
764e8a365b | ||
![]() |
e302042520 | ||
![]() |
e453eb9a91 | ||
![]() |
98fcb91dae | ||
![]() |
c8a1f625f0 | ||
![]() |
b70cf7c049 | ||
![]() |
ecdfe63d00 | ||
![]() |
7635fe51f7 | ||
![]() |
8cba38ac62 | ||
![]() |
fab63e6ffc | ||
![]() |
27f257ba03 | ||
![]() |
a2aa462030 | ||
![]() |
0f44804225 | ||
![]() |
de78fc495b | ||
![]() |
93731f1b3f | ||
![]() |
2e9e10299c | ||
![]() |
9f627b5ec9 | ||
![]() |
ad252f432a | ||
![]() |
eb1feddea6 | ||
![]() |
1634014dde | ||
![]() |
e863772159 | ||
![]() |
7c34f4e93c | ||
![]() |
91032056e1 | ||
![]() |
f427d267b6 | ||
![]() |
a7a8265053 | ||
![]() |
827fceca83 | ||
![]() |
7aaa3e8f51 | ||
![]() |
1fe49198d1 | ||
![]() |
c582aff563 | ||
![]() |
5272f1cba3 | ||
![]() |
b72d356083 | ||
![]() |
fbd6533eee | ||
![]() |
2998dbd0a1 | ||
![]() |
cb8da634f4 | ||
![]() |
e8f229816e | ||
![]() |
fe0fc952e8 | ||
![]() |
29a76ae600 | ||
![]() |
5471600dfb | ||
![]() |
df42c4d59f | ||
![]() |
8047495b2e | ||
![]() |
de04b47c29 | ||
![]() |
b709bec24d | ||
![]() |
35f93e8e16 | ||
![]() |
554a84f8b0 | ||
![]() |
f26fcabde1 | ||
![]() |
75b91c204d | ||
![]() |
0837c25602 | ||
![]() |
34f8937b8d | ||
![]() |
4a7f3ee415 | ||
![]() |
b218531ff7 | ||
![]() |
e96dee2038 | ||
![]() |
080105c088 | ||
![]() |
5d2535c1c1 | ||
![]() |
49b21059fa | ||
![]() |
c1af948649 | ||
![]() |
36ad3df9e7 | ||
![]() |
e607d721a2 | ||
![]() |
5bfbfeb665 | ||
![]() |
1f1eabb1e9 | ||
![]() |
762050f8fc | ||
![]() |
e3c1270205 | ||
![]() |
414685910b | ||
![]() |
d61b9c5d4d | ||
![]() |
cf86a1cecd | ||
![]() |
a3f3287e24 | ||
![]() |
6e18d780ba | ||
![]() |
7dde763fc6 | ||
![]() |
8c85ffca5f | ||
![]() |
321e568d86 | ||
![]() |
e0649a7e78 | ||
![]() |
4cd3233cd0 | ||
![]() |
c554528afe | ||
![]() |
7ab7f4b0fc | ||
![]() |
58c0ac7638 | ||
![]() |
2514224a3a | ||
![]() |
247f6b4a8e | ||
![]() |
3d89864b75 | ||
![]() |
7ac75ad772 | ||
![]() |
caa628371f | ||
![]() |
fd31f632d9 | ||
![]() |
a25b6e087b | ||
![]() |
1626d938d1 | ||
![]() |
a4c7640499 | ||
![]() |
2c1b93a12b | ||
![]() |
8f19025c2a | ||
![]() |
20d41bcff2 | ||
![]() |
1ad77e00ff | ||
![]() |
0b65c02666 | ||
![]() |
294095367a | ||
![]() |
05a6ffd554 | ||
![]() |
e0a30dc40c | ||
![]() |
1940bc4e73 | ||
![]() |
a7e4e0273a | ||
![]() |
29a9d57cdc | ||
![]() |
9c7a4e4983 | ||
![]() |
35ead5bcf2 | ||
![]() |
645bd58d79 | ||
![]() |
6c47a552ab | ||
![]() |
f54bc8bea4 | ||
![]() |
eb54d81c5e | ||
![]() |
431d2f082c | ||
![]() |
a0ff0cdc7e | ||
![]() |
fb91558261 | ||
![]() |
fc2a47ca31 | ||
![]() |
dcccbaad59 | ||
![]() |
99d040de3f | ||
![]() |
ee30a75b57 | ||
![]() |
8c001aa478 | ||
![]() |
849bc11a01 | ||
![]() |
5024e0b092 | ||
![]() |
d93447489b | ||
![]() |
33988e70ab | ||
![]() |
d2b41d70c8 | ||
![]() |
8e1e51d268 | ||
![]() |
53500ea005 | ||
![]() |
e048389dea | ||
![]() |
fa7b1a205d | ||
![]() |
7dd6b7e9bb | ||
![]() |
78b96accda | ||
![]() |
73d0e2568a | ||
![]() |
92fc212a0e | ||
![]() |
6f4d7b7c1b | ||
![]() |
63ee1c36e8 | ||
![]() |
7d07debcb5 | ||
![]() |
dd67e1ee9d | ||
![]() |
493efdbf10 | ||
![]() |
e323175275 | ||
![]() |
c1fa7f8645 | ||
![]() |
275b962363 | ||
![]() |
3847c33017 | ||
![]() |
9e21f52213 | ||
![]() |
25cf9b33ec | ||
![]() |
c7a2d3589f | ||
![]() |
d8dd3834c3 | ||
![]() |
ee01c2c745 | ||
![]() |
e7e5a2b4e9 | ||
![]() |
ff16f59be1 | ||
![]() |
2cd4937ddc | ||
![]() |
0e9abc1762 | ||
![]() |
e24ce87946 | ||
![]() |
308e358d3f | ||
![]() |
d15e6a4847 | ||
![]() |
e311239a28 | ||
![]() |
df677789d2 | ||
![]() |
0af44eadb6 | ||
![]() |
85cafe530e | ||
![]() |
7609db28f1 | ||
![]() |
fefda39284 | ||
![]() |
b2f98bd059 | ||
![]() |
26c69fe6d4 | ||
![]() |
bf4f1a7c37 | ||
![]() |
9b0dd39d9d | ||
![]() |
66d4cc2ab8 | ||
![]() |
0bcbaf6521 | ||
![]() |
e074872b24 | ||
![]() |
63ec1e618e | ||
![]() |
331c15b76c | ||
![]() |
d2089c9aad |
4
AUTHORS
@@ -12,7 +12,7 @@ Contributors:
|
||||
* Silvan Scherrer <silvan.scherrer@aroa.ch>
|
||||
|
||||
Code from other projects:
|
||||
* files src/qtsingleapp/*
|
||||
* files src/qtsingleapp/* src/lineedit/*
|
||||
copyright: Nokia Corporation
|
||||
license: LGPL
|
||||
|
||||
@@ -83,7 +83,7 @@ Translations authors:
|
||||
- German: Niels Hoffmann (zentralmaschine@users.sourceforge.net)
|
||||
- Greek: Tsvetan Bankov (emerge_life@users.sourceforge.net) and Stephanos Antaris (santaris@csd.auth.gr)
|
||||
- Hungarian: Majoros Péter (majoros.j.p@t-online.hu)
|
||||
- Italian: Mirko Ferrari (mirkoferrari@gmail.com) and Ferraro Luciano (luciano.ferraro@gmail.com)
|
||||
- Italian: Matteo Sechi (bu17714@gmail.com)
|
||||
- Japanese: Nardog (alphisation@gmail.com)
|
||||
- Korean: Jin Woo Sin (jin828sin@users.sourceforge.net)
|
||||
- Norwegian: Lars-Erik Labori (hamil@users.sourceforge.net)
|
||||
|
100
Changelog
@@ -1,4 +1,102 @@
|
||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.3.0
|
||||
* Wed Nov 10 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.10
|
||||
- BUGFIX: Fix possible crash when selecting a RSS item (really closes #575624)
|
||||
- BUGFIX: Improved IPv6 support (IP filter and Peer list)
|
||||
- BUGFIX: Make IP filter more tolerant towards strangely formatted IPs
|
||||
- BUGFIX: More reliable folder scanning
|
||||
- BUGFIX: Do not create the torrent root folder at final destination if
|
||||
torrent is in the temp dir (closes #673271)
|
||||
- BUGFIX: Fix compilation with libnotify v0.7.0 (closes #671769)
|
||||
- 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
|
||||
- FEATURE: Added actions to "Move to top/bottom" of priority queue
|
||||
- FEATURE: Auto-Shutdown on downloads completion
|
||||
- FEATURE: Email notification on download completion
|
||||
- FEATURE: Added button to password-lock the UI
|
||||
- FEATURE: Added label-level Pause/Resume/Delete actions
|
||||
- FEATURE: Torrents can now be filtered by name
|
||||
- FEATURE: Run external program on torrent completion
|
||||
- FEATURE: Detect executable updates in order to advise the user to restart
|
||||
|
||||
* Tue Jul 27 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.3.0
|
||||
- FEATURE: Simplified torrent root folder renaming/truncating (< v2.3.0 is no longer forward compatible)
|
||||
- FEATURE: Remember previous save paths in torrent addition dialog
|
||||
- FEATURE: Max number of half-open connections can now be edited
|
||||
|
26
qcm/qtsingleapplication.qcm
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: libboost
|
||||
arg: with-qtsingleapplication=[system|shipped], Use the shipped qtsingleapplication library or the system one
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
class qc_qtsingleapplication : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_qtsingleapplication(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "qtsingleapplication library"; }
|
||||
QString shortname() const { return "qtsingleapplication"; }
|
||||
|
||||
bool exec(){
|
||||
QString s;
|
||||
s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION");
|
||||
if(s.compare("system", Qt::CaseInsensitive) == 0) {
|
||||
// System
|
||||
conf->addDefine("USE_SYSTEM_QTSINGLEAPPLICATION");
|
||||
printf(" [system] ");
|
||||
} else {
|
||||
printf(" [shipped] ");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
164
src/GUI.cpp
14
src/GUI.h
@@ -57,6 +57,8 @@ class about;
|
||||
class createtorrent;
|
||||
class downloadFromURL;
|
||||
class HidableTabWidget;
|
||||
class LineEdit;
|
||||
class QFileSystemWatcher;
|
||||
|
||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
Q_OBJECT
|
||||
@@ -69,6 +71,7 @@ public:
|
||||
QWidget* getCurrentTabWidget() const;
|
||||
TransferListWidget* getTransferList() const { return transferList; }
|
||||
QMenu* getTrayIconMenu();
|
||||
PropertiesWidget *getProperties() const { return properties; }
|
||||
|
||||
public slots:
|
||||
void trackerAuthenticationRequired(QTorrentHandle& h);
|
||||
@@ -77,6 +80,7 @@ public slots:
|
||||
void downloadFromURLList(const QStringList& urls);
|
||||
void updateAltSpeedsBtn(bool alternative);
|
||||
void updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused);
|
||||
void deleteBTSession();
|
||||
|
||||
protected slots:
|
||||
// GUI related slots
|
||||
@@ -97,6 +101,10 @@ protected slots:
|
||||
void handleDownloadFromUrlFailure(QString, QString) const;
|
||||
void createSystrayDelayed();
|
||||
void tab_changed(int);
|
||||
void on_actionLock_qBittorrent_triggered();
|
||||
void defineUILockPassword();
|
||||
bool unlockUI();
|
||||
void notifyOfUpdate(QString);
|
||||
// Keyboard shortcuts
|
||||
void createKeyboardShortcuts();
|
||||
void displayTransferTab() const;
|
||||
@@ -130,6 +138,7 @@ protected:
|
||||
void displaySearchTab(bool enable);
|
||||
|
||||
private:
|
||||
QFileSystemWatcher *executable_watcher;
|
||||
// Bittorrent
|
||||
Bittorrent *BTSession;
|
||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
|
||||
@@ -150,6 +159,8 @@ private:
|
||||
PropertiesWidget *properties;
|
||||
bool displaySpeedInTitle;
|
||||
bool force_exit;
|
||||
bool ui_locked;
|
||||
LineEdit *search_filter;
|
||||
// Keyboard shortcuts
|
||||
QShortcut *switchSearchShortcut;
|
||||
QShortcut *switchSearchShortcut2;
|
||||
@@ -160,6 +171,7 @@ private:
|
||||
QAction *prioSeparator2;
|
||||
QSplitter *hSplitter;
|
||||
QSplitter *vSplitter;
|
||||
QMenu *lockMenu;
|
||||
// Search
|
||||
QPointer<SearchEngine> searchEngine;
|
||||
// RSS
|
||||
@@ -170,6 +182,8 @@ private slots:
|
||||
void on_actionRSS_Reader_triggered();
|
||||
void on_actionSpeed_in_title_bar_triggered();
|
||||
void on_actionTop_tool_bar_triggered();
|
||||
void on_actionShutdown_when_downloads_complete_triggered();
|
||||
void on_actionDonate_money_triggered();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
BIN
src/Icons/oxygen/emblem-favorite.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
src/Icons/oxygen/encrypted32.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
src/Icons/oxygen/go-bottom.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
src/Icons/oxygen/go-down.png
Normal file
After Width: | Height: | Size: 892 B |
BIN
src/Icons/oxygen/go-top.png
Normal file
After Width: | Height: | Size: 996 B |
BIN
src/Icons/oxygen/go-up.png
Normal file
After Width: | Height: | Size: 929 B |
@@ -1,6 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;Network;P2P;
|
||||
Comment=V2.3.0
|
||||
Comment=V2.4.10
|
||||
Exec=qbittorrent %f
|
||||
GenericName=Bittorrent client
|
||||
GenericName[ar]=العميل Bittorrent
|
||||
|
BIN
src/Icons/skin/arrow-right.gif
Normal file
After Width: | Height: | Size: 54 B |
BIN
src/Icons/skin/delete_perm22.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 75 KiB |
@@ -47,7 +47,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>2.3.0</string>
|
||||
<string>2.4.10</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
|
6
src/about.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>gpl.html</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
439
src/about_imp.h
@@ -108,6 +108,7 @@ public:
|
||||
session* getSession() const;
|
||||
QHash<QString, TrackerInfos> getTrackersInfo(QString hash) const;
|
||||
bool hasActiveTorrents() const;
|
||||
bool hasDownloadingTorrents() const;
|
||||
bool isQueueingEnabled() const;
|
||||
int getMaximumActiveDownloads() const;
|
||||
int getMaximumActiveTorrents() const;
|
||||
@@ -199,6 +200,9 @@ protected slots:
|
||||
void takeETASamples();
|
||||
void exportTorrentFiles(QString path);
|
||||
void saveTempFastResumeData();
|
||||
void sendNotificationEmail(QTorrentHandle h);
|
||||
void autoRunExternalProgram(QTorrentHandle h, bool async=true);
|
||||
void cleanUpAutoRunProcess(int);
|
||||
|
||||
signals:
|
||||
void addedTorrent(QTorrentHandle& h);
|
||||
|
@@ -50,6 +50,7 @@
|
||||
#include "torrentpersistentdata.h"
|
||||
#include "createtorrent_imp.h"
|
||||
#include "misc.h"
|
||||
#include "qinisettings.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
using namespace boost::filesystem;
|
||||
@@ -80,8 +81,11 @@ createtorrent::~createtorrent() {
|
||||
}
|
||||
|
||||
void createtorrent::on_addFolder_button_clicked(){
|
||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), QDir::homePath(), QFileDialog::ShowDirsOnly);
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString();
|
||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), last_path, QFileDialog::ShowDirsOnly);
|
||||
if(!dir.isEmpty()) {
|
||||
settings.setValue("CreateTorrent/last_add_path", dir);
|
||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||
dir = dir.replace("/", "\\");
|
||||
#endif
|
||||
@@ -90,8 +94,11 @@ void createtorrent::on_addFolder_button_clicked(){
|
||||
}
|
||||
|
||||
void createtorrent::on_addFile_button_clicked(){
|
||||
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath());
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString();
|
||||
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), last_path);
|
||||
if(!file.isEmpty()) {
|
||||
settings.setValue("CreateTorrent/last_add_path", misc::removeLastPathPart(file));
|
||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||
file = file.replace("/", "\\");
|
||||
#endif
|
||||
@@ -177,13 +184,14 @@ void createtorrent::on_createButton_clicked(){
|
||||
return;
|
||||
}
|
||||
QStringList trackers = allItems(trackers_list);
|
||||
/*if(!trackers.size()){
|
||||
QMessageBox::critical(0, tr("No tracker path set"), tr("Please set at least one tracker"));
|
||||
return;
|
||||
}*/
|
||||
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), QDir::homePath(), tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
QString last_path = settings.value("CreateTorrent/last_save_path", QDir::homePath()).toString();
|
||||
|
||||
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), last_path, tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||
if(!destination.isEmpty()) {
|
||||
if(!destination.endsWith(QString::fromUtf8(".torrent")))
|
||||
settings.setValue("CreateTorrent/last_save_path", misc::removeLastPathPart(destination));
|
||||
if(!destination.toUpper().endsWith(".TORRENT"))
|
||||
destination += QString::fromUtf8(".torrent");
|
||||
} else {
|
||||
return;
|
||||
@@ -212,16 +220,22 @@ void createtorrent::handleCreationSuccess(QString path, QString branch_path) {
|
||||
// Remove busy cursor
|
||||
setCursor(QCursor(Qt::ArrowCursor));
|
||||
if(checkStartSeeding->isChecked()) {
|
||||
QString root_folder;
|
||||
// Create save path temp data
|
||||
boost::intrusive_ptr<torrent_info> t;
|
||||
try {
|
||||
t = new torrent_info(path.toUtf8().data());
|
||||
root_folder = misc::truncateRootFolder(t);
|
||||
} catch(std::exception&) {
|
||||
QMessageBox::critical(0, tr("Torrent creation"), tr("Created torrent file is invalid. It won't be added to download list."));
|
||||
return;
|
||||
}
|
||||
QString hash = misc::toQString(t->info_hash());
|
||||
TorrentTempData::setSavePath(hash, branch_path);
|
||||
QString save_path = branch_path;
|
||||
if(!root_folder.isEmpty()) {
|
||||
save_path = QDir(save_path).absoluteFilePath(root_folder);
|
||||
}
|
||||
TorrentTempData::setSavePath(hash, save_path);
|
||||
#if LIBTORRENT_VERSION_MINOR > 14
|
||||
// Enable seeding mode (do not recheck the files)
|
||||
TorrentTempData::setSeedingMode(hash, true);
|
||||
@@ -277,8 +291,7 @@ void torrentCreatorThread::run() {
|
||||
char const* creator_str = "qBittorrent "VERSION;
|
||||
try {
|
||||
file_storage fs;
|
||||
file_pool fp;
|
||||
path full_path = complete(path(input_path.toLocal8Bit().data()));
|
||||
path full_path = complete(path(input_path.toUtf8().constData()));
|
||||
// Adding files to the torrent
|
||||
add_files(fs, full_path, file_filter);
|
||||
if(abort) return;
|
||||
@@ -303,7 +316,7 @@ void torrentCreatorThread::run() {
|
||||
t.set_priv(is_private);
|
||||
if(abort) return;
|
||||
// create the torrent and print it to out
|
||||
ofstream out(complete(path((const char*)save_path.toLocal8Bit())), std::ios_base::binary);
|
||||
ofstream out(complete(path((const char*)save_path.toUtf8())), std::ios_base::binary);
|
||||
bencode(std::ostream_iterator<char>(out), t.generate());
|
||||
emit updateProgress(100);
|
||||
emit creationSuccess(save_path, QString::fromUtf8(full_path.branch_path().string().c_str()));
|
||||
|
@@ -60,31 +60,34 @@ public:
|
||||
pix.fill();
|
||||
pixmap = pix;
|
||||
} else {
|
||||
const int nb_pieces = pieces.size();
|
||||
const qulonglong nb_pieces = pieces.size();
|
||||
// Reduce the number of pieces before creating the pixmap
|
||||
// otherwise it can crash when there are too many pieces
|
||||
if(nb_pieces > width()) {
|
||||
const int ratio = floor(nb_pieces/(double)width());
|
||||
std::vector<bool> scaled_pieces;
|
||||
std::vector<bool> scaled_downloading;
|
||||
for(int i=0; i<nb_pieces; i+= ratio) {
|
||||
const uint w = width();
|
||||
if(nb_pieces > w) {
|
||||
const uint ratio = floor(nb_pieces/(double)w);
|
||||
bitfield scaled_pieces(ceil(nb_pieces/(double)ratio), false);
|
||||
bitfield scaled_downloading(ceil(nb_pieces/(double)ratio), false);
|
||||
uint scaled_index = 0;
|
||||
for(qulonglong i=0; i<nb_pieces; i+= ratio) {
|
||||
bool have = true;
|
||||
for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
||||
for(qulonglong j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
||||
if(!pieces[i]) { have = false; break; }
|
||||
}
|
||||
scaled_pieces.push_back(have);
|
||||
if(have) {
|
||||
scaled_downloading.push_back(false);
|
||||
scaled_pieces.set_bit(scaled_index);
|
||||
} else {
|
||||
bool downloading = false;
|
||||
for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
||||
for(qulonglong j=i; j<qMin(i+ratio, nb_pieces); ++j) {
|
||||
if(downloading_pieces[i]) { downloading = true; break; }
|
||||
}
|
||||
scaled_downloading.push_back(downloading);
|
||||
if(downloading)
|
||||
scaled_downloading.set_bit(scaled_index);
|
||||
}
|
||||
++scaled_index;
|
||||
}
|
||||
QPixmap pix = QPixmap(scaled_pieces.size(), 1);
|
||||
pix.fill();
|
||||
//pix.fill();
|
||||
QPainter painter(&pix);
|
||||
for(uint i=0; i<scaled_pieces.size(); ++i) {
|
||||
if(scaled_pieces[i]) {
|
||||
@@ -101,7 +104,7 @@ public:
|
||||
pixmap = pix;
|
||||
} else {
|
||||
QPixmap pix = QPixmap(pieces.size(), 1);
|
||||
pix.fill();
|
||||
//pix.fill();
|
||||
QPainter painter(&pix);
|
||||
for(uint i=0; i<pieces.size(); ++i) {
|
||||
if(pieces[i]) {
|
||||
|
@@ -44,7 +44,7 @@
|
||||
#include <QTemporaryFile>
|
||||
|
||||
enum EngineColumns {ENGINE_NAME, ENGINE_URL, ENGINE_STATE, ENGINE_ID};
|
||||
#define UPDATE_URL "http://qbittorrent.svn.sourceforge.net/viewvc/qbittorrent/trunk/src/search_engine/engines/"
|
||||
#define UPDATE_URL "http://qbittorrent.svn.sourceforge.net/viewvc/qbittorrent/branches/v2_4_x/src/search_engine/engines/"
|
||||
|
||||
engineSelectDlg::engineSelectDlg(QWidget *parent, SupportedEngines *supported_engines) : QDialog(parent), supported_engines(supported_engines) {
|
||||
setupUi(this);
|
||||
@@ -270,6 +270,7 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
|
||||
// Backup in case install fails
|
||||
QFile::copy(dest_path, dest_path+".bak");
|
||||
misc::safeRemove(dest_path);
|
||||
misc::safeRemove(dest_path+"c");
|
||||
update = true;
|
||||
}
|
||||
// Copy the plugin
|
||||
|
@@ -38,6 +38,7 @@
|
||||
//#include "proplistdelegate.h"
|
||||
#include "torrentpersistentdata.h"
|
||||
#include <QDebug>
|
||||
#include <QTranslator>
|
||||
|
||||
EventManager::EventManager(QObject *parent, Bittorrent *BTSession)
|
||||
: QObject(parent), BTSession(BTSession)
|
||||
@@ -124,8 +125,20 @@ QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
|
||||
|
||||
void EventManager::setGlobalPreferences(QVariantMap m) const {
|
||||
// UI
|
||||
if(m.contains("locale"))
|
||||
Preferences::setLocale(m["locale"].toString());
|
||||
if(m.contains("locale")) {
|
||||
QString locale = m["locale"].toString();
|
||||
if(Preferences::getLocale() != locale) {
|
||||
QTranslator *translator = new QTranslator;
|
||||
if(translator->load(QString::fromUtf8(":/lang/qbittorrent_") + locale)){
|
||||
qDebug("%s locale recognized, using translation.", qPrintable(locale));
|
||||
}else{
|
||||
qDebug("%s locale unrecognized, using default (en_GB).", qPrintable(locale));
|
||||
}
|
||||
qApp->installTranslator(translator);
|
||||
}
|
||||
|
||||
Preferences::setLocale(locale);
|
||||
}
|
||||
// Downloads
|
||||
if(m.contains("save_path"))
|
||||
Preferences::setSavePath(m["save_path"].toString());
|
||||
@@ -163,6 +176,16 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
|
||||
}
|
||||
if(m.contains("export_dir"))
|
||||
Preferences::setExportDir(m["export_dir"].toString());
|
||||
if(m.contains("mail_notification_enabled"))
|
||||
Preferences::setMailNotificationEnabled(m["mail_notification_enabled"].toBool());
|
||||
if(m.contains("mail_notification_email"))
|
||||
Preferences::setMailNotificationEmail(m["mail_notification_email"].toString());
|
||||
if(m.contains("mail_notification_smtp"))
|
||||
Preferences::setMailNotificationSMTP(m["mail_notification_smtp"].toString());
|
||||
if(m.contains("autorun_enabled"))
|
||||
Preferences::setAutoRunEnabled(m["autorun_enabled"].toBool());
|
||||
if(m.contains("autorun_program"))
|
||||
Preferences::setAutoRunProgram(m["autorun_program"].toString());
|
||||
if(m.contains("preallocate_all"))
|
||||
Preferences::preAllocateAllFiles(m["preallocate_all"].toBool());
|
||||
if(m.contains("queueing_enabled"))
|
||||
@@ -265,6 +288,11 @@ QVariantMap EventManager::getGlobalPreferences() const {
|
||||
data["download_in_scan_dirs"] = var_list;
|
||||
data["export_dir_enabled"] = Preferences::isTorrentExportEnabled();
|
||||
data["export_dir"] = Preferences::getExportDir();
|
||||
data["mail_notification_enabled"] = Preferences::isMailNotificationEnabled();
|
||||
data["mail_notification_email"] = Preferences::getMailNotificationEmail();
|
||||
data["mail_notification_smtp"] = Preferences::getMailNotificationSMTP();
|
||||
data["autorun_enabled"] = Preferences::isAutoRunEnabled();
|
||||
data["autorun_program"] = Preferences::getAutoRunProgram();
|
||||
data["preallocate_all"] = Preferences::preAllocateAllFiles();
|
||||
data["queueing_enabled"] = Preferences::isQueueingSystemEnabled();
|
||||
data["max_active_downloads"] = Preferences::getMaxActiveDownloads();
|
||||
|
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
QStringList getNotMatchingTokens() const {
|
||||
QString notmatching = this->value("not", "").toString();
|
||||
return notmatching.split(" ");
|
||||
return notmatching.split(QRegExp("[\\s|]"));
|
||||
}
|
||||
|
||||
QString getNotMatchingTokens_str() const {
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "misc.h"
|
||||
|
||||
#ifndef CIFS_MAGIC_NUMBER
|
||||
#define CIFS_MAGIC_NUMBER 0xFF534D42
|
||||
#endif
|
||||
@@ -27,6 +29,9 @@
|
||||
#define NFS_SUPER_MAGIC 0x6969
|
||||
#endif
|
||||
|
||||
const int WATCH_INTERVAL = 10000; // 10 sec
|
||||
const int MAX_PARTIAL_RETRIES = 5;
|
||||
|
||||
/*
|
||||
* Subclassing QFileSystemWatcher in order to support Network File
|
||||
* System watching (NFS, CIFS) on Linux and Mac OS.
|
||||
@@ -39,11 +44,14 @@ private:
|
||||
QList<QDir> watched_folders;
|
||||
QPointer<QTimer> watch_timer;
|
||||
#endif
|
||||
QStringList filters;
|
||||
QStringList m_filters;
|
||||
// Partial torrents
|
||||
QHash<QString, int> m_partialTorrents;
|
||||
QPointer<QTimer> m_partialTorrentTimer;
|
||||
|
||||
#ifndef Q_WS_WIN
|
||||
protected:
|
||||
bool isNetworkFileSystem(QString path) {
|
||||
private:
|
||||
static bool isNetworkFileSystem(QString path) {
|
||||
QString file = path;
|
||||
if(!file.endsWith(QDir::separator()))
|
||||
file += QDir::separator();
|
||||
@@ -99,7 +107,7 @@ protected:
|
||||
|
||||
public:
|
||||
FileSystemWatcher(QObject *parent): QFileSystemWatcher(parent) {
|
||||
filters << "*.torrent";
|
||||
m_filters << "*.torrent";
|
||||
connect(this, SIGNAL(directoryChanged(QString)), this, SLOT(scanLocalFolder(QString)));
|
||||
}
|
||||
|
||||
@@ -108,6 +116,8 @@ public:
|
||||
if(watch_timer)
|
||||
delete watch_timer;
|
||||
#endif
|
||||
if(m_partialTorrentTimer)
|
||||
delete m_partialTorrentTimer;
|
||||
}
|
||||
|
||||
QStringList directories() const {
|
||||
@@ -137,7 +147,7 @@ public:
|
||||
if (!watch_timer) {
|
||||
watch_timer = new QTimer(this);
|
||||
connect(watch_timer, SIGNAL(timeout()), this, SLOT(scanNetworkFolders()));
|
||||
watch_timer->start(5000); // 5 sec
|
||||
watch_timer->start(WATCH_INTERVAL); // 5 sec
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
@@ -196,14 +206,72 @@ protected slots:
|
||||
#endif
|
||||
}
|
||||
|
||||
void processPartialTorrents() {
|
||||
QStringList no_longer_partial;
|
||||
|
||||
// Check which torrents are still partial
|
||||
foreach(const QString& torrent_path, m_partialTorrents.keys()) {
|
||||
if(!QFile::exists(torrent_path)) {
|
||||
m_partialTorrents.remove(torrent_path);
|
||||
continue;
|
||||
}
|
||||
if(misc::isValidTorrentFile(torrent_path)) {
|
||||
no_longer_partial << torrent_path;
|
||||
m_partialTorrents.remove(torrent_path);
|
||||
} else {
|
||||
if(m_partialTorrents[torrent_path] >= MAX_PARTIAL_RETRIES) {
|
||||
m_partialTorrents.remove(torrent_path);
|
||||
QFile::rename(torrent_path, torrent_path+".invalid");
|
||||
} else {
|
||||
m_partialTorrents[torrent_path]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the partial timer if necessary
|
||||
if(m_partialTorrents.empty()) {
|
||||
m_partialTorrentTimer->stop();
|
||||
m_partialTorrentTimer->deleteLater();
|
||||
qDebug("No longer any partial torrent.");
|
||||
} else {
|
||||
qDebug("Still %d partial torrents after delayed processing.", m_partialTorrents.count());
|
||||
m_partialTorrentTimer->start(WATCH_INTERVAL);
|
||||
}
|
||||
// Notify of new torrents
|
||||
if(!no_longer_partial.isEmpty())
|
||||
emit torrentsAdded(no_longer_partial);
|
||||
}
|
||||
|
||||
signals:
|
||||
void torrentsAdded(QStringList &pathList);
|
||||
|
||||
private:
|
||||
void startPartialTorrentTimer() {
|
||||
Q_ASSERT(!m_partialTorrents.isEmpty());
|
||||
if(!m_partialTorrentTimer) {
|
||||
m_partialTorrentTimer = new QTimer();
|
||||
connect(m_partialTorrentTimer, SIGNAL(timeout()), SLOT(processPartialTorrents()));
|
||||
m_partialTorrentTimer->setSingleShot(true);
|
||||
m_partialTorrentTimer->start(WATCH_INTERVAL);
|
||||
}
|
||||
}
|
||||
|
||||
void addTorrentsFromDir(const QDir &dir, QStringList &torrents) {
|
||||
const QStringList files = dir.entryList(filters, QDir::Files, QDir::Unsorted);
|
||||
foreach(const QString &file, files)
|
||||
torrents << dir.canonicalPath() + '/' + file;
|
||||
const QStringList files = dir.entryList(m_filters, QDir::Files, QDir::Unsorted);
|
||||
foreach(const QString &file, files) {
|
||||
const QString file_abspath = dir.absoluteFilePath(file);
|
||||
if(misc::isValidTorrentFile(file_abspath)) {
|
||||
torrents << file_abspath;
|
||||
} else {
|
||||
if(!m_partialTorrents.contains(file_abspath)) {
|
||||
qDebug("Partial torrent detected at: %s", qPrintable(file_abspath));
|
||||
qDebug("Delay the file's processing...");
|
||||
m_partialTorrents.insert(file_abspath, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!m_partialTorrents.empty())
|
||||
startPartialTorrentTimer();
|
||||
}
|
||||
|
||||
};
|
||||
|
508
src/gpl.html
Normal file
@@ -109,7 +109,7 @@ QString HttpConnection::translateDocument(QString data) {
|
||||
bool found = false;
|
||||
do {
|
||||
found = false;
|
||||
QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),µ&\\-\\.]+)\\)"));
|
||||
QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),%µ&\\-\\.]+)\\)"));
|
||||
i = regex.indexIn(data, i);
|
||||
if(i >= 0) {
|
||||
//qDebug("Found translatable string: %s", regex.cap(1).toUtf8().data());
|
||||
@@ -161,7 +161,7 @@ void HttpConnection::respond() {
|
||||
write();
|
||||
return;
|
||||
}
|
||||
// Client sucessfuly authenticated, reset number of failed attempts
|
||||
// Client successfully authenticated, reset number of failed attempts
|
||||
parent->resetNbFailedAttemptsForIp(peer_ip);
|
||||
QString url = parser.url();
|
||||
// Favicon
|
||||
@@ -500,6 +500,16 @@ void HttpConnection::respondCommand(QString command)
|
||||
if(h.is_valid()) h.queue_position_down();
|
||||
return;
|
||||
}
|
||||
if(command == "topPrio") {
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(parser.post("hash"));
|
||||
if(h.is_valid()) h.queue_position_top();
|
||||
return;
|
||||
}
|
||||
if(command == "bottomPrio") {
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(parser.post("hash"));
|
||||
if(h.is_valid()) h.queue_position_bottom();
|
||||
return;
|
||||
}
|
||||
if(command == "recheck"){
|
||||
recheckTorrent(parser.post("hash"));
|
||||
return;
|
||||
|
@@ -54,7 +54,7 @@ class HttpConnection : public QObject
|
||||
|
||||
protected slots:
|
||||
void write();
|
||||
virtual void respond();
|
||||
void respond();
|
||||
void respondJson();
|
||||
void respondGenPropertiesJson(QString hash);
|
||||
void respondTrackersPropertiesJson(QString hash);
|
||||
|
@@ -44,7 +44,7 @@ class HttpResponseGenerator : public QHttpResponseHeader
|
||||
void setMessage(const QString message);
|
||||
void stripMessage();
|
||||
void setContentTypeByExt(const QString ext);
|
||||
virtual QByteArray toByteArray() const;
|
||||
QByteArray toByteArray() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|