/***************************************************************************
 *   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.2.1";

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) 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("caihua"), I18N_NOOP("icon designer"), "13307864987@gx165.com");  
	about.addAuthor( I18N_NOOP("casper"), I18N_NOOP("developer, IP address converting"), "tlmcasper@163.com" );
	about.addAuthor( I18N_NOOP("QuickTime"), I18N_NOOP("face designer"), "yahzee@d3eye.com");
	about.addAuthor( I18N_NOOP("zsyddl"), I18N_NOOP("developer, user details window"), "morrowren@sina.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"); 
	
	KCmdLineArgs::init(argc, argv, &about);
	KCmdLineArgs::addCmdLineOptions( options );
	KApplication app;
	EvaMain::mAboutData = &about;
	EvaMain *mainWin = 0;

//     if (app.isRestored())
//     {
//         RESTORE(EvaMain);
//     }
//     else
//     {
        // no session.. just start up normally
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

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

        mainWin = new EvaMain();
//         app.setMainWidget( mainWin );
//         mainWin->show();
	QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
        args->clear();
//     }

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

