Beispiel #1
0
void MainWindow::loadFinished(bool ok)
{
    // disconnect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
    if (ok) {
        QString confString = QString(
            "hotot_qt_variables = {"
            "      'platform': 'Linux'"
            "    , 'wrapper': 'qt'"
            "    , 'avatar_cache_dir': '%3'"
            "    , 'extra_fonts': %4"
            "    , 'extra_exts': %5"
            "    , 'extra_themes': %6"
            "    , 'locale': '%7'"
            "};").arg(m_confDir)
                 .arg(extraFonts())
                 .arg(extraExtensions())
                 .arg(extraThemes())
                 .arg(QLocale::system().name());

        m_webView->page()->currentFrame()->evaluateJavaScript(confString);
        m_webView->page()->currentFrame()->evaluateJavaScript(
            "overlay_variables(hotot_qt_variables);"
            "globals.load_flags = 1;");

        if (m_firstLoad) {
            m_firstLoad = false;
            QTimer::singleShot(300, this, SLOT(notifyLoadFinished()));
        }
    }
    else {
        show();
    }
}
Beispiel #2
0
void MainWindow::loadFinished(bool ok)
{
    disconnect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
    if (ok) {
        initDatabases();

        QString confString = QString(
            "hotot_qt_variables = {"
            "      'platform': 'Linux'"
            "    , 'avatar_cache_dir': '%3'"
            "    , 'extra_fonts': %4"
            "    , 'extra_exts': %5"
            "    , 'extra_themes': %6"
            "    , 'locale': '%7'"
            "};").arg(m_confDir)
                 .arg(extraFonts())
                 .arg(extraExtensions())
                 .arg(extraThemes())
                 .arg(QLocale::system().name());

        m_webView->page()->currentFrame()->evaluateJavaScript(confString);
        QTimer::singleShot(0, this, SLOT(notifyLoadFinished()));
#ifndef MEEGO_EDITION_HARMATTAN
        if (!isStartMinimized() || !isAutoSignIn()) {
            show();
            QSettings settings("hotot-qt", "hotot");
            restoreGeometry(settings.value("geometry").toByteArray());
            restoreState(settings.value("windowState").toByteArray());
        }
#else
        show();
#endif
    }
    else {
        show();
    }
}