summaryrefslogtreecommitdiffstats
path: root/qnetchess/src/main.cpp
blob: d58a6cce1f7b25e2788b7f13f57a47a275d2f0e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * $Id: main.cpp,v 0.1 2005/01/08 12:19:58 denis Exp $
 *
 * Author: Denis Kozadaev (denis@tambov.ru)
 * Description:
 *
 * See also: style(9)
 *
 * Hacked by:
 */

#include <ntqapplication.h>
#include <ntqmessagebox.h>
#include <ntqtextcodec.h>
#include <ntqtranslator.h>

#include "mainwindow.h"

const int
	XSize = 800,
	YSize = 600;

int
main(int argc, const char *argv[])
{
	TQApplication	*app;
	MainWindow	*mw;
//	TQTranslator	*qt;
	int		result = 0;

	app = new TQApplication(argc, (char **)argv);
/* FIXME: how does TQTranslator() work in TQt?
	qt = new TQTranslator();
	if (qt->load(LOCALE_FILE))
		app->installTranslator(qt);*/
	mw = new MainWindow();

	if (mw->sockOk()) {
		app->setMainWidget(mw);
		mw->show();
		mw->resize(XSize, YSize);
		mw->setMinimumSize(mw->size());
		result = app->exec();
	} else
		TQMessageBox::critical(NULL, TQObject::tr("Socket Error"),
			TQObject::tr("Cannot create a server socket!"));

	delete mw;
//	delete qt;
	delete app;

	return (result);
}