File indexing completed on 2024-04-14 15:51:32

0001 /***************************************************************************
0002                insertpartfilenamedlg.h  -  description
0003                              -------------------
0004     begin                : Sat Jun 30 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 INSERTPARTFILENAMEDLG_H
0019 #define INSERTPARTFILENAMEDLG_H
0020 
0021 #include <QDialog>
0022 
0023 #include "ui_partfilenamewidget.h"
0024 
0025 class QDialogButtonBox;
0026 
0027 class InsertPartFilenameDlg : public QDialog
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit InsertPartFilenameDlg(const QString &filename, QWidget *parent = nullptr);
0033 
0034     /**
0035      * \returns the command to insert a substring of the original
0036      *          filename into the new filename
0037      */
0038     inline const QString &command() const;
0039 
0040 private Q_SLOTS:
0041     void slotSelectionChanged();
0042     void slotUpdateKRenameCommand();
0043 
0044 private:
0045     Ui::PartFilenameWidget m_widget;
0046     QDialogButtonBox      *m_buttons;
0047 
0048     QString m_command;
0049     int     m_start;
0050     int     m_end;
0051 };
0052 
0053 inline const QString &InsertPartFilenameDlg::command() const
0054 {
0055     return m_command;
0056 }
0057 
0058 #endif // INSERTPARTFILENAMEDLG_H