Check and attempt to fir the registry on Windows, if the text/css type is misconfigured. Fixes #2716

This commit is contained in:
Neel Patel
2017-11-15 16:33:24 +00:00
committed by Dave Page
parent 8f070f6095
commit 96df3147d6
3 changed files with 70 additions and 0 deletions
+34
View File
@@ -63,6 +63,10 @@ BrowserWindow::BrowserWindow(QString url)
m_appServerUrl = url;
#ifdef _WIN32
m_regMessage = "";
#endif
// Setup the shortcuts
createActions();
@@ -137,6 +141,9 @@ BrowserWindow::BrowserWindow(QString url)
m_mainWebView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
#endif
// Register the signal when base URL loading is finished.
connect(m_mainWebView, SIGNAL(loadFinished(bool )),this, SLOT(urlLoadingFinished(bool )));
// Restore the geometry, or set a nice default
QSettings settings;
@@ -188,6 +195,33 @@ void BrowserWindow::closeEvent(QCloseEvent *event)
}
}
#ifdef _WIN32
// Set the message when change in registry value.
void BrowserWindow::setRegistryMessage(const QString &msg)
{
m_regMessage = msg;
}
QString BrowserWindow::getRegistryMessage()
{
return m_regMessage;
}
#endif
void BrowserWindow::urlLoadingFinished(bool res)
{
if (res)
{
#ifdef _WIN32
// Check if registry value is set by application then display information message to user.
// If message is empty string means no value set by application in registry.
QString message = getRegistryMessage();
if (message != QString(""))
QMessageBox::information(this, tr("Registry change"), message);
#endif
}
}
// Create the actions for the window
void BrowserWindow::createActions()
{