Qt/DevelopmentWarning: Add "Don't show me this warning again" option
This commit is contained in:
parent
ab27f0f78c
commit
0d3c4a3883
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QCommandLinkButton>
|
#include <QCommandLinkButton>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
@ -12,6 +13,7 @@
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
|
|
||||||
|
#include "Core/ConfigManager.h"
|
||||||
#include "DolphinQt2/InDevelopmentWarning.h"
|
#include "DolphinQt2/InDevelopmentWarning.h"
|
||||||
#include "DolphinQt2/Resources.h"
|
#include "DolphinQt2/Resources.h"
|
||||||
|
|
||||||
|
@ -40,6 +42,7 @@ InDevelopmentWarning::InDevelopmentWarning(QWidget* parent)
|
||||||
QCommandLinkButton* btn_dolphinwx = new QCommandLinkButton(
|
QCommandLinkButton* btn_dolphinwx = new QCommandLinkButton(
|
||||||
tr("Run DolphinWX Instead"), tr("Recommended for normal users"), container);
|
tr("Run DolphinWX Instead"), tr("Recommended for normal users"), container);
|
||||||
QCommandLinkButton* btn_run = new QCommandLinkButton(tr("Use DolphinQt Anyway"), container);
|
QCommandLinkButton* btn_run = new QCommandLinkButton(tr("Use DolphinQt Anyway"), container);
|
||||||
|
QCheckBox* hide_future = new QCheckBox(tr("Don't show me this warning again"));
|
||||||
|
|
||||||
container->setForegroundRole(QPalette::Text);
|
container->setForegroundRole(QPalette::Text);
|
||||||
container->setBackgroundRole(QPalette::Base);
|
container->setBackgroundRole(QPalette::Base);
|
||||||
|
@ -87,12 +90,15 @@ InDevelopmentWarning::InDevelopmentWarning(QWidget* parent)
|
||||||
connect(btn_run, &QCommandLinkButton::clicked, this, [this](bool) { accept(); });
|
connect(btn_run, &QCommandLinkButton::clicked, this, [this](bool) { accept(); });
|
||||||
connect(std_buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this,
|
connect(std_buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this,
|
||||||
[this](bool) { reject(); });
|
[this](bool) { reject(); });
|
||||||
|
connect(hide_future, &QCheckBox::toggled,
|
||||||
|
[](bool hide) { SConfig::GetInstance().m_show_development_warning = !hide; });
|
||||||
|
|
||||||
QVBoxLayout* body_column = new QVBoxLayout();
|
QVBoxLayout* body_column = new QVBoxLayout();
|
||||||
body_column->addWidget(heading);
|
body_column->addWidget(heading);
|
||||||
body_column->addWidget(body);
|
body_column->addWidget(body);
|
||||||
body_column->addWidget(btn_dolphinwx);
|
body_column->addWidget(btn_dolphinwx);
|
||||||
body_column->addWidget(btn_run);
|
body_column->addWidget(btn_run);
|
||||||
|
body_column->addWidget(hide_future);
|
||||||
body_column->setMargin(0);
|
body_column->setMargin(0);
|
||||||
body_column->setSpacing(10);
|
body_column->setSpacing(10);
|
||||||
|
|
||||||
|
|
|
@ -79,8 +79,6 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
// There's intentionally no way to set this from the UI.
|
|
||||||
// Add it to your INI manually instead.
|
|
||||||
if (SConfig::GetInstance().m_show_development_warning)
|
if (SConfig::GetInstance().m_show_development_warning)
|
||||||
{
|
{
|
||||||
InDevelopmentWarning warning_box;
|
InDevelopmentWarning warning_box;
|
||||||
|
|
Loading…
Reference in New Issue