void MainWindow::editHTML(const QString &fileName)
{
    bool isNew = !m_htmlEditor;
    if (isNew) {
        m_htmlEditor.reset(new HtmlEditor);
        m_htmlEditor->setWindowIcon(windowIcon());
    }
    m_htmlEditor->load(fileName);
    m_htmlEditor->show();
    m_htmlEditor->raise();

    bool isExternal = false;
    int screen = Settings.playerExternal().toInt(&isExternal);
    isExternal = isExternal && (screen != QApplication::desktop()->screenNumber(this));

    if (!isExternal) {
        if (Settings.playerZoom() >= 1.0f) {
            m_htmlEditor->changeZoom(100 * m_player->videoSize().width() / MLT.profile().width());
            m_htmlEditor->resizeWebView(m_player->videoSize().width(), m_player->videoSize().height());
        } else {
            m_htmlEditor->changeZoom(100 * MLT.displayWidth() / MLT.profile().width());
            m_htmlEditor->resizeWebView(MLT.displayWidth(), MLT.displayHeight());
        }
    } else {
        m_htmlEditor->changeZoom(100);
    }
    if (isNew) {
        // Center the new window over the main window.
        QPoint point = pos();
        QPoint halfSize(width(), height());
        halfSize /= 2;
        point += halfSize;
        halfSize = QPoint(m_htmlEditor->width(), m_htmlEditor->height());
        halfSize /= 2;
        point -= halfSize;
        m_htmlEditor->move(point);
    }
}
void MainWindow::editHTML(const QString &fileName)
{
    bool isNew = !m_htmlEditor;
    if (isNew) {
        m_htmlEditor.reset(new HtmlEditor);
        m_htmlEditor->setWindowIcon(windowIcon());
    }
    m_htmlEditor->load(fileName);
    m_htmlEditor->show();
    m_htmlEditor->raise();

    bool isExternal = false;
    int screen = Settings.playerExternal().toInt(&isExternal);
    isExternal = isExternal && (screen != QApplication::desktop()->screenNumber(this));

    if (!isExternal) {
        if (Settings.playerZoom() >= 1.0f) {
            m_htmlEditor->changeZoom(100 * m_player->videoSize().width() / MLT.profile().width());
            m_htmlEditor->resizeWebView(m_player->videoSize().width(), m_player->videoSize().height());
        } else {
            m_htmlEditor->changeZoom(100 * MLT.displayWidth() / MLT.profile().width());
            m_htmlEditor->resizeWebView(MLT.displayWidth(), MLT.displayHeight());
        }
    } else {
        m_htmlEditor->changeZoom(100);
    }
    if (isNew) {
         
        QPoint point = pos();
        QPoint halfSize(width(), height());
        halfSize /= 2;
        point += halfSize;
        halfSize = QPoint(m_htmlEditor->width(), m_htmlEditor->height());
        halfSize /= 2;
        point -= halfSize;
        m_htmlEditor->move(point);
    }
}