main.cpp   main.cpp 
skipping to change at line 36 skipping to change at line 36
#include "StelIniParser.hpp" #include "StelIniParser.hpp"
#include <QDebug> #include <QDebug>
#include <QApplication> #include <QApplication>
#include <QMessageBox> #include <QMessageBox>
#include <QTranslator> #include <QTranslator>
#include <QGLFormat> #include <QGLFormat>
#include <QPlastiqueStyle> #include <QPlastiqueStyle>
#include <QFileInfo> #include <QFileInfo>
#include <QFontDatabase> #include <QFontDatabase>
#include <QDir>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <windows.h>
#ifdef _MSC_BUILD
#include <MMSystem.h>
#pragma comment(lib,"Winmm.lib")
#endif
#endif //Q_OS_WIN #endif //Q_OS_WIN
//! @class GettextStelTranslator //! @class GettextStelTranslator
//! Provides i18n support through gettext. //! Provides i18n support through gettext.
class GettextStelTranslator : public QTranslator class GettextStelTranslator : public QTranslator
{ {
public: public:
virtual bool isEmpty() const { return false; } virtual bool isEmpty() const { return false; }
//! Overrides QTranslator::translate(). //! Overrides QTranslator::translate().
skipping to change at line 170 skipping to change at line 175
// 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-2013 Fabien Cher eau et al"); QString copyrightLine = QString("Copyright (C) 2000-2013 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:" << QDir::toNativeSeparators(StelL ogger::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())
{ {
qDebug() << " " << n << ". " << i; qDebug() << " " << n << ". " << QDir::toNativeSeparators(i);
++n; ++n;
} }
// Now manage the loading of the proper config file // Now manage the loading of the proper config file
QString configName; QString configName;
try try
{ {
configName = CLIProcessor::argsGetOptionWithArg(argList, "-c ", "--config-file", "config.ini").toString(); configName = CLIProcessor::argsGetOptionWithArg(argList, "-c ", "--config-file", "config.ini").toString();
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
skipping to change at line 257 skipping to change at line 262
if (restoreDefaultConfigFile) if (restoreDefaultConfigFile)
{ {
if (confSettings) if (confSettings)
delete confSettings; delete confSettings;
QString backupFile(configFileFullPath.left(configFil eFullPath.length()-3) + QString("old")); QString backupFile(configFileFullPath.left(configFil eFullPath.length()-3) + QString("old"));
if (QFileInfo(backupFile).exists()) if (QFileInfo(backupFile).exists())
QFile(backupFile).remove(); QFile(backupFile).remove();
QFile(configFileFullPath).rename(backupFile); QFile(configFileFullPath).rename(backupFile);
copyDefaultConfigFile(configFileFullPath); copyDefaultConfigFile(configFileFullPath);
confSettings = new QSettings(configFileFullPath, Ste lIniFormat); confSettings = new QSettings(configFileFullPath, Ste lIniFormat);
qWarning() << "Resetting defaults config file. Previ ous config file was backed up in " << backupFile; qWarning() << "Resetting defaults config file. Previ ous config file was backed up in " << QDir::toNativeSeparators(backupFile);
} }
} }
else else
{ {
qDebug() << "Config file " << configFileFullPath << " does n ot exist. Copying the default file."; qDebug() << "Config file " << QDir::toNativeSeparators(confi gFileFullPath) << " does not exist. Copying the default file.";
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: " << QDir::toNativeSeparators(configFil eFullPath);
// Override config file values from CLI. // Override config file values from CLI.
CLIProcessor::parseCLIArgsPostConfig(argList, confSettings); CLIProcessor::parseCLIArgsPostConfig(argList, confSettings);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
bool safeMode = false; // used in Q_OS_WIN, but need the QGL::setPre ferredPaintEngine() call here. bool safeMode = false; // used in Q_OS_WIN, but need the QGL::setPre ferredPaintEngine() call here.
#endif #endif
if (!confSettings->value("main/use_qpaintenginegl2", true).toBool() if (!confSettings->value("main/use_qpaintenginegl2", true).toBool()
|| qApp->property("onetime_safe_mode").isValid()) { || qApp->property("onetime_safe_mode").isValid()) {
// The user explicitely request to use the older paint engin e. // The user explicitely request to use the older paint engin e.
skipping to change at line 318 skipping to change at line 323
if (!fileFont.isEmpty()) if (!fileFont.isEmpty())
{ {
try try
{ {
const QString& afName = StelFileMgr::findFile(QStrin g("data/%1").arg(fileFont)); const QString& afName = StelFileMgr::findFile(QStrin g("data/%1").arg(fileFont));
if (!afName.isEmpty() && !afName.contains("file not found")) if (!afName.isEmpty() && !afName.contains("file not found"))
QFontDatabase::addApplicationFont(afName); QFontDatabase::addApplicationFont(afName);
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "ERROR while loading custom font " << fileFont << " : " << e.what(); qWarning() << "ERROR while loading custom font " << QDir::toNativeSeparators(fileFont) << " : " << e.what();
} }
} }
QString baseFont = confSettings->value("gui/base_font_name", "DejaVu Sans").toString(); QString baseFont = confSettings->value("gui/base_font_name", "DejaVu Sans").toString();
QString safeFont = confSettings->value("gui/safe_font_name", "Verdan a").toString(); QString safeFont = confSettings->value("gui/safe_font_name", "Verdan a").toString();
// 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
skipping to change at line 363 skipping to change at line 368
StelTranslator::init(StelFileMgr::findFile("data/iso639-1.ut f8")); StelTranslator::init(StelFileMgr::findFile("data/iso639-1.ut f8"));
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "ERROR while loading translations: " << e.what () << endl; qWarning() << "ERROR while loading translations: " << e.what () << endl;
} }
// Use our gettext translator for Qt translations as well // Use our gettext translator for Qt translations as well
GettextStelTranslator trans; GettextStelTranslator trans;
app.installTranslator(&trans); app.installTranslator(&trans);
if (!QGLFormat::hasOpenGL()) if (!QGLFormat::hasOpenGL()) // Check support of OpenGL
{ {
qWarning() << "Oops... This system does not support OpenGL." ;
QMessageBox::warning(0, "Stellarium", q_("This system does n ot support OpenGL.")); QMessageBox::warning(0, "Stellarium", q_("This system does n ot support OpenGL."));
app.quit();
} }
else if (!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Versi
on_1_2)) // Check supported version of OpenGL
{
// OK, minimal required version of OpenGL is 1.2. If platfor
m does not support this
// version then say to user about troubles and quit from app
lication.
qWarning() << "Oops... This platform support only OpenGL 1.1
.";
QMessageBox::warning(0, "Stellarium", q_("Your platform does
not support minimal required OpenGL 1.2. Please upgrade drivers for graphi
cs card."));
app.quit();
}
else
{
StelMainWindow mainWin;
mainWin.init(confSettings);
app.exec();
mainWin.deinit();
delete confSettings;
StelLogger::deinit();
#ifdef Q_OS_WIN
if(timerGrain)
timeEndPeriod(timerGrain);
#endif //Q_OS_WIN
StelMainWindow mainWin; return 0;
mainWin.init(confSettings); }
app.exec();
mainWin.deinit();
delete confSettings;
StelLogger::deinit();
#ifdef Q_OS_WIN
if(timerGrain)
timeEndPeriod(timerGrain);
#endif //Q_OS_WIN
return 0;
} }
 End of changes. 13 change blocks. 
21 lines changed or deleted 44 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/