Improve FIFO analyzer search function

- Only one search result is generated per command/line, even if there are multiple matches in that line.
- Pressing enter on the edit field begins a search, just like clicking the begin button.
- The next and previous buttons are disabled until a search is begun.
- The search results are cleared when changing objects or frames.
- The previous button once again works (a regression from the previous commit), and the register updates and graphics data for the correct object are searched.
- currentRow() never returns -1, so checking that is unnecessary (and misleading).
- The 'Invalid search parameters (no object selected)' previously never showed up before because FRAME_ROLE is present if and only if OBJECT_ROLE is present.
This commit is contained in:
Pokechu22
2021-02-19 14:02:59 -08:00
parent 1dc3ff5879
commit dbacf68b79
2 changed files with 58 additions and 59 deletions

View File

@ -8,6 +8,8 @@
#include <QWidget>
#include "Common/CommonTypes.h"
class QGroupBox;
class QLabel;
class QLineEdit;
@ -57,9 +59,13 @@ private:
struct SearchResult
{
int frame;
int object;
int cmd;
constexpr SearchResult(u32 frame, u32 object, u32 cmd)
: m_frame(frame), m_object(object), m_cmd(cmd)
{
}
const u32 m_frame;
const u32 m_object;
const u32 m_cmd;
};
std::vector<int> m_object_data_offsets;