1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

[AdBlockDialog] Change AdBlockDialog to QWidget

Closes #1169
This commit is contained in:
nowrep 2014-01-25 20:06:08 +01:00
parent d5ea5342cf
commit 4a7423b02f
4 changed files with 13 additions and 38 deletions

View File

@ -21,6 +21,7 @@
#include "adblocktreewidget.h"
#include "adblockaddsubscriptiondialog.h"
#include "mainapplication.h"
#include "qztools.h"
#include <QMenu>
#include <QTimer>
@ -28,7 +29,7 @@
#include <QInputDialog>
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);
}

View File

@ -18,7 +18,7 @@
#ifndef ADBLOCKDIALOG_H
#define ADBLOCKDIALOG_H
#include <QDialog>
#include <QWidget>
#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

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AdBlockDialog</class>
<widget class="QDialog" name="AdBlockDialog">
<widget class="QWidget" name="AdBlockDialog">
<property name="geometry">
<rect>
<x>0</x>
@ -141,38 +141,6 @@
<include location="../data/icons.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AdBlockDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>75</x>
<y>495</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AdBlockDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>75</x>
<y>495</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>adblockCheckBox</sender>
<signal>toggled(bool)</signal>

View File

@ -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();
}