From 4c0dc51110603cbe0e98228c703e26402094a3cc Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Sat, 12 Jul 2014 23:02:52 +0200 Subject: Finish of the OtherLogs page, and (re)format page related files --- gui/pagedialog/PageDialog.cpp | 30 +++++++++++++++++------------- gui/pagedialog/PageDialog.h | 5 +++-- 2 files changed, 20 insertions(+), 15 deletions(-) (limited to 'gui/pagedialog') diff --git a/gui/pagedialog/PageDialog.cpp b/gui/pagedialog/PageDialog.cpp index 4dd4a811..c0bcdf9f 100644 --- a/gui/pagedialog/PageDialog.cpp +++ b/gui/pagedialog/PageDialog.cpp @@ -14,18 +14,20 @@ */ #include "PageDialog.h" -#include "gui/Platform.h" -#include "MultiMC.h" -#include "logic/settings/SettingsObject.h" -#include -#include #include #include #include -#include +#include + +#include "MultiMC.h" +#include "logic/settings/SettingsObject.h" +#include "gui/Platform.h" +#include "gui/widgets/IconLabel.h" +#include "gui/widgets/PageContainer.h" -PageDialog::PageDialog(BasePageProviderPtr pageProvider, QString defaultId, QWidget *parent) : QDialog(parent) +PageDialog::PageDialog(BasePageProviderPtr pageProvider, QString defaultId, QWidget *parent) + : QDialog(parent) { MultiMCPlatform::fixWM_CLASS(this); setWindowTitle(pageProvider->dialogTitle()); @@ -34,23 +36,25 @@ PageDialog::PageDialog(BasePageProviderPtr pageProvider, QString defaultId, QWid QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(m_container); mainLayout->setSpacing(0); - mainLayout->setContentsMargins(0,0,0,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); 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::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) +void PageDialog::closeEvent(QCloseEvent *event) { - if(m_container->requestClose(event)) + if (m_container->requestClose(event)) { MMC->settings()->set("PagedGeometry", saveGeometry().toBase64()); QDialog::closeEvent(event); diff --git a/gui/pagedialog/PageDialog.h b/gui/pagedialog/PageDialog.h index 097eac64..19d1b01f 100644 --- a/gui/pagedialog/PageDialog.h +++ b/gui/pagedialog/PageDialog.h @@ -14,8 +14,9 @@ */ #pragma once + #include -#include +#include "gui/pages/BasePageProvider.h" class PageContainer; class PageDialog : public QDialog @@ -24,7 +25,7 @@ class PageDialog : public QDialog public: explicit PageDialog(BasePageProviderPtr pageProvider, QString defaultId = QString(), QWidget *parent = 0); - virtual ~PageDialog() {}; + virtual ~PageDialog() {} private slots: -- cgit v1.2.3