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 QApplication application(argc, argv);
76 QPixmap splash_pm(
":BALLView-1.4-Splashscreen.png");
77 QSplashScreen* splash =
new QSplashScreen(splash_pm);
81 if (!QGLFormat::hasOpenGL())
83 QMessageBox::critical(0,
"Error while starting BALLView",
84 "Your computer has no OpenGL support, please install the correct drivers. Aborting for now...",
85 QMessageBox::Ok, Qt::NoButton, Qt::NoButton);
95 if (f.
hasEntry(
"GENERAL",
"language"))
97 QString str = f.
getValue(
"GENERAL",
"language").c_str();
99 if (!(str ==
"Default"))
101 QString loc =
"BALLView." + str;
104 QStringList dpaths = QString(p.
getDataPath().c_str()).split(
"\n");
106 QTranslator* translator =
new QTranslator(&application);
107 foreach(QString str, dpaths)
109 translator->load(loc, str +
"BALLView/translations");
110 if (!translator->isEmpty())
112 QCoreApplication::installTranslator(translator);
126 BALL::File out(temp_file_name, std::ios::out);
127 out <<
"test" << std::endl;
132 QMessageBox::warning(0,
"Error while starting BALLView",
133 QString(
"You dont have write access to the current working directory\n") +
134 "and BALLView can not find your home directory. This can cause\n" +
135 "unexpected behaviour. Please start BALLView from your homedir with\n" +
136 "absolute path (e.g. C:\\Programs\\BALLView\\BALLView).\n");
162 if (argument ==
"-l")
179 splash->finish(&mainframe);
183 return application.exec();