add report bad avatar function
This commit is contained in:
@@ -862,7 +862,7 @@ void gameTableImpl::setPlayerAvatar(int myID, QString myAvatar) {
|
|||||||
boost::shared_ptr<PlayerInterface> tmpPlayer = myStartWindow->getSession()->getCurrentGame()->getPlayerByUniqueId(myID);
|
boost::shared_ptr<PlayerInterface> tmpPlayer = myStartWindow->getSession()->getCurrentGame()->getPlayerByUniqueId(myID);
|
||||||
if (tmpPlayer.get()) {
|
if (tmpPlayer.get()) {
|
||||||
|
|
||||||
QFile myAvatarFile(myAvatar);
|
QFile myAvatarFile(myAvatar);
|
||||||
if(myAvatarFile.exists()) {
|
if(myAvatarFile.exists()) {
|
||||||
playerAvatarLabelArray[tmpPlayer->getMyID()]->setPixmap(myAvatar);
|
playerAvatarLabelArray[tmpPlayer->getMyID()]->setPixmap(myAvatar);
|
||||||
tmpPlayer->setMyAvatar(myAvatar.toUtf8().constData());
|
tmpPlayer->setMyAvatar(myAvatar.toUtf8().constData());
|
||||||
@@ -3053,6 +3053,7 @@ void gameTableImpl::leaveCurrentNetworkGame() {
|
|||||||
if (myStartWindow->getSession()->isNetworkClientRunning()) {
|
if (myStartWindow->getSession()->isNetworkClientRunning()) {
|
||||||
|
|
||||||
myMessageDialogImpl dialog(myConfig, this);
|
myMessageDialogImpl dialog(myConfig, this);
|
||||||
|
dialog.setParent(this);
|
||||||
|
|
||||||
if(!dialog.checkIfMesssageWillBeDisplayed(1)) {
|
if(!dialog.checkIfMesssageWillBeDisplayed(1)) {
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,13 @@ MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
|
|||||||
myContextMenu->addAction(action_VoteForKick);
|
myContextMenu->addAction(action_VoteForKick);
|
||||||
action_IgnorePlayer = new QAction(QIcon(":/gfx/im-ban-user.png"), tr("Ignore Player"), myContextMenu);
|
action_IgnorePlayer = new QAction(QIcon(":/gfx/im-ban-user.png"), tr("Ignore Player"), myContextMenu);
|
||||||
myContextMenu->addAction(action_IgnorePlayer);
|
myContextMenu->addAction(action_IgnorePlayer);
|
||||||
|
action_ReportBadAvatar = new QAction(QIcon(":/gfx/emblem-important.png"), tr("Report bad Avatar"), myContextMenu);
|
||||||
|
myContextMenu->addAction(action_ReportBadAvatar);
|
||||||
|
|
||||||
|
|
||||||
connect( action_VoteForKick, SIGNAL ( triggered() ), this, SLOT ( sendTriggerVoteOnKickSignal() ) );
|
connect( action_VoteForKick, SIGNAL ( triggered() ), this, SLOT ( sendTriggerVoteOnKickSignal() ) );
|
||||||
connect( action_IgnorePlayer, SIGNAL ( triggered() ), this, SLOT ( putPlayerOnIgnoreList() ) );
|
connect( action_IgnorePlayer, SIGNAL ( triggered() ), this, SLOT ( putPlayerOnIgnoreList() ) );
|
||||||
|
connect( action_ReportBadAvatar, SIGNAL ( triggered() ), this, SLOT ( reportBadAvatar() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -119,13 +123,13 @@ void MyAvatarLabel::setPixmapAndCountry ( const QPixmap &pix,QString countryStri
|
|||||||
int showCountryFlags = myW->getMyConfig()->readConfigInt("ShowCountryFlagInAvatar");
|
int showCountryFlags = myW->getMyConfig()->readConfigInt("ShowCountryFlagInAvatar");
|
||||||
if(showCountryFlags && !countryString.isEmpty())
|
if(showCountryFlags && !countryString.isEmpty())
|
||||||
{
|
{
|
||||||
if(seatPlace<=2||seatPlace>=8)
|
if(seatPlace<=2||seatPlace>=8)
|
||||||
{
|
{
|
||||||
painter.drawPixmap(resultAvatar.width()-(QPixmap(countryString)).width(),resultAvatar.height()-(QPixmap(countryString)).height(),QPixmap(countryString));
|
painter.drawPixmap(resultAvatar.width()-(QPixmap(countryString)).width(),resultAvatar.height()-(QPixmap(countryString)).height(),QPixmap(countryString));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
painter.drawPixmap(resultAvatar.width()-(QPixmap(countryString)).width(),0,QPixmap(countryString));
|
painter.drawPixmap(resultAvatar.width()-(QPixmap(countryString)).width(),0,QPixmap(countryString));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
painter.end();
|
painter.end();
|
||||||
@@ -183,3 +187,29 @@ void MyAvatarLabel::putPlayerOnIgnoreList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyAvatarLabel::reportBadAvatar() {
|
||||||
|
|
||||||
|
Game *currentGame = myW->getSession()->getCurrentGame();
|
||||||
|
int j=0;
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
||||||
|
|
||||||
|
if(myId == j) {
|
||||||
|
|
||||||
|
QString avatar = QString::fromUtf8((*it_c)->getMyAvatar().c_str());
|
||||||
|
if(!avatar.isEmpty()) {
|
||||||
|
|
||||||
|
QString nick = QString::fromUtf8((*it_c)->getMyName().c_str());
|
||||||
|
int ret = QMessageBox::question(this, tr("PokerTH - Question"),
|
||||||
|
tr("Are you sure you want to report the avatar of \"%1\" as inappropriate?").arg(nick),
|
||||||
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
|
|
||||||
|
QFileInfo fi(avatar);
|
||||||
|
// tue_irgendwas_in_session(myId, fi.baseName());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -39,9 +39,11 @@ public slots:
|
|||||||
void setVoteRunning ( bool theValue ) { voteRunning = theValue; }
|
void setVoteRunning ( bool theValue ) { voteRunning = theValue; }
|
||||||
void setPixmap ( const QPixmap &, const bool = FALSE);
|
void setPixmap ( const QPixmap &, const bool = FALSE);
|
||||||
void setPixmapAndCountry ( const QPixmap &, QString country, int seatPlace, const bool = FALSE);
|
void setPixmapAndCountry ( const QPixmap &, QString country, int seatPlace, const bool = FALSE);
|
||||||
|
void setPixmapPath ( const QString theValue) { myPath = theValue; }
|
||||||
void paintEvent(QPaintEvent*);
|
void paintEvent(QPaintEvent*);
|
||||||
void putPlayerOnIgnoreList();
|
void putPlayerOnIgnoreList();
|
||||||
bool playerIsOnIgnoreList(QString playerName);
|
bool playerIsOnIgnoreList(QString playerName);
|
||||||
|
void reportBadAvatar();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -49,8 +51,10 @@ private:
|
|||||||
QMenu *myContextMenu;
|
QMenu *myContextMenu;
|
||||||
QAction *action_VoteForKick;
|
QAction *action_VoteForKick;
|
||||||
QAction *action_IgnorePlayer;
|
QAction *action_IgnorePlayer;
|
||||||
|
QAction *action_ReportBadAvatar;
|
||||||
|
|
||||||
QPixmap myPixmap;
|
QPixmap myPixmap;
|
||||||
|
QString myPath;
|
||||||
|
|
||||||
int myId;
|
int myId;
|
||||||
bool myContextMenuEnabled;
|
bool myContextMenuEnabled;
|
||||||
|
|||||||
Reference in New Issue
Block a user