6 #include <QtGui/QApplication>
7 #include <BALL/CONFIG/config.h>
13 #include <QtCore/QLocale>
14 #include <QtCore/QTranslator>
16 #include <QtGui/QMessageBox>
17 #include <QtGui/QSplashScreen>
18 #include <QtOpenGL/qgl.h>
46 fprintf( stderr,
"Fatal: %s\n", msg );
49 fprintf( stderr,
"Critical: %s\n", msg );
58 #ifndef BALL_OS_WINDOWS
59 int main(
int argc,
char **argv)
62 int WINAPI WinMain(HINSTANCE, HINSTANCE, PSTR cmd_line,
int)
74 putenv(
"BALL_RETURN_VALUE=");
75 QApplication application(argc, argv);
77 QPixmap splash_pm(
":BALLView-1.4-Splashscreen.png");
78 QSplashScreen* splash =
new QSplashScreen(splash_pm);
82 if (!QGLFormat::hasOpenGL())
84 QMessageBox::critical(0,
"Error while starting BALLView",
85 "Your computer has no OpenGL support, please install the correct drivers. Aborting for now...",
86 QMessageBox::Ok, Qt::NoButton, Qt::NoButton);
96 if (f.
hasEntry(
"GENERAL",
"language"))
98 QString str = f.
getValue(
"GENERAL",
"language").c_str();
100 if (!(str ==
"Default"))
102 QString loc =
"BALLView." + str;
105 QStringList dpaths = QString(p.
getDataPath().c_str()).split(
"\n");
107 QTranslator* translator =
new QTranslator(&application);
108 foreach(QString str, dpaths)
110 translator->load(loc, str +
"BALLView/translations");
111 if (!translator->isEmpty())
113 QCoreApplication::installTranslator(translator);
127 BALL::File out(temp_file_name, std::ios::out);
128 out <<
"test" << std::endl;
133 QMessageBox::warning(0,
"Error while starting BALLView",
134 QString(
"You dont have write access to the current working directory\n") +
135 "and BALLView can not find your home directory. This can cause\n" +
136 "unexpected behaviour. Please start BALLView from your homedir with\n" +
137 "absolute path (e.g. C:\\Programs\\BALLView\\BALLView).\n");
163 if (argument ==
"-l")
180 splash->finish(&mainframe);
184 int value = application.exec();
185 char* return_value = getenv(
"BALL_RETURN_VALUE");
186 if (return_value != 0)