- Update .pro file
authorunc0rr
Sun, 03 Apr 2011 19:26:53 +0400
changeset 5094 9c3553254100
parent 5093 7eb35faa7f7a
child 5097 53e9d9451328
- Update .pro file - Add a label in chat widget with a number of nicks listed
QTfrontend/chatwidget.cpp
QTfrontend/chatwidget.h
project_files/hedgewars.pro
--- a/QTfrontend/chatwidget.cpp	Sun Apr 03 16:31:48 2011 +0400
+++ b/QTfrontend/chatwidget.cpp	Sun Apr 03 19:26:53 2011 +0400
@@ -31,6 +31,7 @@
 #include <QCursor>
 #include <QScrollBar>
 #include <QItemSelectionModel>
+#include <QLabel>
 
 #include "hwconsts.h"
 #include "SDLs.h"
@@ -142,7 +143,7 @@
     chatEditLine->setMaxLength(300);
     connect(chatEditLine, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
 
-    mainLayout.addWidget(chatEditLine, 1, 0);
+    mainLayout.addWidget(chatEditLine, 2, 0);
 
     chatText = new QTextBrowser(this);
     chatText->document()->setDefaultStyleSheet(STYLE);
@@ -152,7 +153,7 @@
     chatText->setOpenLinks(false);
     connect(chatText, SIGNAL(anchorClicked(const QUrl&)),
         this, SLOT(linkClicked(const QUrl&)));
-    mainLayout.addWidget(chatText, 0, 0);
+    mainLayout.addWidget(chatText, 0, 0, 2, 1);
 
     chatNicks = new QListWidget(this);
     chatNicks->setMinimumHeight(10);
@@ -165,7 +166,12 @@
     connect(chatNicks, SIGNAL(currentRowChanged(int)),
         this, SLOT(chatNickSelected(int)));
 
-    mainLayout.addWidget(chatNicks, 0, 1, -1, 1);
+    mainLayout.addWidget(chatNicks, 1, 1, 2, 1);
+
+    lblCount = new QLabel(this);
+    mainLayout.addWidget(lblCount, 0, 1);
+    lblCount->setText("0");
+    lblCount->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
 
     acInfo = new QAction(QAction::tr("Info"), chatNicks);
     acInfo->setIcon(QIcon(":/res/info.png"));
@@ -393,6 +399,8 @@
     updateNickItem(item);
     chatNicks->addItem(item);
 
+    lblCount->setText(QString::number(chatNicks->count()));
+
     if(notifyNick && notify && gameSettings->value("frontend/sound", true).toBool()) {
        Mix_PlayChannel(-1, sound[rand()%4], 0);
     }
@@ -405,6 +413,8 @@
         chatNicks->takeItem(chatNicks->row(*it));
         ++it;
     }
+
+    lblCount->setText(QString::number(chatNicks->count()));
 }
 
 void HWChatWidget::clear()
--- a/QTfrontend/chatwidget.h	Sun Apr 03 16:31:48 2011 +0400
+++ b/QTfrontend/chatwidget.h	Sun Apr 03 19:26:53 2011 +0400
@@ -34,6 +34,7 @@
 class QListWidget;
 class QSettings;
 class SDLInteraction;
+class QLabel;
 
 // this class is for custom nick sorting
 class ListWidgetNickItem : public QListWidgetItem
@@ -101,6 +102,7 @@
   QAction * acIgnore;
   QAction * acFriend;
   QSettings * gameSettings;
+  QLabel * lblCount;
   SDLInteraction * sdli;
   Mix_Chunk *sound[4];
   bool notify;
--- a/project_files/hedgewars.pro	Sun Apr 03 16:31:48 2011 +0400
+++ b/project_files/hedgewars.pro	Sun Apr 03 19:26:53 2011 +0400
@@ -54,7 +54,7 @@
 	../QTfrontend/namegen.cpp ../QTfrontend/netregister.cpp \
 	../QTfrontend/netserver.cpp ../QTfrontend/netserverslist.cpp \
 	../QTfrontend/netudpserver.cpp ../QTfrontend/netudpwidget.cpp \
-	../QTfrontend/newnetclient.cpp ../QTfrontend/pages.cpp \
+        ../QTfrontend/newnetclient.cpp \
 	../QTfrontend/playrecordpage.cpp ../QTfrontend/proto.cpp \
 	../QTfrontend/selectWeapon.cpp ../QTfrontend/statsPage.cpp \
 	../QTfrontend/tcpBase.cpp ../QTfrontend/team.cpp \
@@ -65,7 +65,26 @@
     ../QTfrontend/hwconsts.cpp \
     ../QTfrontend/drawmapwidget.cpp \
     ../QTfrontend/drawmapscene.cpp \
-    ../QTfrontend/qaspectratiolayout.cpp
+    ../QTfrontend/qaspectratiolayout.cpp \
+    ../QTfrontend/pagetraining.cpp \
+    ../QTfrontend/pagesingleplayer.cpp \
+    ../QTfrontend/pageselectweapon.cpp \
+    ../QTfrontend/pagescheme.cpp \
+    ../QTfrontend/pageroomslist.cpp \
+    ../QTfrontend/pageoptions.cpp \
+    ../QTfrontend/pagenettype.cpp \
+    ../QTfrontend/pagenetserver.cpp \
+    ../QTfrontend/pagenetgame.cpp \
+    ../QTfrontend/pagenet.cpp \
+    ../QTfrontend/pagemultiplayer.cpp \
+    ../QTfrontend/pagemain.cpp \
+    ../QTfrontend/pageingame.cpp \
+    ../QTfrontend/pageinfo.cpp \
+    ../QTfrontend/pageeditteam.cpp \
+    ../QTfrontend/pagedrawmap.cpp \
+    ../QTfrontend/pageconnecting.cpp \
+    ../QTfrontend/pagecampaign.cpp \
+    ../QTfrontend/pageadmin.cpp
 
 win32 {
 	SOURCES += ../QTfrontend/xfire.cpp