1 /*
2 # PostgreSQL Database Modeler (pgModeler)
3 #
4 # Copyright 2006-2020 - Raphael Araújo e Silva <raphael@pgmodeler.io>
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation version 3.
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 # The complete text of GPLv3 is at LICENSE file on source code root directory.
16 # Also, you can get the complete GNU General Public License at <http://www.gnu.org/licenses/>
17 */
18 
19 /**
20 \ingroup libpgmodeler_ui
21 \class TaskProgressWidget
22 \brief Implements a widget that shows the progress of executed operations (e.g. loading a model file, generation source code)
23 */
24 
25 #ifndef TASK_PROGRESS_WIDGET_H
26 #define TASK_PROGRESS_WIDGET_H
27 
28 #include <QtWidgets>
29 #include "ui_taskprogresswidget.h"
30 #include <map>
31 
32 using namespace std;
33 
34 class TaskProgressWidget: public QDialog, public Ui::TaskProgressWidget
35 {
36 	private:
37 		Q_OBJECT
38 
39 		//! \brief Stores the icons that are shown as the icons tokens are send via	updateProgress() slot
40 		map<unsigned, QIcon> icons;
41 
42 	public:
43 		TaskProgressWidget(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Widget);
44 		void addIcon(unsigned id, const QIcon &ico);
45 
46 	public slots:
47 		void show();
48 		void close();
49 		void updateProgress(int progress, unsigned icon_id);
50 		void updateProgress(int progress, QString text, unsigned icon_id);
51 };
52 
53 #endif
54