mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Display a message when a link to a search plugin is invalid. Closes #892.
This commit is contained in:
parent
65012bc517
commit
c7aa2cb684
1 changed files with 16 additions and 4 deletions
|
@ -326,15 +326,27 @@ void engineSelectDlg::on_installButton_clicked() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void engineSelectDlg::askForPluginUrl() {
|
void engineSelectDlg::askForPluginUrl() {
|
||||||
bool ok;
|
bool ok(false);
|
||||||
QString url = AutoExpandableDialog::getText(this, tr("New search engine plugin URL"),
|
QString url = AutoExpandableDialog::getText(this, tr("New search engine plugin URL"),
|
||||||
tr("URL:"), QLineEdit::Normal,
|
tr("URL:"), QLineEdit::Normal,
|
||||||
"http://", &ok);
|
"http://", &ok);
|
||||||
if (ok && !url.isEmpty()) {
|
|
||||||
|
while(true) {
|
||||||
|
if (!ok || url.isEmpty())
|
||||||
|
return;
|
||||||
|
if (!url.endsWith(".py")) {
|
||||||
|
QMessageBox::warning(this, tr("Invlalid link"), tr("The link doesn't seem to point to a search engine plugin."));
|
||||||
|
url = AutoExpandableDialog::getText(this, tr("New search engine plugin URL"),
|
||||||
|
tr("URL:"), QLineEdit::Normal,
|
||||||
|
url, &ok);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
setCursor(QCursor(Qt::WaitCursor));
|
setCursor(QCursor(Qt::WaitCursor));
|
||||||
downloader->downloadUrl(url);
|
downloader->downloadUrl(url);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void engineSelectDlg::askForLocalPlugin() {
|
void engineSelectDlg::askForLocalPlugin() {
|
||||||
QStringList pathsList = QFileDialog::getOpenFileNames(0,
|
QStringList pathsList = QFileDialog::getOpenFileNames(0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue