From 6e5017e48b633e20bbba61ac2e7cd58e693aec4e Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 19 Feb 2013 12:15:22 -0600 Subject: Implemented loadList() stuff. --- gui/mainwindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gui/mainwindow.cpp') diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index bc0840a0..d19d69dc 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -29,6 +29,7 @@ #include "gui/logindialog.h" #include "gui/taskdialog.h" +#include "data/inst/instancelist.h" #include "data/appsettings.h" #include "data/version.h" @@ -36,7 +37,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), - ui(new Ui::MainWindow) + ui(new Ui::MainWindow), + instList(settings->getInstanceDir()) { ui->setupUi(this); @@ -45,8 +47,7 @@ MainWindow::MainWindow(QWidget *parent) : restoreGeometry(settings->getConfig().value("MainWindowGeometry", saveGeometry()).toByteArray()); restoreState(settings->getConfig().value("MainWindowState", saveState()).toByteArray()); - instList.initialLoad("instances"); - ui->instanceView->setModel(&instList); + instList.loadList(); } MainWindow::~MainWindow() @@ -67,7 +68,7 @@ void MainWindow::on_actionViewInstanceFolder_triggered() void MainWindow::on_actionRefresh_triggered() { - instList.initialLoad("instances"); + instList.loadList(); } void MainWindow::on_actionViewCentralModsFolder_triggered() -- cgit v1.2.3 From dd2e836b4cf4cfa043f9ea2911f58f1d22d4e282 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 20 Feb 2013 19:10:09 -0600 Subject: Split MultiMC up into a few separate libraries. Fixed plugin system. Tons of other stuff... --- gui/mainwindow.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'gui/mainwindow.cpp') 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 #include +#include -#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()); +} -- cgit v1.2.3