You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-23 22:32:16 +02:00
Compare commits
1 Commits
release-2.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d09a3ddd0c |
28
src/GUI.cpp
28
src/GUI.cpp
@@ -345,10 +345,18 @@ void GUI::on_actionBugReport_triggered() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GUI::tab_changed(int new_tab) {
|
void GUI::tab_changed(int new_tab) {
|
||||||
if(new_tab == TAB_TRANSFER) {
|
Q_UNUSED(new_tab);
|
||||||
|
// We cannot rely on the index new_tab
|
||||||
|
// because the tab order is undetermined now
|
||||||
|
if(tabs->currentWidget() == vSplitter) {
|
||||||
qDebug("Changed tab to transfer list, refreshing the list");
|
qDebug("Changed tab to transfer list, refreshing the list");
|
||||||
transferList->refreshList();
|
transferList->refreshList();
|
||||||
properties->loadDynamicData();
|
properties->loadDynamicData();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(tabs->currentWidget() == searchEngine) {
|
||||||
|
qDebug("Changed tab to search engine, giving focus to search input");
|
||||||
|
searchEngine->giveFocusToSearchInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,15 +409,17 @@ void GUI::createKeyboardShortcuts() {
|
|||||||
|
|
||||||
// Keyboard shortcuts slots
|
// Keyboard shortcuts slots
|
||||||
void GUI::displayTransferTab() const {
|
void GUI::displayTransferTab() const {
|
||||||
tabs->setCurrentIndex(TAB_TRANSFER);
|
tabs->setCurrentWidget(transferList);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::displaySearchTab() const {
|
void GUI::displaySearchTab() const {
|
||||||
tabs->setCurrentIndex(TAB_SEARCH);
|
if(searchEngine)
|
||||||
|
tabs->setCurrentWidget(searchEngine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::displayRSSTab() const {
|
void GUI::displayRSSTab() const {
|
||||||
tabs->setCurrentIndex(TAB_RSS);
|
if(rssWidget)
|
||||||
|
tabs->setCurrentWidget(rssWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of keyboard shortcuts slots
|
// End of keyboard shortcuts slots
|
||||||
@@ -509,10 +519,12 @@ void GUI::on_actionExit_triggered() {
|
|||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
int GUI::getCurrentTabIndex() const {
|
QWidget* GUI::getCurrentTabWidget() const {
|
||||||
if(isMinimized() || !isVisible())
|
if(isMinimized() || !isVisible())
|
||||||
return -1;
|
return 0;
|
||||||
return tabs->currentIndex();
|
if(tabs->currentIndex() == 0)
|
||||||
|
return transferList;
|
||||||
|
return tabs->currentWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::setTabText(int index, QString text) const {
|
void GUI::setTabText(int index, QString text) const {
|
||||||
@@ -551,7 +563,7 @@ void GUI::on_actionAbout_triggered() {
|
|||||||
|
|
||||||
void GUI::showEvent(QShowEvent *e) {
|
void GUI::showEvent(QShowEvent *e) {
|
||||||
qDebug("** Show Event **");
|
qDebug("** Show Event **");
|
||||||
if(getCurrentTabIndex() == TAB_TRANSFER) {
|
if(getCurrentTabWidget() == transferList) {
|
||||||
qDebug("-> Refreshing transfer list");
|
qDebug("-> Refreshing transfer list");
|
||||||
transferList->refreshList();
|
transferList->refreshList();
|
||||||
properties->loadDynamicData();
|
properties->loadDynamicData();
|
||||||
|
@@ -37,8 +37,6 @@
|
|||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "qtorrenthandle.h"
|
#include "qtorrenthandle.h"
|
||||||
|
|
||||||
enum TabIndex{TAB_TRANSFER, TAB_SEARCH, TAB_RSS};
|
|
||||||
|
|
||||||
class Bittorrent;
|
class Bittorrent;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
class downloadFromURL;
|
class downloadFromURL;
|
||||||
@@ -68,7 +66,7 @@ public:
|
|||||||
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
|
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
|
||||||
~GUI();
|
~GUI();
|
||||||
// Methods
|
// Methods
|
||||||
int getCurrentTabIndex() const;
|
QWidget* getCurrentTabWidget() const;
|
||||||
TransferListWidget* getTransferList() const { return transferList; }
|
TransferListWidget* getTransferList() const { return transferList; }
|
||||||
QMenu* getTrayIconMenu();
|
QMenu* getTrayIconMenu();
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -162,10 +162,10 @@ public slots:
|
|||||||
void startTorrentsInPause(bool b);
|
void startTorrentsInPause(bool b);
|
||||||
void setDefaultTempPath(QString temppath);
|
void setDefaultTempPath(QString temppath);
|
||||||
void setAppendLabelToSavePath(bool append);
|
void setAppendLabelToSavePath(bool append);
|
||||||
void appendLabelToTorrentSavePath(QTorrentHandle h);
|
void appendLabelToTorrentSavePath(QTorrentHandle &h);
|
||||||
void changeLabelInTorrentSavePath(QTorrentHandle h, QString old_label, QString new_label);
|
void changeLabelInTorrentSavePath(QTorrentHandle &h, QString old_label, QString new_label);
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#if LIBTORRENT_VERSION_MINOR > 14
|
||||||
void appendqBextensionToTorrent(QTorrentHandle h, bool append);
|
void appendqBextensionToTorrent(QTorrentHandle &h, bool append);
|
||||||
void setAppendqBExtension(bool append);
|
void setAppendqBExtension(bool append);
|
||||||
#endif
|
#endif
|
||||||
void applyEncryptionSettings(pe_settings se);
|
void applyEncryptionSettings(pe_settings se);
|
||||||
@@ -226,6 +226,7 @@ private:
|
|||||||
QPointer<BandwidthScheduler> bd_scheduler;
|
QPointer<BandwidthScheduler> bd_scheduler;
|
||||||
QMap<QUrl, QString> savepath_fromurl;
|
QMap<QUrl, QString> savepath_fromurl;
|
||||||
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
||||||
|
QHash<QString, QString> savePathsToRemove;
|
||||||
QStringList torrentsToPausedAfterChecking;
|
QStringList torrentsToPausedAfterChecking;
|
||||||
QTimer resumeDataTimer;
|
QTimer resumeDataTimer;
|
||||||
// Ratio
|
// Ratio
|
||||||
|
Binary file not shown.
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
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
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
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -94,6 +94,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, GUI* main_window, TransferLi
|
|||||||
connect(PropDelegate, SIGNAL(filteredFilesChanged()), this, SLOT(filteredFilesChanged()));
|
connect(PropDelegate, SIGNAL(filteredFilesChanged()), this, SLOT(filteredFilesChanged()));
|
||||||
connect(stackedProperties, SIGNAL(currentChanged(int)), this, SLOT(loadDynamicData()));
|
connect(stackedProperties, SIGNAL(currentChanged(int)), this, SLOT(loadDynamicData()));
|
||||||
connect(BTSession, SIGNAL(savePathChanged(QTorrentHandle&)), this, SLOT(updateSavePath(QTorrentHandle&)));
|
connect(BTSession, SIGNAL(savePathChanged(QTorrentHandle&)), this, SLOT(updateSavePath(QTorrentHandle&)));
|
||||||
|
connect(BTSession, SIGNAL(metadataReceived(QTorrentHandle&)), this, SLOT(updateTorrentInfos(QTorrentHandle&)));
|
||||||
|
|
||||||
// Downloaded pieces progress bar
|
// Downloaded pieces progress bar
|
||||||
downloaded_pieces = new DownloadedPiecesBar(this);
|
downloaded_pieces = new DownloadedPiecesBar(this);
|
||||||
@@ -226,6 +227,12 @@ void PropertiesWidget::updateSavePath(QTorrentHandle& _h) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PropertiesWidget::updateTorrentInfos(QTorrentHandle& _h) {
|
||||||
|
if(h.is_valid() && h == _h) {
|
||||||
|
loadTorrentInfos(h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PropertiesWidget::on_reannounce_btn_clicked() {
|
void PropertiesWidget::on_reannounce_btn_clicked() {
|
||||||
if(h.is_valid()) {
|
if(h.is_valid()) {
|
||||||
h.force_reannounce();
|
h.force_reannounce();
|
||||||
@@ -243,18 +250,8 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Save path
|
// Save path
|
||||||
QString p;
|
updateSavePath(h);
|
||||||
if(h.has_metadata() && h.num_files() == 1) {
|
changeSavePathButton->setEnabled(h.has_metadata());
|
||||||
p = h.firstFileSavePath();
|
|
||||||
} else {
|
|
||||||
p = TorrentPersistentData::getSavePath(h.hash());
|
|
||||||
if(p.isEmpty())
|
|
||||||
p = h.save_path();
|
|
||||||
}
|
|
||||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
|
||||||
p = p.replace("/", "\\");
|
|
||||||
#endif
|
|
||||||
save_path->setText(p);
|
|
||||||
// Creation date
|
// Creation date
|
||||||
lbl_creationDate->setText(h.creation_date());
|
lbl_creationDate->setText(h.creation_date());
|
||||||
// Hash
|
// Hash
|
||||||
@@ -330,7 +327,7 @@ void PropertiesWidget::reloadPreferences() {
|
|||||||
|
|
||||||
void PropertiesWidget::loadDynamicData() {
|
void PropertiesWidget::loadDynamicData() {
|
||||||
// Refresh only if the torrent handle is valid and if visible
|
// Refresh only if the torrent handle is valid and if visible
|
||||||
if(!h.is_valid() || main_window->getCurrentTabIndex() != TAB_TRANSFER || state != VISIBLE) return;
|
if(!h.is_valid() || main_window->getCurrentTabWidget() != transferList || state != VISIBLE) return;
|
||||||
try {
|
try {
|
||||||
// Transfer infos
|
// Transfer infos
|
||||||
if(stackedProperties->currentIndex() == MAIN_TAB) {
|
if(stackedProperties->currentIndex() == MAIN_TAB) {
|
||||||
|
@@ -85,6 +85,7 @@ protected:
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void loadTorrentInfos(QTorrentHandle &h);
|
void loadTorrentInfos(QTorrentHandle &h);
|
||||||
|
void updateTorrentInfos(QTorrentHandle &h);
|
||||||
void loadUrlSeeds();
|
void loadUrlSeeds();
|
||||||
void on_main_infos_button_clicked();
|
void on_main_infos_button_clicked();
|
||||||
void on_trackers_button_clicked();
|
void on_trackers_button_clicked();
|
||||||
|
@@ -599,6 +599,8 @@ void QTorrentHandle::force_recheck() const {
|
|||||||
|
|
||||||
void QTorrentHandle::move_storage(QString new_path) const {
|
void QTorrentHandle::move_storage(QString new_path) const {
|
||||||
Q_ASSERT(h.is_valid());
|
Q_ASSERT(h.is_valid());
|
||||||
|
if(QDir(save_path()) == QDir(new_path)) return;
|
||||||
|
TorrentPersistentData::setPreviousSavePath(hash(), save_path());
|
||||||
h.move_storage(new_path.toLocal8Bit().constData());
|
h.move_storage(new_path.toLocal8Bit().constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -277,6 +277,10 @@ void SearchEngine::searchTextEdited(QString) {
|
|||||||
search_button->setText(tr("Search"));
|
search_button->setText(tr("Search"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SearchEngine::giveFocusToSearchInput() {
|
||||||
|
search_pattern->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
// Function called when we click on search button
|
// Function called when we click on search button
|
||||||
void SearchEngine::on_search_button_clicked(){
|
void SearchEngine::on_search_button_clicked(){
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
@@ -549,7 +553,7 @@ void SearchEngine::searchFinished(int exitcode,QProcess::ExitStatus){
|
|||||||
}
|
}
|
||||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||||
bool useNotificationBalloons = settings.value("Preferences/General/NotificationBaloons", true).toBool();
|
bool useNotificationBalloons = settings.value("Preferences/General/NotificationBaloons", true).toBool();
|
||||||
if(useNotificationBalloons && parent->getCurrentTabIndex() != TAB_SEARCH) {
|
if(useNotificationBalloons && parent->getCurrentTabWidget() != this) {
|
||||||
parent->showNotificationBaloon(tr("Search Engine"), tr("Search has finished"));
|
parent->showNotificationBaloon(tr("Search Engine"), tr("Search has finished"));
|
||||||
}
|
}
|
||||||
if(exitcode){
|
if(exitcode){
|
||||||
|
@@ -104,6 +104,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void on_download_button_clicked();
|
void on_download_button_clicked();
|
||||||
void downloadTorrent(QString engine_url, QString torrent_url);
|
void downloadTorrent(QString engine_url, QString torrent_url);
|
||||||
|
void giveFocusToSearchInput();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
// Search slots
|
// Search slots
|
||||||
|
@@ -3,7 +3,7 @@ LANG_PATH = lang
|
|||||||
ICONS_PATH = Icons
|
ICONS_PATH = Icons
|
||||||
|
|
||||||
# Set the following variable to 1 to enable debug
|
# Set the following variable to 1 to enable debug
|
||||||
DEBUG_MODE = 0
|
DEBUG_MODE = 1
|
||||||
|
|
||||||
# Global
|
# Global
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
@@ -12,9 +12,9 @@ CONFIG += qt \
|
|||||||
|
|
||||||
# Update this VERSION for each release
|
# Update this VERSION for each release
|
||||||
os2 {
|
os2 {
|
||||||
DEFINES += VERSION=\'\"v2.3.0rc3\"\'
|
DEFINES += VERSION=\'\"v2.3.0rc5\"\'
|
||||||
} else {
|
} else {
|
||||||
DEFINES += VERSION=\\\"v2.3.0rc3\\\"
|
DEFINES += VERSION=\\\"v2.3.0rc5\\\"
|
||||||
}
|
}
|
||||||
DEFINES += VERSION_MAJOR=2
|
DEFINES += VERSION_MAJOR=2
|
||||||
DEFINES += VERSION_MINOR=3
|
DEFINES += VERSION_MINOR=3
|
||||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user