]> cloud.milkyroute.net Git - dolphin.git/blob - src/views/renamedialog.h
Fix minor typos
[dolphin.git] / src / views / renamedialog.h
1 /***************************************************************************
2 * Copyright (C) 2006-2010 by Peter Penz (peter.penz@gmx.at) *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
19
20 #ifndef RENAMEDIALOG_H
21 #define RENAMEDIALOG_H
22
23 #include "dolphin_export.h"
24
25 #include <KFileItem>
26
27 #include <QDialog>
28 #include <QString>
29
30 class QLineEdit;
31 class QSpinBox;
32 class QPushButton;
33 class KJob;
34 /**
35 * @brief Dialog for renaming a variable number of files.
36 *
37 * The dialog deletes itself when accepted or rejected.
38 */
39 class DOLPHIN_EXPORT RenameDialog : public QDialog
40 {
41 Q_OBJECT
42
43 public:
44 explicit RenameDialog(QWidget* parent, const KFileItemList& items);
45 ~RenameDialog() override;
46
47 signals:
48 void renamingFinished(const QList<QUrl>& urls);
49
50 private slots:
51 void slotAccepted();
52 void slotTextChanged(const QString& newName);
53 void slotFileRenamed(const QUrl& oldUrl, const QUrl& newUrl);
54 void slotResult(KJob* job);
55
56 protected:
57 void showEvent(QShowEvent* event) override;
58
59 private:
60 bool m_renameOneItem;
61 QList<QUrl> m_renamedItems;
62 QString m_newName;
63 QLineEdit* m_lineEdit;
64 KFileItemList m_items;
65 bool m_allExtensionsDifferent;
66 QSpinBox* m_spinBox;
67 QPushButton* m_okButton;
68 };
69
70 #endif