]> Creatis software - clitk.git/blob - vv/vvProgressDialog.cxx
*** empty log message ***
[clitk.git] / vv / vvProgressDialog.cxx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17   ======================================================================-====*/
18
19 // vv
20 #include "vvProgressDialog.h"
21
22 //------------------------------------------------------------------------------
23 vvProgressDialog::vvProgressDialog(std::string message, bool show_progress) 
24 {
25   setupUi(this);
26   connect(mCancelButton, SIGNAL(rejected()), this, SLOT(reject()));
27   textLabel->setText(message.c_str());
28   if (show_progress) 
29     progressBar->show();
30   else 
31     progressBar->hide();
32   this->show();
33 }
34 //------------------------------------------------------------------------------
35
36
37 //------------------------------------------------------------------------------
38 void vvProgressDialog::SetText(std::string message)
39 {
40   textLabel->setText(message.c_str());
41 }
42 //------------------------------------------------------------------------------
43
44
45 //------------------------------------------------------------------------------
46 void vvProgressDialog::AddToText(std::string message)
47 {
48   textLabel->setText(QString("%1\n%2").arg(textLabel->text()).arg(message.c_str()));
49 }
50 //------------------------------------------------------------------------------
51
52
53 //------------------------------------------------------------------------------
54 void vvProgressDialog::SetProgress(unsigned int current,unsigned int max)
55 {
56   progressBar->setMaximum(max);
57   progressBar->setValue(current);
58 }
59 //------------------------------------------------------------------------------
60