NOISSUE tabs -> spaces
This commit is contained in:
@ -26,35 +26,35 @@
|
||||
#include "widgets/PageContainer.h"
|
||||
|
||||
PageDialog::PageDialog(BasePageProvider *pageProvider, QString defaultId, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
setWindowTitle(pageProvider->dialogTitle());
|
||||
m_container = new PageContainer(pageProvider, defaultId, this);
|
||||
setWindowTitle(pageProvider->dialogTitle());
|
||||
m_container = new PageContainer(pageProvider, defaultId, this);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(m_container);
|
||||
mainLayout->setSpacing(0);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
setLayout(mainLayout);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(m_container);
|
||||
mainLayout->setSpacing(0);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
setLayout(mainLayout);
|
||||
|
||||
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close);
|
||||
buttons->button(QDialogButtonBox::Close)->setDefault(true);
|
||||
m_container->addButtons(buttons);
|
||||
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close);
|
||||
buttons->button(QDialogButtonBox::Close)->setDefault(true);
|
||||
m_container->addButtons(buttons);
|
||||
|
||||
connect(buttons->button(QDialogButtonBox::Close), SIGNAL(clicked()), this, SLOT(close()));
|
||||
connect(buttons->button(QDialogButtonBox::Help), SIGNAL(clicked()), m_container, SLOT(help()));
|
||||
connect(buttons->button(QDialogButtonBox::Close), SIGNAL(clicked()), this, SLOT(close()));
|
||||
connect(buttons->button(QDialogButtonBox::Help), SIGNAL(clicked()), m_container, SLOT(help()));
|
||||
|
||||
restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("PagedGeometry").toByteArray()));
|
||||
restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("PagedGeometry").toByteArray()));
|
||||
}
|
||||
|
||||
void PageDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
qDebug() << "Paged dialog close requested";
|
||||
if (m_container->prepareToClose())
|
||||
{
|
||||
qDebug() << "Paged dialog close approved";
|
||||
MMC->settings()->set("PagedGeometry", saveGeometry().toBase64());
|
||||
qDebug() << "Paged dialog geometry saved";
|
||||
QDialog::closeEvent(event);
|
||||
}
|
||||
qDebug() << "Paged dialog close requested";
|
||||
if (m_container->prepareToClose())
|
||||
{
|
||||
qDebug() << "Paged dialog close approved";
|
||||
MMC->settings()->set("PagedGeometry", saveGeometry().toBase64());
|
||||
qDebug() << "Paged dialog geometry saved";
|
||||
QDialog::closeEvent(event);
|
||||
}
|
||||
}
|
||||
|
@ -21,15 +21,15 @@
|
||||
class PageContainer;
|
||||
class PageDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PageDialog(BasePageProvider *pageProvider, QString defaultId = QString(), QWidget *parent = 0);
|
||||
virtual ~PageDialog() {}
|
||||
explicit PageDialog(BasePageProvider *pageProvider, QString defaultId = QString(), QWidget *parent = 0);
|
||||
virtual ~PageDialog() {}
|
||||
|
||||
private
|
||||
slots:
|
||||
virtual void closeEvent(QCloseEvent *event);
|
||||
virtual void closeEvent(QCloseEvent *event);
|
||||
|
||||
private:
|
||||
PageContainer * m_container;
|
||||
PageContainer * m_container;
|
||||
};
|
||||
|
Reference in New Issue
Block a user