From 4c0dc51110603cbe0e98228c703e26402094a3cc Mon Sep 17 00:00:00 2001
From: Jan Dalheimer <jan@dalheimer.de>
Date: Sat, 12 Jul 2014 23:02:52 +0200
Subject: Finish of the OtherLogs page, and (re)format page related files

---
 gui/widgets/PageContainer.cpp | 13 +++++++++----
 gui/widgets/PageContainer.h   |  8 +++++---
 gui/widgets/PageContainer_p.h | 18 +++++++++++++++++-
 3 files changed, 31 insertions(+), 8 deletions(-)

(limited to 'gui/widgets')

diff --git a/gui/widgets/PageContainer.cpp b/gui/widgets/PageContainer.cpp
index d5df72ce..a68f94cd 100644
--- a/gui/widgets/PageContainer.cpp
+++ b/gui/widgets/PageContainer.cpp
@@ -14,12 +14,11 @@
  */
 
 #include "PageContainer.h"
-#include "gui/Platform.h"
+
 #include <QStackedLayout>
 #include <QPushButton>
 #include <QSortFilterProxyModel>
 #include <QUrl>
-#include "MultiMC.h"
 #include <QStyledItemDelegate>
 #include <QListView>
 #include <QLineEdit>
@@ -27,10 +26,12 @@
 #include <QDialogButtonBox>
 #include <QGridLayout>
 #include <QDesktopServices>
-#include "logic/settings/SettingsObject.h"
 
+#include "MultiMC.h"
+#include "logic/settings/SettingsObject.h"
+#include "gui/widgets/IconLabel.h"
+#include "gui/Platform.h"
 #include "PageContainer_p.h"
-#include <gui/widgets/IconLabel.h>
 
 class PageEntryFilterModel : public QSortFilterProxyModel
 {
@@ -197,5 +198,9 @@ bool PageContainer::requestClose(QCloseEvent *event)
 		if (!page->apply())
 			return false;
 	}
+	if (m_currentPage)
+	{
+		m_currentPage->closed();
+	}
 	return true;
 }
diff --git a/gui/widgets/PageContainer.h b/gui/widgets/PageContainer.h
index c0f17e90..06498850 100644
--- a/gui/widgets/PageContainer.h
+++ b/gui/widgets/PageContainer.h
@@ -14,9 +14,11 @@
  */
 
 #pragma once
+
 #include <QWidget>
 #include <QModelIndex>
-#include <gui/pages/BasePageProvider.h>
+
+#include "gui/pages/BasePageProvider.h"
 
 class QLayout;
 class IconLabel;
@@ -34,7 +36,7 @@ class PageContainer : public QWidget
 public:
 	explicit PageContainer(BasePageProviderPtr pageProvider, QString defaultId = QString(),
 						QWidget *parent = 0);
-	virtual ~PageContainer() {};
+	virtual ~PageContainer() {}
 
 	void addButtons(QWidget * buttons);
 	void addButtons(QLayout * buttons);
@@ -49,7 +51,7 @@ slots:
 	void help();
 
 private:
-	BasePage * m_currentPage;
+	BasePage * m_currentPage = 0;
 	QSortFilterProxyModel *m_proxyModel;
 	PageModel *m_model;
 	QStackedLayout *m_pageStack;
diff --git a/gui/widgets/PageContainer_p.h b/gui/widgets/PageContainer_p.h
index f10e8f2c..1f68776b 100644
--- a/gui/widgets/PageContainer_p.h
+++ b/gui/widgets/PageContainer_p.h
@@ -1,4 +1,20 @@
+/* Copyright 2014 MultiMC Contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #pragma once
+
 #include <QListView>
 #include <QStyledItemDelegate>
 #include <QEvent>
@@ -30,7 +46,7 @@ public:
 		empty.fill(Qt::transparent);
 		m_emptyIcon = QIcon(empty);
 	}
-	virtual ~PageModel() {};
+	virtual ~PageModel() {}
 
 	int rowCount(const QModelIndex &parent = QModelIndex()) const
 	{
-- 
cgit