5 #include <QDesktopServices> 33 for (
int i = 1; i < argc; i++) {
35 if (arg.startsWith(
"-pref")) {
38 int nextIndex = i + 1;
40 if (nextIndex < argc) {
41 FileName preferenceFile(argv[nextIndex]);
42 QString filePath = preferenceFile.
expanded();
43 Preference::Preferences().clear();
44 Preference::Preferences().Load(filePath);
47 QMessageBox::warning(NULL,
"Warning",
"Preference flag set but no preference file given.");
51 setlocale(LC_NUMERIC,
"en_US");
53 QDesktopServices::setUrlHandler(
"http",
this,
"openUrl");
76 return QApplication::notify(rec, ev);
79 QMessageBox::critical(NULL,
"Error", e.
what());
89 QDesktopServices::openUrl(url);
const char * what() const
Returns a string representation of this exception in its current state.
File name manipulation and expansion.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
virtual bool notify(QObject *rec, QEvent *ev)
notify - this function overrides the QApplication notify as QT event handlers do not handle exception...
QIsisApplication(int &argc, char *argv[])
Constructor.
Namespace for ISIS/Bullet specific routines.
void openUrl(QUrl url)
Open a URL in the browser specified by Isis.