File indexing completed on 2024-12-08 05:14:48

0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 // SPDX-FileCopyrightText: 2007 Dominik Seichter <domseichter@web.de>
0003 
0004 #ifndef REPLACE_DIALOG_H
0005 #define REPLACE_DIALOG_H
0006 
0007 #include <QDialog>
0008 
0009 #include "ui_replacewidget.h"
0010 #include "batchrenamer.h"
0011 
0012 class QDialogButtonBox;
0013 class QTableWidgetItem;
0014 
0015 /**
0016  * This is a dialog with a list of strings for find and replace
0017  */
0018 class ReplaceDialog : public QDialog
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit ReplaceDialog(const QList<TReplaceItem> &items, QWidget *parent = nullptr);
0023 
0024     QList<TReplaceItem> replaceList() const;
0025 
0026 private Q_SLOTS:
0027 
0028     void slotAdd();
0029     void slotEdit();
0030     void slotRemove();
0031 
0032     void slotSaveList();
0033     void slotLoadList();
0034 
0035     void slotEnableControls();
0036 
0037 private:
0038     QTableWidgetItem *createTableItem(const QString &text, bool isCheckable = false);
0039 
0040 private:
0041     Ui::ReplaceWidget   m_widget;
0042     QDialogButtonBox   *m_buttons;
0043 };
0044 
0045 #endif // REPLACE_DIALOG_H