StelMainWindow.cpp   StelMainWindow.cpp 
skipping to change at line 33 skipping to change at line 33
#include <QResizeEvent> #include <QResizeEvent>
#include <QIcon> #include <QIcon>
#include <QDebug> #include <QDebug>
#include <QFontDatabase> #include <QFontDatabase>
#include <QCoreApplication> #include <QCoreApplication>
#include <stdexcept> #include <stdexcept>
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainGraphicsView.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelModuleMgr.hpp"
#include "StelGui.hpp"
// Initialize static variables // Initialize static variables
StelMainWindow* StelMainWindow::singleton = NULL; StelMainWindow* StelMainWindow::singleton = NULL;
StelMainWindow::StelMainWindow(QWidget* parent) : QMainWindow(parent), init Complete(false) StelMainWindow::StelMainWindow(QWidget* parent) : QMainWindow(parent), init Complete(false)
{ {
// Can't create 2 StelMainWindow instances // Can't create 2 StelMainWindow instances
Q_ASSERT(!singleton); Q_ASSERT(!singleton);
singleton = this; singleton = this;
} }
void StelMainWindow::init() void StelMainWindow::init()
{ {
setWindowIcon(QIcon(":/mainWindow/icon.bmp")); setWindowIcon(QIcon(":/mainWindow/icon.bmp"));
QString fName; QString fName;
try try
{ {
fName = StelApp::getInstance().getFileMgr().findFile("data/D ejaVuSans.ttf"); fName = StelApp::getInstance().getFileMgr().findFile("data/D ejaVuSans.ttf");
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "ERROR while loading font DejaVuSans : " << e. // Removed this warning practically allowing to package the
what(); program without the font file.
// This is useful for distribution having already a package
for DejaVu font.
// qWarning() << "ERROR while loading font DejaVuSans : " <<
e.what();
} }
if (!fName.isEmpty()) if (!fName.isEmpty())
QFontDatabase::addApplicationFont(fName); QFontDatabase::addApplicationFont(fName);
// Init the main window. It must be done here because it is not the responsability of StelApp to do that // Init the main window. It must be done here because it is not the responsability of StelApp to do that
QCoreApplication::processEvents();
QSettings* settings = StelApp::getInstance().getSettings(); QSettings* settings = StelApp::getInstance().getSettings();
resize(settings->value("video/screen_w", 800).toInt(), settings->val ue("video/screen_h", 600).toInt()); resize(settings->value("video/screen_w", 800).toInt(), settings->val ue("video/screen_h", 600).toInt());
if (settings->value("video/fullscreen", true).toBool()) if (settings->value("video/fullscreen", true).toBool())
{ {
showFullScreen(); showFullScreen();
} }
else else
{ {
show(); show();
} }
StelMainGraphicsView::getInstance().init(); StelMainGraphicsView::getInstance().init();
skipping to change at line 108 skipping to change at line 115
void StelMainWindow::setFullScreen(bool b) void StelMainWindow::setFullScreen(bool b)
{ {
if (b) if (b)
showFullScreen(); showFullScreen();
else else
showNormal(); showNormal();
} }
void StelMainWindow::closeEvent(QCloseEvent* event) void StelMainWindow::closeEvent(QCloseEvent* event)
{ {
StelMainGraphicsView::getInstance().deinitGL(); event->ignore();
QCoreApplication::exit(); ((StelGui*)GETSTELMODULE("StelGui"))->quitStellarium();
} }
void StelMainWindow::resizeEvent(QResizeEvent* event) void StelMainWindow::resizeEvent(QResizeEvent* event)
{ {
QMainWindow::resizeEvent(event); QMainWindow::resizeEvent(event);
} }
 End of changes. 6 change blocks. 
5 lines changed or deleted 14 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/