diff options
| author | 2018-10-24 17:37:18 -0400 | |
|---|---|---|
| committer | 2018-10-24 17:37:18 -0400 | |
| commit | b723390ab1df2047acb9ebb10bb7b34c34b827d0 (patch) | |
| tree | 789d93dafdef97a039e764626f7fc3059dcb8f9d /src | |
| parent | Merge pull request #1564 from lioncash/npad (diff) | |
| parent | graphic_breakpoints: Correct translation of strings in BreakpointModel's data... (diff) | |
| download | yuzu-b723390ab1df2047acb9ebb10bb7b34c34b827d0.tar.gz yuzu-b723390ab1df2047acb9ebb10bb7b34c34b827d0.tar.xz yuzu-b723390ab1df2047acb9ebb10bb7b34c34b827d0.zip | |
Merge pull request #1571 from lioncash/debug-translate
graphic_breakpoints: Correct translation of strings in BreakpointModel's data() function
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/debugger/graphics/graphics_breakpoints.cpp | 33 | ||||
| -rw-r--r-- | src/yuzu/debugger/graphics/graphics_breakpoints_p.h | 2 |
2 files changed, 20 insertions, 15 deletions
diff --git a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp b/src/yuzu/debugger/graphics/graphics_breakpoints.cpp index b5c88f944..67ed0ba6d 100644 --- a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp +++ b/src/yuzu/debugger/graphics/graphics_breakpoints.cpp | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <map> | ||
| 6 | #include <QLabel> | 5 | #include <QLabel> |
| 7 | #include <QMetaType> | 6 | #include <QMetaType> |
| 8 | #include <QPushButton> | 7 | #include <QPushButton> |
| @@ -32,21 +31,8 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const { | |||
| 32 | switch (role) { | 31 | switch (role) { |
| 33 | case Qt::DisplayRole: { | 32 | case Qt::DisplayRole: { |
| 34 | if (index.column() == 0) { | 33 | if (index.column() == 0) { |
| 35 | static const std::map<Tegra::DebugContext::Event, QString> map = { | 34 | return DebugContextEventToString(event); |
| 36 | {Tegra::DebugContext::Event::MaxwellCommandLoaded, tr("Maxwell command loaded")}, | ||
| 37 | {Tegra::DebugContext::Event::MaxwellCommandProcessed, | ||
| 38 | tr("Maxwell command processed")}, | ||
| 39 | {Tegra::DebugContext::Event::IncomingPrimitiveBatch, | ||
| 40 | tr("Incoming primitive batch")}, | ||
| 41 | {Tegra::DebugContext::Event::FinishedPrimitiveBatch, | ||
| 42 | tr("Finished primitive batch")}, | ||
| 43 | }; | ||
| 44 | |||
| 45 | DEBUG_ASSERT(map.size() == | ||
| 46 | static_cast<std::size_t>(Tegra::DebugContext::Event::NumEvents)); | ||
| 47 | return (map.find(event) != map.end()) ? map.at(event) : QString(); | ||
| 48 | } | 35 | } |
| 49 | |||
| 50 | break; | 36 | break; |
| 51 | } | 37 | } |
| 52 | 38 | ||
| @@ -128,6 +114,23 @@ void BreakPointModel::OnResumed() { | |||
| 128 | active_breakpoint = context->active_breakpoint; | 114 | active_breakpoint = context->active_breakpoint; |
| 129 | } | 115 | } |
| 130 | 116 | ||
| 117 | QString BreakPointModel::DebugContextEventToString(Tegra::DebugContext::Event event) { | ||
| 118 | switch (event) { | ||
| 119 | case Tegra::DebugContext::Event::MaxwellCommandLoaded: | ||
| 120 | return tr("Maxwell command loaded"); | ||
| 121 | case Tegra::DebugContext::Event::MaxwellCommandProcessed: | ||
| 122 | return tr("Maxwell command processed"); | ||
| 123 | case Tegra::DebugContext::Event::IncomingPrimitiveBatch: | ||
| 124 | return tr("Incoming primitive batch"); | ||
| 125 | case Tegra::DebugContext::Event::FinishedPrimitiveBatch: | ||
| 126 | return tr("Finished primitive batch"); | ||
| 127 | case Tegra::DebugContext::Event::NumEvents: | ||
| 128 | break; | ||
| 129 | } | ||
| 130 | |||
| 131 | return tr("Unknown debug context event"); | ||
| 132 | } | ||
| 133 | |||
| 131 | GraphicsBreakPointsWidget::GraphicsBreakPointsWidget( | 134 | GraphicsBreakPointsWidget::GraphicsBreakPointsWidget( |
| 132 | std::shared_ptr<Tegra::DebugContext> debug_context, QWidget* parent) | 135 | std::shared_ptr<Tegra::DebugContext> debug_context, QWidget* parent) |
| 133 | : QDockWidget(tr("Maxwell Breakpoints"), parent), Tegra::DebugContext::BreakPointObserver( | 136 | : QDockWidget(tr("Maxwell Breakpoints"), parent), Tegra::DebugContext::BreakPointObserver( |
diff --git a/src/yuzu/debugger/graphics/graphics_breakpoints_p.h b/src/yuzu/debugger/graphics/graphics_breakpoints_p.h index 7112b87e6..fb488e38f 100644 --- a/src/yuzu/debugger/graphics/graphics_breakpoints_p.h +++ b/src/yuzu/debugger/graphics/graphics_breakpoints_p.h | |||
| @@ -29,6 +29,8 @@ public: | |||
| 29 | void OnResumed(); | 29 | void OnResumed(); |
| 30 | 30 | ||
| 31 | private: | 31 | private: |
| 32 | static QString DebugContextEventToString(Tegra::DebugContext::Event event); | ||
| 33 | |||
| 32 | std::weak_ptr<Tegra::DebugContext> context_weak; | 34 | std::weak_ptr<Tegra::DebugContext> context_weak; |
| 33 | bool at_breakpoint; | 35 | bool at_breakpoint; |
| 34 | Tegra::DebugContext::Event active_breakpoint; | 36 | Tegra::DebugContext::Event active_breakpoint; |