]> cloud.milkyroute.net Git - dolphin.git/blob - src/renamedialog.h
Use a KIO Job for applying the view properties recursively to sub directories.
[dolphin.git] / src / renamedialog.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz *
3 * peter.penz@gmx.at *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifndef RENAMEDIALOG_H
21 #define RENAMEDIALOG_H
22
23 #include <kdialog.h>
24 #include <kurl.h>
25 #include <qstring.h>
26
27 class KLineEdit;
28
29 /**
30 * @brief Dialog for renaming a variable number of files.
31 *
32 * The renaming is not done by the dialog, the invoker
33 * must do this itself:
34 * \code
35 * RenameDialog dialog(...);
36 * if (dialog.exec() == QDialog::Accepted) {
37 * const QString& newName = dialog.newName();
38 * // ... rename items corresponding to the new name
39 * }
40 * \endcode
41 * @author Peter Penz
42 */
43 class RenameDialog : public KDialog
44 {
45 Q_OBJECT
46
47 public:
48 RenameDialog(const KUrl::List& items);
49 virtual ~RenameDialog();
50
51 /**
52 * Returns the new name of the items. If the returned string is not empty,
53 * then it is assured that the string contains exactly one character #,
54 * which should be replaced by ascending numbers. An empty string indicates
55 * that the user has removed the # character.
56 */
57 const QString& newName() const { return m_newName; }
58
59 protected slots:
60 virtual void slotButtonClicked(int button);
61
62 private:
63 KLineEdit* m_lineEdit;
64 QString m_newName;
65 };
66
67 #endif