gui+log fixes

This commit is contained in:
doitux
2007-11-01 16:51:59 +00:00
parent 47eee5474c
commit 75071a777c
4 changed files with 18 additions and 12 deletions
+1 -1
View File
@@ -129,7 +129,7 @@
<property name="iconSize" >
<size>
<width>25</width>
<height>25</height>
<height>26</height>
</size>
</property>
<property name="indentation" >
@@ -515,14 +515,21 @@ void gameLobbyDialogImpl::refreshConnectedPlayerAvatars() {
while (*it) {
std::string myAvatarFileName;
PlayerInfo playerInfo(mySession->getClientPlayerInfo((*it)->data(0, Qt::UserRole).toInt()));
mySession->getAvatarFile(playerInfo.avatar, myAvatarFileName);
QString myAvatarString(QString::fromUtf8(myAvatarFileName.c_str()));
if(QFile::QFile(myAvatarString).exists()) {
(*it)->setIcon(0, QIcon(myAvatarString));
}
PlayerInfo playerInfo(mySession->getClientPlayerInfo((*it)->data(0, Qt::UserRole).toUInt()));
if(mySession->getAvatarFile(playerInfo.avatar, myAvatarFileName)) {
QString myAvatarString(QString::fromUtf8(myAvatarFileName.c_str()));
if(QFile::QFile(myAvatarString).exists()) {
QPixmap myAvatarPixmap(25,26);
myAvatarPixmap.fill(Qt::transparent);
QPixmap tempPixmap(myAvatarString);
QPainter p(&myAvatarPixmap);
p.drawPixmap (0,0,25,25,tempPixmap);
(*it)->setIcon(0, QIcon(myAvatarPixmap));
}
}
++it;
}
}
+2 -2
View File
@@ -353,11 +353,11 @@ void Log::logNewGameAdminMsg(QString playerName) {
void Log::logPlayerWinGame(QString playerName, int gameID) {
myW->textBrowser_Log->append( "<i><b>"+playerName+" wins game " + QString::number(gameID,10) +"!</i></b>");
myW->textBrowser_Log->append( "<br><i><b>"+playerName+" wins game " + QString::number(gameID,10) +"!</i></b><br>");
if(myConfig->readConfigInt("LogOnOff")) {
logFileStreamString += "<i><b>"+playerName+" wins game " + QString::number(gameID,10) +"!</i></b><br>\n";
logFileStreamString += "</br></br><i><b>"+playerName+" wins game " + QString::number(gameID,10) +"!</i></b><br>\n";
if(myConfig->readConfigInt("LogInterval") == 0) {
writeLogFileStream(logFileStreamString);
+1 -2
View File
@@ -544,6 +544,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
connect(this, SIGNAL(signalRefreshButton()), this, SLOT(refreshButton()));
connect(this, SIGNAL(signalRefreshGameLabels(int)), this, SLOT(refreshGameLabels(int)));
connect(this, SIGNAL(signalSetPlayerAvatar(int, QString)), this, SLOT(setPlayerAvatar(int, QString)));
connect(this, SIGNAL(signalSetPlayerAvatar(int, QString)), myGameLobbyDialog, SLOT(refreshConnectedPlayerAvatars()));
connect(this, SIGNAL(signalGuiUpdateDone()), this, SLOT(guiUpdateDone()));
@@ -2623,8 +2624,6 @@ void mainWindowImpl::postRiverRunAnimation3() {
}
}
textBrowser_Log->append("");
postRiverRunAnimation3Timer->start(postRiverRunAnimationSpeed/2);
}