From d88b7f6fde056aa6356bd9735484bf7d55337d43 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Fri, 20 Sep 2024 15:17:47 +0200 Subject: [PATCH] cellSaveData: improve logging for overlays --- rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp | 2 ++ rpcs3/rpcs3qt/save_data_dialog.cpp | 9 +++++++++ rpcs3/rpcs3qt/save_data_list_dialog.cpp | 14 ++++++++------ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp index afeca45e97..1754b3694c 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp @@ -199,6 +199,8 @@ namespace rsx s32 save_dialog::show(std::vector& save_entries, u32 focused, u32 op, vm::ptr listSet, bool enable_overlay) { + rsx_log.notice("Showing native UI save_dialog (save_entries=%d, focused=%d, op=0x%x, listSet=*0x%x, enable_overlay=%d)", save_entries.size(), focused, op, listSet, enable_overlay); + visible = false; if (enable_overlay) diff --git a/rpcs3/rpcs3qt/save_data_dialog.cpp b/rpcs3/rpcs3qt/save_data_dialog.cpp index 27bfa57d00..20e9f78cfe 100644 --- a/rpcs3/rpcs3qt/save_data_dialog.cpp +++ b/rpcs3/rpcs3qt/save_data_dialog.cpp @@ -15,6 +15,8 @@ LOG_CHANNEL(cellSaveData); s32 save_data_dialog::ShowSaveDataList(std::vector& save_entries, s32 focused, u32 op, vm::ptr listSet, bool enable_overlay) { + cellSaveData.notice("ShowSaveDataList(save_entries=%d, focused=%d, op=0x%x, listSet=*0x%x, enable_overlay=%d)", save_entries.size(), focused, op, listSet, enable_overlay); + // TODO: Implement proper error checking in savedata_op? const bool use_end = sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_BEGIN, 0) >= 0; @@ -26,21 +28,28 @@ s32 save_data_dialog::ShowSaveDataList(std::vector& save_entries, // TODO: Install native shell as an Emu callback if (auto manager = g_fxo->try_get()) { + cellSaveData.notice("ShowSaveDataList: Showing native UI dialog"); + const s32 result = manager->create()->show(save_entries, focused, op, listSet, enable_overlay); if (result != rsx::overlays::user_interface::selection_code::error) { + cellSaveData.notice("ShowSaveDataList: Native UI dialog returned with selection %d", result); if (use_end) sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_END, 0); return result; } + + cellSaveData.error("ShowSaveDataList: Native UI dialog returned error"); } if (!Emu.HasGui()) { + cellSaveData.notice("ShowSaveDataList(): Aborting: Emulation has no GUI attached"); if (use_end) sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_END, 0); return -2; } // Fall back to front-end GUI + cellSaveData.notice("ShowSaveDataList(): Using fallback GUI"); atomic_t selection = 0; input::SetIntercepted(true); diff --git a/rpcs3/rpcs3qt/save_data_list_dialog.cpp b/rpcs3/rpcs3qt/save_data_list_dialog.cpp index 6275161892..f10760ce4a 100644 --- a/rpcs3/rpcs3qt/save_data_list_dialog.cpp +++ b/rpcs3/rpcs3qt/save_data_list_dialog.cpp @@ -10,7 +10,7 @@ #include #include -constexpr auto qstr = QString::fromStdString; +LOG_CHANNEL(cellSaveData); //Show up the savedata list, either to choose one to save/load or to manage saves. //I suggest to use function callbacks to give save data list or get save data entry. (Not implemented or stubbed) @@ -18,6 +18,8 @@ save_data_list_dialog::save_data_list_dialog(const std::vector& e : QDialog(parent) , m_save_entries(entries) { + cellSaveData.notice("Creating Qt save_data_list_dialog (entries=%d, focusedEntry=%d, op=0x%x, listSet=*0x%x)", entries.size(), focusedEntry, op, listSet); + if (op >= 8) { setWindowTitle(tr("Save Data Interface (Delete)")); @@ -107,7 +109,7 @@ save_data_list_dialog::save_data_list_dialog(const std::vector& e { const int original_index = m_list->item(row, 0)->data(Qt::UserRole).toInt(); const SaveDataEntry original_entry = m_save_entries[original_index]; - const QString original_dir_name = qstr(original_entry.dirName); + const QString original_dir_name = QString::fromStdString(original_entry.dirName); QVariantMap notes = m_persistent_settings->GetValue(gui::persistent::save_notes).toMap(); notes[original_dir_name] = m_list->item(row, col)->text(); m_persistent_settings->SetValue(gui::persistent::save_notes, notes); @@ -127,7 +129,7 @@ void save_data_list_dialog::UpdateSelectionLabel() else { const int entry = m_list->item(m_list->currentRow(), 0)->data(Qt::UserRole).toInt(); - m_entry_label->setText(tr("Currently Selected: ") + qstr(m_save_entries[entry].dirName)); + m_entry_label->setText(tr("Currently Selected: ") + QString::fromStdString(m_save_entries[entry].dirName)); } } } @@ -186,9 +188,9 @@ void save_data_list_dialog::UpdateList() int row = 0; for (const SaveDataEntry& entry: m_save_entries) { - QString title = qstr(entry.title); - QString subtitle = qstr(entry.subtitle); - QString dirName = qstr(entry.dirName); + const QString title = QString::fromStdString(entry.title); + const QString subtitle = QString::fromStdString(entry.subtitle); + const QString dirName = QString::fromStdString(entry.dirName); QTableWidgetItem* titleItem = new QTableWidgetItem(title); titleItem->setData(Qt::UserRole, row); // For sorting to work properly