File: patchreviewtoolview.h

package info (click to toggle)
kdevelop 4%3A5.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 52,544 kB
  • sloc: cpp: 254,897; python: 3,380; sh: 1,271; ansic: 657; xml: 221; php: 95; makefile: 36; lisp: 13; sed: 12
file content (109 lines) | stat: -rw-r--r-- 3,190 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/***************************************************************************
   Copyright 2006-2009 David Nolden <david.nolden.kdevelop@art-master.de>
***************************************************************************/

/***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
***************************************************************************/

#ifndef KDEVPLATFORM_PLUGIN_PATCHREVIEWTOOLVIEW_H
#define KDEVPLATFORM_PLUGIN_PATCHREVIEWTOOLVIEW_H

#include <QWidget>
#include <QPointer>
#include <QTime>

#include <ui_patchreview.h>

namespace Sublime { class Area; }
namespace KDevelop { class IDocument; }
namespace Purpose { class Menu; }

class QStandardItem;
class KJob;
class PatchReviewPlugin;
class LocalPatchSource;
class QModelIndex;
class QSortFilterProxyModel;

class PatchReviewToolView : public QWidget
{
    Q_OBJECT
public:
    PatchReviewToolView( QWidget* parent, PatchReviewPlugin* plugin );
    ~PatchReviewToolView() override;

    // opens the document which should be part of the patch,
    // ensuring that the tabs are sorted correctly
    void open( const QUrl& url, bool activate ) const;

Q_SIGNALS:
    void dialogClosed( PatchReviewToolView* );
    void  stateChanged( PatchReviewToolView* );
private Q_SLOTS:

    void startingNewReview();

    void fileDoubleClicked( const QModelIndex& i );

    void nextHunk();
    void prevHunk();
    void prevFile();
    void nextFile();
    void seekFile(bool forwards);

    void patchChanged();

    void slotAppliedChanged( int newState );

    void finishReview();

    void runTests();

    void selectAll();
    void deselectAll();

    void fileItemChanged( QStandardItem* item );

private:
    void resizeEvent(QResizeEvent*) override;

    void kompareModelChanged();

    void showEditDialog();
    ///Fills the editor views from m_editingPatch
    void fillEditFromPatch();
    /// Retrieve the patch from plugin and perform all necessary casts
    LocalPatchSource* GetLocalPatchSource();

    Ui_EditPatch m_editPatch;

    QTime m_lastDataTime;
    QString m_lastTerminalData;

    /// Whether the set of checked URLs should be reset on the next update
    bool m_resetCheckedUrls;

    PatchReviewPlugin* m_plugin;

    QPointer< QWidget > m_customWidget;
    QAction* m_selectAllAction;
    QAction* m_deselectAllAction;
    Purpose::Menu* m_exportMenu;

    class PatchFilesModel* m_fileModel;
    QSortFilterProxyModel* m_fileSortProxyModel;

public Q_SLOTS:
    void documentActivated( KDevelop::IDocument* );
    void customContextMenuRequested(const QPoint& p);
    void testJobResult(KJob* job);
    void testJobPercent(KJob* job, ulong percent);
};

#endif // KDEVPLATFORM_PLUGIN_PATCHREVIEWTOOLVIEW_H