CuteLogger
Fast and simple logging solution for Qt based applications
jobsdock.h
1 /*
2  * Copyright (c) 2012-2017 Meltytech, LLC
3  * Author: Dan Dennedy <dan@dennedy.org>
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 3 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, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef JOBSDOCK_H
20 #define JOBSDOCK_H
21 
22 #include <QDockWidget>
23 
24 class AbstractJob;
25 class QStandardItem;
26 
27 namespace Ui {
28  class JobsDock;
29 }
30 
31 class JobsDock : public QDockWidget
32 {
33  Q_OBJECT
34 
35 public:
36  explicit JobsDock(QWidget *parent = 0);
37  ~JobsDock();
38  AbstractJob* currentJob() const;
39 
40 public slots:
41  void onJobAdded();
42  void onProgressUpdated(QStandardItem* item, int percent);
43 
44 protected:
45  void resizeEvent(QResizeEvent *event);
46 
47 private:
48  Ui::JobsDock *ui;
49 
50 private slots:
51  void on_treeView_customContextMenuRequested(const QPoint &pos);
52  void on_actionStopJob_triggered();
53  void on_actionViewLog_triggered();
54  void on_pauseButton_toggled(bool checked);
55  void on_actionRun_triggered();
56  void on_menuButton_clicked();
57  void on_treeView_doubleClicked(const QModelIndex &index);
58  void on_actionRemove_triggered();
59 };
60 
61 #endif // JOBSDOCK_H