start votekick gui implementation
This commit is contained in:
@@ -2788,10 +2788,13 @@ void gameTableImpl::localGameModification() {
|
||||
|
||||
tabWidget_Left->setCurrentIndex(0);
|
||||
tabWidget_Left->removeTab(1);
|
||||
if(tabWidget_Left->widget(2) == tab_Kick)
|
||||
tabWidget_Left->removeTab(2);
|
||||
|
||||
int i;
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++ ) {
|
||||
setLabelArray[i]->stopTimeOutAnimation();
|
||||
playerAvatarLabelArray[i]->setEnabledContextMenu(FALSE);
|
||||
}
|
||||
|
||||
pushButton_break->show();
|
||||
@@ -2811,9 +2814,16 @@ void gameTableImpl::networkGameModification() {
|
||||
|
||||
if(tabWidget_Left->widget(1) != tab_Chat)
|
||||
tabWidget_Left->insertTab(1, tab_Chat, QString(tr("Chat")));
|
||||
if(tabWidget_Left->widget(2) == tab_Kick)
|
||||
tabWidget_Left->removeTab(2);
|
||||
|
||||
tabWidget_Left->setCurrentIndex(1);
|
||||
myChat->clearNewGame();
|
||||
|
||||
int i;
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++ ) {
|
||||
playerAvatarLabelArray[i]->setEnabledContextMenu(TRUE);
|
||||
}
|
||||
|
||||
if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET) {
|
||||
pushButton_break->show();
|
||||
@@ -3038,7 +3048,7 @@ void gameTableImpl::leaveCurrentNetworkGame() {
|
||||
}
|
||||
}
|
||||
|
||||
void gameTableImpl::voteForKick(int id) {
|
||||
void gameTableImpl::triggerVoteOnKick(int id) {
|
||||
|
||||
qDebug() << "vote for kick user: " << id;
|
||||
// myStartWindow->getSession()->sendVoteKickSignal(id);
|
||||
|
||||
@@ -231,7 +231,7 @@ public slots:
|
||||
|
||||
void flipHolecardsAllIn();
|
||||
void showMyCards();
|
||||
void voteForKick(int id);
|
||||
void triggerVoteOnKick(int id);
|
||||
|
||||
void handSwitchRounds();
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
|
||||
{
|
||||
|
||||
myContextMenu = new QMenu;
|
||||
action_VoteForKick = new QAction(tr("Vote for kick this user"), myContextMenu);
|
||||
action_VoteForKick = new QAction(tr("Start vote on kick this user"), myContextMenu);
|
||||
myContextMenu->addAction(action_VoteForKick);
|
||||
|
||||
connect( action_VoteForKick, SIGNAL ( triggered() ), this, SLOT ( sendVoteForKickSignal() ) );
|
||||
connect( action_VoteForKick, SIGNAL ( triggered() ), this, SLOT ( sendTriggerVoteOnKickSignal() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@ MyAvatarLabel::~MyAvatarLabel()
|
||||
|
||||
void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
||||
|
||||
showContextMenu(event->globalPos());
|
||||
if(myContextMenuEnabled)
|
||||
showContextMenu(event->globalPos());
|
||||
}
|
||||
|
||||
void MyAvatarLabel::showContextMenu(const QPoint &pos) {
|
||||
@@ -41,7 +42,12 @@ void MyAvatarLabel::showContextMenu(const QPoint &pos) {
|
||||
myContextMenu->popup(pos);
|
||||
}
|
||||
|
||||
void MyAvatarLabel::sendVoteForKickSignal()
|
||||
void MyAvatarLabel::sendTriggerVoteOnKickSignal()
|
||||
{
|
||||
myW->voteForKick(myId);
|
||||
myW->triggerVoteOnKick(myId);
|
||||
}
|
||||
|
||||
void MyAvatarLabel::setEnabledContextMenu(bool b)
|
||||
{
|
||||
myContextMenuEnabled = b;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,8 @@ public:
|
||||
public slots:
|
||||
|
||||
void showContextMenu(const QPoint &pos);
|
||||
void sendVoteForKickSignal();
|
||||
void sendTriggerVoteOnKickSignal();
|
||||
void setEnabledContextMenu(bool);
|
||||
|
||||
private:
|
||||
|
||||
@@ -42,6 +43,7 @@ private:
|
||||
QAction *action_VoteForKick;
|
||||
|
||||
int myId;
|
||||
bool myContextMenuEnabled;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user