mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
Debugger: Fix some untranslatable strings
This commit is contained in:
parent
a8ea4e55ef
commit
a92297ceec
@ -393,7 +393,10 @@ void DockManager::createWindowsMenu(QMenu* menu)
|
||||
const auto description_iterator = DockTables::DEBUGGER_VIEWS.find(type);
|
||||
pxAssert(description_iterator != DockTables::DEBUGGER_VIEWS.end());
|
||||
|
||||
QAction* action = add_another_menu->addAction(description_iterator->second.display_name);
|
||||
QString display_name = QCoreApplication::translate(
|
||||
"DebuggerView", description_iterator->second.display_name);
|
||||
|
||||
QAction* action = add_another_menu->addAction(display_name);
|
||||
connect(action, &QAction::triggered, this, [this, type]() {
|
||||
if (m_current_layout == DockLayout::INVALID_INDEX)
|
||||
return;
|
||||
|
||||
@ -158,7 +158,7 @@ Qt::ItemFlags SavedAddressesModel::flags(const QModelIndex& index) const
|
||||
|
||||
void SavedAddressesModel::addRow()
|
||||
{
|
||||
const SavedAddress defaultNewAddress = {0, "Name", "Description"};
|
||||
const SavedAddress defaultNewAddress = {0, tr("Name"), tr("Description")};
|
||||
addRow(defaultNewAddress);
|
||||
}
|
||||
|
||||
|
||||
@ -245,11 +245,21 @@ void DebugAnalysisSettingsWidget::setupSymbolSourceGrid()
|
||||
int i = 0;
|
||||
for (auto& [name, temp] : m_symbol_sources)
|
||||
{
|
||||
temp.check_box = new QCheckBox(QString::fromStdString(name));
|
||||
QString display_name = SymbolGuardian::TranslateSymbolSourceName(name.c_str());
|
||||
|
||||
temp.check_box = new QCheckBox(display_name);
|
||||
temp.check_box->setChecked(temp.previous_value);
|
||||
layout->addWidget(temp.check_box, i / 2, i % 2);
|
||||
|
||||
connect(temp.check_box, &QCheckBox::checkStateChanged, this, &DebugAnalysisSettingsWidget::symbolSourceCheckStateChanged);
|
||||
connect(temp.check_box, &QCheckBox::checkStateChanged, this, [this, name]() {
|
||||
auto temp = m_symbol_sources.find(name);
|
||||
if (temp == m_symbol_sources.end())
|
||||
return;
|
||||
|
||||
temp->second.modified_by_user = true;
|
||||
|
||||
saveSymbolSources();
|
||||
});
|
||||
|
||||
i++;
|
||||
}
|
||||
@ -264,21 +274,6 @@ void DebugAnalysisSettingsWidget::setupSymbolSourceGrid()
|
||||
m_ui.symbolSourceErrorMessage->hide();
|
||||
}
|
||||
|
||||
void DebugAnalysisSettingsWidget::symbolSourceCheckStateChanged()
|
||||
{
|
||||
QCheckBox* check_box = qobject_cast<QCheckBox*>(sender());
|
||||
if (!check_box)
|
||||
return;
|
||||
|
||||
auto temp = m_symbol_sources.find(check_box->text().toStdString());
|
||||
if (temp == m_symbol_sources.end())
|
||||
return;
|
||||
|
||||
temp->second.modified_by_user = true;
|
||||
|
||||
saveSymbolSources();
|
||||
}
|
||||
|
||||
void DebugAnalysisSettingsWidget::saveSymbolSources()
|
||||
{
|
||||
if (!m_dialog)
|
||||
|
||||
@ -30,7 +30,6 @@ public:
|
||||
|
||||
protected:
|
||||
void setupSymbolSourceGrid();
|
||||
void symbolSourceCheckStateChanged();
|
||||
void saveSymbolSources();
|
||||
|
||||
void setupSymbolFileList();
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include "SymbolGuardian.h"
|
||||
|
||||
#include "DebugInterface.h"
|
||||
#include "Host.h"
|
||||
|
||||
SymbolGuardian R5900SymbolGuardian;
|
||||
SymbolGuardian R3000SymbolGuardian;
|
||||
@ -216,3 +217,23 @@ void SymbolGuardian::ClearIrxModules()
|
||||
m_database.destroy_symbols_from_module(module, false);
|
||||
});
|
||||
}
|
||||
|
||||
const char* SymbolGuardian::TranslateSymbolSourceName(const char* name)
|
||||
{
|
||||
static constexpr std::array<const char*, 8> names = {
|
||||
TRANSLATE_NOOP("SymbolGuardian", "DWARF Symbol Table"),
|
||||
TRANSLATE_NOOP("SymbolGuardian", "ELF Section Headers"),
|
||||
TRANSLATE_NOOP("SymbolGuardian", "ELF Symbol Table"),
|
||||
TRANSLATE_NOOP("SymbolGuardian", "Function Scanner"),
|
||||
TRANSLATE_NOOP("SymbolGuardian", "Nocash Symbols"),
|
||||
TRANSLATE_NOOP("SymbolGuardian", "SNDLL Symbol Table"),
|
||||
TRANSLATE_NOOP("SymbolGuardian", "Symbol Table Importer"),
|
||||
TRANSLATE_NOOP("SymbolGuardian", "User-Defined"),
|
||||
};
|
||||
|
||||
for (const char* test_name : names)
|
||||
if (strcmp(test_name, name) == 0)
|
||||
return TRANSLATE("SymbolGuardian", name);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
@ -88,6 +88,10 @@ public:
|
||||
// Delete all symbols from modules that have the "is_irx" flag set.
|
||||
void ClearIrxModules();
|
||||
|
||||
// Translate the name of a ccc::SymbolSource object, or return it as is if
|
||||
// no translation is available.
|
||||
static const char* TranslateSymbolSourceName(const char* name);
|
||||
|
||||
protected:
|
||||
ccc::SymbolDatabase m_database;
|
||||
mutable std::shared_mutex m_big_symbol_lock;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user