~ubuntu-branches/debian/jessie/stellarium/jessie

« back to all changes in this revision

Viewing changes to src/main.cpp

  • Committer: Package Import Robot
  • Author(s): Tomasz Buchert
  • Date: 2012-05-18 13:26:18 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20120518132618-3uso09fo68c218cx
Tags: 0.11.2-1
* Imported Upstream version 0.11.1 and then 0.11.2 (Closes: #658431)
* Change maintainer (Closes: #668916)
* Machine-readable copyright file
* Bump Standards-Version to 3.9.3
* Update debhelper compat to 9
* Fix lintian duplicate-font-file warning
* Fix copyright-refers-to-symlink-license lintian tag
* Add lintian override for embedded-library error

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Stellarium
3
3
 * Copyright (C) 2002 Fabien Chereau
 
4
 * Copyright (C) 2012 Timothy Reaves
4
5
 *
5
6
 * This program is free software; you can redistribute it and/or
6
7
 * modify it under the terms of the GNU General Public License
14
15
 *
15
16
 * You should have received a copy of the GNU General Public License
16
17
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
18
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
18
19
 */
19
20
 
20
21
#include "StelMainWindow.hpp"
150
151
        // OK we start the full program.
151
152
        // Print the console splash and get on with loading the program
152
153
        QString versionLine = QString("This is %1 - http://www.stellarium.org").arg(StelUtils::getApplicationName());
153
 
        QString copyrightLine = QString("Copyright (C) 2000-2011 Fabien Chereau et al");
 
154
        QString copyrightLine = QString("Copyright (C) 2000-2012 Fabien Chereau et al");
154
155
        int maxLength = qMax(versionLine.size(), copyrightLine.size());
155
156
        qDebug() << qPrintable(QString(" %1").arg(QString().fill('-', maxLength+2)));
156
157
        qDebug() << qPrintable(QString("[ %1 ]").arg(versionLine.leftJustified(maxLength, ' ')));
259
260
        // Override config file values from CLI.
260
261
        CLIProcessor::parseCLIArgsPostConfig(argList, confSettings);
261
262
 
262
 
        bool safeMode = false;
263
 
        if (confSettings->value("main/use_qpaintenginegl2", true).toBool() && !qApp->property("onetime_safe_mode").isValid())
264
 
        {
265
 
                // The default is to let Qt choose which paint engine fits the best between OpenGL and OpenGL2.
266
 
                // However it causes troubles on some older hardware, so add an option.
267
 
        }
268
 
        else
269
 
        {
 
263
        bool safeMode = false; // used in Q_OS_WIN, but need the QGL::setPreferredPaintEngine() call here.
 
264
        if (!confSettings->value("main/use_qpaintenginegl2", true).toBool()
 
265
                || qApp->property("onetime_safe_mode").isValid()) {
270
266
                // The user explicitely request to use the older paint engine.
271
267
                QGL::setPreferredPaintEngine(QPaintEngine::OpenGL);
272
268
                safeMode = true;
297
293
        // Set the default application font and font size.
298
294
        // Note that style sheet will possibly override this setting.
299
295
#ifdef Q_OS_WIN
 
296
 
300
297
        // On windows use Verdana font, to avoid unresolved bug with OpenGL1 Qt paint engine.
301
298
        // See Launchpad question #111823 for more info
302
299
        QFont tmpFont(safeMode ? "Verdana" : "DejaVu Sans");
 
300
        tmpFont.setStyleHint(QFont::AnyStyle, QFont::OpenGLCompatible);
303
301
 
304
302
        // Activate verdana by defaut for all win32 builds to see if it improves things.
305
303
        // -> this seems to bring crippled arabic fonts with OpenGL2 paint engine..
311
309
        QFont tmpFont("DejaVu Sans");
312
310
#endif
313
311
#endif
314
 
        tmpFont.setPixelSize(13);
 
312
        tmpFont.setPixelSize(confSettings->value("gui/base_font_size", 13).toInt());
315
313
//tmpFont.setFamily("Verdana");
316
314
//tmpFont.setBold(true);
317
315
        QApplication::setFont(tmpFont);