summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoanna Hulboj <joanna.hulboj@isode.com>2017-03-28 09:38:23 (GMT)
committerJoanna Hulboj <joanna.hulboj@isode.com>2017-04-07 13:04:59 (GMT)
commit0b4c4ade26c7ff77ba7f8b4ae83e4bd3581bf345 (patch)
tree3044fef83e2a0f09af6fc8df07b1afc98a251560 /Swift/QtUI/QtWebKitChatView.cpp
parented2226782ac15345aeb8e615b41d30e5aab67b51 (diff)
downloadswift-0b4c4ade26c7ff77ba7f8b4ae83e4bd3581bf345.zip
swift-0b4c4ade26c7ff77ba7f8b4ae83e4bd3581bf345.tar.bz2
Do not grey out chat view after clearing
Test-Information: Run Swift, open chat window, enter a message and send it. Right click on chat view and choose Clear. Chat log in a view will be cleared but it will stay white. On the top of the chat view will be a message: e.g. Starting chat with test - test@test.isode.net: Offline. Change-Id: Ie453602e2f2b14e3ecca699821521ad33937ccf6
Diffstat (limited to 'Swift/QtUI/QtWebKitChatView.cpp')
-rw-r--r--Swift/QtUI/QtWebKitChatView.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp
index ce3e9cd..290bd59 100644
--- a/Swift/QtUI/QtWebKitChatView.cpp
+++ b/Swift/QtUI/QtWebKitChatView.cpp
@@ -87,62 +87,62 @@ QtWebKitChatView::QtWebKitChatView(QtChatWindow* window, UIEventStream* eventStr
webPage_->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
if (Log::getLogLevel() == Log::debug) {
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();
+ logCleared();
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());