diff --git a/mac_post_make.sh b/mac_post_make.sh new file mode 100755 index 00000000..b28aefce --- /dev/null +++ b/mac_post_make.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Author: Erhard List (dunkanx@pokerth.net) Version: 1.0 + +# ATTENTION: this is for MAC only! +# +# This script integrates the necessary frameworks into the binary. +# +# The integration of Qt is optional (commandlineswitch --without-qt) as you can save 30MB +# of binary-size if you leave Qt out. +# Using such a "small" version needs to install qt 4.2.3 on the mac seperatly as a framework +# (see http://trolltech.com/developer/downloads/qt/mac) + +QT_FW_PATH="/Library/Frameworks" +SDL_FW_PATH="/Library/Frameworks" +APPLICATION="./bin/pokerth.app" +BINARY="$APPLICATION/Contents/MacOs/pokerth" + +# strip binary +strip $BINARY + +# create framework-path +BINARY_FW_PATH="$APPLICATION/Contents/Frameworks" +mkdir $BINARY_FW_PATH + +# integrate SDL-frameworks into binary +cp -R $SDL_FW_PATH/SDL.framework $BINARY_FW_PATH +cp -R $SDL_FW_PATH/SDL_mixer.framework $BINARY_FW_PATH + +# integrate Qt-frameworks into binary + +if [ "$1" != "--without-qt" ] ; then + + cp -R $QT_FW_PATH/QtCore.framework $BINARY_FW_PATH + cp -R $QT_FW_PATH/QtGui.framework $BINARY_FW_PATH + + # redirect binary to use integrated frameworks + QTCORE="QtCore.framework/Versions/4.0/QtCore" + QTGUI="QtGui.framework/Versions/4.0/QtGui" + install_name_tool -id @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTCORE + install_name_tool -id @executable_path/../Frameworks/$QTGUI $BINARY_FW_PATH/$QTGUI + QTCORE_LINK=$(otool -L $BINARY | grep QtCore | cut -d"(" -f1 | cut -f2) + QTGUI_LINK=$(otool -L $BINARY | grep QtGui | cut -d"(" -f1 | cut -f2) + install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY + install_name_tool -change $QTGUI_LINK @executable_path/../Frameworks/$QTGUI $BINARY + QTCORE_LINK=$(otool -L $BINARY_FW_PATH/$QTGUI | grep QtCore | cut -d"(" -f1 | cut -f2) + install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTGUI + +fi \ No newline at end of file diff --git a/pokerth.pro b/pokerth.pro index 52dbe348..ab1c1cac 100755 --- a/pokerth.pro +++ b/pokerth.pro @@ -267,7 +267,7 @@ win32{ src/net/linux/socket_startup.cpp } -unix{ +unix:!mac{ exists( /usr/lib/libboost_thread-mt.so ) { message("Found libboost_thread-mt") LIBS += -lboost_thread-mt @@ -281,29 +281,36 @@ unix{ #LIBS += -lcrypto -lSDL_mixer -lSDL -lmikmod } -macx{ +mac{ # make it universal CONFIG += x86 CONFIG += ppc - - # for universal-compilation on PPC-Mac uncomment the following line + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3 + + # for universal-compilation on PPC-Mac uncomment the following line + # on Intel-Mac you have to comment this line out or build will fail. # QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/ - # link needed Qt parts static (path is standard for self-compiling qt) - LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtCore.a - LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtGui.a + # Qt static (path is standard for self-compiling qt) + #LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtCore.a + #LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtGui.a + # QT dynamic linked framework (see also mac_post_make.sh) + LIBS += -framework QtCore + LIBS += -framework QtGui + # SDL and SDL_mixer come as frameworks + LIBS += -framework SDL + LIBS += -framework SDL_mixer # standard path for darwinports # make sure you have a universal version of boost LIBS += /opt/local/lib/libboost_thread.a - # crypto should be installed on every mac + # libraries installed on every mac LIBS += -lcrypto -lz -framework Carbon # set the application icon RC_FILE = pokerth.icns LIBPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/lib INCLUDEPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/include/ - INCLUDEPATH += /usr/local/Trolltech/Qt-4.2.3/include/ - INCLUDEPATH += /usr/local/Trolltech/Qt-4.2.3/include/QtCore - INCLUDEPATH += /usr/local/Trolltech/Qt-4.2.3/include/QtGui + INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers + INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers } CONFIG += qt release diff --git a/src/gui/qt/mainwindow.ui b/src/gui/qt/mainwindow.ui index c4bde6c9..c35c801c 100644 --- a/src/gui/qt/mainwindow.ui +++ b/src/gui/qt/mainwindow.ui @@ -6068,15 +6068,9 @@ 0 0 1000 - 30 + 23 - - - View - - - Game @@ -6088,6 +6082,12 @@ + + + View + + + @@ -6133,21 +6133,45 @@ Fullscreen - F + Ctrl-F + + + + + Show/Hide Chat-Window + + + Ctrl-C + + + + + Show/Hide Help Window + + + Ctrl-H + + + + + Show/Hide Log Window + + + Ctrl-L - - MySetLabel - QLabel -
mysetlabel.h
-
MyRightTabWidget QTabWidget
myrighttabwidget.h
+ + MySetLabel + QLabel +
mysetlabel.h
+
MyLeftTabWidget QTabWidget diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 494544ba..60f4ffbb 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -569,6 +569,9 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) connect( actionCreate_network_Game, SIGNAL( triggered() ), this, SLOT( callCreateNetworkGameDialog() ) ); connect( actionQuit, SIGNAL( triggered() ), this, SLOT( quitPokerTH() ) ); connect( actionFullScreen, SIGNAL( triggered() ), this, SLOT( switchFullscreen() ) ); + connect( actionShowHideChat, SIGNAL( triggered() ), this, SLOT( switchChatWindow() ) ); + connect( actionShowHideHelp, SIGNAL( triggered() ), this, SLOT( switchHelpWindow() ) ); + connect( actionShowHideLog, SIGNAL( triggered() ), this, SLOT( switchLogWindow() ) ); connect( pushButton_BetRaise, SIGNAL( clicked() ), this, SLOT( myBetRaise() ) ); connect( pushButton_FoldAllin, SIGNAL( clicked() ), this, SLOT( myFoldAllin() ) ); @@ -2562,8 +2565,6 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { if (event->key() == Qt::Key_F1) { pushButton_FoldAllin->click(); } if (event->key() == Qt::Key_F2) { pushButton_CallCheckSet->click(); } if (event->key() == Qt::Key_F3) { pushButton_BetRaise->click(); } - if (event->key() == Qt::Key_F10) { switchLeftToolBox(); } - if (event->key() == Qt::Key_F11) { switchRightToolBox(); } if (event->key() == Qt::Key_S) { setLabelArray[0]->startTimeOutAnimation(myConfig->readConfigInt("NetTimeOutPlayerAction"),TRUE); } //s if (event->key() == 16777249) { pushButton_break->click(); @@ -2579,16 +2580,43 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { // if(event->type() == QEvent::MouseMove) { event->setAccepted ( FALSE ); } // } -void mainWindowImpl::switchLeftToolBox() { +void mainWindowImpl::switchChatWindow() { - if (groupBox_LeftToolBox->isHidden()) { groupBox_LeftToolBox->show(); } - else { groupBox_LeftToolBox->hide(); } + int tab = 1; + if (groupBox_LeftToolBox->isHidden()) { + tabWidget_Left->setCurrentIndex(tab); + groupBox_LeftToolBox->show(); + } else { + if (tabWidget_Left->currentIndex() == tab) { + groupBox_LeftToolBox->hide(); + } else { + tabWidget_Left->setCurrentIndex(tab); + } + } } -void mainWindowImpl::switchRightToolBox() { +void mainWindowImpl::switchHelpWindow() { - if (groupBox_RightToolBox->isHidden()) { groupBox_RightToolBox->show(); } - else { groupBox_RightToolBox->hide(); } + int tab = 0; + if (groupBox_LeftToolBox->isHidden()) { + tabWidget_Left->setCurrentIndex(tab); + groupBox_LeftToolBox->show(); + } else { + if (tabWidget_Left->currentIndex() == tab) { + groupBox_LeftToolBox->hide(); + } else { + tabWidget_Left->setCurrentIndex(tab); + } + } +} + +void mainWindowImpl::switchLogWindow() { + + if (groupBox_RightToolBox->isHidden()) { + groupBox_RightToolBox->show(); + } else { + groupBox_RightToolBox->hide(); + } } void mainWindowImpl::switchFullscreen() { diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index c35170a1..dc14e865 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -250,8 +250,9 @@ public slots: void keyPressEvent ( QKeyEvent*); // bool event ( QEvent * ); - void switchLeftToolBox(); - void switchRightToolBox(); + void switchChatWindow(); + void switchHelpWindow(); + void switchLogWindow(); void switchFullscreen(); void paintStartSplash(); diff --git a/src/gui/qt/sound/sdlplayer.h b/src/gui/qt/sound/sdlplayer.h index 34c02d75..8e63d90b 100644 --- a/src/gui/qt/sound/sdlplayer.h +++ b/src/gui/qt/sound/sdlplayer.h @@ -14,12 +14,17 @@ #ifndef SDLPLAYER_H #define SDLPLAYER_H -#ifdef _WIN32 +#ifdef _WIN32 #include #include #else - #include - #include + #ifdef __APPLE__ + #include + #include + #else + #include + #include + #endif #endif #include