Enabled modality for appropriate dialogs

Make sure it is impossible to open more than one torrent addition from URL dialog
This commit is contained in:
Christophe Dumez 2010-03-10 20:21:56 +00:00
parent 9202ce8757
commit cc3a6350a5
6 changed files with 15 additions and 4 deletions

View file

@ -227,6 +227,8 @@ GUI::~GUI() {
delete aboutDlg;
if(options)
delete options;
if(downloadFromURLDialog)
delete downloadFromURLDialog;
if(rssWidget)
delete rssWidget;
delete searchEngine;
@ -633,8 +635,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();
@ -960,7 +962,9 @@ void GUI::on_actionOptions_triggered() {
// Display an input dialog to prompt user for
// an url
void GUI::on_actionDownload_from_URL_triggered() {
downloadFromURL *downloadFromURLDialog = new downloadFromURL(this);
connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&)));
if(!downloadFromURLDialog) {
downloadFromURLDialog = new downloadFromURL(this);
connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&)));
}
}