mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.3 KiB
C++
73 lines
1.3 KiB
C++
#ifndef CSV_TOOLS_SEARCHBOX_H
|
|
#define CSV_TOOLS_SEARCHBOX_H
|
|
|
|
#include <QCheckBox>
|
|
#include <QComboBox>
|
|
#include <QLabel>
|
|
#include <QLineEdit>
|
|
#include <QPushButton>
|
|
#include <QStackedWidget>
|
|
#include <QWidget>
|
|
|
|
class QGridLayout;
|
|
|
|
namespace CSMTools
|
|
{
|
|
class Search;
|
|
}
|
|
|
|
namespace CSVTools
|
|
{
|
|
class SearchBox : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
QStackedWidget mInput;
|
|
QLineEdit mText;
|
|
QComboBox mRecordState;
|
|
QCheckBox mCaseSensitive;
|
|
QPushButton mSearch;
|
|
QGridLayout* mLayout;
|
|
QComboBox mMode;
|
|
bool mSearchEnabled;
|
|
QStackedWidget mReplaceInput;
|
|
QLineEdit mReplaceText;
|
|
QLabel mReplacePlaceholder;
|
|
QPushButton mReplace;
|
|
|
|
private:
|
|
void updateSearchButton();
|
|
|
|
public:
|
|
SearchBox(QWidget* parent = nullptr);
|
|
|
|
void setSearchMode(bool enabled);
|
|
|
|
CSMTools::Search getSearch() const;
|
|
|
|
std::string getReplaceText() const;
|
|
|
|
void setEditLock(bool locked);
|
|
|
|
void focus();
|
|
|
|
private slots:
|
|
|
|
void modeSelected(int index);
|
|
|
|
void textChanged(const QString& text);
|
|
|
|
void startSearch(bool checked = true);
|
|
|
|
void replaceAll(bool checked);
|
|
|
|
signals:
|
|
|
|
void startSearch(const CSMTools::Search& search);
|
|
|
|
void replaceAll();
|
|
};
|
|
}
|
|
|
|
#endif
|