diff options
-rw-r--r-- | Swift/QtUI/QtWebKitChatView.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp index 9aeef24..048fe99 100644 --- a/Swift/QtUI/QtWebKitChatView.cpp +++ b/Swift/QtUI/QtWebKitChatView.cpp @@ -89,60 +89,61 @@ QtWebKitChatView::QtWebKitChatView(QtChatWindow* window, UIEventStream* eventStr webPage_->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); } webView_->setPage(webPage_); connect(webPage_, SIGNAL(selectionChanged()), SLOT(copySelectionToClipboard())); viewReady_ = false; isAtBottom_ = true; resetView(); jsBridge = new QtChatWindowJSBridge(); addToJSEnvironment("chatwindow", jsBridge); connect(jsBridge, SIGNAL(buttonClicked(QString,QString,QString,QString,QString,QString)), this, SLOT(handleHTMLButtonClicked(QString,QString,QString,QString,QString,QString))); connect(jsBridge, SIGNAL(verticalScrollBarPositionChanged(double)), this, SLOT(handleVerticalScrollBarPositionChanged(double))); } QtWebKitChatView::~QtWebKitChatView() { delete jsBridge; } void QtWebKitChatView::handleClearRequested() { QMessageBox messageBox(this); messageBox.setWindowTitle(tr("Clear log")); messageBox.setText(tr("You are about to clear the contents of your chat log.")); messageBox.setInformativeText(tr("Are you sure?")); messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); messageBox.setDefaultButton(QMessageBox::Yes); int button = messageBox.exec(); if (button == QMessageBox::Yes) { logCleared(); resetView(); + resizeFont(fontSizeSteps_); } } void QtWebKitChatView::handleKeyPressEvent(QKeyEvent* event) { webView_->keyPressEvent(event); } void QtWebKitChatView::addMessageBottom(std::shared_ptr<ChatSnippet> snippet) { if (viewReady_) { addToDOM(snippet); } else { /* If this asserts, the previous queuing code was necessary and should be reinstated */ assert(false); } } void QtWebKitChatView::addMessageTop(std::shared_ptr<ChatSnippet> /* snippet */) { // TODO: Implement this in a sensible manner later. SWIFT_LOG(error) << "Not yet implemented!" << std::endl; } void QtWebKitChatView::addToDOM(std::shared_ptr<ChatSnippet> snippet) { //qDebug() << snippet->getContent(); rememberScrolledToBottom(); QWebElement insertElement = webPage_->mainFrame()->findFirstElement("#insert"); assert(!insertElement.isNull()); insertElement.prependOutside(snippet->getContent()); //qDebug() << "-----------------"; |