Files
pokerth/src/pokerth.cpp
T

93 lines
2.8 KiB
C++
Raw Normal View History

2007-01-13 02:40:33 +00:00
/***************************************************************************
* Copyright (C) 2006 by FThauer FHammer *
* f.thauer@web.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
2007-01-16 22:42:02 +00:00
2007-01-17 00:39:20 +00:00
#include <iostream>
2007-01-16 22:42:02 +00:00
/////// can be removed for non-qt-guis ////////////
2007-01-13 02:40:33 +00:00
#include <qapplication.h>
2007-04-30 23:18:31 +00:00
#ifdef __APPLE__
#include <QMacStyle>
#endif
2007-01-16 22:42:02 +00:00
///////////////////////////////////////////////////
2007-01-13 02:40:33 +00:00
#include "session.h"
#include "guiwrapper.h"
#include <net/socket_startup.h>
2007-01-13 02:40:33 +00:00
#include <cstdlib>
#include <ctime>
#ifdef _MSC_VER
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#define ENABLE_LEAK_CHECK() \
{ \
int tmpFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); \
tmpFlag |= _CRTDBG_LEAK_CHECK_DF; \
_CrtSetDbgFlag(tmpFlag); \
}
#endif
#endif
#ifndef ENABLE_LEAK_CHECK
#define ENABLE_LEAK_CHECK()
#endif
using namespace std;
2007-01-13 02:40:33 +00:00
class GuiWrapper;
int main( int argc, char **argv )
{
//ENABLE_LEAK_CHECK();
//_CrtSetBreakAlloc(49937);
socket_startup();
2007-01-16 23:08:39 +00:00
2007-01-16 22:42:02 +00:00
/////// can be removed for non-qt-guis ////////////
2007-01-13 02:40:33 +00:00
QApplication a( argc, argv );
2007-04-30 23:14:30 +00:00
#ifdef __APPLE__
2007-04-30 23:18:31 +00:00
a.setStyle(new QMacStyle);
2007-04-30 23:14:30 +00:00
#else
a.setStyle(new QPlastiqueStyle);
#endif
2007-03-03 00:11:26 +00:00
Q_INIT_RESOURCE(resources);
2007-04-30 12:19:14 +00:00
QString locale = QLocale::system().name();
QTranslator translator;
2007-05-02 19:31:28 +00:00
translator.load(QString(":/translations/resources/translations/pokerth_") + locale);
2007-04-30 12:19:14 +00:00
a.installTranslator(&translator);
2007-01-16 22:42:02 +00:00
///////////////////////////////////////////////////
2007-04-20 23:14:08 +00:00
GuiInterface *myGuiInterface = new GuiWrapper();
Session theFirst(myGuiInterface);
myGuiInterface->setSession(&theFirst);
2007-01-13 02:40:33 +00:00
int retVal = a.exec();
socket_cleanup();
return retVal;
2007-01-13 02:40:33 +00:00
}