| 27 | #include "ui/widgets/PageContainer.h" |
| 28 | |
| 29 | PageDialog::PageDialog(BasePageProvider *pageProvider, QString defaultId, QWidget *parent) |
| 30 | : QDialog(parent) |
| 31 | { |
| 32 | setWindowTitle(pageProvider->dialogTitle()); |
| 33 | m_container = new PageContainer(pageProvider, defaultId, this); |
| 34 | |
| 35 | QVBoxLayout *mainLayout = new QVBoxLayout; |
| 36 | mainLayout->addWidget(m_container); |
| 37 | mainLayout->setSpacing(0); |
| 38 | mainLayout->setContentsMargins(0, 0, 0, 0); |
| 39 | setLayout(mainLayout); |
| 40 | |
| 41 | QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close); |
| 42 | buttons->button(QDialogButtonBox::Close)->setDefault(true); |
| 43 | buttons->setContentsMargins(6, 0, 6, 0); |
| 44 | m_container->addButtons(buttons); |
| 45 | |
| 46 | connect(buttons->button(QDialogButtonBox::Close), SIGNAL(clicked()), this, SLOT(close())); |
| 47 | connect(buttons->button(QDialogButtonBox::Help), SIGNAL(clicked()), m_container, SLOT(help())); |
| 48 | |
| 49 | restoreGeometry(QByteArray::fromBase64(APPLICATION->settings()->get("PagedGeometry").toByteArray())); |
| 50 | } |
| 51 | |
| 52 | void PageDialog::closeEvent(QCloseEvent *event) |
| 53 | { |
nothing calls this directly
no test coverage detected