summaryrefslogtreecommitdiffstats
path: root/gui/MainWindow.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-06-09 01:29:18 +0200
committerPetr Mrázek <peterix@gmail.com>2014-06-09 01:38:31 +0200
commit171325d42784a69ac3cadc6ab330603e258eec02 (patch)
tree6485fc30e3c106e512134dccddb95b384f7b77e6 /gui/MainWindow.cpp
parentbe73eb3322b6bb5ab1144f9942ef9bd188c704a1 (diff)
downloadMultiMC-171325d42784a69ac3cadc6ab330603e258eec02.tar
MultiMC-171325d42784a69ac3cadc6ab330603e258eec02.tar.gz
MultiMC-171325d42784a69ac3cadc6ab330603e258eec02.tar.lz
MultiMC-171325d42784a69ac3cadc6ab330603e258eec02.tar.xz
MultiMC-171325d42784a69ac3cadc6ab330603e258eec02.zip
Instance settings moved to a page.
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r--gui/MainWindow.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp
index 830a4fb4..e9cfd361 100644
--- a/gui/MainWindow.cpp
+++ b/gui/MainWindow.cpp
@@ -56,7 +56,6 @@
#include "gui/dialogs/VersionSelectDialog.h"
#include "gui/dialogs/CustomMessageBox.h"
#include "gui/dialogs/LwjglSelectDialog.h"
-#include "gui/dialogs/InstanceSettings.h"
#include "gui/dialogs/IconPickerDialog.h"
#include "gui/dialogs/EditNotesDialog.h"
#include "gui/dialogs/CopyInstanceDialog.h"
@@ -944,12 +943,13 @@ void MainWindow::on_actionSettings_triggered()
void MainWindow::on_actionInstanceSettings_triggered()
{
- if (m_selectedInstance)
- {
- InstanceSettings settings(&m_selectedInstance->settings(), this);
- settings.setWindowTitle(tr("Instance settings"));
- settings.exec();
- }
+ if (!m_selectedInstance)
+ return;
+ auto provider = std::dynamic_pointer_cast<BasePageProvider>(m_selectedInstance);
+ if(!provider)
+ return;
+ PageDialog dlg(provider, "settings" , this);
+ dlg.exec();
}
void MainWindow::on_actionManageAccounts_triggered()
@@ -1042,19 +1042,13 @@ void MainWindow::on_actionViewSelectedInstFolder_triggered()
void MainWindow::on_actionEditInstance_triggered()
{
- if (m_selectedInstance)
- {
- auto provider = std::dynamic_pointer_cast<BasePageProvider>(m_selectedInstance);
- if(!provider)
- {
- QLOG_ERROR() << "Instance can't be converted to BasePageProvider (NYI)";
- return;
- }
- auto dialog = new PageDialog(provider, this);
- if (dialog)
- dialog->exec();
- dialog->deleteLater();
- }
+ if (!m_selectedInstance)
+ return;
+ auto provider = std::dynamic_pointer_cast<BasePageProvider>(m_selectedInstance);
+ if(!provider)
+ return;
+ PageDialog dlg(provider, "" , this);
+ dlg.exec();
}
void MainWindow::closeEvent(QCloseEvent *event)