mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 16:53:08 -07:00
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:
parent
9202ce8757
commit
cc3a6350a5
6 changed files with 15 additions and 4 deletions
|
@ -227,6 +227,8 @@ GUI::~GUI() {
|
||||||
delete aboutDlg;
|
delete aboutDlg;
|
||||||
if(options)
|
if(options)
|
||||||
delete options;
|
delete options;
|
||||||
|
if(downloadFromURLDialog)
|
||||||
|
delete downloadFromURLDialog;
|
||||||
if(rssWidget)
|
if(rssWidget)
|
||||||
delete rssWidget;
|
delete rssWidget;
|
||||||
delete searchEngine;
|
delete searchEngine;
|
||||||
|
@ -960,7 +962,9 @@ void GUI::on_actionOptions_triggered() {
|
||||||
// Display an input dialog to prompt user for
|
// Display an input dialog to prompt user for
|
||||||
// an url
|
// an url
|
||||||
void GUI::on_actionDownload_from_URL_triggered() {
|
void GUI::on_actionDownload_from_URL_triggered() {
|
||||||
downloadFromURL *downloadFromURLDialog = new downloadFromURL(this);
|
if(!downloadFromURLDialog) {
|
||||||
|
downloadFromURLDialog = new downloadFromURL(this);
|
||||||
connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&)));
|
connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ class StatusBar;
|
||||||
class consoleDlg;
|
class consoleDlg;
|
||||||
class about;
|
class about;
|
||||||
class createtorrent;
|
class createtorrent;
|
||||||
|
class downloadFromURL;
|
||||||
|
|
||||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -139,6 +140,7 @@ private:
|
||||||
QPointer<consoleDlg> console;
|
QPointer<consoleDlg> console;
|
||||||
QPointer<about> aboutDlg;
|
QPointer<about> aboutDlg;
|
||||||
QPointer<createtorrent> createTorrentDlg;
|
QPointer<createtorrent> createTorrentDlg;
|
||||||
|
QPointer<downloadFromURL> downloadFromURLDialog;
|
||||||
QPointer<QSystemTrayIcon> systrayIcon;
|
QPointer<QSystemTrayIcon> systrayIcon;
|
||||||
QPointer<QTimer> systrayCreator;
|
QPointer<QTimer> systrayCreator;
|
||||||
QMenu *myTrayIconMenu;
|
QMenu *myTrayIconMenu;
|
||||||
|
|
|
@ -46,6 +46,7 @@ class consoleDlg : public QDialog, private Ui_ConsoleDlg{
|
||||||
consoleDlg(QWidget *parent, Bittorrent* _BTSession) : QDialog(parent) {
|
consoleDlg(QWidget *parent, Bittorrent* _BTSession) : QDialog(parent) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
setModal(true);
|
||||||
BTSession = _BTSession;
|
BTSession = _BTSession;
|
||||||
textConsole->setHtml(BTSession->getConsoleMessages().join("<br>"));
|
textConsole->setHtml(BTSession->getConsoleMessages().join("<br>"));
|
||||||
textBannedPeers->setHtml(BTSession->getPeerBanMessages().join("<br>"));
|
textBannedPeers->setHtml(BTSession->getPeerBanMessages().join("<br>"));
|
||||||
|
|
|
@ -65,6 +65,7 @@ bool file_filter(boost::filesystem::path const& filename)
|
||||||
createtorrent::createtorrent(QWidget *parent): QDialog(parent){
|
createtorrent::createtorrent(QWidget *parent): QDialog(parent){
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
setModal(true);
|
||||||
creatorThread = new torrentCreatorThread(this);
|
creatorThread = new torrentCreatorThread(this);
|
||||||
connect(creatorThread, SIGNAL(creationSuccess(QString, const char*)), this, SLOT(handleCreationSuccess(QString, const char*)));
|
connect(creatorThread, SIGNAL(creationSuccess(QString, const char*)), this, SLOT(handleCreationSuccess(QString, const char*)));
|
||||||
connect(creatorThread, SIGNAL(creationFailure(QString)), this, SLOT(handleCreationFailure(QString)));
|
connect(creatorThread, SIGNAL(creationFailure(QString)), this, SLOT(handleCreationFailure(QString)));
|
||||||
|
|
|
@ -47,6 +47,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
icon_lbl->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/url.png")));
|
icon_lbl->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/url.png")));
|
||||||
|
setModal(true);
|
||||||
show();
|
show();
|
||||||
// Paste clipboard if there is an URL in it
|
// Paste clipboard if there is an URL in it
|
||||||
QString clip_txt = qApp->clipboard()->text();
|
QString clip_txt = qApp->clipboard()->text();
|
||||||
|
|
|
@ -52,6 +52,8 @@
|
||||||
options_imp::options_imp(QWidget *parent):QDialog(parent){
|
options_imp::options_imp(QWidget *parent):QDialog(parent){
|
||||||
qDebug("-> Constructing Options");
|
qDebug("-> Constructing Options");
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
setModal(true);
|
||||||
|
|
||||||
QString savePath;
|
QString savePath;
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
// Get apply button in button box
|
// Get apply button in button box
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue