1#include "QIsisApplication.h"
5#include <QDesktopServices>
12#include "Preference.h"
13#include "IException.h"
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);
File name manipulation and expansion.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
const char * what() const
Returns a string representation of this exception in its current state.
void openUrl(QUrl url)
Open a URL in the browser specified by Isis.
QIsisApplication(int &argc, char *argv[])
Constructor.
virtual bool notify(QObject *rec, QEvent *ev)
notify - this function overrides the QApplication notify as QT event handlers do not handle exception...
This is free and unencumbered software released into the public domain.