Compare commits
86 Commits
release-2.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
49cb648557 | ||
![]() |
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 |
2
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
|
||||
|
||||
|
32
Changelog
@@ -1,3 +1,35 @@
|
||||
* 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
|
||||
|
119
src/GUI.cpp
@@ -34,6 +34,7 @@
|
||||
#endif
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
#include <QDesktopServices>
|
||||
@@ -69,6 +70,7 @@
|
||||
#include "qmacapplication.h"
|
||||
void qt_mac_set_dock_menu(QMenu *menu);
|
||||
#endif
|
||||
#include "lineedit.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
@@ -83,7 +85,7 @@ using namespace libtorrent;
|
||||
// Constructor
|
||||
GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), force_exit(false) {
|
||||
setupUi(this);
|
||||
|
||||
ui_locked = Preferences::isUILocked();
|
||||
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
||||
displaySpeedInTitle = Preferences::speedInTitleBar();
|
||||
// Setting icons
|
||||
@@ -107,6 +109,11 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
actionSet_global_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
|
||||
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();
|
||||
QAction *defineUiLockPasswdAct = lockMenu->addAction(tr("Set the password..."));
|
||||
connect(defineUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(defineUILockPassword()));
|
||||
actionLock_qBittorrent->setMenu(lockMenu);
|
||||
prioSeparator = toolBar->insertSeparator(actionDecreasePriority);
|
||||
prioSeparator2 = menu_Edit->insertSeparator(actionDecreasePriority);
|
||||
prioSeparator->setVisible(false);
|
||||
@@ -149,6 +156,13 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
connect(transferList, SIGNAL(torrentStatusUpdate(uint,uint,uint,uint,uint)), this, SLOT(updateNbTorrents(uint,uint,uint,uint,uint)));
|
||||
vboxLayout->addWidget(tabs);
|
||||
|
||||
// Name filter
|
||||
search_filter = new LineEdit();
|
||||
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)));
|
||||
|
||||
// Transfer list slots
|
||||
connect(actionStart, SIGNAL(triggered()), transferList, SLOT(startSelectedTorrents()));
|
||||
connect(actionStart_All, SIGNAL(triggered()), transferList, SLOT(startAllTorrents()));
|
||||
@@ -160,10 +174,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
|
||||
// Configure BT session according to options
|
||||
loadPreferences(false);
|
||||
// Resume unfinished torrents
|
||||
BTSession->startUpTorrents();
|
||||
// Add torrent given on command line
|
||||
processParams(torrentCmdLine);
|
||||
|
||||
// Start connection checking timer
|
||||
guiUpdater = new QTimer(this);
|
||||
@@ -187,6 +197,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
actionSearch_engine->setChecked(Preferences::isSearchEnabled());
|
||||
displaySearchTab(actionSearch_engine->isChecked());
|
||||
displayRSSTab(actionRSS_Reader->isChecked());
|
||||
actionShutdown_when_downloads_complete->setChecked(Preferences::shutdownWhenDownloadsComplete());
|
||||
|
||||
show();
|
||||
|
||||
@@ -203,10 +214,23 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), for
|
||||
}while(transferListFilters->getStatusFilters()->verticalScrollBar()->sliderPosition() > 0);
|
||||
transferListFilters->getStatusFilters()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
||||
if(Preferences::startMinimized()) {
|
||||
showMinimized();
|
||||
if(ui_locked) {
|
||||
hide();
|
||||
} else {
|
||||
if(Preferences::startMinimized())
|
||||
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
|
||||
processParams(torrentCmdLine);
|
||||
|
||||
qDebug("GUI Built");
|
||||
#ifdef Q_WS_WIN
|
||||
if(!Preferences::neverCheckFileAssoc() && !Preferences::isFileAssocOk()) {
|
||||
@@ -239,7 +263,10 @@ 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;
|
||||
delete guiUpdater;
|
||||
if(createTorrentDlg)
|
||||
@@ -276,10 +303,8 @@ GUI::~GUI() {
|
||||
delete switchTransferShortcut;
|
||||
delete switchRSSShortcut;
|
||||
// Delete BTSession objects
|
||||
qDebug("Deleting BTSession");
|
||||
delete BTSession;
|
||||
// Deleting remaining top level widgets
|
||||
qDebug("Deleting remaining top level widgets");
|
||||
|
||||
// May freeze for a few seconds after the next line
|
||||
// because the Bittorrent session proxy will
|
||||
// actually be deleted now and destruction
|
||||
@@ -287,6 +312,35 @@ GUI::~GUI() {
|
||||
qDebug("Exiting GUI destructor...");
|
||||
}
|
||||
|
||||
void GUI::defineUILockPassword() {
|
||||
QString old_pass_md5 = Preferences::getUILockPasswordMD5();
|
||||
if(old_pass_md5.isNull()) old_pass_md5 = "";
|
||||
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);
|
||||
if(ok) {
|
||||
if(new_clear_password != old_pass_md5) {
|
||||
Preferences::setUILockPassword(new_clear_password);
|
||||
}
|
||||
QMessageBox::information(this, tr("Password update"), tr("The UI lock password has been successfully updated"));
|
||||
}
|
||||
}
|
||||
|
||||
void GUI::on_actionLock_qBittorrent_triggered() {
|
||||
// Check if there is a password
|
||||
if(Preferences::getUILockPasswordMD5().isEmpty()) {
|
||||
// Ask for a password
|
||||
bool ok = false;
|
||||
QString clear_password = QInputDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, "", &ok);
|
||||
if(!ok) return;
|
||||
Preferences::setUILockPassword(clear_password);
|
||||
}
|
||||
// Lock the interface
|
||||
ui_locked = true;
|
||||
Preferences::setUILocked(true);
|
||||
myTrayIconMenu->setEnabled(false);
|
||||
hide();
|
||||
}
|
||||
|
||||
void GUI::displayRSSTab(bool enable) {
|
||||
if(enable) {
|
||||
// RSS tab
|
||||
@@ -528,10 +582,41 @@ void GUI::setTabText(int index, QString text) const {
|
||||
tabs->setTabText(index, text);
|
||||
}
|
||||
|
||||
bool GUI::unlockUI() {
|
||||
bool ok = false;
|
||||
QString clear_password = QInputDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, "", &ok);
|
||||
if(!ok) return false;
|
||||
QString real_pass_md5 = Preferences::getUILockPasswordMD5();
|
||||
QCryptographicHash md5(QCryptographicHash::Md5);
|
||||
md5.addData(clear_password.toLocal8Bit());
|
||||
QString password_md5 = md5.result().toHex();
|
||||
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) {
|
||||
if(isHidden()) {
|
||||
if(ui_locked) {
|
||||
// Ask for UI lock password
|
||||
if(!unlockUI())
|
||||
return;
|
||||
}
|
||||
show();
|
||||
if(isMinimized()) {
|
||||
if(isMaximized()) {
|
||||
@@ -738,8 +823,8 @@ void GUI::on_actionOpen_triggered() {
|
||||
// Open File Open Dialog
|
||||
// Note: it is possible to select more than one file
|
||||
const QStringList pathsList = QFileDialog::getOpenFileNames(0,
|
||||
tr("Open Torrent Files"), settings.value(QString::fromUtf8("MainWindowLastDir"), QDir::homePath()).toString(),
|
||||
tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||
tr("Open Torrent Files"), settings.value(QString::fromUtf8("MainWindowLastDir"), QDir::homePath()).toString(),
|
||||
tr("Torrent Files")+QString::fromUtf8(" (*.torrent)"));
|
||||
if(!pathsList.empty()) {
|
||||
const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
|
||||
const uint listSize = pathsList.size();
|
||||
@@ -821,6 +906,7 @@ void GUI::loadPreferences(bool configure_session) {
|
||||
BTSession->addConsoleMessage(tr("Options were saved successfully."));
|
||||
#ifndef Q_WS_MAC
|
||||
const bool newSystrayIntegration = Preferences::systrayIntegration();
|
||||
actionLock_qBittorrent->setEnabled(newSystrayIntegration);
|
||||
if(newSystrayIntegration != (systrayIcon!=0)) {
|
||||
if(newSystrayIntegration) {
|
||||
// create the trayicon
|
||||
@@ -849,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();
|
||||
@@ -1031,6 +1119,8 @@ QMenu* GUI::getTrayIconMenu() {
|
||||
myTrayIconMenu->addAction(actionPause_All);
|
||||
myTrayIconMenu->addSeparator();
|
||||
myTrayIconMenu->addAction(actionExit);
|
||||
if(ui_locked)
|
||||
myTrayIconMenu->setEnabled(false);
|
||||
return myTrayIconMenu;
|
||||
}
|
||||
|
||||
@@ -1066,6 +1156,11 @@ void GUI::on_actionTop_tool_bar_triggered() {
|
||||
Preferences::setToolbarDisplayed(is_visible);
|
||||
}
|
||||
|
||||
void GUI::on_actionShutdown_when_downloads_complete_triggered() {
|
||||
bool is_checked = static_cast<QAction*>(sender())->isChecked();
|
||||
Preferences::setShutdownWhenDownloadsComplete(is_checked);
|
||||
}
|
||||
|
||||
void GUI::on_actionSpeed_in_title_bar_triggered() {
|
||||
displaySpeedInTitle = static_cast<QAction*>(sender())->isChecked();
|
||||
Preferences::showSpeedInTitleBar(displaySpeedInTitle);
|
||||
|
11
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);
|
||||
@@ -97,6 +100,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 +137,7 @@ protected:
|
||||
void displaySearchTab(bool enable);
|
||||
|
||||
private:
|
||||
QFileSystemWatcher *executable_watcher;
|
||||
// Bittorrent
|
||||
Bittorrent *BTSession;
|
||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
|
||||
@@ -150,6 +158,8 @@ private:
|
||||
PropertiesWidget *properties;
|
||||
bool displaySpeedInTitle;
|
||||
bool force_exit;
|
||||
bool ui_locked;
|
||||
LineEdit *search_filter;
|
||||
// Keyboard shortcuts
|
||||
QShortcut *switchSearchShortcut;
|
||||
QShortcut *switchSearchShortcut2;
|
||||
@@ -170,6 +180,7 @@ 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();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
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.2
|
||||
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: 79 KiB |
@@ -47,7 +47,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>2.3.0</string>
|
||||
<string>2.4.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
|
@@ -47,7 +47,6 @@ class about : public QDialog, private Ui::AboutDlg{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
// Set icons
|
||||
logo->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/qbittorrent22.png")));
|
||||
mascot_lbl->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/mascot.png")));
|
||||
//Title
|
||||
lb_name->setText(QString::fromUtf8("<b><h1>")+tr("qBittorrent")+QString::fromUtf8(" "VERSION"</h1></b>"));
|
||||
// Thanks
|
||||
|
@@ -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;
|
||||
|
@@ -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 {
|
||||
|
@@ -202,8 +202,13 @@ signals:
|
||||
private:
|
||||
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;
|
||||
foreach(const QString &file, files) {
|
||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||
torrents << dir.absoluteFilePath(file).replace("/", "\\");
|
||||
#else
|
||||
torrents << dir.absoluteFilePath(file);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
@@ -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;
|
||||
|
301
src/icons.qrc
@@ -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;
|
||||
|
50
src/lang.qrc
@@ -1,34 +1,34 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>lang/qbittorrent_es.qm</file>
|
||||
<file>lang/qbittorrent_sk.qm</file>
|
||||
<file>lang/qbittorrent_zh_TW.qm</file>
|
||||
<file>lang/qbittorrent_pt.qm</file>
|
||||
<file>lang/qbittorrent_sv.qm</file>
|
||||
<file>lang/qbittorrent_pl.qm</file>
|
||||
<file>lang/qbittorrent_it.qm</file>
|
||||
<file>lang/qbittorrent_ar.qm</file>
|
||||
<file>lang/qbittorrent_ko.qm</file>
|
||||
<file>lang/qbittorrent_en.qm</file>
|
||||
<file>lang/qbittorrent_ro.qm</file>
|
||||
<file>lang/qbittorrent_bg.qm</file>
|
||||
<file>lang/qbittorrent_ru.qm</file>
|
||||
<file>lang/qbittorrent_nl.qm</file>
|
||||
<file>lang/qbittorrent_nb.qm</file>
|
||||
<file>lang/qbittorrent_hu.qm</file>
|
||||
<file>lang/qbittorrent_ru.qm</file>
|
||||
<file>lang/qbittorrent_zh_TW.qm</file>
|
||||
<file>lang/qbittorrent_tr.qm</file>
|
||||
<file>lang/qbittorrent_fi.qm</file>
|
||||
<file>lang/qbittorrent_uk.qm</file>
|
||||
<file>lang/qbittorrent_cs.qm</file>
|
||||
<file>lang/qbittorrent_pt_BR.qm</file>
|
||||
<file>lang/qbittorrent_sk.qm</file>
|
||||
<file>lang/qbittorrent_ja.qm</file>
|
||||
<file>lang/qbittorrent_el.qm</file>
|
||||
<file>lang/qbittorrent_ca.qm</file>
|
||||
<file>lang/qbittorrent_hr.qm</file>
|
||||
<file>lang/qbittorrent_sr.qm</file>
|
||||
<file>lang/qbittorrent_hu.qm</file>
|
||||
<file>lang/qbittorrent_da.qm</file>
|
||||
<file>lang/qbittorrent_de.qm</file>
|
||||
<file>lang/qbittorrent_zh.qm</file>
|
||||
<file>lang/qbittorrent_ja.qm</file>
|
||||
<file>lang/qbittorrent_tr.qm</file>
|
||||
<file>lang/qbittorrent_pt.qm</file>
|
||||
<file>lang/qbittorrent_it.qm</file>
|
||||
<file>lang/qbittorrent_fr.qm</file>
|
||||
<file>lang/qbittorrent_uk.qm</file>
|
||||
<file>lang/qbittorrent_zh.qm</file>
|
||||
<file>lang/qbittorrent_ko.qm</file>
|
||||
<file>lang/qbittorrent_nb.qm</file>
|
||||
<file>lang/qbittorrent_sv.qm</file>
|
||||
<file>lang/qbittorrent_de.qm</file>
|
||||
<file>lang/qbittorrent_sr.qm</file>
|
||||
<file>lang/qbittorrent_pt_BR.qm</file>
|
||||
<file>lang/qbittorrent_da.qm</file>
|
||||
<file>lang/qbittorrent_cs.qm</file>
|
||||
<file>lang/qbittorrent_pl.qm</file>
|
||||
<file>lang/qbittorrent_bg.qm</file>
|
||||
<file>lang/qbittorrent_ar.qm</file>
|
||||
<file>lang/qbittorrent_es.qm</file>
|
||||
<file>lang/qbittorrent_en.qm</file>
|
||||
<file>lang/qbittorrent_hr.qm</file>
|
||||
<file>lang/qbittorrent_ro.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|