/* $Id: main.cpp,v 1.16 2003/09/18 11:59:04 rjesse Exp $
 *
 * This file is part of the Mango recipe management distribution.
 * Copyright (c) 2000-2003, Roland Jesse
 * All rights reserved.
 *
 * For license and copyright information see the file COPYRIGHT or 
 * <http://www.opensource.org/licenses/bsd-license.html>.
 */

/*! \mainpage %Mango Documentation
 *
 * \section intro Introduction
 *
 * %Mango is just another program for handling mealmaster compatible
 * recipes.
 *
 * \section copyright Copyright
 *
 * Copyright (c) 2000-2003, Roland Jesse <rjesse@users.sf.net>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * -# Redistributions of source code must retain the above
 *    copyright notice, this list of conditions and the following
 *    disclaimer.
 * -# Redistributions in binary form must reproduce the above
 *    copyright notice, this list of conditions and the following
 *    disclaimer in the documentation and/or other materials
 *    provided with the distribution.
 * -# All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by Roland Jesse and
 *      further contributors.
 * -# Neither the name Roland Jesse nor the names of other
 *    contributors may be used to endorse or promote products
 *    derived from this software without specific prior written
 *    permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * \section install Installation
 *
 * \subsection prereq Prerequisits
 *
 * - Qt version 3.0 or later (http://www.trolltech.com/qt/)
 * - QextMDI (http://www.geocities.com/gigafalk/qextmdi.htm)
 *  
 * \subsection compilation Compilation
 *
 * <code>% ./configure [-platform <platform>]</code><br />
 * <code>% make [install]</code>
 */

/*!  \todo Use QApplication's applicationDirPath() and
  applicationFilePath() in order to return the application's directory
  and full path file name. Than look up images and translations from
  there.
*/

#include "Mango.h"
#include "resources.h"
#ifdef NO_KDE2
# include <qapplication.h>
#else
# include <kapp.h>
# include <kaboutdata.h>
# include <kcmdlineargs.h>
#endif // !NO_KDE2
#include <qnetwork.h>
#include <qtextcodec.h>

void qInitImages_mango();

int
main(int argc, char* argv[]) {
   qInitImages_mango();
#ifdef NO_KDE2
   QApplication a( argc, argv);
#else
   KAboutData aboutData( "Mango", "Mango", MANGO_VERSION_STRING,
                         "The recipe management package.",
                         KAboutData::License_BSD, "(c) 2000-2003, Roland Jesse",
                         0, "http://mango.sf.net/", "mango-hackers@lists.sf.net");
   aboutData.addAuthor( "Roland Jesse");
   KCmdLineArgs::init( argc, argv, &aboutData );
   KApplication a;
#endif // !NO_KDE2
   qInitNetworkProtocols();
   
   QTranslator translator( 0);
   bool ret = translator.load( QString( "mango_") + QTextCodec::locale(), ".");
   if (ret) qApp->installTranslator( &translator);
   
   Mango* mango = Mango::getInstance();
   a.setMainWidget( mango);
   mango->show();
   int rc = a.exec();
   Mango::deleteInstance();
   return rc;
}
