This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include "game.h"
|
||||
#include "session.h"
|
||||
#include "tools.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
#include "configfile.h"
|
||||
#include "sdlplayer.h"
|
||||
|
||||
@@ -51,6 +51,7 @@ class startNetworkGameDialogImpl;
|
||||
class changeHumanPlayerNameDialogImpl;
|
||||
class gameLobbyDialogImpl;
|
||||
|
||||
class QtHelper;
|
||||
class QColor;
|
||||
|
||||
class SDLPlayer;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define STARTSPLASH_H
|
||||
|
||||
#include "mainwindowimpl.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtCore>
|
||||
@@ -38,6 +39,7 @@ public slots:
|
||||
private:
|
||||
|
||||
mainWindowImpl *myW;
|
||||
QtHelper *myQtHelper;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -28,4 +28,31 @@ std::string QtHelper::stringToUtf8(const std::string &myString) {
|
||||
return myUtf8String;
|
||||
}
|
||||
|
||||
std::string QtHelper::getDefaultLanguage() { return QLocale::system().name().toStdString(); }
|
||||
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) + "/";
|
||||
}
|
||||
@@ -16,7 +16,8 @@
|
||||
/**
|
||||
@author FThauer FHammer <webmaster@pokerth.net>
|
||||
*/
|
||||
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
|
||||
|
||||
@@ -106,7 +106,6 @@
|
||||
<file>resources/graphics/bigblindPuck.png</file>
|
||||
<file>resources/graphics/fileopen16.png</file>
|
||||
<file>resources/graphics/handRanking_release.png</file>
|
||||
<file>resources/graphics/logoChip3D.png</file>
|
||||
<file>resources/graphics/smallblindPuck.png</file>
|
||||
<file>resources/graphics/toolboxFrameBG.png</file>
|
||||
<file>resources/graphics/windowicon.png</file>
|
||||
|
||||
Reference in New Issue
Block a user