mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 06:39:14 +01:00
Factorize software renderer backend switching warning to be fetched from a new GetWarningMessage in video backend - will be needed for DX11.1 feature set warnings
This commit is contained in:
parent
799c52463e
commit
890f781cd0
@ -160,16 +160,16 @@ void GeneralWidget::SaveSettings()
|
|||||||
const auto current_backend = m_backend_combo->currentData().toString().toStdString();
|
const auto current_backend = m_backend_combo->currentData().toString().toStdString();
|
||||||
if (SConfig::GetInstance().m_strVideoBackend != current_backend)
|
if (SConfig::GetInstance().m_strVideoBackend != current_backend)
|
||||||
{
|
{
|
||||||
if (current_backend == "Software Renderer")
|
auto warningMessage =
|
||||||
|
g_available_video_backends[m_backend_combo->currentIndex()]->GetWarningMessage();
|
||||||
|
if (warningMessage)
|
||||||
{
|
{
|
||||||
ModalMessageBox confirm_sw(this);
|
ModalMessageBox confirm_sw(this);
|
||||||
|
|
||||||
confirm_sw.setIcon(QMessageBox::Warning);
|
confirm_sw.setIcon(QMessageBox::Warning);
|
||||||
confirm_sw.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
confirm_sw.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||||
confirm_sw.setWindowTitle(tr("Confirm backend change"));
|
confirm_sw.setWindowTitle(tr("Confirm backend change"));
|
||||||
confirm_sw.setText(tr("The software renderer is significantly slower than other "
|
confirm_sw.setText(tr(warningMessage->c_str()));
|
||||||
"backends and is only recommended for debugging purposes.\n\nDo you "
|
|
||||||
"really want to enable software rendering? If unsure, select 'No'."));
|
|
||||||
|
|
||||||
if (confirm_sw.exec() != QMessageBox::Yes)
|
if (confirm_sw.exec() != QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
|
@ -53,6 +53,13 @@ std::string VideoSoftware::GetDisplayName() const
|
|||||||
return _trans("Software Renderer");
|
return _trans("Software Renderer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<std::string> VideoSoftware::GetWarningMessage() const
|
||||||
|
{
|
||||||
|
return _trans("The software renderer is significantly slower than other "
|
||||||
|
"backends and is only recommended for debugging purposes.\n\nDo you "
|
||||||
|
"really want to enable software rendering? If unsure, select 'No'.");
|
||||||
|
}
|
||||||
|
|
||||||
void VideoSoftware::InitBackendInfo()
|
void VideoSoftware::InitBackendInfo()
|
||||||
{
|
{
|
||||||
g_Config.backend_info.api_type = APIType::Nothing;
|
g_Config.backend_info.api_type = APIType::Nothing;
|
||||||
|
@ -16,6 +16,7 @@ class VideoSoftware : public VideoBackendBase
|
|||||||
|
|
||||||
std::string GetName() const override;
|
std::string GetName() const override;
|
||||||
std::string GetDisplayName() const override;
|
std::string GetDisplayName() const override;
|
||||||
|
std::optional<std::string> GetWarningMessage() const override;
|
||||||
|
|
||||||
void InitBackendInfo() override;
|
void InitBackendInfo() override;
|
||||||
};
|
};
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -42,6 +43,7 @@ public:
|
|||||||
virtual std::string GetName() const = 0;
|
virtual std::string GetName() const = 0;
|
||||||
virtual std::string GetDisplayName() const { return GetName(); }
|
virtual std::string GetDisplayName() const { return GetName(); }
|
||||||
virtual void InitBackendInfo() = 0;
|
virtual void InitBackendInfo() = 0;
|
||||||
|
virtual std::optional<std::string> GetWarningMessage() const { return {}; }
|
||||||
|
|
||||||
// Prepares a native window for rendering. This is called on the main thread, or the
|
// Prepares a native window for rendering. This is called on the main thread, or the
|
||||||
// thread which owns the window.
|
// thread which owns the window.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user