main.cpp   main.cpp 
skipping to change at line 28 skipping to change at line 28
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelMainView.hpp" #include "StelMainView.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 "StelUtils.hpp" #include "StelUtils.hpp"
#ifndef DISABLE_SCRIPTING
#include "StelScriptOutput.hpp"
#endif
#include <QDebug> #include <QDebug>
#ifndef USE_QUICKVIEW #ifndef USE_QUICKVIEW
#include <QApplication> #include <QApplication>
#include <QMessageBox> #include <QMessageBox>
#include <QStyleFactory> #include <QStyleFactory>
#else #else
#include <QGuiApplication> #include <QGuiApplication>
#endif #endif
skipping to change at line 144 skipping to change at line 147
argv = newArgv; argv = newArgv;
#endif #endif
QCoreApplication::setApplicationName("stellarium"); QCoreApplication::setApplicationName("stellarium");
QCoreApplication::setApplicationVersion(StelUtils::getApplicationVer sion()); QCoreApplication::setApplicationVersion(StelUtils::getApplicationVer sion());
QCoreApplication::setOrganizationDomain("stellarium.org"); QCoreApplication::setOrganizationDomain("stellarium.org");
QCoreApplication::setOrganizationName("stellarium"); QCoreApplication::setOrganizationName("stellarium");
// LP:1335611: Avoid troubles with search of the paths of the plugin s (deployments troubles) --AW // LP:1335611: Avoid troubles with search of the paths of the plugin s (deployments troubles) --AW
#if QT_VERSION==QT_VERSION_CHECK(5, 3, 1) #if QT_VERSION>=QT_VERSION_CHECK(5, 3, 1)
QCoreApplication::addLibraryPath("."); QCoreApplication::addLibraryPath(".");
#endif #endif
QGuiApplication::setDesktopSettingsAware(false); QGuiApplication::setDesktopSettingsAware(false);
#ifndef USE_QUICKVIEW #ifndef USE_QUICKVIEW
QApplication::setStyle(QStyleFactory::create("Fusion")); QApplication::setStyle(QStyleFactory::create("Fusion"));
// The QApplication MUST be created before the StelFileMgr is initia lized. // The QApplication MUST be created before the StelFileMgr is initia lized.
QApplication app(argc, argv); QApplication app(argc, argv);
#else #else
skipping to change at line 291 skipping to change at line 294
else else
{ {
qDebug() << "Config file " << QDir::toNativeSeparators(confi gFileFullPath) << " does not 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: " << QDir::toNativeSeparators(configFil eFullPath); qDebug() << "Config file is: " << QDir::toNativeSeparators(configFil eFullPath);
#ifndef DISABLE_SCRIPTING
QString outputFile = StelFileMgr::getUserDir()+"/output.txt";
if (confSettings->value("main/use_separate_output_file", false).toBo
ol())
outputFile = StelFileMgr::getUserDir()+"/output-"+QDateTime:
:currentDateTime().toString("yyyyMMdd-HHmmss")+".txt";
StelScriptOutput::init(outputFile);
#endif
// Override config file values from CLI. // Override config file values from CLI.
CLIProcessor::parseCLIArgsPostConfig(argList, confSettings); CLIProcessor::parseCLIArgsPostConfig(argList, confSettings);
// Support hi-dpi pixmaps // Support hi-dpi pixmaps
app.setAttribute(Qt::AA_UseHighDpiPixmaps); app.setAttribute(Qt::AA_UseHighDpiPixmaps);
// Add the DejaVu font that we use everywhere in the program // Add the DejaVu font that we use everywhere in the program
const QString& fName = StelFileMgr::findFile("data/DejaVuSans.ttf"); const QString& fName = StelFileMgr::findFile("data/DejaVuSans.ttf");
if (!fName.isEmpty()) if (!fName.isEmpty())
QFontDatabase::addApplicationFont(fName); QFontDatabase::addApplicationFont(fName);
skipping to change at line 312 skipping to change at line 322
QString fileFont = confSettings->value("gui/base_font_file", "").toS tring(); QString fileFont = confSettings->value("gui/base_font_file", "").toS tring();
if (!fileFont.isEmpty()) if (!fileFont.isEmpty())
{ {
const QString& afName = StelFileMgr::findFile(QString("data/ %1").arg(fileFont)); const QString& afName = StelFileMgr::findFile(QString("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);
else else
qWarning() << "ERROR while loading custom font " << QDir::toNativeSeparators(fileFont); qWarning() << "ERROR while loading custom font " << QDir::toNativeSeparators(fileFont);
} }
QString baseFont = confSettings->value("gui/base_font_name", "DejaVu
Sans").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
// Let's try avoid ugly font rendering on Windows.
// Details: https://sourceforge.net/p/stellarium/discussion/278769/t
hread/810a1e5c/
QString baseFont = confSettings->value("gui/base_font_name", "Verdan
a").toString();
QFont tmpFont(baseFont); QFont tmpFont(baseFont);
tmpFont.setStyleHint(QFont::AnyStyle, QFont::OpenGLCompatible); tmpFont.setStyleHint(QFont::AnyStyle, QFont::OpenGLCompatible);
#else #else
QString baseFont = confSettings->value("gui/base_font_name", "DejaVu Sans").toString();
QFont tmpFont(baseFont); QFont tmpFont(baseFont);
#endif #endif
tmpFont.setPixelSize(confSettings->value("gui/base_font_size", 13).t oInt()); tmpFont.setPixelSize(confSettings->value("gui/base_font_size", 13).t oInt());
QGuiApplication::setFont(tmpFont); QGuiApplication::setFont(tmpFont);
// Initialize translator feature // Initialize translator feature
StelTranslator::init(StelFileMgr::getInstallationDir() + "/data/iso6 39-1.utf8"); StelTranslator::init(StelFileMgr::getInstallationDir() + "/data/iso6 39-1.utf8");
// Use our custom translator for Qt translations as well // Use our custom translator for Qt translations as well
CustomQTranslator trans; CustomQTranslator trans;
skipping to change at line 344 skipping to change at line 356
bool appCanRun = true; bool appCanRun = true;
// some basic diagnostics // some basic diagnostics
if (!QGLFormat::hasOpenGL()){ if (!QGLFormat::hasOpenGL()){
qWarning() << "Oops... This system does not support 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."));
appCanRun = false; appCanRun = false;
} }
if (!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_ 1) && !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0) ) // Check supported version of OpenGL if (!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_ 1) && !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0) ) // Check supported version of OpenGL
{ {
// OK, minimal required version of OpenGL is 2.1 (OpenGL ES // OK, minimal required version of OpenGL is 2.1 and OpenGL
is 2.0). If platform does not support this Shading Language is 1.20 (or OpenGL ES is 2.0 and GLSL ES is 2.0).
// version then say to user about troubles and quit from app // Recommended OpenGL 3.0 and OpenGL Shading Language 1.30 a
lication. nd above.
// If platform does not support this version then say to use
r about troubles and quit from application.
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
qWarning() << "Oops... Insufficient OpenGL version. Please u pdate drivers, graphics hardware, or use MESA (or ANGLE) version."; qWarning() << "Oops... Insufficient OpenGL version. Please u pdate drivers, graphics hardware, or use MESA (or ANGLE) version.";
QMessageBox::warning(0, "Stellarium", q_("Insufficient OpenG L version. Please update drivers, graphics hardware, or use MESA (or ANGLE) version.")); QMessageBox::warning(0, "Stellarium", q_("Insufficient OpenG L version. Please update drivers, graphics hardware, or use MESA (or ANGLE) version."));
#else #else
qWarning() << "Oops... Insufficient OpenGL version. Please u pdate drivers, or graphics hardware."; qWarning() << "Oops... Insufficient OpenGL version. Please u pdate drivers, or graphics hardware.";
QMessageBox::warning(0, "Stellarium", q_("Insufficient OpenG L version. Please update drivers, or graphics hardware.")); QMessageBox::warning(0, "Stellarium", q_("Insufficient OpenG L version. Please update drivers, or graphics hardware."));
#endif #endif
appCanRun = false; appCanRun = false;
} }
 End of changes. 7 change blocks. 
8 lines changed or deleted 25 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/