2021-11-26 11:00:45 -06:00
|
|
|
/*
|
|
|
|
Copyright (C) 2021 Srivats P.
|
|
|
|
|
|
|
|
This file is part of "Ostinato"
|
|
|
|
|
|
|
|
This is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _FIND_REPLACE_H
|
|
|
|
#define _FIND_REPLACE_H
|
|
|
|
|
|
|
|
#include "ui_findreplace.h"
|
|
|
|
|
2021-12-15 09:58:52 -06:00
|
|
|
class MandatoryFieldsGroup;
|
|
|
|
|
2021-11-26 11:00:45 -06:00
|
|
|
class FindReplaceDialog: public QDialog, public Ui::FindReplace
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-11-27 10:43:55 -06:00
|
|
|
struct Action;
|
|
|
|
|
|
|
|
FindReplaceDialog(Action *action, QWidget *parent = 0);
|
2021-12-15 09:58:52 -06:00
|
|
|
~FindReplaceDialog();
|
2021-11-27 10:43:55 -06:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_protocol_currentIndexChanged(const QString &name);
|
2021-12-04 00:47:37 -06:00
|
|
|
void on_field_currentIndexChanged(int index);
|
2021-12-11 23:22:43 -06:00
|
|
|
void on_matchAny_toggled(bool checked);
|
2021-12-03 07:31:32 -06:00
|
|
|
void on_buttonBox_accepted();
|
2021-11-27 10:43:55 -06:00
|
|
|
|
|
|
|
private:
|
2021-12-03 07:31:32 -06:00
|
|
|
struct FieldAttrib;
|
|
|
|
|
|
|
|
quint32 protocolId_{0};
|
2021-11-27 10:43:55 -06:00
|
|
|
Action *action_{nullptr};
|
2021-12-03 07:31:32 -06:00
|
|
|
QList<FieldAttrib> fieldAttrib_;
|
2021-12-15 09:58:52 -06:00
|
|
|
MandatoryFieldsGroup *mandatoryFields_{nullptr};
|
2021-11-27 10:43:55 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct FindReplaceDialog::Action
|
|
|
|
{
|
2021-12-11 01:06:33 -06:00
|
|
|
QString protocolField;
|
2021-11-27 10:43:55 -06:00
|
|
|
quint32 protocolNumber;
|
|
|
|
quint32 fieldIndex;
|
2021-12-03 07:31:32 -06:00
|
|
|
int fieldBitSize;
|
2021-11-27 10:43:55 -06:00
|
|
|
QVariant findValue;
|
|
|
|
QVariant findMask;
|
|
|
|
QVariant replaceValue;
|
|
|
|
QVariant replaceMask;
|
|
|
|
|
|
|
|
bool selectedStreamsOnly; // in-out param
|
2021-11-26 11:00:45 -06:00
|
|
|
};
|
|
|
|
|
2021-12-03 07:31:32 -06:00
|
|
|
struct FindReplaceDialog::FieldAttrib
|
|
|
|
{
|
|
|
|
quint32 index;
|
|
|
|
int bitSize;
|
|
|
|
};
|
2021-11-26 11:00:45 -06:00
|
|
|
#endif
|
|
|
|
|