From 94d6f00f65c14dc1ef4df6af34abe146006c6e4d Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 19 Sep 2013 17:47:50 -0700 Subject: [PATCH] Parenting the info view to the menu is preventing the menu from showing up on Linux. Let's try not doing that. --- interface/src/Application.cpp | 2 +- interface/src/InfoView.cpp | 13 +++++++------ interface/src/InfoView.h | 6 +++--- interface/src/Menu.cpp | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index dc77966335..58bb48cae6 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -321,7 +321,7 @@ void Application::initializeGL() { Menu::getInstance()->checkForUpdates(); #endif - InfoView::showFirstTime(Menu::getInstance()); + InfoView::showFirstTime(); } void Application::paintGL() { diff --git a/interface/src/InfoView.cpp b/interface/src/InfoView.cpp index 78817b0f32..867c8f0f9e 100644 --- a/interface/src/InfoView.cpp +++ b/interface/src/InfoView.cpp @@ -17,8 +17,7 @@ #define SETTINGS_VERSION_KEY "info-version" #define MAX_DIALOG_HEIGHT_RATIO 0.9 -InfoView::InfoView(bool forced, QWidget* parent) : - QWebView(parent), +InfoView::InfoView(bool forced) : _forced(forced) { switchToResourcesParentIfRequired(); @@ -29,12 +28,12 @@ InfoView::InfoView(bool forced, QWidget* parent) : connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loaded(bool))); } -void InfoView::showFirstTime(QWidget* parent) { - new InfoView(false, parent); +void InfoView::showFirstTime() { + new InfoView(false); } -void InfoView::forcedShow(QWidget* parent) { - new InfoView(true, parent); +void InfoView::forcedShow() { + new InfoView(true); } bool InfoView::shouldShow() { @@ -59,6 +58,7 @@ bool InfoView::shouldShow() { void InfoView::loaded(bool ok) { if (!ok || !shouldShow()) { + deleteLater(); return; } @@ -72,5 +72,6 @@ void InfoView::loaded(bool ok) { resize(mainFrame->contentsSize().width(), height); move(desktop->screen()->rect().center() - rect().center()); setWindowTitle(title()); + setAttribute(Qt::WA_DeleteOnClose); show(); } diff --git a/interface/src/InfoView.h b/interface/src/InfoView.h index ffeae66828..009587c1d5 100644 --- a/interface/src/InfoView.h +++ b/interface/src/InfoView.h @@ -14,11 +14,11 @@ class InfoView : public QWebView { Q_OBJECT public: - static void showFirstTime(QWidget* parent); - static void forcedShow(QWidget* parent); + static void showFirstTime(); + static void forcedShow(); private: - InfoView(bool forced, QWidget* parent); + InfoView(bool forced); bool _forced; bool shouldShow(); diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 03f7db6251..ca7e513f67 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -684,7 +684,7 @@ bool Menu::isVoxelModeActionChecked() { } void Menu::aboutApp() { - InfoView::forcedShow(this); + InfoView::forcedShow(); } void updateDSHostname(const QString& domainServerHostname) {