diff --git a/data/gfx/gui/misc/welcomepokerth.png b/data/gfx/gui/misc/welcomepokerth.png new file mode 100644 index 00000000..3d015a58 Binary files /dev/null and b/data/gfx/gui/misc/welcomepokerth.png differ diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index 64290ba5..de78c6de 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -111,9 +111,9 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) } //Intro abspielen? - if (myConfig->readConfigInt("ShowIntro")) { -// label_logo->hide(); - QTimer::singleShot(100, this, SLOT( paintStartSplash() )); } +// if (myConfig->readConfigInt("ShowIntro")) { +// // label_logo->hide(); +// QTimer::singleShot(100, this, SLOT( paintStartSplash() )); } // userWidgetsArray init userWidgetsArray[0] = pushButton_BetRaise; @@ -3045,16 +3045,16 @@ void gameTableImpl::breakButtonClicked() { void gameTableImpl::paintStartSplash() { - StartSplash *mySplash = new StartSplash(this, myConfig); - -#ifdef __APPLE__ - int offset = 305; -#else - int offset = 237; -#endif - mySplash->setGeometry(this->pos().x()+offset,this->pos().y()+210,400,250); -// mySplash->setWindowFlags(Qt::SplashScreen); - mySplash->show(); +// StartSplash *mySplash = new StartSplash(this, myConfig); +// +// #ifdef __APPLE__ +// int offset = 305; +// #else +// int offset = 237; +// #endif +// mySplash->setGeometry(this->pos().x()+offset,this->pos().y()+210,400,250); +// // mySplash->setWindowFlags(Qt::SplashScreen); +// mySplash->show(); } diff --git a/src/gui/qt/gametable/startsplash/startsplash.cpp b/src/gui/qt/gametable/startsplash/startsplash.cpp index 9b5fa0a0..05daeb87 100755 --- a/src/gui/qt/gametable/startsplash/startsplash.cpp +++ b/src/gui/qt/gametable/startsplash/startsplash.cpp @@ -19,25 +19,10 @@ ***************************************************************************/ #include "startsplash.h" -#include "configfile.h" -#include "gametableimpl.h" - -StartSplash::StartSplash(gameTableImpl *parent, ConfigFile *c) - : QSplashScreen(parent), myW(parent), myConfig(c) +StartSplash::StartSplash(QPixmap &p) + : QSplashScreen(p) { - - myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); - - logo = myAppDataPath+"gfx/gui/misc/logoChip3D.png"; - - - frameNo = 52; - opacityCounter = 13; - opacity = 1.0; - - QTimer *timer = new QTimer; - connect(timer, SIGNAL(timeout()), this, SLOT(nextAnimationFrame())); - timer->start(40); + QTimer::singleShot(3000, this, SLOT(closeThis())); } @@ -45,238 +30,4 @@ StartSplash::~StartSplash() { } -void StartSplash::nextAnimationFrame() { - - ++frameNo; - update(); - } - -void StartSplash::paintEvent(QPaintEvent * /*event*/) { - - QPainter painter(this); - -#ifdef _WIN32 - QFont welcomeFont; - welcomeFont.setFamily("Times New Roman"); - welcomeFont.setPixelSize(42); -#else -#ifdef __APPLE__ - QFont welcomeFont; - welcomeFont.setFamily("Century Schoolbook L"); - welcomeFont.setPixelSize(42); -#else - QFont welcomeFont; - welcomeFont.setFamily("Century Schoolbook L"); - welcomeFont.setPixelSize(35); -#endif -#endif -#ifdef __APPLE__ - QFont haveFont; - haveFont.setFamily("Century Schoolbook L"); - haveFont.setPixelSize(24); -#else - QFont haveFont; - haveFont.setFamily("Century Schoolbook L"); - haveFont.setPixelSize(24); -#endif - - QFont versionFont; - versionFont.setFamily("Nimbus Sans L"); - versionFont.setPixelSize(12); - - if(frameNo >= 52 && frameNo < 55) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - } - - if(frameNo >= 55 && frameNo < 57) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"W"); - - } - - if(frameNo >= 57 && frameNo < 59) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"We"); - - } - - if(frameNo >= 59 && frameNo < 61) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Wel"); - - } - - if(frameNo >= 61 && frameNo < 63) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welc"); - - } - - if(frameNo >= 63 && frameNo < 65) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welco"); - - } - - if(frameNo >= 65 && frameNo < 67) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welcom"); - - } - - if(frameNo >= 67 && frameNo < 72) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welcome"); - - } - - if(frameNo >= 72 && frameNo < 74) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welcome t"); - - } - - if(frameNo >= 74 && frameNo < 79 ) { - - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welcome to"); - - } - - if(frameNo >= 79 && frameNo < 91) { -// - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welcome to"); - - --opacityCounter; -// std::cout << opacity << " " << opacityCounter << "\n"; - opacity = 1.0/opacityCounter; -// std::cout << opacity << "\n"; - painter.setOpacity(opacity); - painter.drawPixmap(150,85,100,100,logo); - - } - - if(frameNo >= 91 && frameNo < 106) { -// - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welcome to"); - - painter.drawPixmap(150,85,100,100,logo); - - } - - if(frameNo >= 106 && frameNo < 136) { -// - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welcome to"); - - painter.drawPixmap(150,85,100,100,logo); - - painter.setFont(haveFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(3,190,390,40,4,"Have a lot of fun!"); - - } - - if(frameNo >= 136 && frameNo < 190) { -// - painter.setBrush(QColor(35,71,0)); - painter.drawRect(0,0,399,249); - - painter.setRenderHint(QPainter::Antialiasing, TRUE); - painter.setFont(welcomeFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(48,27,300,45,4,"Welcome to"); - - painter.drawPixmap(150,85,100,100,logo); - - painter.setFont(haveFont); - painter.setPen(QColor(255,255,255)); - painter.drawText(3,190,390,40,4,"Have a lot of fun! ;-)"); - - } - - //even draw version number - painter.setOpacity(1.0); - painter.setFont(versionFont); - painter.setPen(QColor(153,213,0)); - painter.drawText(309,227,100,20,4,QString("Version %1").arg(POKERTH_BETA_RELEASE_STRING)); - painter.setOpacity(opacity); - - if(frameNo >=190) { - this->close(); - } -} - +void StartSplash::closeThis() { this->close(); } diff --git a/src/gui/qt/gametable/startsplash/startsplash.h b/src/gui/qt/gametable/startsplash/startsplash.h index 8e5d6514..9f189eba 100755 --- a/src/gui/qt/gametable/startsplash/startsplash.h +++ b/src/gui/qt/gametable/startsplash/startsplash.h @@ -15,32 +15,18 @@ #include #include -class gameTableImpl; -class ConfigFile; + class StartSplash : public QSplashScreen { Q_OBJECT public: - StartSplash(gameTableImpl *, ConfigFile*); + StartSplash(QPixmap& p); ~StartSplash(); - - int frameNo; - int opacityCounter; - qreal opacity; - - void paintEvent(QPaintEvent * event); public slots: - void nextAnimationFrame(); - -private: - - gameTableImpl *myW; - QString myAppDataPath; - QPixmap logo; - ConfigFile *myConfig; + void closeThis(); }; diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index 9f1039d3..be5869eb 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -23,18 +23,22 @@ #include "log.h" #include "chat.h" #include "gametableimpl.h" +#include "startwindowimpl.h" #include "configfile.h" using namespace std; -GuiWrapper::GuiWrapper(ConfigFile *c) : myLog(0), myW(0), myConfig(c) +GuiWrapper::GuiWrapper(ConfigFile *c) : myLog(NULL), myW(NULL), myConfig(c), myStartWindow(NULL) { myW = new gameTableImpl(myConfig); myW->show(); myLog = new Log(myW, myConfig); + + myStartWindow = new startWindowImpl(myW, myConfig); +// myStartWindow-> show(); } diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index 9851f2ce..82cdb226 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -26,6 +26,7 @@ class Session; class gameTableImpl; +class startWindowImpl; class Log; class Chat; class ConfigFile; @@ -146,6 +147,7 @@ private: Chat *myChat; gameTableImpl *myW; ConfigFile *myConfig; + startWindowImpl *myStartWindow; }; diff --git a/src/pokerth.cpp b/src/pokerth.cpp index ff1e2604..32cd0c7f 100755 --- a/src/pokerth.cpp +++ b/src/pokerth.cpp @@ -18,18 +18,17 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -/////// can be removed for non-qt-guis //////////// #include #ifdef __APPLE__ #include #endif -/////////////////////////////////////////////////// #include "session.h" #include "guiwrapper.h" -#include "startwindowimpl.h" #include "configfile.h" +#include "startsplash.h" +#include "game_defs.h" #include #include @@ -105,6 +104,12 @@ int main( int argc, char **argv ) // #endif a.setStyleSheet("QApplication, QWidget, QDialog { " + font1String + " font-size: 12px; }"); #endif + + QPixmap *pixmap = new QPixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth.png"); + StartSplash splash(*pixmap); + splash.show(); + splash.showMessage(QString("Version %1").arg(POKERTH_BETA_RELEASE_STRING), 0x0042, QColor(153,213,0)); + //Set translations QTranslator qtTranslator; qtTranslator.load(QString(myAppDataPath +"translations/qt_") + QString::fromStdString(myConfig->readConfigString("Language"))); @@ -134,12 +139,11 @@ int main( int argc, char **argv ) session->init(); // TODO handle error myGuiInterface->setSession(session); } - -// boost::shared_ptr myStartWindow(new startWindowImpl(myGuiInterface.get(), myConfig)); - + int retVal = a.exec(); - + curl_global_cleanup(); socket_cleanup(); return retVal; + }