2017-09-27 00:53:05 -06:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-09-27 00:53:05 -06:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDockWidget>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
class QAction;
|
2020-03-21 01:48:49 -06:00
|
|
|
class QCloseEvent;
|
|
|
|
class QShowEvent;
|
2017-09-27 00:53:05 -06:00
|
|
|
class QTableWidget;
|
|
|
|
class QTableWidgetItem;
|
|
|
|
class QToolBar;
|
|
|
|
|
|
|
|
class WatchWidget : public QDockWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit WatchWidget(QWidget* parent = nullptr);
|
|
|
|
~WatchWidget();
|
|
|
|
|
|
|
|
void AddWatch(QString name, u32 addr);
|
|
|
|
signals:
|
|
|
|
void RequestMemoryBreakpoint(u32 addr);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent*) override;
|
2019-07-06 02:50:11 -06:00
|
|
|
void showEvent(QShowEvent* event) override;
|
2017-09-27 00:53:05 -06:00
|
|
|
|
|
|
|
private:
|
|
|
|
void CreateWidgets();
|
|
|
|
void ConnectWidgets();
|
|
|
|
|
2021-02-20 07:03:42 -07:00
|
|
|
void OnDelete();
|
|
|
|
void OnClear();
|
|
|
|
void OnNewWatch();
|
|
|
|
|
2017-09-27 00:53:05 -06:00
|
|
|
void OnLoad();
|
|
|
|
void OnSave();
|
|
|
|
|
2019-07-06 02:50:11 -06:00
|
|
|
void UpdateButtonsEnabled();
|
2017-09-27 00:53:05 -06:00
|
|
|
void Update();
|
|
|
|
|
|
|
|
void ShowContextMenu();
|
|
|
|
void OnItemChanged(QTableWidgetItem* item);
|
|
|
|
void DeleteWatch(int row);
|
|
|
|
void AddWatchBreakpoint(int row);
|
|
|
|
|
2018-04-11 15:43:47 -06:00
|
|
|
void UpdateIcons();
|
|
|
|
|
2021-02-20 07:03:42 -07:00
|
|
|
QAction* m_new;
|
|
|
|
QAction* m_delete;
|
|
|
|
QAction* m_clear;
|
2017-09-27 00:53:05 -06:00
|
|
|
QAction* m_load;
|
|
|
|
QAction* m_save;
|
|
|
|
QToolBar* m_toolbar;
|
|
|
|
QTableWidget* m_table;
|
|
|
|
|
|
|
|
bool m_updating = false;
|
2019-06-28 15:04:23 -06:00
|
|
|
|
2019-09-30 15:38:36 -06:00
|
|
|
static constexpr int NUM_COLUMNS = 6;
|
2017-09-27 00:53:05 -06:00
|
|
|
};
|