You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-23 22:32:16 +02:00
Compare commits
60 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1858de2d6 | ||
|
|
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 |
34
Changelog
34
Changelog
@@ -1,4 +1,35 @@
|
||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.4.0
|
||||
* 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
|
||||
@@ -6,6 +37,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)
|
||||
|
||||
47
src/GUI.cpp
47
src/GUI.cpp
@@ -34,6 +34,7 @@
|
||||
#endif
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
#include <QDesktopServices>
|
||||
@@ -70,6 +71,7 @@
|
||||
void qt_mac_set_dock_menu(QMenu *menu);
|
||||
#endif
|
||||
#include "lineedit.h"
|
||||
#include "sessionapplication.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
@@ -87,6 +89,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
ui_locked = Preferences::isUILocked();
|
||||
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
||||
displaySpeedInTitle = Preferences::speedInTitleBar();
|
||||
// Clean exit on log out
|
||||
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
|
||||
// Setting icons
|
||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
||||
actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.png")));
|
||||
@@ -109,7 +113,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
actionSet_global_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/download.png")));
|
||||
actionDocumentation->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/qb_question.png")));
|
||||
actionLock_qBittorrent->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/encrypted32.png")));
|
||||
QMenu *lockMenu = new QMenu();
|
||||
lockMenu = new QMenu();
|
||||
QAction *defineUiLockPasswdAct = lockMenu->addAction(tr("Set the password..."));
|
||||
connect(defineUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(defineUILockPassword()));
|
||||
actionLock_qBittorrent->setMenu(lockMenu);
|
||||
@@ -157,7 +161,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 +224,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
|
||||
@@ -241,6 +251,16 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
#endif
|
||||
}
|
||||
|
||||
void GUI::deleteBTSession() {
|
||||
guiUpdater->stop();
|
||||
status_bar->stopTimer();
|
||||
if(BTSession) {
|
||||
delete BTSession;
|
||||
BTSession = 0;
|
||||
}
|
||||
QTimer::singleShot(0, this, SLOT(close()));
|
||||
}
|
||||
|
||||
// Destructor
|
||||
GUI::~GUI() {
|
||||
qDebug("GUI destruction");
|
||||
@@ -251,15 +271,20 @@ GUI::~GUI() {
|
||||
#endif
|
||||
// Async deletion of Bittorrent session as early as possible
|
||||
// in order to speed up exit
|
||||
session_proxy sp = BTSession->asyncDeletion();
|
||||
session_proxy sp;
|
||||
if(BTSession)
|
||||
sp = BTSession->asyncDeletion();
|
||||
// Some saving
|
||||
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;
|
||||
delete guiUpdater;
|
||||
delete lockMenu;
|
||||
if(createTorrentDlg)
|
||||
delete createTorrentDlg;
|
||||
if(console)
|
||||
@@ -328,6 +353,7 @@ void GUI::on_actionLock_qBittorrent_triggered() {
|
||||
// Lock the interface
|
||||
ui_locked = true;
|
||||
Preferences::setUILocked(true);
|
||||
myTrayIconMenu->setEnabled(false);
|
||||
hide();
|
||||
}
|
||||
|
||||
@@ -583,12 +609,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) {
|
||||
@@ -643,7 +678,7 @@ void GUI::closeEvent(QCloseEvent *e) {
|
||||
e->accept();
|
||||
return;
|
||||
}
|
||||
if(settings.value(QString::fromUtf8("Preferences/General/ExitConfirm"), true).toBool() && BTSession->hasActiveTorrents()) {
|
||||
if(settings.value(QString::fromUtf8("Preferences/General/ExitConfirm"), true).toBool() && BTSession && BTSession->hasActiveTorrents()) {
|
||||
if(e->spontaneous() || force_exit) {
|
||||
if(!isVisible())
|
||||
show();
|
||||
@@ -916,6 +951,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 +1135,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
|
||||
@@ -79,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
|
||||
@@ -102,6 +104,7 @@ protected slots:
|
||||
void on_actionLock_qBittorrent_triggered();
|
||||
void defineUILockPassword();
|
||||
bool unlockUI();
|
||||
void notifyOfUpdate(QString);
|
||||
// Keyboard shortcuts
|
||||
void createKeyboardShortcuts();
|
||||
void displayTransferTab() const;
|
||||
@@ -135,6 +138,7 @@ protected:
|
||||
void displaySearchTab(bool enable);
|
||||
|
||||
private:
|
||||
QFileSystemWatcher *executable_watcher;
|
||||
// Bittorrent
|
||||
Bittorrent *BTSession;
|
||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
|
||||
@@ -167,6 +171,7 @@ private:
|
||||
QAction *prioSeparator2;
|
||||
QSplitter *hSplitter;
|
||||
QSplitter *vSplitter;
|
||||
QMenu *lockMenu;
|
||||
// Search
|
||||
QPointer<SearchEngine> searchEngine;
|
||||
// RSS
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;Network;P2P;
|
||||
Comment=V2.4.0
|
||||
Comment=V2.4.4
|
||||
Exec=qbittorrent %f
|
||||
GenericName=Bittorrent client
|
||||
GenericName[ar]=العميل Bittorrent
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
@@ -47,7 +47,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>2.4.0</string>
|
||||
<string>2.4.4</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
|
||||
@@ -165,6 +165,7 @@ Bittorrent::~Bittorrent() {
|
||||
#endif
|
||||
saveSessionState();
|
||||
saveFastResumeData();
|
||||
qDebug("Deleting the session");
|
||||
// Delete session
|
||||
session_proxy sp = s->abort();
|
||||
delete s;
|
||||
@@ -203,7 +204,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 +834,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");
|
||||
}
|
||||
@@ -867,13 +868,13 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
|
||||
qDebug("addMagnetURI: Temp folder is enabled.");
|
||||
qDebug("addTorrent::Temp folder is enabled.");
|
||||
QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
|
||||
p.save_path = torrent_tmp_path.toLocal8Bit().constData();
|
||||
p.save_path = torrent_tmp_path.toUtf8().constData();
|
||||
// Check if save path exists, creating it otherwise
|
||||
if(!QDir(torrent_tmp_path).exists())
|
||||
QDir().mkpath(torrent_tmp_path);
|
||||
qDebug("addMagnetURI: using save_path: %s", qPrintable(torrent_tmp_path));
|
||||
} else {
|
||||
p.save_path = savePath.toLocal8Bit().constData();
|
||||
p.save_path = savePath.toUtf8().constData();
|
||||
// Check if save path exists, creating it otherwise
|
||||
if(!QDir(savePath).exists())
|
||||
QDir().mkpath(savePath);
|
||||
@@ -1121,13 +1122,13 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||
if(!torrent_tmp_path.endsWith("/")) torrent_tmp_path += "/";
|
||||
torrent_tmp_path += root_folder;
|
||||
}
|
||||
p.save_path = torrent_tmp_path.toLocal8Bit().constData();
|
||||
p.save_path = torrent_tmp_path.toUtf8().constData();
|
||||
// Check if save path exists, creating it otherwise
|
||||
if(!QDir(torrent_tmp_path).exists())
|
||||
QDir().mkpath(torrent_tmp_path);
|
||||
qDebug("addTorrent: using save_path: %s", qPrintable(torrent_tmp_path));
|
||||
} else {
|
||||
p.save_path = savePath.toLocal8Bit().constData();
|
||||
p.save_path = savePath.toUtf8().constData();
|
||||
// Check if save path exists, creating it otherwise
|
||||
if(!QDir(savePath).exists())
|
||||
QDir().mkpath(savePath);
|
||||
@@ -1530,7 +1531,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();
|
||||
@@ -1541,6 +1542,7 @@ void Bittorrent::saveTempFastResumeData() {
|
||||
// Only save fast resume data for unfinished and unpaused torrents (Optimization)
|
||||
// Called periodically and on exit
|
||||
void Bittorrent::saveFastResumeData() {
|
||||
qDebug("Saving fast resume data...");
|
||||
// Stop listening for alerts
|
||||
resumeDataTimer.stop();
|
||||
timerAlerts->stop();
|
||||
@@ -1838,7 +1840,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 +2359,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
|
||||
@@ -2490,7 +2492,10 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
qDebug("getSavePath, got save_path from persistent data: %s", qPrintable(savePath));
|
||||
}
|
||||
// Clean path
|
||||
savePath = savePath.replace("\\", "/");
|
||||
savePath = misc::expandPath(savePath);
|
||||
if(!savePath.endsWith("/"))
|
||||
savePath += "/";
|
||||
return savePath;
|
||||
}
|
||||
|
||||
@@ -2606,9 +2611,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);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,8 @@ void createtorrent::on_createButton_clicked(){
|
||||
QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), last_path, tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||
if(!destination.isEmpty()) {
|
||||
settings.setValue("CreateTorrent/last_save_path", misc::removeLastPathPart(destination));
|
||||
destination += QString::fromUtf8(".torrent");
|
||||
if(!destination.toUpper().endsWith(".TORRENT"))
|
||||
destination += QString::fromUtf8(".torrent");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
@@ -169,6 +182,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 +291,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();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -132,6 +132,7 @@ namespace json {
|
||||
tmp += c;
|
||||
}
|
||||
}
|
||||
if(!tmp.isEmpty()) couples << tmp;
|
||||
foreach(QString couple, couples) {
|
||||
QStringList parts = couple.split(":");
|
||||
if(parts.size() != 2) continue;
|
||||
|
||||
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
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
Binary file not shown.
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
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
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user