Commit ebde55d4 authored by Laurent Montel's avatar Laurent Montel 😁

Clean up toggleFullAddressList method

parent 7f6a15b8
......@@ -2902,8 +2902,8 @@ void ViewerPrivate::toggleFullAddressList(const QString &field)
{
const bool doShow = (field == QLatin1String("To") && showFullToAddressList()) || (field == QLatin1String("Cc") && showFullCcAddressList());
#ifdef MESSAGEVIEWER_USE_QTWEBENGINE
//TODO
qDebug() << "void ViewerPrivate::toggleFullAddressList(const QString &field) not implemented";
mViewer->toggleFullAddressList(field, bind(&ViewerPrivate::recipientsQuickListLinkHtml, this, doShow, field), doShow);
#else
// First inject the correct icon
if (mViewer->replaceInnerHtml(QLatin1String("iconFull") + field + QLatin1String("AddressList"),
......
......@@ -267,8 +267,23 @@ void MailWebEngineView::injectAttachments(const boost::function<QString()> &dela
page()->runJavaScript(MessageViewer::WebEngineScript::injectAttachments(html, QStringLiteral("*#attachmentInjectionPoint")));
}
bool MailWebEngineView::replaceInnerHtml(const QString &id, const boost::function<QString()> &delayedHtml)
void MailWebEngineView::toggleFullAddressList(const QString &field, const boost::function<QString()> &delayedHtml, bool doShow)
{
const QString html = delayedHtml();
if (html.isEmpty()) {
return;
}
qDebug() << "void MailWebEngineView::toggleFullAddressList(const QString &field, const boost::function<QString()> &delayedHtml, bool doShow)" << html << " fields " << field;
//page()->runJavaScript(MessageViewer::WebEngineScript::toggleFullAddressList(field, QStringLiteral("*#attachmentInjectionPoint")));
#if 0
if (mViewer->replaceInnerHtml(QLatin1String("iconFull") + field + QLatin1String("AddressList"),
bind(&ViewerPrivate::recipientsQuickListLinkHtml, this, doShow, field))) {
// Then show/hide the full address list
mViewer->setElementByIdVisible(QLatin1String("dotsFull") + field + QLatin1String("AddressList"), !doShow);
mViewer->setElementByIdVisible(QLatin1String("hiddenFull") + field + QLatin1String("AddressList"), doShow);
}
qDebug() << "bool MailWebEngineView::replaceInnerHtml(const QString &id, const boost::function<QString()> &delayedHtml)";
#if 0
QWebElement doc = page()->currentFrame()->documentElement();
......@@ -281,6 +296,8 @@ bool MailWebEngineView::replaceInnerHtml(const QString &id, const boost::functio
#endif
//TODO
return false;
#endif
//TODO
}
bool MailWebEngineView::hasVerticalScrollBar() const
......
......@@ -49,7 +49,6 @@ public:
void scrollPageDown(int percent);
void scrollPageUp(int percent);
void injectAttachments(const boost::function<QString()> &delayedHtml);
bool replaceInnerHtml(const QString &id, const boost::function<QString()> &delayedHtml);
bool hasVerticalScrollBar() const;
bool isAttachmentInjectionPoint(const QPoint &globalPos) const;
......@@ -60,6 +59,8 @@ public:
void setAllowExternalContent(bool b);
QList<QAction *> interceptorUrlActions() const;
void toggleFullAddressList(const QString &field, const boost::function<QString ()> &delayedHtml, bool doShow);
public Q_SLOTS:
void slotZoomChanged(qreal zoom);
void slotShowDetails();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment