File indexing completed on 2024-04-28 05:42:05

0001 /***************************************************************************
0002  *   Copyright (C) 2005-2009 by Rajko Albrecht                             *
0003  *   ral@alwins-world.de                                                   *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; if not, write to the                         *
0017  *   Free Software Foundation, Inc.,                                       *
0018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
0019  ***************************************************************************/
0020 #ifndef SVNLOGDLGIMP_H
0021 #define SVNLOGDLGIMP_H
0022 
0023 #include "simple_logcb.h"
0024 #include "svnqt/client.h"
0025 #include "svnqt/log_entry.h"
0026 #include "ui_svnlogdlg.h"
0027 
0028 #include <QRegExp>
0029 
0030 class QDialogButtonBox;
0031 class QKeyEvent;
0032 class QTreeWidgetItem;
0033 class SvnActions;
0034 class SvnLogModel;
0035 class QSortFilterProxyModel;
0036 class QModelIndex;
0037 
0038 class SvnLogDlgImp : public QDialog, public Ui::LogDialog, public SimpleLogCb
0039 {
0040     Q_OBJECT
0041 public:
0042     SvnLogDlgImp(SvnActions *ac, bool modal, QWidget *parent = nullptr);
0043     ~SvnLogDlgImp() override;
0044     void dispLog(const svn::LogEntriesMapPtr &log, const QString &what, const QString &root, const svn::Revision &peg, const QString &pegUrl);
0045     void saveSize();
0046     bool getSingleLog(svn::LogEntry &t, const svn::Revision &r, const QString &what, const svn::Revision &peg, QString &root) override;
0047 
0048 signals:
0049     void makeDiff(const QString &, const svn::Revision &, const QString &, const svn::Revision &, QWidget *);
0050     void makeCat(const svn::Revision &, const QString &, const QString &, const svn::Revision &, QWidget *);
0051 
0052 protected:
0053     void keyPressEvent(QKeyEvent *e) override;
0054     void keyReleaseEvent(QKeyEvent *e) override;
0055     void showEvent(QShowEvent *e) override;
0056 
0057 protected slots:
0058     void slotDispPrevious();
0059     void slotDispSelected();
0060     void slotRevisionSelected();
0061     void slotPrevFifty();
0062     void slotBeginHead();
0063     void slotHelpRequested();
0064 
0065 private:
0066     QString _name;
0067     QString _base;
0068     SvnActions *m_Actions;
0069     bool m_ControlKeyDown;
0070     svn::LogEntriesMapPtr m_Entries;
0071     SvnLogModel *m_CurrentModel;
0072     QSortFilterProxyModel *m_SortModel;
0073 
0074     QString _bugurl;
0075 
0076     void dispLog(const svn::LogEntriesMapPtr &);
0077 
0078     QRegExp _r1, _r2;
0079 
0080 protected slots:
0081     void slotListEntries();
0082     void slotChangedPathContextMenu(const QPoint &);
0083     void slotSingleDoubleClicked(QTreeWidgetItem *, int);
0084     void slotGetLogs();
0085     void slotBlameItem();
0086     void slotSelectionChanged(const QItemSelection &, const QItemSelection &);
0087     void slotCustomContextMenu(const QPoint &);
0088 
0089 protected:
0090     /* it works 'cause we use single selection only */
0091     QModelIndex selectedRow(int column = 0);
0092     void replaceBugids(QString &msg);
0093     QString genReplace(const QString &);
0094     svn::Revision m_peg;
0095     svn::Path m_PegUrl;
0096 };
0097 
0098 #endif