/***************************************************************************
 *   Copyright (C) 2008 by Peter Dahlberg   *
 *   pdahlberg@gmail.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 <QApplication>
#include <QIcon>
#include "lsim.h"
#include <QDesktopWidget>
#include <QDebug>
#include <QMessageBox>
#include <QLocale>

int main(int argc, char *argv[])
{
	QT_REQUIRE_VERSION( argc, argv, "4.4.0"); //minimale Qt version
	Q_INIT_RESOURCE(application);
	QApplication app(argc, argv);
	app.setWindowIcon(QIcon(":icons/lsim.svg"));

	lsim * mw = new lsim();
	int dWidth = app.desktop()->availableGeometry(mw).width();
	int dHeight = app.desktop()->availableGeometry(mw).height();
	int frWidth = mw->frameGeometry().width() - mw->geometry().width();
	int frHeight = mw->frameGeometry().height() - mw->geometry().height();
	mw->resize(0.9*dWidth-frWidth, 0.9 *dHeight-frHeight);
	int midX = (dWidth - mw->frameGeometry().width()) / 2.0;
	int midY = (dHeight - mw->frameGeometry().height()) / 2.0;
	mw->move(midX,midY);
	if (dWidth <= 1024) {
		mw->showMaximized();
	}
	else {		
		mw->show();
	}
	return app.exec();
}

