/***************************************************************************
                          main.cpp  -  description
                             -------------------
    begin                : Mon Apr 29 14:47:46 EET DST 2002
    copyright            : (C) 2002 by Argo Vessmann (ARTEC Design)
    email                : 
 ***************************************************************************/

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

#include <config.h>

#include <qapplication.h>
#include <qfont.h>
#include <qstring.h>
#include <qtextcodec.h>
#include <qtranslator.h>

#include "netmoswiz.h"
#include "askcontinuenewt.h"
#include "newtwizard.h"

#include <iostream.h>

#include <X11/Xlib.h>


int main(int argc, char *argv[])
{

  bool useGUI = getenv( "DISPLAY" ) != 0;

  if ( !useGUI ) {
	newtWizard nwiz;
	return nwiz.exec();
  }
  Display *d;
  if ( !(d = XOpenDisplay( NULL )) ) {
  	AskContinueNewt *ask;
	ask = new AskContinueNewt();
	if ( ask->exec() ) {
		delete ask;
		newtWizard nwiz;
		return nwiz.exec();
	} else {
		delete ask;
		exit( 0 );
	}
  }
//  QApplication::setDesktopSettingsAware( FALSE );
  QApplication a( d, argc, argv );
  a.setFont(QFont("helvetica", 12));
  QTranslator tor( 0 );
  // set the location where your .qm files are in load() below as the last parameter instead of "."
  // for development, use "/" to use the english original as
  // .qm files are stored in the base project directory.
  tor.load( QString("netmosconf.") + QTextCodec::locale(), "." );
  a.installTranslator( &tor );
  /* uncomment the following line, if you want a Windows 95 look*/
  // a.setStyle( new QWindowsStyle() );

  Netmoswiz *n = new Netmoswiz();
  a.setMainWidget( n );

  n->show();
/*
  NetmosconfApp *netmosconf=new NetmosconfApp();
  a.setMainWidget(netmosconf);

  netmosconf->show();
*/

  return a.exec();
}


