main.cpp   main.cpp 
/* /*
* Stellarium * Stellarium
* Copyright (C) 2002 Fabien Chereau * Copyright (C) 2002 Fabien Chereau
* Copyright (C) 2012 Timothy Reaves
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelMainWindow.hpp" #include "StelMainWindow.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelLogger.hpp" #include "StelLogger.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "CLIProcessor.hpp" #include "CLIProcessor.hpp"
#include "StelIniParser.hpp" #include "StelIniParser.hpp"
#include <QDebug> #include <QDebug>
skipping to change at line 151 skipping to change at line 152
// output, such as --help and --version // output, such as --help and --version
CLIProcessor::parseCLIArgsPreConfig(argList); CLIProcessor::parseCLIArgsPreConfig(argList);
// Start logging. // Start logging.
StelLogger::init(StelFileMgr::getUserDir()+"/log.txt"); StelLogger::init(StelFileMgr::getUserDir()+"/log.txt");
StelLogger::writeLog(argStr); StelLogger::writeLog(argStr);
// OK we start the full program. // OK we start the full program.
// Print the console splash and get on with loading the program // Print the console splash and get on with loading the program
QString versionLine = QString("This is %1 - http://www.stellarium.or g").arg(StelUtils::getApplicationName()); QString versionLine = QString("This is %1 - http://www.stellarium.or g").arg(StelUtils::getApplicationName());
QString copyrightLine = QString("Copyright (C) 2000-2011 Fabien Cher eau et al"); QString copyrightLine = QString("Copyright (C) 2000-2012 Fabien Cher eau et al");
int maxLength = qMax(versionLine.size(), copyrightLine.size()); int maxLength = qMax(versionLine.size(), copyrightLine.size());
qDebug() << qPrintable(QString(" %1").arg(QString().fill('-', maxLen gth+2))); qDebug() << qPrintable(QString(" %1").arg(QString().fill('-', maxLen gth+2)));
qDebug() << qPrintable(QString("[ %1 ]").arg(versionLine.leftJustifi ed(maxLength, ' '))); qDebug() << qPrintable(QString("[ %1 ]").arg(versionLine.leftJustifi ed(maxLength, ' ')));
qDebug() << qPrintable(QString("[ %1 ]").arg(copyrightLine.leftJusti fied(maxLength, ' '))); qDebug() << qPrintable(QString("[ %1 ]").arg(copyrightLine.leftJusti fied(maxLength, ' ')));
qDebug() << qPrintable(QString(" %1").arg(QString().fill('-', maxLen gth+2))); qDebug() << qPrintable(QString(" %1").arg(QString().fill('-', maxLen gth+2)));
qDebug() << "Writing log file to:" << StelLogger::getLogFileName(); qDebug() << "Writing log file to:" << StelLogger::getLogFileName();
qDebug() << "File search paths:"; qDebug() << "File search paths:";
int n=0; int n=0;
foreach (QString i, StelFileMgr::getSearchPaths()) foreach (QString i, StelFileMgr::getSearchPaths())
{ {
skipping to change at line 260 skipping to change at line 261
copyDefaultConfigFile(configFileFullPath); copyDefaultConfigFile(configFileFullPath);
confSettings = new QSettings(configFileFullPath, StelIniForm at); confSettings = new QSettings(configFileFullPath, StelIniForm at);
} }
Q_ASSERT(confSettings); Q_ASSERT(confSettings);
qDebug() << "Config file is: " << configFileFullPath; qDebug() << "Config file is: " << configFileFullPath;
// Override config file values from CLI. // Override config file values from CLI.
CLIProcessor::parseCLIArgsPostConfig(argList, confSettings); CLIProcessor::parseCLIArgsPostConfig(argList, confSettings);
bool safeMode = false; bool safeMode = false; // used in Q_OS_WIN, but need the QGL::setPre
if (confSettings->value("main/use_qpaintenginegl2", true).toBool() & ferredPaintEngine() call here.
& !qApp->property("onetime_safe_mode").isValid()) if (!confSettings->value("main/use_qpaintenginegl2", true).toBool()
{ || qApp->property("onetime_safe_mode").isValid()) {
// The default is to let Qt choose which paint engine fits t
he best between OpenGL and OpenGL2.
// However it causes troubles on some older hardware, so add
an option.
}
else
{
// The user explicitely request to use the older paint engin e. // The user explicitely request to use the older paint engin e.
QGL::setPreferredPaintEngine(QPaintEngine::OpenGL); QGL::setPreferredPaintEngine(QPaintEngine::OpenGL);
safeMode = true; safeMode = true;
} }
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
// On Leopard (10.5) + ppc architecture, text display is buggy if Op enGL2 Qt paint engine is used. // On Leopard (10.5) + ppc architecture, text display is buggy if Op enGL2 Qt paint engine is used.
if ((QSysInfo::MacintoshVersion == QSysInfo::MV_LEOPARD) && (QSysInf o::ByteOrder == QSysInfo::BigEndian)) if ((QSysInfo::MacintoshVersion == QSysInfo::MV_LEOPARD) && (QSysInf o::ByteOrder == QSysInfo::BigEndian))
QGL::setPreferredPaintEngine(QPaintEngine::OpenGL); QGL::setPreferredPaintEngine(QPaintEngine::OpenGL);
#endif #endif
skipping to change at line 298 skipping to change at line 294
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
// Removed this warning practically allowing to package the program without the font file. // Removed this warning practically allowing to package the program without the font file.
// This is useful for distribution having already a package for DejaVu font. // This is useful for distribution having already a package for DejaVu font.
// qWarning() << "ERROR while loading font DejaVuSans : " << e.what(); // qWarning() << "ERROR while loading font DejaVuSans : " << e.what();
} }
// Set the default application font and font size. // Set the default application font and font size.
// Note that style sheet will possibly override this setting. // Note that style sheet will possibly override this setting.
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
// On windows use Verdana font, to avoid unresolved bug with OpenGL1 Qt paint engine. // On windows use Verdana font, to avoid unresolved bug with OpenGL1 Qt paint engine.
// See Launchpad question #111823 for more info // See Launchpad question #111823 for more info
QFont tmpFont(safeMode ? "Verdana" : "DejaVu Sans"); QFont tmpFont(safeMode ? "Verdana" : "DejaVu Sans");
tmpFont.setStyleStrategy(QFont::OpenGLCompatible); tmpFont.setStyleHint(QFont::AnyStyle, QFont::OpenGLCompatible);
// Activate verdana by defaut for all win32 builds to see if it impr oves things. // Activate verdana by defaut for all win32 builds to see if it impr oves things.
// -> this seems to bring crippled arabic fonts with OpenGL2 paint e ngine.. // -> this seems to bring crippled arabic fonts with OpenGL2 paint e ngine..
// QFont tmpFont("Verdana"); // QFont tmpFont("Verdana");
#else #else
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
QFont tmpFont("Verdana"); QFont tmpFont("Verdana");
#else #else
QFont tmpFont("DejaVu Sans"); QFont tmpFont("DejaVu Sans");
#endif #endif
 End of changes. 6 change blocks. 
14 lines changed or deleted 9 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/