2009-02-05 14:21:47 +00:00
|
|
|
/* This file is (c) 2008-2009 Konstantin Isakov <ikm@users.berlios.de>
|
2009-01-28 20:55:45 +00:00
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#include <QApplication>
|
2009-02-05 20:55:00 +00:00
|
|
|
#include <QIcon>
|
2009-01-28 20:55:45 +00:00
|
|
|
#include "mainwindow.hh"
|
2009-02-01 00:08:08 +00:00
|
|
|
#include "config.hh"
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2009-04-03 12:53:35 +00:00
|
|
|
//#define __DO_DEBUG
|
2009-03-26 19:00:08 +00:00
|
|
|
|
|
|
|
#ifdef __DO_DEBUG
|
|
|
|
#include <sys/resource.h>
|
|
|
|
#endif
|
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
int main( int argc, char ** argv )
|
|
|
|
{
|
2009-03-26 19:00:08 +00:00
|
|
|
#ifdef __DO_DEBUG
|
|
|
|
{
|
|
|
|
rlimit limit;
|
|
|
|
|
|
|
|
memset( &limit, 0, sizeof( limit ) );
|
|
|
|
limit.rlim_cur = RLIM_INFINITY;
|
|
|
|
limit.rlim_max = RLIM_INFINITY;
|
|
|
|
setrlimit( RLIMIT_CORE, &limit );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
QApplication app( argc, argv );
|
|
|
|
|
2009-04-12 19:41:58 +00:00
|
|
|
app.setApplicationName( "GoldenDict" );
|
|
|
|
app.setOrganizationDomain( "http://goldendict.berlios.de/" );
|
|
|
|
|
2009-02-05 20:55:00 +00:00
|
|
|
app.setWindowIcon( QIcon( ":/icons/programicon.png" ) );
|
|
|
|
|
2009-04-12 19:41:58 +00:00
|
|
|
// Load translations
|
|
|
|
|
|
|
|
QTranslator qtTranslator;
|
|
|
|
|
|
|
|
qtTranslator.load( "qt_" + QLocale::system().name(),
|
|
|
|
QLibraryInfo::location( QLibraryInfo::TranslationsPath ) );
|
|
|
|
app.installTranslator( &qtTranslator );
|
|
|
|
|
|
|
|
QTranslator translator;
|
|
|
|
translator.load( QString( Config::getProgramDataDir() ) + "/locale/" + QLocale::system().name() );
|
|
|
|
app.installTranslator( &translator );
|
|
|
|
|
|
|
|
|
2009-02-08 17:21:46 +00:00
|
|
|
// Apply qt stylesheet
|
|
|
|
{
|
|
|
|
QFile builtInCssFile( ":/qt-style.css" );
|
|
|
|
builtInCssFile.open( QFile::ReadOnly );
|
|
|
|
QByteArray css = builtInCssFile.readAll();
|
|
|
|
|
|
|
|
// Try loading a style sheet if there's one
|
|
|
|
QFile cssFile( Config::getUserQtCssFileName() );
|
|
|
|
|
|
|
|
if ( cssFile.open( QFile::ReadOnly ) )
|
|
|
|
css += cssFile.readAll();
|
|
|
|
|
|
|
|
app.setStyleSheet( css );
|
|
|
|
}
|
2009-02-01 00:08:08 +00:00
|
|
|
|
2009-01-28 20:55:45 +00:00
|
|
|
MainWindow m;
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|