fix
This commit is contained in:
parent
50de655261
commit
87933ba82d
4 changed files with 5 additions and 2 deletions
|
@ -149,7 +149,7 @@ void PlayerListWidget::showContextMenu(const QPoint &pos, const QModelIndex &ind
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(aDetails);
|
menu->addAction(aDetails);
|
||||||
menu->addAction(aChat);
|
menu->addAction(aChat);
|
||||||
if (userLevel & ServerInfo_User::IsRegistered) {
|
if ((userLevel & ServerInfo_User::IsRegistered) && (tabSupervisor->getUserLevel() & ServerInfo_User::IsRegistered)) {
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
if (tabSupervisor->getUserListsTab()->getBuddyList()->userInList(userName))
|
if (tabSupervisor->getUserListsTab()->getBuddyList()->userInList(userName))
|
||||||
menu->addAction(aRemoveFromBuddyList);
|
menu->addAction(aRemoveFromBuddyList);
|
||||||
|
|
|
@ -57,6 +57,7 @@ void TabSupervisor::start(AbstractClient *_client, ServerInfo_User *userInfo)
|
||||||
{
|
{
|
||||||
client = _client;
|
client = _client;
|
||||||
userName = userInfo->getName();
|
userName = userInfo->getName();
|
||||||
|
userLevel = userInfo->getUserLevel();
|
||||||
|
|
||||||
connect(client, SIGNAL(roomEventReceived(RoomEvent *)), this, SLOT(processRoomEvent(RoomEvent *)));
|
connect(client, SIGNAL(roomEventReceived(RoomEvent *)), this, SLOT(processRoomEvent(RoomEvent *)));
|
||||||
connect(client, SIGNAL(gameEventContainerReceived(GameEventContainer *)), this, SLOT(processGameEventContainer(GameEventContainer *)));
|
connect(client, SIGNAL(gameEventContainerReceived(GameEventContainer *)), this, SLOT(processGameEventContainer(GameEventContainer *)));
|
||||||
|
|
|
@ -25,6 +25,7 @@ class TabSupervisor : public QTabWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
QString userName;
|
QString userName;
|
||||||
|
int userLevel;
|
||||||
QIcon *tabChangedIcon;
|
QIcon *tabChangedIcon;
|
||||||
AbstractClient *client;
|
AbstractClient *client;
|
||||||
QList<AbstractClient *> localClients;
|
QList<AbstractClient *> localClients;
|
||||||
|
@ -46,6 +47,7 @@ public:
|
||||||
int getGameCount() const { return gameTabs.size(); }
|
int getGameCount() const { return gameTabs.size(); }
|
||||||
TabUserLists *getUserListsTab() const { return tabUserLists; }
|
TabUserLists *getUserListsTab() const { return tabUserLists; }
|
||||||
bool getAdminLocked() const;
|
bool getAdminLocked() const;
|
||||||
|
int getUserLevel() const { return userLevel; }
|
||||||
signals:
|
signals:
|
||||||
void setMenu(QMenu *menu);
|
void setMenu(QMenu *menu);
|
||||||
void localGameEnded();
|
void localGameEnded();
|
||||||
|
|
|
@ -183,7 +183,7 @@ void UserList::showContextMenu(const QPoint &pos, const QModelIndex &index)
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(aDetails);
|
menu->addAction(aDetails);
|
||||||
menu->addAction(aChat);
|
menu->addAction(aChat);
|
||||||
if (userLevel & ServerInfo_User::IsRegistered) {
|
if ((userLevel & ServerInfo_User::IsRegistered) && (tabSupervisor->getUserLevel() & ServerInfo_User::IsRegistered)) {
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
if (tabSupervisor->getUserListsTab()->getBuddyList()->userInList(userName))
|
if (tabSupervisor->getUserListsTab()->getBuddyList()->userInList(userName))
|
||||||
menu->addAction(aRemoveFromBuddyList);
|
menu->addAction(aRemoveFromBuddyList);
|
||||||
|
|
Loading…
Reference in a new issue