You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-23 22:32:16 +02:00
Compare commits
22 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa9c319f5b | ||
|
|
eb54d81c5e | ||
|
|
431d2f082c | ||
|
|
a0ff0cdc7e | ||
|
|
fb91558261 | ||
|
|
fc2a47ca31 | ||
|
|
dcccbaad59 | ||
|
|
99d040de3f | ||
|
|
ee30a75b57 | ||
|
|
8c001aa478 | ||
|
|
849bc11a01 | ||
|
|
5024e0b092 | ||
|
|
d93447489b | ||
|
|
33988e70ab | ||
|
|
d2b41d70c8 | ||
|
|
8e1e51d268 | ||
|
|
53500ea005 | ||
|
|
e048389dea | ||
|
|
fa7b1a205d | ||
|
|
7dd6b7e9bb | ||
|
|
78b96accda | ||
|
|
73d0e2568a |
@@ -6,6 +6,7 @@
|
||||
- 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)
|
||||
|
||||
25
src/GUI.cpp
25
src/GUI.cpp
@@ -34,6 +34,7 @@
|
||||
#endif
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
#include <QDesktopServices>
|
||||
@@ -157,7 +158,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
|
||||
// Name filter
|
||||
search_filter = new LineEdit();
|
||||
toolBar->addWidget(search_filter);
|
||||
QAction *separatorBFSearch = toolBar->insertSeparator(actionLock_qBittorrent);
|
||||
toolBar->insertWidget(separatorBFSearch, search_filter);
|
||||
search_filter->setFixedWidth(200);
|
||||
connect(search_filter, SIGNAL(textChanged(QString)), transferList, SLOT(applyNameFilter(QString)));
|
||||
|
||||
@@ -219,6 +221,11 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
showMinimized();
|
||||
}
|
||||
|
||||
// Start watching the executable for updates
|
||||
executable_watcher = new QFileSystemWatcher();
|
||||
connect(executable_watcher, SIGNAL(fileChanged(QString)), this, SLOT(notifyOfUpdate(QString)));
|
||||
executable_watcher->addPath(qApp->applicationFilePath());
|
||||
|
||||
// Resume unfinished torrents
|
||||
BTSession->startUpTorrents();
|
||||
// Add torrent given on command line
|
||||
@@ -256,6 +263,8 @@ GUI::~GUI() {
|
||||
properties->saveSettings();
|
||||
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tab_changed(int)));
|
||||
// Delete other GUI objects
|
||||
if(executable_watcher)
|
||||
delete executable_watcher;
|
||||
delete status_bar;
|
||||
delete search_filter;
|
||||
delete transferList;
|
||||
@@ -328,6 +337,7 @@ void GUI::on_actionLock_qBittorrent_triggered() {
|
||||
// Lock the interface
|
||||
ui_locked = true;
|
||||
Preferences::setUILocked(true);
|
||||
myTrayIconMenu->setEnabled(false);
|
||||
hide();
|
||||
}
|
||||
|
||||
@@ -583,12 +593,21 @@ bool GUI::unlockUI() {
|
||||
if(real_pass_md5 == password_md5) {
|
||||
ui_locked = false;
|
||||
Preferences::setUILocked(false);
|
||||
myTrayIconMenu->setEnabled(true);
|
||||
return true;
|
||||
}
|
||||
QMessageBox::warning(this, tr("Invalid password"), tr("The password is invalid"));
|
||||
return false;
|
||||
}
|
||||
|
||||
void GUI::notifyOfUpdate(QString) {
|
||||
// Show restart message
|
||||
status_bar->showRestartRequired();
|
||||
// Delete the executable watcher
|
||||
delete executable_watcher;
|
||||
executable_watcher = 0;
|
||||
}
|
||||
|
||||
// Toggle Main window visibility
|
||||
void GUI::toggleVisibility(QSystemTrayIcon::ActivationReason e) {
|
||||
if(e == QSystemTrayIcon::Trigger || e == QSystemTrayIcon::DoubleClick) {
|
||||
@@ -916,6 +935,8 @@ void GUI::loadPreferences(bool configure_session) {
|
||||
toolBar->setVisible(true);
|
||||
toolBar->layout()->setSpacing(7);
|
||||
} else {
|
||||
// Clear search filter before hiding the top toolbar
|
||||
search_filter->clear();
|
||||
toolBar->setVisible(false);
|
||||
}
|
||||
const uint new_refreshInterval = Preferences::getRefreshInterval();
|
||||
@@ -1098,6 +1119,8 @@ QMenu* GUI::getTrayIconMenu() {
|
||||
myTrayIconMenu->addAction(actionPause_All);
|
||||
myTrayIconMenu->addSeparator();
|
||||
myTrayIconMenu->addAction(actionExit);
|
||||
if(ui_locked)
|
||||
myTrayIconMenu->setEnabled(false);
|
||||
return myTrayIconMenu;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ class createtorrent;
|
||||
class downloadFromURL;
|
||||
class HidableTabWidget;
|
||||
class LineEdit;
|
||||
class QFileSystemWatcher;
|
||||
|
||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
Q_OBJECT
|
||||
@@ -102,6 +103,7 @@ protected slots:
|
||||
void on_actionLock_qBittorrent_triggered();
|
||||
void defineUILockPassword();
|
||||
bool unlockUI();
|
||||
void notifyOfUpdate(QString);
|
||||
// Keyboard shortcuts
|
||||
void createKeyboardShortcuts();
|
||||
void displayTransferTab() const;
|
||||
@@ -135,6 +137,7 @@ protected:
|
||||
void displaySearchTab(bool enable);
|
||||
|
||||
private:
|
||||
QFileSystemWatcher *executable_watcher;
|
||||
// Bittorrent
|
||||
Bittorrent *BTSession;
|
||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
|
||||
|
||||
@@ -203,7 +203,7 @@ bool Bittorrent::isPexEnabled() const {
|
||||
}
|
||||
|
||||
void Bittorrent::processBigRatios() {
|
||||
if(ratio_limit <= 0) return;
|
||||
if(ratio_limit < 0) return;
|
||||
qDebug("Process big ratios...");
|
||||
std::vector<torrent_handle> torrents = s->get_torrents();
|
||||
std::vector<torrent_handle>::iterator torrentIT;
|
||||
@@ -833,7 +833,7 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
|
||||
qDebug("Resuming magnet URI: %s", qPrintable(hash));
|
||||
// Load metadata
|
||||
if(QFile::exists(torrentBackup.path()+QDir::separator()+hash+QString(".torrent")))
|
||||
return addTorrent(torrentBackup.path()+QDir::separator()+hash+QString(".torrent"), false, false, true);
|
||||
return addTorrent(torrentBackup.path()+QDir::separator()+hash+QString(".torrent"), false, QString(), true);
|
||||
} else {
|
||||
qDebug("Adding new magnet URI");
|
||||
}
|
||||
@@ -1530,7 +1530,7 @@ void Bittorrent::saveTempFastResumeData() {
|
||||
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
||||
try {
|
||||
if(!h.is_valid() || !h.has_metadata() || h.is_seed() || h.is_paused()) continue;
|
||||
if(!h.is_valid() || !h.has_metadata() /*|| h.is_seed() || h.is_paused()*/) continue;
|
||||
if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) continue;
|
||||
qDebug("Saving fastresume data for %s", qPrintable(h.name()));
|
||||
h.save_resume_data();
|
||||
@@ -1838,7 +1838,7 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
// Torrents will a ratio superior to the given value will
|
||||
// be automatically deleted
|
||||
void Bittorrent::setMaxRatio(float ratio) {
|
||||
if(ratio <= 0) ratio = -1.;
|
||||
if(ratio < 0) ratio = -1.;
|
||||
if(ratio_limit == -1 && ratio != -1) {
|
||||
Q_ASSERT(!BigRatioTimer);
|
||||
BigRatioTimer = new QTimer(this);
|
||||
@@ -2357,13 +2357,13 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
}
|
||||
else if (fastresume_rejected_alert* p = dynamic_cast<fastresume_rejected_alert*>(a.get())) {
|
||||
QTorrentHandle h(p->handle);
|
||||
if(h.is_valid()){
|
||||
if(h.is_valid()) {
|
||||
qDebug("/!\\ Fast resume failed for %s, reason: %s", qPrintable(h.name()), p->message().c_str());
|
||||
#if LIBTORRENT_VERSION_MINOR < 15
|
||||
QString msg = QString::fromLocal8Bit(p->message().c_str());
|
||||
if(msg.contains("filesize", Qt::CaseInsensitive) && msg.contains("mismatch", Qt::CaseInsensitive)) {
|
||||
if(msg.contains("filesize", Qt::CaseInsensitive) && msg.contains("mismatch", Qt::CaseInsensitive) && TorrentPersistentData::isSeed(h.hash()) && h.has_missing_files()) {
|
||||
#else
|
||||
if(p->error.value() == 134) {
|
||||
if(p->error.value() == 134 && TorrentPersistentData::isSeed(h.hash()) && h.has_missing_files()) {
|
||||
#endif
|
||||
const QString hash = h.hash();
|
||||
// Mismatching file size (files were probably moved
|
||||
@@ -2606,9 +2606,9 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
filters << "*.torrent";
|
||||
const QStringList torrents_on_hd = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted);
|
||||
foreach(QString hash, torrents_on_hd) {
|
||||
qDebug("found torrent with hash: %s on hard disk", qPrintable(hash));
|
||||
hash.chop(8); // remove trailing .torrent
|
||||
if(!known_torrents.contains(hash)) {
|
||||
qDebug("found torrent with hash: %s on hard disk", qPrintable(hash));
|
||||
std::cerr << "ERROR Detected!!! Adding back torrent " << qPrintable(hash) << " which got lost for some reason." << std::endl;
|
||||
addTorrent(torrentBackup.path()+QDir::separator()+hash+".torrent", false, QString(), true);
|
||||
}
|
||||
|
||||
@@ -169,6 +169,10 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
|
||||
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"))
|
||||
@@ -274,6 +278,8 @@ QVariantMap EventManager::getGlobalPreferences() const {
|
||||
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();
|
||||
|
||||
@@ -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());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -3055,6 +3055,10 @@ Do you want to install it now?</source>
|
||||
<source>Global Upload Speed Limit</source>
|
||||
<translation>Globalni limit brzine slanja</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>qBittorrent needs to be restarted</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TorrentFilesModel</name>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5135,6 +5135,10 @@ Do you want to install it now?</source>
|
||||
<source>Click to enable alternative speed limits</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>qBittorrent needs to be restarted</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TorrentFilesModel</name>
|
||||
|
||||
@@ -5443,6 +5443,10 @@ Do you want to install it now?</source>
|
||||
<source>Click to enable alternative speed limits</source>
|
||||
<translation>Kliknij, aby włączyć alternatywne limity prędkości</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>qBittorrent needs to be restarted</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TorrentFilesModel</name>
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user