PCManFM-Qt
renamedialog.h
1 /*
2 
3  Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
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 along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 
21 #ifndef FM_RENAMEDIALOG_H
22 #define FM_RENAMEDIALOG_H
23 
24 #include "libfmqtglobals.h"
25 #include <QDialog>
26 #include <libfm/fm.h>
27 
28 namespace Ui {
29  class RenameDialog;
30 };
31 
32 class QPushButton;
33 
34 namespace Fm {
35 
36 class LIBFM_QT_API RenameDialog : public QDialog {
37 Q_OBJECT
38 
39 public:
40  enum Action {
41  ActionCancel,
42  ActionRename,
43  ActionOverwrite,
44  ActionIgnore
45  };
46 
47 public:
48  explicit RenameDialog(FmFileInfo* src, FmFileInfo* dest, QWidget* parent = 0, Qt::WindowFlags f = 0);
49  virtual ~RenameDialog();
50 
51  Action action() {
52  return action_;
53  }
54 
55  bool applyToAll() {
56  return applyToAll_;
57  }
58 
59  QString newName() {
60  return newName_;
61  }
62 
63 protected Q_SLOTS:
64  void onRenameClicked();
65  void onIgnoreClicked();
66  void onFileNameChanged(QString newName);
67 
68 protected:
69  void accept();
70  void reject();
71 
72 private:
73  Ui::RenameDialog* ui;
74  QPushButton* renameButton_;
75  Action action_;
76  bool applyToAll_;
77  QString oldName_;
78  QString newName_;
79 };
80 
81 }
82 
83 #endif // FM_RENAMEDIALOG_H
Definition: appchoosercombobox.cpp:26
Definition: appchooserdialog.h:28
Definition: renamedialog.h:36