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);