Parenting the info view to the menu is preventing the menu from showing up on

Linux.  Let's try not doing that.
This commit is contained in:
Andrzej Kapolka 2013-09-19 17:47:50 -07:00
parent 9c320e9827
commit 94d6f00f65
4 changed files with 12 additions and 11 deletions

View file

@ -321,7 +321,7 @@ void Application::initializeGL() {
Menu::getInstance()->checkForUpdates(); Menu::getInstance()->checkForUpdates();
#endif #endif
InfoView::showFirstTime(Menu::getInstance()); InfoView::showFirstTime();
} }
void Application::paintGL() { void Application::paintGL() {

View file

@ -17,8 +17,7 @@
#define SETTINGS_VERSION_KEY "info-version" #define SETTINGS_VERSION_KEY "info-version"
#define MAX_DIALOG_HEIGHT_RATIO 0.9 #define MAX_DIALOG_HEIGHT_RATIO 0.9
InfoView::InfoView(bool forced, QWidget* parent) : InfoView::InfoView(bool forced) :
QWebView(parent),
_forced(forced) { _forced(forced) {
switchToResourcesParentIfRequired(); switchToResourcesParentIfRequired();
@ -29,12 +28,12 @@ InfoView::InfoView(bool forced, QWidget* parent) :
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loaded(bool))); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loaded(bool)));
} }
void InfoView::showFirstTime(QWidget* parent) { void InfoView::showFirstTime() {
new InfoView(false, parent); new InfoView(false);
} }
void InfoView::forcedShow(QWidget* parent) { void InfoView::forcedShow() {
new InfoView(true, parent); new InfoView(true);
} }
bool InfoView::shouldShow() { bool InfoView::shouldShow() {
@ -59,6 +58,7 @@ bool InfoView::shouldShow() {
void InfoView::loaded(bool ok) { void InfoView::loaded(bool ok) {
if (!ok || !shouldShow()) { if (!ok || !shouldShow()) {
deleteLater();
return; return;
} }
@ -72,5 +72,6 @@ void InfoView::loaded(bool ok) {
resize(mainFrame->contentsSize().width(), height); resize(mainFrame->contentsSize().width(), height);
move(desktop->screen()->rect().center() - rect().center()); move(desktop->screen()->rect().center() - rect().center());
setWindowTitle(title()); setWindowTitle(title());
setAttribute(Qt::WA_DeleteOnClose);
show(); show();
} }

View file

@ -14,11 +14,11 @@
class InfoView : public QWebView { class InfoView : public QWebView {
Q_OBJECT Q_OBJECT
public: public:
static void showFirstTime(QWidget* parent); static void showFirstTime();
static void forcedShow(QWidget* parent); static void forcedShow();
private: private:
InfoView(bool forced, QWidget* parent); InfoView(bool forced);
bool _forced; bool _forced;
bool shouldShow(); bool shouldShow();

View file

@ -684,7 +684,7 @@ bool Menu::isVoxelModeActionChecked() {
} }
void Menu::aboutApp() { void Menu::aboutApp() {
InfoView::forcedShow(this); InfoView::forcedShow();
} }
void updateDSHostname(const QString& domainServerHostname) { void updateDSHostname(const QString& domainServerHostname) {