29 #include <QApplication>
30 #include <QMessageBox>
45 int simPTGUIMode::operator()(
int argc,
char **argv)
47 int exit_status = EXIT_SUCCESS;
50 QApplication app(argc, argv,
true);
51 qRegisterMetaType<std::string>(
"std::string");
52 QObject::connect(qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()));
56 cout <<
"simPT_sim starting up in gui mode at: " <<
TimeStamp().
ToString() << endl;
57 cout <<
"Executing " << argv[0]<< endl << endl;
58 cout <<
"Revision: " << RevisionInfo::CompoundId() << endl;
61 QStringList search_paths = QIcon::themeSearchPaths();
63 QIcon::setThemeSearchPaths(search_paths);
64 QIcon::setThemeName(
"Tango");
67 QPalette tooltippalette = QToolTip::palette();
68 QColor transparentcolor = QColor(tooltippalette.brush(QPalette::Window).color());
69 tooltippalette.setBrush(QPalette::Window, QBrush(transparentcolor));
70 QToolTip::setPalette(tooltippalette);
71 qApp->setStyleSheet(
"QToolTip { color: red; border: 2px solid gray; }");
74 auto factory = make_shared<Gui::AppCustomizer>();
76 controller.setVisible(
true);
79 exit_status = app.exec();
82 cout << endl << controller.GetTimings() << endl << endl;
85 catch (exception& e) {
86 cerr << e.what() << endl;
87 QString qmess = QString(
"Exception:\n%1\n").arg(e.what());
88 QMessageBox::critical(0,
"Critical Error", qmess,
89 QMessageBox::Abort, QMessageBox::NoButton, QMessageBox::NoButton);
90 exit_status = EXIT_FAILURE;
93 cerr <<
"Unknown exception." << endl;
94 QString qmess = QString(
"Unknown exception.");
95 QMessageBox::critical(0,
"Critical Error", qmess);
96 exit_status = EXIT_FAILURE;
static std::string GetDataDir()
Utility method: get name of the directory for data files.
Info on git revision and commit date.
Namespace for miscellaneous utilities.
Namespace for SimPT shell package.
Namespace for startup modes for simPT tools.
Interface/Implementation for the exec modes.
Interface for AppCustomizer.
Interfaces for simulator session.
Provides wall-clock time stamp using the time call.
std::string ToString() const
Returns string with the time stamp after eliminating newline.
Namespace for controllers for App, Workspace, Project and Session.
Namespace for clock and timekeeping related classes.