diff --git a/src/lib/adblock/adblockdialog.cpp b/src/lib/adblock/adblockdialog.cpp index e396da559..08d0cb38b 100644 --- a/src/lib/adblock/adblockdialog.cpp +++ b/src/lib/adblock/adblockdialog.cpp @@ -21,6 +21,7 @@ #include "adblocktreewidget.h" #include "adblockaddsubscriptiondialog.h" #include "mainapplication.h" +#include "qztools.h" #include #include @@ -28,7 +29,7 @@ #include AdBlockDialog::AdBlockDialog(QWidget* parent) - : QDialog(parent) + : QWidget(parent) , m_manager(AdBlockManager::instance()) , m_currentTreeWidget(0) , m_currentSubscription(0) @@ -37,6 +38,9 @@ AdBlockDialog::AdBlockDialog(QWidget* parent) { setAttribute(Qt::WA_DeleteOnClose); setupUi(this); + + QzTools::centerWidgetOnScreen(this); + #ifdef Q_OS_MAC tabWidget->setDocumentMode(false); #endif @@ -193,5 +197,5 @@ void AdBlockDialog::closeEvent(QCloseEvent* ev) m_manager->setUseLimitedEasyList(useLimitedEasyList->isChecked()); } - QDialog::closeEvent(ev); + QWidget::closeEvent(ev); } diff --git a/src/lib/adblock/adblockdialog.h b/src/lib/adblock/adblockdialog.h index 0d068fe8f..64aa88756 100644 --- a/src/lib/adblock/adblockdialog.h +++ b/src/lib/adblock/adblockdialog.h @@ -18,7 +18,7 @@ #ifndef ADBLOCKDIALOG_H #define ADBLOCKDIALOG_H -#include +#include #include "qz_namespace.h" #include "ui_adblockdialog.h" @@ -28,7 +28,7 @@ class AdBlockTreeWidget; class AdBlockManager; class AdBlockRule; -class QT_QUPZILLA_EXPORT AdBlockDialog : public QDialog, public Ui_AdBlockDialog +class QT_QUPZILLA_EXPORT AdBlockDialog : public QWidget, public Ui_AdBlockDialog { Q_OBJECT diff --git a/src/lib/adblock/adblockdialog.ui b/src/lib/adblock/adblockdialog.ui index 452435eff..0331f0b2f 100644 --- a/src/lib/adblock/adblockdialog.ui +++ b/src/lib/adblock/adblockdialog.ui @@ -1,7 +1,7 @@ AdBlockDialog - + 0 @@ -141,38 +141,6 @@ - - buttonBox - accepted() - AdBlockDialog - accept() - - - 75 - 495 - - - 157 - 274 - - - - - buttonBox - rejected() - AdBlockDialog - reject() - - - 75 - 495 - - - 286 - 274 - - - adblockCheckBox toggled(bool) diff --git a/src/lib/adblock/adblockmanager.cpp b/src/lib/adblock/adblockmanager.cpp index 3e9c0684e..80482517e 100644 --- a/src/lib/adblock/adblockmanager.cpp +++ b/src/lib/adblock/adblockmanager.cpp @@ -413,10 +413,13 @@ AdBlockSubscription* AdBlockManager::subscriptionByName(const QString &name) con AdBlockDialog* AdBlockManager::showDialog() { if (!m_adBlockDialog) { - m_adBlockDialog = new AdBlockDialog(mApp->getWindow()); + m_adBlockDialog = new AdBlockDialog; } m_adBlockDialog.data()->show(); + m_adBlockDialog.data()->raise(); + m_adBlockDialog.data()->activateWindow(); + return m_adBlockDialog.data(); }