Changeset View
Changeset View
Standalone View
Standalone View
plugins/grepview/grepoutputview.h
1 | /************************************************************************** | 1 | /************************************************************************** | ||
---|---|---|---|---|---|
2 | * Copyright 2010 Silvère Lestang <silvere.lestang@gmail.com> * | 2 | * Copyright 2010 Silvère Lestang <silvere.lestang@gmail.com> * | ||
3 | * Copyright 2010 Julien Desgats <julien.desgats@gmail.com> * | 3 | * Copyright 2010 Julien Desgats <julien.desgats@gmail.com> * | ||
4 | * * | 4 | * * | ||
5 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 7 | * the Free Software Foundation; either version 2 of the License, or * | ||
8 | * (at your option) any later version. * | 8 | * (at your option) any later version. * | ||
9 | * * | 9 | * * | ||
10 | ***************************************************************************/ | 10 | ***************************************************************************/ | ||
11 | 11 | | |||
12 | #ifndef KDEVPLATFORM_PLUGIN_GREPOUTPUTVIEW_H | 12 | #ifndef KDEVPLATFORM_PLUGIN_GREPOUTPUTVIEW_H | ||
13 | #define KDEVPLATFORM_PLUGIN_GREPOUTPUTVIEW_H | 13 | #define KDEVPLATFORM_PLUGIN_GREPOUTPUTVIEW_H | ||
14 | 14 | | |||
15 | #include <QList> | ||||
16 | | ||||
15 | #include <interfaces/iuicontroller.h> | 17 | #include <interfaces/iuicontroller.h> | ||
16 | #include <interfaces/itoolviewactionlistener.h> | 18 | #include <interfaces/itoolviewactionlistener.h> | ||
17 | 19 | | |||
18 | #include "ui_grepoutputview.h" | 20 | #include "ui_grepoutputview.h" | ||
19 | 21 | | |||
20 | namespace KDevelop | 22 | namespace KDevelop | ||
21 | { | 23 | { | ||
22 | class IStatus; | 24 | class IStatus; | ||
23 | } | 25 | } | ||
24 | 26 | | |||
25 | class QModelIndex; | 27 | class QModelIndex; | ||
26 | 28 | | |||
27 | class GrepViewPlugin; | 29 | class GrepViewPlugin; | ||
28 | class GrepOutputModel; | 30 | class GrepOutputModel; | ||
31 | struct GrepJobSettings; | ||||
29 | 32 | | |||
30 | class GrepOutputViewFactory: public KDevelop::IToolViewFactory | 33 | class GrepOutputViewFactory: public KDevelop::IToolViewFactory | ||
31 | { | 34 | { | ||
32 | public: | 35 | public: | ||
33 | explicit GrepOutputViewFactory(GrepViewPlugin* plugin); | 36 | explicit GrepOutputViewFactory(GrepViewPlugin* plugin); | ||
34 | QWidget* create(QWidget* parent = nullptr) override; | 37 | QWidget* create(QWidget* parent = nullptr) override; | ||
35 | Qt::DockWidgetArea defaultPosition() override; | 38 | Qt::DockWidgetArea defaultPosition() override; | ||
36 | QString id() const override; | 39 | QString id() const override; | ||
Show All 16 Lines | 49 | public: | |||
53 | ~GrepOutputView() override; | 56 | ~GrepOutputView() override; | ||
54 | GrepOutputModel* model(); | 57 | GrepOutputModel* model(); | ||
55 | 58 | | |||
56 | /** | 59 | /** | ||
57 | * This causes the creation of a new model, the old one is kept in model history. | 60 | * This causes the creation of a new model, the old one is kept in model history. | ||
58 | * Oldest models are deleted if needed. | 61 | * Oldest models are deleted if needed. | ||
59 | * @return pointer to the new model | 62 | * @return pointer to the new model | ||
60 | */ | 63 | */ | ||
61 | GrepOutputModel* renewModel(const QString& name, const QString& description); | 64 | GrepOutputModel* renewModel(const GrepJobSettings& settings, const QString& description); | ||
62 | 65 | | |||
63 | void setMessage(const QString& msg, MessageType type = Information); | 66 | void setMessage(const QString& msg, MessageType type = Information); | ||
64 | 67 | | |||
65 | public Q_SLOTS: | 68 | public Q_SLOTS: | ||
66 | void showErrorMessage( const QString& errorMessage ); | 69 | void showErrorMessage( const QString& errorMessage ); | ||
67 | void showMessage( KDevelop::IStatus*, const QString& message ); | 70 | void showMessage( KDevelop::IStatus*, const QString& message ); | ||
68 | void updateApplyState(const QModelIndex &topLeft, const QModelIndex &bottomRight); | 71 | void updateApplyState(const QModelIndex &topLeft, const QModelIndex &bottomRight); | ||
69 | void changeModel(int index); | 72 | void changeModel(int index); | ||
70 | void replacementTextChanged(QString); | 73 | void replacementTextChanged(QString); | ||
71 | 74 | | |||
72 | Q_SIGNALS: | 75 | Q_SIGNALS: | ||
73 | void outputViewIsClosed(); | 76 | void outputViewIsClosed(); | ||
74 | 77 | | |||
75 | private: | 78 | private: | ||
76 | static const int HISTORY_SIZE; | 79 | static const int HISTORY_SIZE; | ||
77 | QAction* m_next; | 80 | QAction* m_next; | ||
78 | QAction* m_prev; | 81 | QAction* m_prev; | ||
79 | QAction* m_collapseAll; | 82 | QAction* m_collapseAll; | ||
80 | QAction* m_expandAll; | 83 | QAction* m_expandAll; | ||
84 | QAction* m_refresh; | ||||
81 | QAction* m_clearSearchHistory; | 85 | QAction* m_clearSearchHistory; | ||
82 | QLabel* m_statusLabel; | 86 | QLabel* m_statusLabel; | ||
83 | GrepViewPlugin *m_plugin; | 87 | GrepViewPlugin *m_plugin; | ||
88 | QList<GrepJobSettings> m_settingsHistory; | ||||
84 | 89 | | |||
85 | private Q_SLOTS: | 90 | private Q_SLOTS: | ||
86 | void selectPreviousItem() override; | 91 | void selectPreviousItem() override; | ||
87 | void selectNextItem() override; | 92 | void selectNextItem() override; | ||
88 | void collapseAllItems(); | 93 | void collapseAllItems(); | ||
89 | void expandAllItems(); | 94 | void expandAllItems(); | ||
90 | void onApply(); | 95 | void onApply(); | ||
91 | void showDialog(); | 96 | void showDialog(); | ||
Show All 10 Lines |