/***************************************************************************
                          main.cpp  -  description
                             -------------------
    begin                : Mon Jul 15 12:24:12 CDT 2002
    copyright            : (C) 2002 by Adam Tenderholt
    email                : a-tenderholt@northwestern.edu
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 <kcmdlineargs.h>
#include <kaboutdata.h>
#include <klocale.h>

#include "kdrawchem.h"
//#include "prefs.h"


static const char *description =
	I18N_NOOP("KDrawChem\nA molecular structure drawing program based on XDrawChem");// \n(http://www.prism.gatech.edu/~gte067k/xdrawchem/)");

#define APP_VERSION "0.2"
// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
	
	
static KCmdLineOptions options[] =
{
  { "+[File]", I18N_NOOP("file to open"), 0 },
  { 0, 0, 0 }
  // INSERT YOUR COMMANDLINE OPTIONS HERE
};

int main(int argc, char *argv[])
{
	QString version = APP_VERSION;
	version += QString( " (Kemistry %1)" ).arg( VERSION );

	KAboutData aboutData( "kdrawchem", I18N_NOOP("KDrawChem"),
		version, description, KAboutData::License_GPL,
		"(c) 2002, Adam Tenderholt", 0, 0, "atenderholt@users.sourceforge.net");
	aboutData.addAuthor("Adam Tenderholt",0, "atenderholt@users.sourceforge.net");
	aboutData.addAuthor( "Francesco Bresciani",0,"fbresciani@users.sourceforge.net" );
	aboutData.setTranslator( I18N_NOOP( "_:NAME OF TRANSLATORS\nYour names" ),
			I18N_NOOP( "_:EMAIL OF TRANSLATORS\nYour emails" ) );
  aboutData.addCredit("Bryan Herger", I18N_NOOP( "Author of XDrawChem" ),0,"http://www.prism.gatech.edu/~gte067k/xdrawchem/");
	KCmdLineArgs::init( argc, argv, &aboutData );
	KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.

  KApplication app;
 
  if (app.isRestored())
  {
    RESTORE(KDrawChemApp);
  }
  else 
  {
    KDrawChemApp *kdrawchem = new KDrawChemApp();
    kdrawchem->show();

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
		
		if (args->count())
		{
        kdrawchem->openDocumentFile(args->arg(0));
		}
		else
		{
		  //kdrawchem->openDocumentFile();
		}
		args->clear();
  }

  return app.exec();
}  
