/***************************************************************************
 *									 *
 *   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 <iostream>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <klocale.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <kapplication.h>

#include "kdevmon.h"
#include "kdevmonconfig.h"
#include <Qt3Support/Q3CString>
#include <qdatetime.h>



//#define __is_release__

QString versionstring1 = "0.4.7";

QString date (__DATE__);
QString day= date.section(' ',0,0);
QString month= QString().setNum(QDate::fromString(date.section(' ',0,0),Qt::ISODate).month());
QString year= date.section(' ',2,2);

QString currentdate ( "+SVN(" + date+" "+ QTime().fromString(QString (__TIME__)).toString( "hhmm" ) + ")" );


// #ifdef __is_release__
static const char *KDEVMONVERSION = versionstring1.toAscii();
// #else
// QString versionstring = versionstring1 + currentdate;
// static const char *KDEVMONVERSION  = versionstring.toAscii() ;
// #endif

static const char *appName = "kdevmon";
static const char *description = I18N_NOOP("Network device monitor");
static int licenseType = KAboutData::License_GPL;
static const char *copyRightStatement = "(C) 2001 Henning Burchardt";
static const char *authorName = "Henning Burchardt";
static const char *authorEmailAddress = "h_burchardt@gmx.net";
	
int main( int argc, char *argv[] ) 
{

	KAboutData aboutData( appName,0, ki18n( "kdevmon" ),KDEVMONVERSION, ki18n(description), KAboutData::License_GPL, ki18n( "(C) 2005, the KDevmon team" ), ki18n("http://kde.org/"), "crissi99@gmx.de" );

	aboutData.addAuthor( ki18n(authorName), ki18n( "Old Developer and maintainer" ), authorEmailAddress );	
	aboutData.addAuthor( ki18n("Christoph Thielecke"), ki18n( "Developer and maintainer" ), "crissi99@gmx.de" );
	KCmdLineArgs::init( argc, argv, &aboutData );
	KCmdLineOptions options;
        options.add("config <configFile", ki18n("The name of the config file (full path or file name)"));
	KApplication a;
	KdevmonConfig *config = KdevmonConfig::getConfig();
	config->readSettings();

	Kdevmon *kdevmon = new Kdevmon(&a);
	a.setMainWidget(kdevmon);
	if( (config->getMainFrameConfig()->isVisible) || (! config->getDockFrameConfig()->isVisible) )
		kdevmon->setMainFrameVisible( true );
	else {
		; // std::cerr << "Kdevmon is hidden.\n";
        }

	return a.exec();
}
