summaryrefslogtreecommitdiff
path: root/src/gui/widgets/chattab.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-18 22:33:28 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-18 22:33:28 +0300
commit71ba93abb9436eabc9fed8e4e49ab5cdee47bb38 (patch)
tree87f9fc99f15d84a8a63b3fbc68950650f9ebc0ed /src/gui/widgets/chattab.cpp
parentbc39b3c006145c6db41e7fcfac9da512944774f3 (diff)
downloadmv-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.gz
mv-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.bz2
mv-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.xz
mv-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.zip
Impliment away log in away mode.
Diffstat (limited to 'src/gui/widgets/chattab.cpp')
-rw-r--r--src/gui/widgets/chattab.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 2fd7840f8..3c277fc8d 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -249,6 +249,9 @@ void ChatTab::chatLog(std::string line, Own own,
addRow(line);
}
+ if (chatWindow && this == localChatTab)
+ chatWindow->addToAwayLog(line);
+
mScrollArea->logic();
if (own != BY_PLAYER)
{
@@ -434,3 +437,19 @@ void ChatTab::loadFromLogFile(std::string name)
}
}
}
+
+void ChatTab::addNewRow(std::string &line)
+{
+ if (mScrollArea->getVerticalScrollAmount() >=
+ mScrollArea->getVerticalMaxScroll())
+ {
+ addRow(line);
+ mScrollArea->setVerticalScrollAmount(
+ mScrollArea->getVerticalMaxScroll());
+ }
+ else
+ {
+ addRow(line);
+ }
+ mScrollArea->logic();
+} \ No newline at end of file