2015-07-05 01:29:41 +01:00
|
|
|
#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())
|
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
auto provider = std::dynamic_pointer_cast<BasePageProvider>(raw_provider);
|
|
|
|
if(!provider)
|
|
|
|
return;
|
|
|
|
{
|
|
|
|
SettingsObject::Lock lock(MMC->settings());
|
|
|
|
PageDialog dlg(provider.get(), open_page, parent);
|
|
|
|
dlg.exec();
|
|
|
|
}
|
2015-07-05 01:29:41 +01:00
|
|
|
}
|
|
|
|
}
|