1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

Make impossible to disable fatal errors

This commit is contained in:
Nekotekina 2017-08-26 22:35:56 +03:00
parent aa5dc5455e
commit d98f739043

View File

@ -150,10 +150,6 @@ void log_frame::SetLogLevel(logs::level lev)
switch (lev)
{
case logs::level::always:
{
nothingAct->trigger();
break;
}
case logs::level::fatal:
{
fatalAct->trigger();
@ -209,12 +205,11 @@ void log_frame::CreateAndConnectActions()
act->setCheckable(true);
// This sets the log level properly when the action is triggered.
auto l_callback = [this, logLevel]() {
s_gui_listener.enabled = logLevel;
connect(act, &QAction::triggered, [this, logLevel]()
{
s_gui_listener.enabled = std::max(logLevel, logs::level::fatal);
xgui_settings->SetValue(GUI::l_level, static_cast<uint>(logLevel));
};
connect(act, &QAction::triggered, l_callback);
});
};
clearAct = new QAction(tr("Clear"), this);
@ -223,6 +218,7 @@ void log_frame::CreateAndConnectActions()
// Action groups make these actions mutually exclusive.
logLevels = new QActionGroup(this);
nothingAct = new QAction(tr("Nothing"), logLevels);
nothingAct->setVisible(false);
fatalAct = new QAction(tr("Fatal"), logLevels);
errorAct = new QAction(tr("Error"), logLevels);
todoAct = new QAction(tr("Todo"), logLevels);
@ -244,7 +240,7 @@ void log_frame::CreateAndConnectActions()
xgui_settings->SetValue(GUI::l_tty, checked);
});
l_initAct(nothingAct, logs::level::always);
l_initAct(nothingAct, logs::level::fatal);
l_initAct(fatalAct, logs::level::fatal);
l_initAct(errorAct, logs::level::error);
l_initAct(todoAct, logs::level::todo);