start implementing chancelabel
This commit is contained in:
+27
-27
@@ -1,7 +1,7 @@
|
|||||||
# QMake pro-file for PokerTH game
|
# QMake pro-file for PokerTH game
|
||||||
|
|
||||||
isEmpty( PREFIX ) {
|
isEmpty( PREFIX ){
|
||||||
PREFIX=/usr
|
PREFIX =/usr
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
@@ -184,7 +184,8 @@ HEADERS += \
|
|||||||
src/gui/qttoolsinterface.h \
|
src/gui/qttoolsinterface.h \
|
||||||
src/gui/qt/qttools/qttoolswrapper.h \
|
src/gui/qt/qttools/qttoolswrapper.h \
|
||||||
src/gui/qt/qttools/qthelper/qthelper.h \
|
src/gui/qt/qttools/qthelper/qthelper.h \
|
||||||
src/gui/generic/serverguiwrapper.h
|
src/gui/generic/serverguiwrapper.h \
|
||||||
|
src/gui/qt/gametable/mychancelabel.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
src/gui/qt/gametable.ui \
|
src/gui/qt/gametable.ui \
|
||||||
@@ -243,7 +244,8 @@ SOURCES += \
|
|||||||
src/gui/qt/gamelobbydialog/lobbychat/lobbychat.cpp \
|
src/gui/qt/gamelobbydialog/lobbychat/lobbychat.cpp \
|
||||||
src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp \
|
src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp \
|
||||||
src/net/common/net_helper_client.cpp \
|
src/net/common/net_helper_client.cpp \
|
||||||
src/core/common/loghelper_client.cpp
|
src/core/common/loghelper_client.cpp \
|
||||||
|
src/gui/qt/gametable/mychancelabel.cpp
|
||||||
|
|
||||||
TRANSLATIONS = \
|
TRANSLATIONS = \
|
||||||
ts/pokerth_bg.ts \
|
ts/pokerth_bg.ts \
|
||||||
@@ -265,7 +267,7 @@ TRANSLATIONS = \
|
|||||||
ts/pokerth_fi.ts \
|
ts/pokerth_fi.ts \
|
||||||
ts/pokerth_START_HERE.ts
|
ts/pokerth_START_HERE.ts
|
||||||
|
|
||||||
win32{
|
win32 {
|
||||||
DEFINES += CURL_STATICLIB
|
DEFINES += CURL_STATICLIB
|
||||||
DEPENDPATH += src/net/win32/ src/core/win32
|
DEPENDPATH += src/net/win32/ src/core/win32
|
||||||
INCLUDEPATH += ../boost/ ../SDL/include ../SDL_mixer
|
INCLUDEPATH += ../boost/ ../SDL/include ../SDL_mixer
|
||||||
@@ -274,7 +276,7 @@ win32{
|
|||||||
|
|
||||||
LIBS += -lpokerth_lib
|
LIBS += -lpokerth_lib
|
||||||
|
|
||||||
win32-msvc2005{
|
win32-msvc2005 {
|
||||||
LIBPATH += Release/lib ../SDL/VisualC/SDL/Release ../SDL/VisualC/SDLmain/Release ../SDL_mixer/VisualC/Release
|
LIBPATH += Release/lib ../SDL/VisualC/SDL/Release ../SDL/VisualC/SDLmain/Release ../SDL_mixer/VisualC/Release
|
||||||
#LIBPATH += Debug/lib ../SDL/VisualC/SDL/Debug ../SDL/VisualC/SDLmain/Debug ../SDL_mixer/VisualC/Debug
|
#LIBPATH += Debug/lib ../SDL/VisualC/SDL/Debug ../SDL/VisualC/SDLmain/Debug ../SDL_mixer/VisualC/Debug
|
||||||
|
|
||||||
@@ -282,7 +284,7 @@ win32{
|
|||||||
LIBS += -llibcurl
|
LIBS += -llibcurl
|
||||||
}
|
}
|
||||||
|
|
||||||
win32-g++{
|
win32-g++ {
|
||||||
#LIBPATH += Release/lib
|
#LIBPATH += Release/lib
|
||||||
LIBPATH += Debug/lib
|
LIBPATH += Debug/lib
|
||||||
LIBPATH += ../SDL/lib ../SDL_mixer/lib
|
LIBPATH += ../SDL/lib ../SDL_mixer/lib
|
||||||
@@ -299,16 +301,16 @@ win32{
|
|||||||
LIBS += -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lole32 -luuid -luser32 -lmsimg32 -lshell32 -lkernel32 -lws2_32 -ladvapi32 -lsdl -lsdlmain -lsdl_mixer -lwldap32
|
LIBS += -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lole32 -luuid -luser32 -lmsimg32 -lshell32 -lkernel32 -lws2_32 -ladvapi32 -lsdl -lsdlmain -lsdl_mixer -lwldap32
|
||||||
RC_FILE = pokerth.rc
|
RC_FILE = pokerth.rc
|
||||||
}
|
}
|
||||||
!win32{
|
!win32 {
|
||||||
DEPENDPATH += src/net/linux/ src/core/linux
|
DEPENDPATH += src/net/linux/ src/core/linux
|
||||||
}
|
}
|
||||||
|
|
||||||
unix{
|
unix {
|
||||||
# workaround for problems with boost_filesystem exceptions
|
# workaround for problems with boost_filesystem exceptions
|
||||||
QMAKE_LFLAGS += -no_dead_strip_inits_and_terms
|
QMAKE_LFLAGS += -no_dead_strip_inits_and_terms
|
||||||
}
|
}
|
||||||
|
|
||||||
unix: !mac{
|
unix : !mac {
|
||||||
|
|
||||||
##### My release static build options
|
##### My release static build options
|
||||||
#QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
|
#QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
|
||||||
@@ -322,22 +324,22 @@ unix: !mac{
|
|||||||
BOOST_IOSTREAMS = boost_iostreams boost_iostreams-mt
|
BOOST_IOSTREAMS = boost_iostreams boost_iostreams-mt
|
||||||
|
|
||||||
|
|
||||||
for(dir, LIB_DIRS) {
|
for(dir, LIB_DIRS){
|
||||||
exists($$dir) {
|
exists($$dir){
|
||||||
for(lib, BOOST_THREAD) {
|
for(lib, BOOST_THREAD){
|
||||||
exists($${dir}/lib$${lib}.so*) {
|
exists($${dir}/lib$${lib}.so*){
|
||||||
message("Found $$lib")
|
message("Found $$lib")
|
||||||
BOOST_THREAD = -l$$lib
|
BOOST_THREAD = -l$$lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(lib, BOOST_FS) {
|
for(lib, BOOST_FS){
|
||||||
exists($${dir}/lib$${lib}.so*) {
|
exists($${dir}/lib$${lib}.so*){
|
||||||
message("Found $$lib")
|
message("Found $$lib")
|
||||||
BOOST_FS = -l$$lib
|
BOOST_FS = -l$$lib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(lib, BOOST_IOSTREAMS) {
|
for(lib, BOOST_IOSTREAMS){
|
||||||
exists($${dir}/lib$${lib}.so*) {
|
exists($${dir}/lib$${lib}.so*){
|
||||||
message("Found $$lib")
|
message("Found $$lib")
|
||||||
BOOST_IOSTREAMS = -l$$lib
|
BOOST_IOSTREAMS = -l$$lib
|
||||||
}
|
}
|
||||||
@@ -345,14 +347,12 @@ unix: !mac{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BOOST_LIBS = $$BOOST_THREAD $$BOOST_FS $$BOOST_IOSTREAMS
|
BOOST_LIBS = $$BOOST_THREAD $$BOOST_FS $$BOOST_IOSTREAMS
|
||||||
!count(BOOST_LIBS, 3) {
|
!count(BOOST_LIBS, 3){
|
||||||
error("could not locate required library: \
|
error( libboost (version >= 1.34.1) --> http://www.boost.org/")
|
||||||
libboost (version >= 1.34.1) --> http://www.boost.org/")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($$system(sdl-config --version)) {
|
if($$system(sdl-config --version)){
|
||||||
error("Could not determine if required library is installed: \
|
error( libSDL_mixer, libSDL --> http://www.libsdl.org/")
|
||||||
libSDL_mixer, libSDL --> http://www.libsdl.org/")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UNAME = $$system(uname -s)
|
UNAME = $$system(uname -s)
|
||||||
@@ -361,7 +361,7 @@ unix: !mac{
|
|||||||
LIBS += -lpokerth_lib
|
LIBS += -lpokerth_lib
|
||||||
LIBS += $$BOOST_LIBS
|
LIBS += $$BOOST_LIBS
|
||||||
LIBS += -lSDL_mixer -lcurl
|
LIBS += -lSDL_mixer -lcurl
|
||||||
!isEmpty( BSD ) {
|
!isEmpty( BSD ){
|
||||||
LIBS += -lcrypto
|
LIBS += -lcrypto
|
||||||
} else {
|
} else {
|
||||||
LIBS += -lgnutls-openssl -lgcrypt
|
LIBS += -lgnutls-openssl -lgcrypt
|
||||||
@@ -386,9 +386,9 @@ unix: !mac{
|
|||||||
desktop.files += pokerth.desktop
|
desktop.files += pokerth.desktop
|
||||||
|
|
||||||
INSTALLS += binary data pixmap desktop
|
INSTALLS += binary data pixmap desktop
|
||||||
}
|
}
|
||||||
|
|
||||||
mac{
|
mac {
|
||||||
# make it universal
|
# make it universal
|
||||||
CONFIG += x86
|
CONFIG += x86
|
||||||
CONFIG += ppc
|
CONFIG += ppc
|
||||||
|
|||||||
+33
-1
@@ -1836,7 +1836,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" >
|
<item row="4" column="0" >
|
||||||
<spacer name="verticalSpacer" >
|
<spacer name="verticalSpacer" >
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@@ -1849,6 +1849,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0" >
|
||||||
|
<widget class="QLabel" name="label_votesMonitor" >
|
||||||
|
<property name="text" >
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -2645,6 +2652,26 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="tab_Chance" >
|
||||||
|
<attribute name="title" >
|
||||||
|
<string>Chance</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2" >
|
||||||
|
<property name="margin" >
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0" >
|
||||||
|
<widget class="MyChanceLable" name="label" >
|
||||||
|
<property name="text" >
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0" >
|
||||||
@@ -3116,6 +3143,11 @@
|
|||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>myavatarlabel.h</header>
|
<header>myavatarlabel.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>MyChanceLable</class>
|
||||||
|
<extends>QLabel</extends>
|
||||||
|
<header>mychancelable.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "mycardspixmaplabel.h"
|
#include "mycardspixmaplabel.h"
|
||||||
#include "mysetlabel.h"
|
#include "mysetlabel.h"
|
||||||
#include "myavatarlabel.h"
|
#include "myavatarlabel.h"
|
||||||
|
#include "mychancelabel.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "chat.h"
|
#include "chat.h"
|
||||||
|
|
||||||
@@ -398,6 +399,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
label_timeout->setStyleSheet("QLabel { color: #99D500;}");
|
label_timeout->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
label_kickVoteTimeout->setStyleSheet("QLabel { color: #99D500;}");
|
label_kickVoteTimeout->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
label_kickUser->setStyleSheet("QLabel { color: #99D500;}");
|
label_kickUser->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
|
label_votesMonitor->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
|
|
||||||
statusbar->setStyleSheet(" QStatusBar { "+ font1String +" font-size: 12px; color: #B7FF00; }");
|
statusbar->setStyleSheet(" QStatusBar { "+ font1String +" font-size: 12px; color: #B7FF00; }");
|
||||||
|
|
||||||
@@ -2651,7 +2653,9 @@ void gameTableImpl::keyPressEvent ( QKeyEvent * event ) {
|
|||||||
}
|
}
|
||||||
else { keyUpDownChatCounter = 0; }
|
else { keyUpDownChatCounter = 0; }
|
||||||
|
|
||||||
|
//TESTING UNIT
|
||||||
|
// if (event->key() == Qt::Key_M) { startVoteOnKick(3,60); }
|
||||||
|
// if (event->key() == Qt::Key_N) { endVoteOnKick(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameTableImpl::changePlayingMode() {
|
void gameTableImpl::changePlayingMode() {
|
||||||
@@ -2686,14 +2690,6 @@ bool gameTableImpl::eventFilter(QObject *obj, QEvent *event)
|
|||||||
myChat->nickAutoCompletition();
|
myChat->nickAutoCompletition();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_M) { //TESTING UNIT
|
|
||||||
startVoteOnKick(3,60);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_N) { //TESTING UNIT
|
|
||||||
stopVoteOnKickTimeout();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (event->type() == QEvent::Close) {
|
else if (event->type() == QEvent::Close) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
closeGameTable();
|
closeGameTable();
|
||||||
@@ -2833,7 +2829,7 @@ void gameTableImpl::localGameModification() {
|
|||||||
void gameTableImpl::networkGameModification() {
|
void gameTableImpl::networkGameModification() {
|
||||||
|
|
||||||
if(tabWidget_Left->widget(1) != tab_Chat)
|
if(tabWidget_Left->widget(1) != tab_Chat)
|
||||||
tabWidget_Left->insertTab(1, tab_Chat, QString(tr(" Chat "))); /*TODO text abgeschnitten --> stylesheets*/
|
tabWidget_Left->insertTab(1, tab_Chat, QString(tr("Chat"))); /*TODO text abgeschnitten --> stylesheets*/
|
||||||
|
|
||||||
tabWidget_Left->removeTab(2);
|
tabWidget_Left->removeTab(2);
|
||||||
|
|
||||||
@@ -3082,9 +3078,10 @@ void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
|
|||||||
tabWidget_Left->setCurrentIndex(2);
|
tabWidget_Left->setCurrentIndex(2);
|
||||||
|
|
||||||
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerId));
|
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerId));
|
||||||
label_kickUser->setText(tr("Do you want to kick %1 \nfrom this game?").arg(QString::fromUtf8(info.playerName.c_str())));
|
label_kickUser->setText(tr("Do you want to kick <b>%1</b> \nfrom this game?").arg(QString::fromUtf8(info.playerName.c_str())));
|
||||||
|
|
||||||
voteOnKickTimeoutSecs = timeoutSec;
|
voteOnKickTimeoutSecs = timeoutSec;
|
||||||
|
playerAboutToKickId = playerId;
|
||||||
startVoteOnKickTimeout();
|
startVoteOnKickTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3092,8 +3089,7 @@ void gameTableImpl::endVoteOnKick()
|
|||||||
{
|
{
|
||||||
stopVoteOnKickTimeout();
|
stopVoteOnKickTimeout();
|
||||||
tabWidget_Left->removeTab(2);
|
tabWidget_Left->removeTab(2);
|
||||||
|
// tabWidget_Left->setCurrentIndex(1);
|
||||||
tabWidget_Left->setCurrentIndex(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameTableImpl::voteOnKickYes()
|
void gameTableImpl::voteOnKickYes()
|
||||||
@@ -3119,7 +3115,12 @@ void gameTableImpl::stopVoteOnKickTimeout()
|
|||||||
|
|
||||||
void gameTableImpl::nextVoteOnKickTimeoutAnimationFrame()
|
void gameTableImpl::nextVoteOnKickTimeoutAnimationFrame()
|
||||||
{
|
{
|
||||||
qDebug() << voteOnKickTimeoutSecs-voteOnKickRealTimer.elapsed().total_seconds();
|
|
||||||
label_kickVoteTimeout->setText(tr("%1 secs left").arg(voteOnKickTimeoutSecs-voteOnKickRealTimer.elapsed().total_seconds()));
|
label_kickVoteTimeout->setText(tr("%1 secs left").arg(voteOnKickTimeoutSecs-voteOnKickRealTimer.elapsed().total_seconds()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gameTableImpl::refreshVotesMonitor()
|
||||||
|
{
|
||||||
|
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerAboutToKickId));
|
||||||
|
label_votesMonitor->setText(tr("Player <b>%1</b> has %2 votes against him.").arg(QString::fromUtf8(info.playerName.c_str())));
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -286,6 +286,7 @@ public slots:
|
|||||||
void startVoteOnKickTimeout();
|
void startVoteOnKickTimeout();
|
||||||
void stopVoteOnKickTimeout();
|
void stopVoteOnKickTimeout();
|
||||||
void nextVoteOnKickTimeoutAnimationFrame();
|
void nextVoteOnKickTimeoutAnimationFrame();
|
||||||
|
void refreshVotesMonitor();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -402,7 +403,9 @@ private:
|
|||||||
|
|
||||||
int keyUpDownChatCounter;
|
int keyUpDownChatCounter;
|
||||||
int myLastPreActionBetValue;
|
int myLastPreActionBetValue;
|
||||||
|
|
||||||
int voteOnKickTimeoutSecs;
|
int voteOnKickTimeoutSecs;
|
||||||
|
int playerAboutToKickId;
|
||||||
// StyleSheetReader *myStyleSheetReader;
|
// StyleSheetReader *myStyleSheetReader;
|
||||||
|
|
||||||
friend class GuiWrapper;
|
friend class GuiWrapper;
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
//
|
||||||
|
// C++ Implementation: mycardspixmaplabel
|
||||||
|
//
|
||||||
|
// Description:
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
|
||||||
|
//
|
||||||
|
// Copyright: See COPYING file that comes with this distribution
|
||||||
|
//
|
||||||
|
//
|
||||||
|
#include "mychancelabel.h"
|
||||||
|
#include "gametableimpl.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
MyChanceLabel::MyChanceLabel(QWidget* parent)
|
||||||
|
: QLabel(parent) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
MyChanceLabel::~MyChanceLabel()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
//
|
||||||
|
// C++ Interface: mycardspixmaplabel
|
||||||
|
//
|
||||||
|
// Description:
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
|
||||||
|
//
|
||||||
|
// Copyright: See COPYING file that comes with this distribution
|
||||||
|
//
|
||||||
|
//
|
||||||
|
#ifndef MYCHANCELABEL_H
|
||||||
|
#define MYCHANCELABEL_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <QtGui>
|
||||||
|
#include <QtCore>
|
||||||
|
|
||||||
|
class gameTableImpl;
|
||||||
|
|
||||||
|
class MyChanceLabel : public QLabel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
MyChanceLabel(QWidget*);
|
||||||
|
|
||||||
|
~MyChanceLabel();
|
||||||
|
|
||||||
|
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
gameTableImpl *myW;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user