summaryrefslogtreecommitdiff
path: root/src/gui/widgets
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
parentbc39b3c006145c6db41e7fcfac9da512944774f3 (diff)
downloadplus-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.gz
plus-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.bz2
plus-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.xz
plus-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.zip
Impliment away log in away mode.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/chattab.cpp19
-rw-r--r--src/gui/widgets/chattab.h2
2 files changed, 21 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
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index 66e9f637d..45e27797d 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -159,6 +159,8 @@ class ChatTab : public Tab
void setNoAway(bool n)
{ mNoAway = n; }
+ void addNewRow(std::string &line);
+
protected:
friend class ChatWindow;
friend class WhisperWindow;