diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/mainwindow.cpp | 16 | ||||
-rw-r--r-- | gui/mainwindow.h | 2 | ||||
-rw-r--r-- | gui/settingsdialog.cpp | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index d19d69dc..19ff2108 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -21,20 +21,25 @@ #include <QDesktopServices> #include <QUrl> +#include <QFileInfo> -#include "util/osutils.h" +#include "osutils.h" #include "gui/settingsdialog.h" #include "gui/newinstancedialog.h" #include "gui/logindialog.h" #include "gui/taskdialog.h" -#include "data/inst/instancelist.h" -#include "data/appsettings.h" +#include "instancelist.h" +#include "appsettings.h" #include "data/version.h" #include "tasks/logintask.h" +// Opens the given file in the default application. +// TODO: Move this somewhere. +void openInDefaultProgram(QString filename); + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), @@ -156,3 +161,8 @@ void MainWindow::onLoginComplete(LoginResponse response) QString("Logged in as %1 with session ID %2."). arg(response.getUsername(), response.getSessionID())); } + +void openInDefaultProgram(QString filename) +{ + QDesktopServices::openUrl("file:///" + QFileInfo(filename).absolutePath()); +} diff --git a/gui/mainwindow.h b/gui/mainwindow.h index d286bd0e..591d0632 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -18,7 +18,7 @@ #include <QMainWindow> -#include "data/inst/instancelist.h" +#include "instancelist.h" #include "data/loginresponse.h" namespace Ui diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index ab4d18ee..b3c42380 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -16,7 +16,7 @@ #include "settingsdialog.h" #include "ui_settingsdialog.h" -#include "data/appsettings.h" +#include "appsettings.h" #include <QFileDialog> #include <QMessageBox> |