diff options
Diffstat (limited to 'src/citra_qt/debugger')
-rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.cpp | 32 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.h | 2 |
2 files changed, 32 insertions, 2 deletions
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index cabf5fe07..392ff570b 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <QApplication> +#include <QClipboard> #include <QLabel> #include <QListView> #include <QMainWindow> @@ -74,7 +76,7 @@ TextureInfoDockWidget::TextureInfoDockWidget(const Pica::DebugUtils::TextureInfo format_choice->addItem(tr("I8")); format_choice->addItem(tr("A8")); format_choice->addItem(tr("IA4")); - format_choice->addItem(tr("UNK10")); + format_choice->addItem(tr("I4")); format_choice->addItem(tr("A4")); format_choice->addItem(tr("ETC1")); format_choice->addItem(tr("ETC1A4")); @@ -304,16 +306,24 @@ GPUCommandListWidget::GPUCommandListWidget(QWidget* parent) : QDockWidget(tr("Pi this, SLOT(OnCommandDoubleClicked(const QModelIndex&))); toggle_tracing = new QPushButton(tr("Start Tracing")); + QPushButton* copy_all = new QPushButton(tr("Copy All")); connect(toggle_tracing, SIGNAL(clicked()), this, SLOT(OnToggleTracing())); connect(this, SIGNAL(TracingFinished(const Pica::DebugUtils::PicaTrace&)), model, SLOT(OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&))); + connect(copy_all, SIGNAL(clicked()), this, SLOT(CopyAllToClipboard())); + command_info_widget = new QWidget; QVBoxLayout* main_layout = new QVBoxLayout; main_layout->addWidget(list_widget); - main_layout->addWidget(toggle_tracing); + { + QHBoxLayout* sub_layout = new QHBoxLayout; + sub_layout->addWidget(toggle_tracing); + sub_layout->addWidget(copy_all); + main_layout->addLayout(sub_layout); + } main_layout->addWidget(command_info_widget); main_widget->setLayout(main_layout); @@ -330,3 +340,21 @@ void GPUCommandListWidget::OnToggleTracing() { toggle_tracing->setText(tr("Start Tracing")); } } + +void GPUCommandListWidget::CopyAllToClipboard() { + QClipboard* clipboard = QApplication::clipboard(); + QString text; + + QAbstractItemModel* model = static_cast<QAbstractListModel*>(list_widget->model()); + + for (int row = 0; row < model->rowCount({}); ++row) { + for (int col = 0; col < model->columnCount({}); ++col) { + QModelIndex index = model->index(row, col); + text += model->data(index).value<QString>(); + text += '\t'; + } + text += '\n'; + } + + clipboard->setText(text); +} diff --git a/src/citra_qt/debugger/graphics_cmdlists.h b/src/citra_qt/debugger/graphics_cmdlists.h index a465d044c..4859b6ec8 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.h +++ b/src/citra_qt/debugger/graphics_cmdlists.h @@ -49,6 +49,8 @@ public slots: void SetCommandInfo(const QModelIndex&); + void CopyAllToClipboard(); + signals: void TracingFinished(const Pica::DebugUtils::PicaTrace&); |