diff --git a/data/gfx/logoChip3D.png b/data/gfx/logoChip3D.png new file mode 100644 index 00000000..66161506 Binary files /dev/null and b/data/gfx/logoChip3D.png differ diff --git a/pokerth_game.pro b/pokerth_game.pro index a75ee2ef..3cef36e0 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -3,9 +3,12 @@ TEMPLATE = app CODECFORSRC = UTF-8 -INSTALLS += TARGET -TARGET.files += bin/* -TARGET.path = /usr/bin/ +CONFIG += qt thread embed_manifest_exe release +#CONFIG += qt thread embed_manifest_exe warn_on debug +UI_DIR = uics +MOC_DIR = mocs +OBJECTS_DIR = obj +TARGET = pokerth INCLUDEPATH += . \ src \ @@ -205,7 +208,6 @@ TRANSLATIONS = \ ts/pokerth_it.ts \ ts/pokerth_nl.ts - win32{ DEPENDPATH += src/net/win32/ src/core/win32 INCLUDEPATH += ../boost/ ../SDL/include ../SDL_mixer @@ -240,6 +242,17 @@ unix: !mac{ ## My release static libs #LIBS += -lcrypto -lSDL_mixer -lSDL -lmikmod + + #### INSTALL #### + + targets.files += pokerth + targets.path = /usr/bin/ + + data.path = /usr/share/pokerth/data + data.files = data/* + + INSTALLS += targets data + } mac{ @@ -273,12 +286,3 @@ mac{ INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers } - -#CONFIG += qt thread embed_manifest_exe release -CONFIG += qt thread embed_manifest_exe warn_on debug -UI_DIR = uics -TARGET = bin/pokerth -MOC_DIR = mocs -OBJECTS_DIR = obj -QT += -# QMAKE_CXXFLAGS_DEBUG += -g diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 3ec59bee..76e391db 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -42,6 +42,7 @@ #include "game.h" #include "session.h" #include "tools.h" +#include "qthelper.h" #include "configfile.h" #include "sdlplayer.h" diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index 30b6365b..884e7de1 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -51,6 +51,7 @@ class startNetworkGameDialogImpl; class changeHumanPlayerNameDialogImpl; class gameLobbyDialogImpl; +class QtHelper; class QColor; class SDLPlayer; diff --git a/src/gui/qt/mainwindow/startsplash/startsplash.cpp b/src/gui/qt/mainwindow/startsplash/startsplash.cpp index 7c829eb3..deb17d7c 100644 --- a/src/gui/qt/mainwindow/startsplash/startsplash.cpp +++ b/src/gui/qt/mainwindow/startsplash/startsplash.cpp @@ -78,7 +78,8 @@ void StartSplash::paintEvent(QPaintEvent * event) { versionFont.setFamily("Nimbus Sans L"); versionFont.setPixelSize(12); - QPixmap logo(":/graphics/resources/graphics/logoChip3D.png"); +// std::cout << myQtHelper->getDataPath().toStdString() << endl; + QPixmap logo(myQtHelper->getDataPath()+"gfx/logoChip3D.png"); if(frameNo >= 52 && frameNo < 55) { diff --git a/src/gui/qt/mainwindow/startsplash/startsplash.h b/src/gui/qt/mainwindow/startsplash/startsplash.h index 74780579..1114935e 100644 --- a/src/gui/qt/mainwindow/startsplash/startsplash.h +++ b/src/gui/qt/mainwindow/startsplash/startsplash.h @@ -13,6 +13,7 @@ #define STARTSPLASH_H #include "mainwindowimpl.h" +#include "qthelper.h" #include #include @@ -38,6 +39,7 @@ public slots: private: mainWindowImpl *myW; + QtHelper *myQtHelper; }; diff --git a/src/gui/qt/qttools/qthelper/qthelper.cpp b/src/gui/qt/qttools/qthelper/qthelper.cpp index cf534744..273b65df 100644 --- a/src/gui/qt/qttools/qthelper/qthelper.cpp +++ b/src/gui/qt/qttools/qthelper/qthelper.cpp @@ -28,4 +28,31 @@ std::string QtHelper::stringToUtf8(const std::string &myString) { return myUtf8String; } -std::string QtHelper::getDefaultLanguage() { return QLocale::system().name().toStdString(); } \ No newline at end of file +std::string QtHelper::getDefaultLanguage() { return QLocale::system().name().toStdString(); } + +QString QtHelper::getDataPath() +{ + QString path = QCoreApplication::instance()->applicationDirPath(); + +#ifdef _WIN32 + path += "/data/"; +#else + #ifdef __APPLE__ + if (QRegExp("Contents/MacOS/?$").indexIn(path) != -1) { + // pointing into an macosx application bundle + path += "/../Resources/data/"; + } else { path += "/data/"; } + #else //Unix + if (QRegExp("pokerth/?$").indexIn(path) != -1) { + // there is an own application directory + path += "/data/"; + } else if (QRegExp("bin/?$").indexIn(path) != -1) { + // we are in a bin directory. e.g. /usr/bin + path += "/../share/pokerth/data/"; + } else { path += "/data/"; } + #endif +#endif + + + return QDir::cleanPath(path) + "/"; +} \ No newline at end of file diff --git a/src/gui/qt/qttools/qthelper/qthelper.h b/src/gui/qt/qttools/qthelper/qthelper.h index 644fbe0a..838b49bb 100644 --- a/src/gui/qt/qttools/qthelper/qthelper.h +++ b/src/gui/qt/qttools/qthelper/qthelper.h @@ -16,7 +16,8 @@ /** @author FThauer FHammer */ -class QtHelper{ +class QtHelper : public QObject{ +Q_OBJECT public: QtHelper(); @@ -25,6 +26,8 @@ public: std::string stringToUtf8(const std::string &); std::string getDefaultLanguage(); + QString getDataPath(); + }; #endif diff --git a/src/gui/qt/resources.qrc b/src/gui/qt/resources.qrc index 032a6f61..9cd785a7 100755 --- a/src/gui/qt/resources.qrc +++ b/src/gui/qt/resources.qrc @@ -106,7 +106,6 @@ resources/graphics/bigblindPuck.png resources/graphics/fileopen16.png resources/graphics/handRanking_release.png - resources/graphics/logoChip3D.png resources/graphics/smallblindPuck.png resources/graphics/toolboxFrameBG.png resources/graphics/windowicon.png