22
22
#include <QTranslator>
23
23
#include "StelMainGraphicsView.hpp"
24
24
#include "StelMainWindow.hpp"
25
#include "Translator.hpp"
25
#include "StelTranslator.hpp"
27
27
#include <QGLFormat>
28
28
#include <QPlastiqueStyle>
30
#include "StelMacosxDirs.hpp"
30
//! @class GettextTranslator
33
//! @class GettextStelTranslator
31
34
//! Provides i18n support through gettext.
32
class GettextTranslator : public QTranslator
35
class GettextStelTranslator : public QTranslator
35
38
virtual bool isEmpty() const { return false; }
44
47
// Main stellarium procedure
45
48
int main(int argc, char **argv)
47
QApplication::setDesktopSettingsAware(false);
50
QCoreApplication::setApplicationName("stellarium");
51
QCoreApplication::setApplicationVersion(StelApp::getApplicationVersion());
52
QCoreApplication::setOrganizationDomain("stellarium.org");
53
QCoreApplication::setOrganizationName("stellarium");
55
//QApplication::setDesktopSettingsAware(false);
48
56
QApplication::setStyle(new QPlastiqueStyle());
49
QApplication app(argc, argv);
50
//app.setQuitOnLastWindowClosed(false);
51
GettextTranslator trans;
58
// With Qt 4.5, force the usage of the raster backend
59
char** argv2 = (char**)malloc(sizeof(char*)*(argc+2));
60
memcpy(argv2, argv, argc*sizeof(char*));
61
char cmd1[] = "-graphicssystem";
62
char cmd2[] = "raster";
66
QApplication app(argc2, argv2);
69
StelMacosxDirs::addApplicationPluginDirectory();
71
GettextStelTranslator trans;
52
72
app.installTranslator(&trans);
53
73
if (!QGLFormat::hasOpenGL())
55
QMessageBox::information(0, "Stellarium", q_("This system does not support OpenGL."));
75
QMessageBox::warning(0, "Stellarium", q_("This system does not support OpenGL."));
78
StelMainWindow* mainWin = new StelMainWindow(NULL);
58
79
StelMainGraphicsView* view = new StelMainGraphicsView(NULL, argc, argv);
59
StelMainWindow* mainWin = new StelMainWindow(NULL);
60
80
mainWin->setCentralWidget(view);