diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
commit | 382067b05c4fe97bcf0da0143405375ec295f7c6 (patch) | |
tree | f668cd2595ac0c85f0942f88729d3ff1956676fa /src/gui/windows/socialwindow.cpp | |
parent | ee8191705826d978b7793497fdd307536c709bff (diff) | |
parent | 9b329556e748050c4300174e9bdc72b15e5b8cc5 (diff) | |
download | plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.gz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.bz2 plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.xz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.zip |
Merge branch 'master' into stable
Diffstat (limited to 'src/gui/windows/socialwindow.cpp')
-rw-r--r-- | src/gui/windows/socialwindow.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 1c6b85153..2385066be 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -35,7 +35,7 @@ #include "gui/windows/confirmdialog.h" #include "gui/windows/okdialog.h" -#include "gui/windows/setup.h" +#include "gui/windows/setupwindow.h" #include "gui/windows/textdialog.h" #include "gui/windows/whoisonline.h" @@ -46,6 +46,7 @@ #include "gui/widgets/label.h" #include "gui/widgets/popup.h" #include "gui/widgets/scrollarea.h" +#include "gui/widgets/tabbedarea.h" #include "gui/widgets/tabs/chattab.h" @@ -1276,6 +1277,7 @@ SocialWindow::SocialWindow() : // TRANSLATORS: social window name Window(_("Social"), false, nullptr, "social.xml"), gcn::ActionListener(), + PlayerRelationsListener(), mGuildInvited(0), mGuildAcceptDialog(nullptr), mGuildCreateDialog(nullptr), @@ -1372,10 +1374,12 @@ void SocialWindow::postInit() enableVisibleSound(true); updateButtons(); + player_relations.addListener(this); } SocialWindow::~SocialWindow() { + player_relations.removeListener(this); if (mGuildAcceptDialog) { mGuildAcceptDialog->close(); @@ -1740,6 +1744,7 @@ void SocialWindow::slowLogic() const unsigned int nowTime = cur_time; if (mNeedUpdate && nowTime - mLastUpdateTime > 1) { + logger->log("soc update"); mPlayers->updateList(); mFriends->updateList(); mNeedUpdate = false; @@ -1819,30 +1824,14 @@ void SocialWindow::removePortal(const int x, const int y) void SocialWindow::nextTab() { - if (!mTabs) - return; - - int tab = mTabs->getSelectedTabIndex(); - - tab++; - if (tab == mTabs->getNumberOfTabs()) - tab = 0; - - mTabs->setSelectedTabByIndex(tab); + if (mTabs) + mTabs->selectNextTab(); } void SocialWindow::prevTab() { - if (!mTabs) - return; - - int tab = mTabs->getSelectedTabIndex(); - - if (tab == 0) - tab = mTabs->getNumberOfTabs(); - tab--; - - mTabs->setSelectedTabByIndex(tab); + if (mTabs) + mTabs->selectPrevTab(); } void SocialWindow::updateAttackFilter() @@ -1908,6 +1897,16 @@ void SocialWindow::updateGuildCounter(const int online, const int total) } } +void SocialWindow::updatedPlayer(const std::string &name A_UNUSED) +{ + mNeedUpdate = true; +} + +void SocialWindow::updateAll() +{ + mNeedUpdate = true; +} + #ifdef USE_PROFILER void SocialWindow::logicChildren() { |