]> Creatis software - clitk.git/blob - vv/vvProgressDialog.h
5692cd4716472c16dda25e31dd499cbbe8859022
[clitk.git] / vv / vvProgressDialog.h
1 /*=========================================================================
2
3  Program:   vv
4  Language:  C++
5  Author :   Pierre Seroul (pierre.seroul@gmail.com)
6
7 Copyright (C) 2008
8 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
9 CREATIS-LRMN http://www.creatis.insa-lyon.fr
10
11 This program is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, version 3 of the License.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
23 =========================================================================*/
24 #ifndef vvProgressDialog_h
25 #define vvProgressDialog_h
26
27 #include "ui_vvProgressDialog.h"
28 #include <string>
29
30 class vvProgressDialog : public QDialog, private Ui::vvProgressDialog
31 {
32     Q_OBJECT
33
34 public:
35     vvProgressDialog(std::string message,bool show_progress=false) {
36         setupUi(this);
37         textLabel->setText(message.c_str());
38         if (show_progress) 
39             progressBar->show();
40         else 
41             progressBar->hide();
42         this->show();
43     }
44     void Update(std::string message)
45     {
46         textLabel->setText(message.c_str());
47     }
48     void SetProgress(unsigned int current,unsigned int max)
49     {
50         progressBar->setMaximum(max);
51         progressBar->setValue(current);
52     }
53     ~vvProgressDialog() {}
54
55 public slots:
56
57 };
58
59 #endif