From 2d8f6481dcf8d7699d6b67a63c6de6048d528a8c Mon Sep 17 00:00:00 2001 From: Dave Page Date: Sat, 22 Jun 2013 00:59:34 +0100 Subject: [PATCH] Fix a display issue in the Linux error handling. Linux won't refresh the qWebView unless we explicitly process events after telling it to load the page again. --- runtime/BrowserWindow.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/runtime/BrowserWindow.cpp b/runtime/BrowserWindow.cpp index b6d2c0a44..45e442e5a 100644 --- a/runtime/BrowserWindow.cpp +++ b/runtime/BrowserWindow.cpp @@ -98,11 +98,24 @@ void BrowserWindow::finishLoading(bool ok) if (m_loadattempt < 5) { qDebug() << "Initial load failed. Retrying in" << m_loadattempt << "seconds."; - webView->setHtml(QString(tr("

Failed to connect to the pgAdmin application server. Retrying in %1 seconds, ") + - tr("or click here to try again now.

")).arg(m_loadattempt).arg(PGA_SERVER_URL)); + + if (m_loadattempt == 1) + { + webView->setHtml(tr("

Connecting...

")); + } + else + { + webView->setHtml(QString(tr("

Failed to connect to the pgAdmin application server. Retrying in %1 seconds, ") + + tr("or click here to try again now.

")).arg(m_loadattempt).arg(PGA_SERVER_URL)); + } pause(m_loadattempt); webView->setUrl(PGA_SERVER_URL); + + // Even if the server comes up while we're looping, Linux won't + // properly display the HTML data unless we explicitly process events. + QCoreApplication::processEvents(QEventLoop::AllEvents, 100); + m_loadattempt++; return; }