mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Qt: save some log viewer filter settings
This commit is contained in:
parent
41e9e0b965
commit
46a50265a3
@ -115,6 +115,7 @@ namespace gui
|
||||
const QString localization = "Localization";
|
||||
const QString pad_settings = "PadSettings";
|
||||
const QString config = "Config";
|
||||
const QString log_viewer = "LogViewer";
|
||||
|
||||
const QString update_on = "true";
|
||||
const QString update_off = "false";
|
||||
@ -252,6 +253,10 @@ namespace gui
|
||||
|
||||
const gui_save pads_show_emulated = gui_save(pad_settings, "show_emulated_values", false);
|
||||
const gui_save pads_geometry = gui_save(pad_settings, "geometry", QByteArray());
|
||||
|
||||
const gui_save lv_show_timestamps = gui_save(log_viewer, "show_timestamps", true);
|
||||
const gui_save lv_show_threads = gui_save(log_viewer, "show_threads", true);
|
||||
const gui_save lv_log_levels = gui_save(log_viewer, "log_levels", 0b11111111u);
|
||||
}
|
||||
|
||||
/** Class for GUI settings..
|
||||
|
@ -41,6 +41,9 @@ log_viewer::log_viewer(std::shared_ptr<gui_settings> gui_settings)
|
||||
resize(QSize(620, 395));
|
||||
|
||||
m_path_last = m_gui_settings->GetValue(gui::fd_log_viewer).toString();
|
||||
m_show_timestamps = m_gui_settings->GetValue(gui::lv_show_timestamps).toBool();
|
||||
m_show_threads = m_gui_settings->GetValue(gui::lv_show_threads).toBool();
|
||||
m_log_levels = std::bitset<32>(m_gui_settings->GetValue(gui::lv_log_levels).toUInt());
|
||||
|
||||
m_log_text = new QPlainTextEdit(this);
|
||||
m_log_text->setReadOnly(true);
|
||||
@ -99,6 +102,7 @@ void log_viewer::show_context_menu(const QPoint& pos)
|
||||
connect(act, &QAction::triggered, this, [this, logLevel](bool checked)
|
||||
{
|
||||
m_log_levels.set(static_cast<u32>(logLevel), checked);
|
||||
m_gui_settings->SetValue(gui::lv_log_levels, ::narrow<u32>(m_log_levels.to_ulong()));
|
||||
filter_log();
|
||||
});
|
||||
};
|
||||
@ -169,12 +173,14 @@ void log_viewer::show_context_menu(const QPoint& pos)
|
||||
connect(threads, &QAction::toggled, this, [this](bool checked)
|
||||
{
|
||||
m_show_threads = checked;
|
||||
m_gui_settings->SetValue(gui::lv_show_threads, m_show_threads);
|
||||
filter_log();
|
||||
});
|
||||
|
||||
connect(timestamps, &QAction::toggled, this, [this](bool checked)
|
||||
{
|
||||
m_show_timestamps = checked;
|
||||
m_gui_settings->SetValue(gui::lv_show_timestamps, m_show_timestamps);
|
||||
filter_log();
|
||||
});
|
||||
|
||||
@ -353,12 +359,10 @@ void log_viewer::filter_log()
|
||||
set_text_and_keep_position(result);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
QMessageBox::information(this, tr("Ooops!"), tr("Cannot find any game boot!"));
|
||||
// Pass through to regular log filter
|
||||
}
|
||||
}
|
||||
|
||||
if (!stream.seek(0))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user