Changeset View
Changeset View
Standalone View
Standalone View
svn/svncommitdialog.h
- This file was added.
1 | /*************************************************************************** | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2019-2020 * | ||||
3 | * by Nikolai Krasheninnikov <nkrasheninnikov@yandex.ru> * | ||||
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 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | ||||
19 | ***************************************************************************/ | ||||
20 | | ||||
21 | #ifndef SVNCOMMITDIALOG_H | ||||
22 | #define SVNCOMMITDIALOG_H | ||||
23 | | ||||
24 | #include <QDialog> | ||||
25 | #include <QHash> | ||||
26 | | ||||
27 | #include <Dolphin/KVersionControlPlugin> | ||||
28 | | ||||
29 | class QPlainTextEdit; | ||||
30 | class QTableWidget; | ||||
31 | | ||||
32 | /** | ||||
33 | * \brief SVN Commit dialog class. | ||||
34 | */ | ||||
35 | class SvnCommitDialog : public QDialog { | ||||
36 | Q_OBJECT | ||||
37 | public: | ||||
38 | /** | ||||
39 | * Constructor. | ||||
40 | * | ||||
41 | * \param versionInfo Pointer to a current full list of SVN plugin changed files. This pointer | ||||
42 | * is saved internaly and used for changes list updates. | ||||
43 | * \param context List of dirs and files for which this dialog is shown. Every directory entry | ||||
44 | * means "every file in this directory", file stands for a file. This context is used | ||||
45 | * like a filter for \p versionInfo to make changes list. | ||||
46 | * \param parent Parent widget. | ||||
47 | */ | ||||
48 | SvnCommitDialog(const QHash<QString, KVersionControlPlugin::ItemVersion> *versionInfo, const QStringList& context, QWidget *parent = nullptr); | ||||
49 | | ||||
50 | virtual ~SvnCommitDialog() override; | ||||
51 | | ||||
52 | signals: | ||||
53 | /** | ||||
54 | * Is emitted for SVN commit. | ||||
55 | * | ||||
56 | * \param context List of files and dirs for which this commit is applied. This not necessarily | ||||
57 | * the same list which passed to the class contructor because some files might be, for | ||||
58 | * example, reverted. | ||||
59 | * \param msg Commit message. | ||||
60 | */ | ||||
61 | void commit(const QStringList& context, const QString& msg); | ||||
62 | | ||||
63 | void revertFiles(const QStringList& filesPath); | ||||
64 | void diffFile(const QString& filePath); | ||||
65 | void addFiles(const QStringList& filesPath); | ||||
66 | | ||||
67 | public slots: | ||||
68 | void refreshChangesList(); | ||||
69 | void show(); | ||||
70 | | ||||
71 | private slots: | ||||
72 | void contextMenu(const QPoint& pos); | ||||
73 | | ||||
74 | private: | ||||
75 | const QHash<QString, KVersionControlPlugin::ItemVersion> *m_versionInfoHash; | ||||
76 | const QStringList m_context; | ||||
77 | QPlainTextEdit *m_editor; | ||||
78 | QTableWidget *m_changes; | ||||
79 | QAction *m_actRevertFile; | ||||
80 | QAction *m_actDiffFile; | ||||
81 | QAction *m_actAddFile; | ||||
82 | }; | ||||
83 | | ||||
84 | #endif // SVNCOMMITDIALOG_H |