File indexing completed on 2024-04-21 16:32:35

0001 /***************************************************************************
0002                        replacedialog.h  -  description
0003                              -------------------
0004     begin                : Sun Jul 22 2007
0005     copyright            : (C) 2007 by Dominik Seichter
0006     email                : domseichter@web.de
0007 ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #ifndef REPLACE_DIALOG_H
0019 #define REPLACE_DIALOG_H
0020 
0021 #include <QDialog>
0022 
0023 #include "ui_replacewidget.h"
0024 #include "batchrenamer.h"
0025 
0026 class QDialogButtonBox;
0027 class QTableWidgetItem;
0028 
0029 /**
0030  * This is a dialog with a list of strings for find and replace
0031  */
0032 class ReplaceDialog : public QDialog
0033 {
0034     Q_OBJECT
0035 public:
0036     explicit ReplaceDialog(const QList<TReplaceItem> &items, QWidget *parent = nullptr);
0037 
0038     QList<TReplaceItem> replaceList() const;
0039 
0040 private Q_SLOTS:
0041 
0042     void slotAdd();
0043     void slotEdit();
0044     void slotRemove();
0045 
0046     void slotSaveList();
0047     void slotLoadList();
0048 
0049     void slotEnableControls();
0050 
0051 private:
0052     QTableWidgetItem *createTableItem(const QString &text, bool isCheckable = false);
0053 
0054 private:
0055     Ui::ReplaceWidget   m_widget;
0056     QDialogButtonBox   *m_buttons;
0057 };
0058 
0059 #endif // REPLACE_DIALOG_H