summaryrefslogtreecommitdiffstats
path: root/application/MainWindow.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2019-06-01 12:28:53 +0200
committerPetr Mrázek <peterix@gmail.com>2019-06-01 12:28:53 +0200
commit932160818e8e15dc124e1ce281749d28e10c5e66 (patch)
tree1924f82fffccf54ef14cbfcd8a7f25ccda53daaf /application/MainWindow.cpp
parent59e1ed3d8750b499b6d515a82bc08f6f72cc456a (diff)
downloadMultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.tar
MultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.tar.gz
MultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.tar.lz
MultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.tar.xz
MultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.zip
NOISSUE add option to open global settings from instance settings
This should hopefully giude people towards using the right thing.
Diffstat (limited to 'application/MainWindow.cpp')
-rw-r--r--application/MainWindow.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 34dfb369..bec57c0d 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -70,7 +70,6 @@
#include "InstanceProxyModel.h"
#include "JavaCommon.h"
#include "LaunchController.h"
-#include "SettingsUI.h"
#include "groupview/GroupView.h"
#include "groupview/InstanceDelegate.h"
#include "widgets/LabeledToolButton.h"
@@ -703,6 +702,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
// model reset -> selection is invalid. All the instance pointers are wrong.
connect(MMC->instances().get(), &InstanceList::dataIsInvalid, this, &MainWindow::selectionBad);
+ // When the global settings page closes, we want to know about it and update our state
+ connect(MMC, &MultiMC::globalSettingsClosed, this, &MainWindow::globalSettingsClosed);
+
m_statusLeft = new QLabel(tr("No instance selected"), this);
m_statusRight = new ServerStatus(this);
statusBar()->addPermanentWidget(m_statusLeft, 1);
@@ -1572,7 +1574,11 @@ void MainWindow::checkForUpdates()
void MainWindow::on_actionSettings_triggered()
{
- SettingsUI::ShowPageDialog(MMC->globalSettingsPages(), this, "global-settings");
+ MMC->ShowGlobalSettings(this, "global-settings");
+}
+
+void MainWindow::globalSettingsClosed()
+{
// FIXME: quick HACK to make this work. improve, optimize.
MMC->instances()->loadList();
proxymodel->invalidate();
@@ -1608,7 +1614,7 @@ void MainWindow::on_actionScreenshots_triggered()
void MainWindow::on_actionManageAccounts_triggered()
{
- SettingsUI::ShowPageDialog(MMC->globalSettingsPages(), this, "accounts");
+ MMC->ShowGlobalSettings(this, "accounts");
}
void MainWindow::on_actionReportBug_triggered()