CuteLogger
Fast and simple logging solution for Qt based applications
jobsdock.h
1 /*
2  * Copyright (c) 2012-2019 Meltytech, LLC
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef JOBSDOCK_H
19 #define JOBSDOCK_H
20 
21 #include <QDockWidget>
22 
23 class AbstractJob;
24 class QStandardItem;
25 
26 namespace Ui {
27  class JobsDock;
28 }
29 
30 class JobsDock : public QDockWidget
31 {
32  Q_OBJECT
33 
34 public:
35  explicit JobsDock(QWidget *parent = 0);
36  ~JobsDock();
37  AbstractJob* currentJob() const;
38 
39 public slots:
40  void onJobAdded();
41  void onProgressUpdated(QStandardItem* item, int percent);
42 
43 protected:
44  void resizeEvent(QResizeEvent *event);
45 
46 private:
47  Ui::JobsDock *ui;
48 
49 private slots:
50  void on_treeView_customContextMenuRequested(const QPoint &pos);
51  void on_actionStopJob_triggered();
52  void on_actionViewLog_triggered();
53  void on_pauseButton_toggled(bool checked);
54  void on_actionRun_triggered();
55  void on_menuButton_clicked();
56  void on_treeView_doubleClicked(const QModelIndex &index);
57  void on_actionRemove_triggered();
58  void on_actionRemoveFinished_triggered();
59 };
60 
61 #endif // JOBSDOCK_H