mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-21 16:27:39 -06:00
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.
This commit is contained in:
parent
9080a782d5
commit
2d8f6481dc
@ -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("<p>Failed to connect to the pgAdmin application server. Retrying in %1 seconds, ") +
|
||||
tr("or click <a href=\"%2\">here</a> to try again now.</p>")).arg(m_loadattempt).arg(PGA_SERVER_URL));
|
||||
|
||||
if (m_loadattempt == 1)
|
||||
{
|
||||
webView->setHtml(tr("<p>Connecting...</p>"));
|
||||
}
|
||||
else
|
||||
{
|
||||
webView->setHtml(QString(tr("<p>Failed to connect to the pgAdmin application server. Retrying in %1 seconds, ") +
|
||||
tr("or click <a href=\"%2\">here</a> to try again now.</p>")).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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user