Merge pull request #6687 from spycrab/qt_graphics_caps

Qt/GraphicsWindow: Disable unsupported options
This commit is contained in:
Léo Lam 2018-04-28 00:35:47 +02:00 committed by GitHub
commit 9c63bae19a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 0 deletions

View File

@ -165,6 +165,16 @@ void EnhancementsWidget::LoadSettings()
m_pp_effect->setCurrentIndex(m_pp_effect->count() - 1);
}
const bool supports_postprocessing = g_Config.backend_info.bSupportsPostProcessing;
m_pp_effect->setEnabled(supports_postprocessing);
if (!supports_postprocessing)
{
m_pp_effect->setToolTip(
tr("%1 doesn't support this feature.")
.arg(QString::fromStdString(SConfig::GetInstance().m_strVideoBackend)));
}
PostProcessingShaderConfiguration pp_shader;
if (selected_shader != "(off)")
{

View File

@ -13,6 +13,7 @@
#include "Core/ConfigManager.h"
#include "DolphinQt2/Config/Graphics/GraphicsBool.h"
#include "DolphinQt2/Config/Graphics/GraphicsSlider.h"
#include "DolphinQt2/Config/Graphics/GraphicsWindow.h"
#include "VideoCommon/VideoConfig.h"
HacksWidget::HacksWidget(GraphicsWindow* parent) : GraphicsWidget(parent)
@ -21,6 +22,9 @@ HacksWidget::HacksWidget(GraphicsWindow* parent) : GraphicsWidget(parent)
LoadSettings();
ConnectWidgets();
AddDescriptions();
connect(parent, &GraphicsWindow::BackendChanged, this, &HacksWidget::OnBackendChanged);
OnBackendChanged(QString::fromStdString(SConfig::GetInstance().m_strVideoBackend));
}
void HacksWidget::CreateWidgets()
@ -98,6 +102,21 @@ void HacksWidget::CreateWidgets()
setLayout(main_layout);
}
void HacksWidget::OnBackendChanged(const QString& backend_name)
{
const bool bbox = g_Config.backend_info.bSupportsBBox;
const bool gpu_texture_decoding = g_Config.backend_info.bSupportsGPUTextureDecoding;
m_gpu_texture_decoding->setEnabled(gpu_texture_decoding);
m_disable_bounding_box->setEnabled(bbox);
if (!gpu_texture_decoding)
m_gpu_texture_decoding->setToolTip(tr("%1 doesn't support this feature.").arg(backend_name));
if (!bbox)
m_disable_bounding_box->setToolTip(tr("%1 doesn't support this feature.").arg(backend_name));
}
void HacksWidget::ConnectWidgets()
{
connect(m_accuracy, &QSlider::valueChanged, [this](int) { SaveSettings(); });

View File

@ -21,6 +21,8 @@ private:
void LoadSettings() override;
void SaveSettings() override;
void OnBackendChanged(const QString& backend_name);
// EFB
QCheckBox* m_skip_efb_cpu;
QCheckBox* m_ignore_format_changes;