summaryrefslogtreecommitdiffstats
path: root/knights/main.cpp
blob: cc76045f5b0c987506c8764b2708382da3a73b68 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/***************************************************************************
                          main.cpp  -  description
                             -------------------
    begin                : Thu Mar  1 10:43:51 CST 2001
    copyright            : (C) 2003 by Troy Corbin Jr.
    email                : tcorbin@users.sourceforge.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#include <tdecmdlineargs.h>
#include <tdeaboutdata.h>
#include <tdelocale.h>

#include "knights.h"
	
static TDECmdLineOptions options[] =
{
	{ "d <path>", I18N_NOOP("Specify the location of your Knights data directory."), 0 },
	{ "+[filename]", I18N_NOOP("A .pgn file to be loaded."), 0 },
	{ 0, 0, 0 }
};

int main(int argc, char *argv[])
{
	TDEAboutData aboutData(	"knights",
												I18N_NOOP("Knights"),
												_VERSION_,
												I18N_NOOP("The Knights Chess Interface\n\nKnights is a chess interface\nfor the Trinity Desktop Environment."),
												TDEAboutData::License_GPL_V2,
												"(c) 2003, Troy Corbin Jr.",
												0,
												"http://knights-chess.com",
												"troy@knights-chess.com");

  aboutData.addAuthor("Troy Corbin Jr.",
											I18N_NOOP("Project Manager and Programmer"),
											"tcorbin@users.sourceforge.net",
											"http://knights.sourceforge.net");
  aboutData.addAuthor("Alexander Wels",
											I18N_NOOP("Communications Programmer"),
											"agpwels@adelphia.net",
											"");
  aboutData.addCredit("Mark Westcott",
											I18N_NOOP("TQtopia port and patches"),
											"mark@houseoffish.org",
											"");
  aboutData.addCredit("Kunnar Klauks",
											I18N_NOOP("Patches and suggestions"),
											"kunnk@yahoo.com",
											"");
  aboutData.addCredit("Harald Fernengel",
											I18N_NOOP("KDE3 Compatability Patch"),
											"harry@kdevelop.org",
											"");
  aboutData.addCredit("Tim Mann",
											I18N_NOOP("XBoard protocol"),
											"tim.mann@compaq.com",
											"http://www.tim-mann.org/chess.html");
	aboutData.setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\nYour names"),
													I18N_NOOP("_: EMAIL OF TRANSLATORS\nYour emails"));

  TDECmdLineArgs::init( argc, argv, &aboutData );
  TDECmdLineArgs::addCmdLineOptions( options );
	TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();

	TDEApplication a;
  Knights *knights = new Knights(args);
	a.setMainWidget(knights);
	if( !knights->init() )	// Did we init ok?
	{
		return 0;
	}
	/* Without this connection, the destructors are not called, and some
			housecleaning ( like destroying child processes ) isn't done */
	a.connect( &a, TQT_SIGNAL( shutDown () ), knights, TQT_SLOT( KillAll() ) );
  a.connect( &a, SIGNAL( aboutToQuit() ), knights, SLOT( aboutToQuit() ) );
	return a.exec();
}