mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 05:07:46 +02:00
GH-1053 split settings dialog creation to its own namespace
This commit is contained in:
28
application/SettingsUI.h
Normal file
28
application/SettingsUI.h
Normal file
@ -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());
|
||||
}
|
Reference in New Issue
Block a user