tweak. no chirp on room creation.
authornemo
Tue, 09 Feb 2010 13:04:11 +0000
changeset 2777 95a1a69d491c
parent 2776 9572aae13d49
child 2778 d106ea17b3f9
tweak. no chirp on room creation.
QTfrontend/chatwidget.cpp
QTfrontend/chatwidget.h
QTfrontend/newnetclient.cpp
QTfrontend/newnetclient.h
--- a/QTfrontend/chatwidget.cpp	Tue Feb 09 03:21:09 2010 +0000
+++ b/QTfrontend/chatwidget.cpp	Tue Feb 09 13:04:11 2010 +0000
@@ -126,13 +126,13 @@
 	chatText->moveCursor(QTextCursor::End);
 }
 
-void HWChatWidget::nickAdded(const QString& nick, bool isChief)
+void HWChatWidget::nickAdded(const QString& nick, bool notifyNick)
 {
 	QListWidgetItem * item = new QListWidgetItem(nick);
 	item->setIcon(QIcon(":/res/hh_small.png"));
 	chatNicks->addItem(item);
 
-    if(isChief && notify && gameSettings->value("audio/frontendsound", true).toBool()) {
+    if(notifyNick && notify && gameSettings->value("audio/frontendsound", true).toBool()) {
        Mix_PlayChannel(-1, sound, 0);
     }
 }
--- a/QTfrontend/chatwidget.h	Tue Feb 09 03:21:09 2010 +0000
+++ b/QTfrontend/chatwidget.h	Tue Feb 09 13:04:11 2010 +0000
@@ -42,7 +42,7 @@
  public slots:
   void onChatString(const QString& str);
   void onServerMessage(const QString& str);
-  void nickAdded(const QString& nick, bool isChief);
+  void nickAdded(const QString& nick, bool notifyNick);
   void nickRemoved(const QString& nick);
   void clear();
   void setReadyStatus(const QString & nick, bool isReady);
--- a/QTfrontend/newnetclient.cpp	Tue Feb 09 03:21:09 2010 +0000
+++ b/QTfrontend/newnetclient.cpp	Tue Feb 09 13:04:11 2010 +0000
@@ -375,8 +375,8 @@
 				if (isChief)
 					emit configAsked();
 			}
-			emit nickAdded(lst[i], isChief);
-			emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i]));
+			emit nickAdded(lst[i], isChief && (lst[i] != mynick));
+            emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i]));
 		}
 		return;
 	}
--- a/QTfrontend/newnetclient.h	Tue Feb 09 03:21:09 2010 +0000
+++ b/QTfrontend/newnetclient.h	Tue Feb 09 13:04:11 2010 +0000
@@ -90,9 +90,9 @@
   void Disconnected();
   void EnteredGame();
   void LeftRoom();
-  void nickAdded(const QString& nick, bool isChief);
+  void nickAdded(const QString& nick, bool notifyNick);
   void nickRemoved(const QString& nick);
-  void nickAddedLobby(const QString& nick, bool isChief);
+  void nickAddedLobby(const QString& nick, bool notifyNick);
   void nickRemovedLobby(const QString& nick);
   void FromNet(const QByteArray & buf);
   void adminAccess(bool);