Draw ready status icon on ready button
authorunc0rr
Mon, 12 Jan 2009 16:38:52 +0000
changeset 1648 32d99a3c7998
parent 1647 ab0c8c4be7b3
child 1649 938a0fda0206
Draw ready status icon on ready button
QTfrontend/hwform.cpp
QTfrontend/newnetclient.cpp
QTfrontend/newnetclient.h
QTfrontend/pages.cpp
QTfrontend/pages.h
--- a/QTfrontend/hwform.cpp	Mon Jan 12 16:36:29 2009 +0000
+++ b/QTfrontend/hwform.cpp	Mon Jan 12 16:38:52 2009 +0000
@@ -481,6 +481,8 @@
 	connect(ui.pageNetGame->pChatWidget, SIGNAL(chatLine(const QString&)),
 		hwnet, SLOT(chatLineToNet(const QString&)));
 	connect(ui.pageNetGame->BtnGo, SIGNAL(clicked()), hwnet, SLOT(ToggleReady()));
+	connect(hwnet, SIGNAL(setMyReadyStatus(bool)),
+		ui.pageNetGame, SLOT(setReadyStatus(bool)));
 
 	connect(ui.pageNetGame->pChatWidget, SIGNAL(kick(const QString&)),
 		hwnet, SLOT(kickPlayer(const QString&)));
--- a/QTfrontend/newnetclient.cpp	Mon Jan 12 16:36:29 2009 +0000
+++ b/QTfrontend/newnetclient.cpp	Mon Jan 12 16:38:52 2009 +0000
@@ -291,6 +291,8 @@
 			return;
 		}
 		emit setReadyStatus(lst[1], true);
+		if (lst[1] == mynick)
+			emit setMyReadyStatus(true);
 		return;
 	}
 	
@@ -301,6 +303,8 @@
 			return;
 		}
 		emit setReadyStatus(lst[1], false);
+		if (lst[1] == mynick)
+			emit setMyReadyStatus(false);
 		return;
 	}
 
--- a/QTfrontend/newnetclient.h	Mon Jan 12 16:36:29 2009 +0000
+++ b/QTfrontend/newnetclient.h	Mon Jan 12 16:38:52 2009 +0000
@@ -120,6 +120,7 @@
   void serverMessage(const QString &);
 
   void setReadyStatus(const QString & nick, bool isReady);
+  void setMyReadyStatus(bool isReady);
   void showMessage(const QString &);
 
  public slots:
--- a/QTfrontend/pages.cpp	Mon Jan 12 16:36:29 2009 +0000
+++ b/QTfrontend/pages.cpp	Mon Jan 12 16:38:52 2009 +0000
@@ -556,7 +556,9 @@
 
 	BtnGo = new QPushButton(this);
 	BtnGo->setFont(*font14);
-	BtnGo->setText(QPushButton::tr("Ready"));
+	//BtnGo->setText(QPushButton::tr("Ready"));
+	BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
+	BtnGo->setIconSize(QSize(25, 34));
 	pageLayout->addWidget(BtnGo, 3, 1);
 
 	BtnBack = addButton(":/res/Exit.png", pageLayout, 3, 0, true);
@@ -575,6 +577,14 @@
 	BtnMaster->setMenu(menu);
 }
 
+void PageNetGame::setReadyStatus(bool isReady)
+{
+	if(isReady)
+		BtnGo->setIcon(QIcon(":/res/lightbulb_on.png"));
+	else
+		BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
+}
+
 PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
--- a/QTfrontend/pages.h	Mon Jan 12 16:36:29 2009 +0000
+++ b/QTfrontend/pages.h	Mon Jan 12 16:38:52 2009 +0000
@@ -279,6 +279,9 @@
 
 	TeamSelWidget* pNetTeamsWidget;
 	GameCFGWidget* pGameCFG;
+
+public slots:
+	void setReadyStatus(bool isReady);
 };
 
 class PageInfo : public AbstractPage