summaryrefslogtreecommitdiffstats
path: root/application/SettingsUI.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-07-05 02:29:41 +0200
committerPetr Mrázek <peterix@gmail.com>2015-07-05 02:29:41 +0200
commit5f41886d76c11fe8befe8d059c75dcb5bc11f78d (patch)
tree1d5917d7492014c52276528f5aafc6f7e7665872 /application/SettingsUI.h
parent7f1320390c55e408a4b0081b2606eab3892a8148 (diff)
downloadMultiMC-5f41886d76c11fe8befe8d059c75dcb5bc11f78d.tar
MultiMC-5f41886d76c11fe8befe8d059c75dcb5bc11f78d.tar.gz
MultiMC-5f41886d76c11fe8befe8d059c75dcb5bc11f78d.tar.lz
MultiMC-5f41886d76c11fe8befe8d059c75dcb5bc11f78d.tar.xz
MultiMC-5f41886d76c11fe8befe8d059c75dcb5bc11f78d.zip
GH-1053 split settings dialog creation to its own namespace
Diffstat (limited to 'application/SettingsUI.h')
-rw-r--r--application/SettingsUI.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/application/SettingsUI.h b/application/SettingsUI.h
new file mode 100644
index 00000000..1e6dc8d0
--- /dev/null
+++ b/application/SettingsUI.h
@@ -0,0 +1,28 @@
+#pragma once
+#include "pages/BasePageProvider.h"
+#include "MultiMC.h"
+#include "pagedialog/PageDialog.h"
+#include "InstancePageProvider.h"
+#include <settings/SettingsObject.h>
+#include <BaseInstance.h>
+
+/*
+ * FIXME: this is a fragment. find a better place for it.
+ */
+namespace SettingsUI
+{
+template <typename T>
+void ShowPageDialog(T raw_provider, QWidget * parent, QString open_page = QString())
+{
+ auto provider = std::dynamic_pointer_cast<BasePageProvider>(raw_provider);
+ if(!provider)
+ return;
+ {
+ SettingsObject::Lock lock(MMC->settings());
+ PageDialog dlg(provider, open_page, parent);
+ dlg.exec();
+ }
+}
+
+void ShowInstancePageDialog(InstancePtr instance, QWidget * parent, QString open_page = QString());
+}