/***************************************************************************
 *   Copyright (C) 2005 by yunfan                                          *
 *   yunfan_zg@163.com                                                     *
 *                                                                         *
 *   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.             *
 ***************************************************************************/


#include "evamain.h"
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>

static const char description[] =
	I18N_NOOP("An IM Client Under KDE Using QQ IM Protocol.");

static const char version[] = "0.3.2";

static KCmdLineOptions options[] =
{
//    { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
	KCmdLineLastOption
};

int main(int argc, char **argv)
{
	KAboutData about("eva", I18N_NOOP("Eva"), version, description,
			KAboutData::License_GPL, I18N_NOOP("(c) 2004-2005, yunfan"), "yunfan_zg@163.com", "http://www.sourceforge.net/projects/evaq");
	about.addAuthor( I18N_NOOP("yunfan"), I18N_NOOP("original developer, maintainer"), 
			"yunfan_zg@163.com","http://www.sourceforge.net/projects/evaq" );
	about.addAuthor( I18N_NOOP("casper"), I18N_NOOP("developer, IP address converting"), "tlmcasper@163.com" ); 
	about.addAuthor( I18N_NOOP("zsyddl"), I18N_NOOP("developer, user details window"), "morrowren@sina.com" );
	
	about.addCredit( I18N_NOOP("caihua"), I18N_NOOP("icon designer"), "13307864987@gx165.com"); 
	about.addCredit( I18N_NOOP("Levin Du"), 
		I18N_NOOP("patch for system setting \nfixed combo box index massing up after \nclicking \"Default\" several times."),
			"zsdjw@21cn.com");
	about.addCredit( I18N_NOOP("Minmin"), I18N_NOOP("encapsulating encryption class in C++"), "csdengxm@hotmail.com");  
	about.addCredit( I18N_NOOP("Phytonix"), I18N_NOOP("some original faces & Eva Logo designer."), "yahzee@d3eye.com");
	about.addCredit( I18N_NOOP("Shixin Zeng"), I18N_NOOP("libeva patch for Windows supporting."), "shixinzeng@gmail.com");
	about.addCredit( I18N_NOOP("starkwong"), I18N_NOOP("libeva patch for Visual Studio .Net 2002/2003 compiling supporting."), "starkwong@hotmail.com");
	
	KCmdLineArgs::init(argc, argv, &about);
	KCmdLineArgs::addCmdLineOptions( options );
	KApplication app;
	EvaMain::mAboutData = &about;
	EvaMain *mainWin = 0;

        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

        /// @todo do something with the command line args here

        mainWin = new EvaMain();

	QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
        args->clear();

    	// mainWin has WDestructiveClose flag by default, so it will delete itself.
	return app.exec();
}

