- Re-factored the code so that Engine is now the main class that owns WindowManager...
[qtmeetings] / src / UserInterface / Utils / ProgressBar.cpp
1 #include "ProgressBar.h"
2
3 #include <QProgressBar>
4 #include <QBoxLayout>
5 #include <QPushButton>
6
7 ProgressBar::ProgressBar( const QString &aText, QWidget *aParent ) :
8         QDialog( aParent )
9 {
10         setWindowTitle( aText );
11         setModal( true );
12
13         iProgress = new QProgressBar();
14         iProgress->setMinimumWidth( 200 );
15         iProgress->setMaximum( 0 );
16         iProgress->setTextVisible( false );
17
18         QBoxLayout* layout = new QBoxLayout( QBoxLayout::LeftToRight, this );
19         layout->setSizeConstraint( QLayout::SetDefaultConstraint );
20         layout->addWidget( iProgress, 0, Qt::AlignHCenter );
21         
22         QPushButton *buttonCancel = new QPushButton( tr( "Cancel" ) );
23         layout->addSpacing( 5 );
24         layout->addWidget( buttonCancel );
25         
26         connect( buttonCancel, SIGNAL( pressed() ), this, SIGNAL( cancel() ) );
27         connect( iProgress, SIGNAL( valueChanged( int ) ), this, SIGNAL( started() ) );
28         
29         setLayout( layout );
30 }
31
32 ProgressBar::~ProgressBar()
33 {
34 }