summaryrefslogtreecommitdiff
path: root/src/gui/socialwindow.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-05-21 21:56:41 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-05-21 21:56:41 +0200
commit63b4c9869b6256ed7644113cd23305b07cf9df03 (patch)
treeaff0d99f5b58cbaf4195ac755ecfb79f97bf7b65 /src/gui/socialwindow.cpp
parent8c4c5a58c256cce7beb21b68c8a7d6b6ff5c4a3a (diff)
parent2953a3f92c5097bd99ff21f4536fe167a32d90c5 (diff)
downloadmana-63b4c9869b6256ed7644113cd23305b07cf9df03.tar.gz
mana-63b4c9869b6256ed7644113cd23305b07cf9df03.tar.bz2
mana-63b4c9869b6256ed7644113cd23305b07cf9df03.tar.xz
mana-63b4c9869b6256ed7644113cd23305b07cf9df03.zip
Merge branch '1.0'
Conflicts: src/beingmanager.cpp src/beingmanager.h src/client.cpp src/localplayer.cpp
Diffstat (limited to 'src/gui/socialwindow.cpp')
-rw-r--r--src/gui/socialwindow.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 8d833123..2043da52 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -326,6 +326,8 @@ SocialWindow::SocialWindow() :
{
addTab(player_node->getParty());
}
+ else
+ updateButtons();
}
SocialWindow::~SocialWindow()
@@ -360,6 +362,8 @@ bool SocialWindow::addTab(Guild *guild)
mTabs->addTab(tab, tab->mScroll);
+ updateButtons();
+
return true;
}
@@ -373,6 +377,8 @@ bool SocialWindow::removeTab(Guild *guild)
delete it->second;
mGuilds.erase(it);
+ updateButtons();
+
return true;
}
@@ -386,6 +392,8 @@ bool SocialWindow::addTab(Party *party)
mTabs->addTab(tab, tab->mScroll);
+ updateButtons();
+
return true;
}
@@ -399,6 +407,8 @@ bool SocialWindow::removeTab(Party *party)
delete it->second;
mParties.erase(it);
+ updateButtons();
+
return true;
}
@@ -451,11 +461,11 @@ void SocialWindow::action(const gcn::ActionEvent &event)
else
showPartyCreate();
}
- else if (event.getId() == "invite")
+ else if (event.getId() == "invite" && mTabs->getSelectedTabIndex() > -1)
{
static_cast<SocialTab*>(mTabs->getSelectedTab())->invite();
}
- else if (event.getId() == "leave")
+ else if (event.getId() == "leave" && mTabs->getSelectedTabIndex() > -1)
{
static_cast<SocialTab*>(mTabs->getSelectedTab())->leave();
}
@@ -594,3 +604,10 @@ void SocialWindow::showPartyCreate()
mPartyCreateDialog->setActionEventId("create party");
mPartyCreateDialog->addActionListener(this);
}
+
+void SocialWindow::updateButtons()
+{
+ bool hasTabs = mTabs->getNumberOfTabs() > 0;
+ mInviteButton->setEnabled(hasTabs);
+ mLeaveButton->setEnabled(hasTabs);
+}