mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-28 23:44:32 +00:00
Use busy cursor when downloading search plugins updates
This commit is contained in:
parent
00c92d6d61
commit
9bdac4d1e3
@ -84,6 +84,7 @@ void engineSelectDlg::dropEvent(QDropEvent *event) {
|
|||||||
qDebug("dropped %s", qPrintable(file));
|
qDebug("dropped %s", qPrintable(file));
|
||||||
file = file.replace("file://", "");
|
file = file.replace("file://", "");
|
||||||
if(file.startsWith("http://", Qt::CaseInsensitive) || file.startsWith("https://", Qt::CaseInsensitive) || file.startsWith("ftp://", Qt::CaseInsensitive)) {
|
if(file.startsWith("http://", Qt::CaseInsensitive) || file.startsWith("https://", Qt::CaseInsensitive) || file.startsWith("ftp://", Qt::CaseInsensitive)) {
|
||||||
|
setCursor(QCursor(Qt::WaitCursor));
|
||||||
downloader->downloadUrl(file);
|
downloader->downloadUrl(file);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -108,6 +109,7 @@ void engineSelectDlg::dragEnterEvent(QDragEnterEvent *event) {
|
|||||||
|
|
||||||
void engineSelectDlg::on_updateButton_clicked() {
|
void engineSelectDlg::on_updateButton_clicked() {
|
||||||
// Download version file from update server on sourceforge
|
// Download version file from update server on sourceforge
|
||||||
|
setCursor(QCursor(Qt::WaitCursor));
|
||||||
downloader->downloadUrl(QString(UPDATE_URL)+"versions.txt");
|
downloader->downloadUrl(QString(UPDATE_URL)+"versions.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,8 +351,10 @@ void engineSelectDlg::askForPluginUrl() {
|
|||||||
QString url = QInputDialog::getText(this, tr("New search engine plugin URL"),
|
QString url = QInputDialog::getText(this, tr("New search engine plugin URL"),
|
||||||
tr("URL:"), QLineEdit::Normal,
|
tr("URL:"), QLineEdit::Normal,
|
||||||
"http://", &ok);
|
"http://", &ok);
|
||||||
if (ok && !url.isEmpty())
|
if (ok && !url.isEmpty()) {
|
||||||
|
setCursor(QCursor(Qt::WaitCursor));
|
||||||
downloader->downloadUrl(url);
|
downloader->downloadUrl(url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void engineSelectDlg::askForLocalPlugin() {
|
void engineSelectDlg::askForLocalPlugin() {
|
||||||
@ -395,6 +399,7 @@ bool engineSelectDlg::parseVersionsFile(QString versions_file) {
|
|||||||
if(isUpdateNeeded(plugin_name, version)) {
|
if(isUpdateNeeded(plugin_name, version)) {
|
||||||
qDebug("Plugin: %s is outdated", qPrintable(plugin_name));
|
qDebug("Plugin: %s is outdated", qPrintable(plugin_name));
|
||||||
// Downloading update
|
// Downloading update
|
||||||
|
setCursor(QCursor(Qt::WaitCursor));
|
||||||
downloader->downloadUrl(UPDATE_URL+plugin_name+".py");
|
downloader->downloadUrl(UPDATE_URL+plugin_name+".py");
|
||||||
//downloader->downloadUrl(UPDATE_URL+plugin_name+".png");
|
//downloader->downloadUrl(UPDATE_URL+plugin_name+".png");
|
||||||
updated = true;
|
updated = true;
|
||||||
@ -413,6 +418,7 @@ bool engineSelectDlg::parseVersionsFile(QString versions_file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
|
void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
|
||||||
|
setCursor(QCursor(Qt::ArrowCursor));
|
||||||
qDebug("engineSelectDlg received %s", qPrintable(url));
|
qDebug("engineSelectDlg received %s", qPrintable(url));
|
||||||
if(url.endsWith("favicon.ico", Qt::CaseInsensitive)){
|
if(url.endsWith("favicon.ico", Qt::CaseInsensitive)){
|
||||||
// Icon downloaded
|
// Icon downloaded
|
||||||
@ -454,6 +460,7 @@ void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void engineSelectDlg::handleDownloadFailure(QString url, QString reason) {
|
void engineSelectDlg::handleDownloadFailure(QString url, QString reason) {
|
||||||
|
setCursor(QCursor(Qt::ArrowCursor));
|
||||||
if(url.endsWith("favicon.ico", Qt::CaseInsensitive)){
|
if(url.endsWith("favicon.ico", Qt::CaseInsensitive)){
|
||||||
qDebug("Could not download favicon: %s, reason: %s", qPrintable(url), qPrintable(reason));
|
qDebug("Could not download favicon: %s, reason: %s", qPrintable(url), qPrintable(reason));
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user