summaryrefslogtreecommitdiffstats
path: root/application/SettingsUI.h
blob: 474bc1ab31da329df9e41b69a12f0228f1953ff3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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.get(), open_page, parent);
        dlg.exec();
    }
}
}