| 1 |
#include "srcctl_p.h" |
| 2 |
#include "srcctl_p.moc" |
| 3 |
|
| 4 |
#include <qlabel.h> |
| 5 |
#include <qpushbutton.h> |
| 6 |
#include <qslider.h> |
| 7 |
#include <qtoolbutton.h> |
| 8 |
#include <qlayout.h> |
| 9 |
#include <qtooltip.h> |
| 10 |
#include <qwhatsthis.h> |
| 11 |
|
| 12 |
|
| 13 |
/* |
| 14 |
* Constructs a SourceControl which is a child of 'parent', with the |
| 15 |
* name 'name' and widget flags set to 'f' |
| 16 |
* |
| 17 |
* The dialog will by default be modeless, unless you set 'modal' to |
| 18 |
* TRUE to construct a modal dialog. |
| 19 |
*/ |
| 20 |
SourceControlDialog::SourceControlDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
| 21 |
: QDialog( parent, name, modal, fl ) |
| 22 |
{ |
| 23 |
if ( !name ) |
| 24 |
setName( "SourceControl" ); |
| 25 |
setCaption( tr( "Source control" ) ); |
| 26 |
|
| 27 |
QGridLayout* gl = new QGridLayout( this, 1, 1 ); |
| 28 |
gl->setSpacing( 5 ); |
| 29 |
gl->setMargin( 5 ); |
| 30 |
|
| 31 |
m_pSlider = new QSlider( this ); |
| 32 |
m_pSlider->setOrientation( QSlider::Horizontal ); |
| 33 |
m_pSlider->setTickmarks( QSlider::Right); |
| 34 |
|
| 35 |
gl->addMultiCellWidget( m_pSlider, 0, 0, 0, 9 ); |
| 36 |
|
| 37 |
m_pButtonPF = new QToolButton( this ); |
| 38 |
m_pButtonPF->setAutoRepeat( TRUE ); |
| 39 |
m_pButtonPF->setText( tr( "<" ) ); |
| 40 |
gl->addWidget( m_pButtonPF, 1, 0 ); |
| 41 |
|
| 42 |
m_pButtonNF = new QToolButton( this ); |
| 43 |
m_pButtonNF->setAutoRepeat( TRUE ); |
| 44 |
m_pButtonNF->setText( tr( ">" ) ); |
| 45 |
gl->addWidget( m_pButtonNF, 1, 1 ); |
| 46 |
|
| 47 |
|
| 48 |
m_pButtonPFF = new QToolButton( this ); |
| 49 |
m_pButtonPFF->setText( tr( "<<" ) ); |
| 50 |
gl->addWidget( m_pButtonPFF, 1, 2 ); |
| 51 |
|
| 52 |
m_pButtonNFF = new QToolButton( this ); |
| 53 |
m_pButtonNFF->setAutoRepeat( TRUE ); |
| 54 |
m_pButtonNFF->setText( tr( ">>" ) ); |
| 55 |
gl->addWidget( m_pButtonNFF, 1, 3 ); |
| 56 |
|
| 57 |
|
| 58 |
m_pButtonPTF = new QToolButton( this ); |
| 59 |
m_pButtonPTF->setText( tr( "<<<" ) ); |
| 60 |
gl->addWidget( m_pButtonPTF, 1, 4 ); |
| 61 |
|
| 62 |
m_pButtonNTF = new QToolButton( this ); |
| 63 |
m_pButtonNTF->setAutoRepeat( TRUE ); |
| 64 |
m_pButtonNTF->setText( tr( ">>>" ) ); |
| 65 |
gl->addWidget( m_pButtonNTF, 1, 5 ); |
| 66 |
|
| 67 |
|
| 68 |
m_pButtonPKF = new QToolButton( this ); |
| 69 |
m_pButtonPKF->setAutoRepeat( TRUE ); |
| 70 |
m_pButtonPKF->setText( tr( "KF<" ) ); |
| 71 |
gl->addWidget( m_pButtonPKF, 1, 6 ); |
| 72 |
|
| 73 |
m_pButtonNKF = new QToolButton( this ); |
| 74 |
m_pButtonNKF->setAutoRepeat( TRUE ); |
| 75 |
m_pButtonNKF->setText( tr( ">KF" ) ); |
| 76 |
gl->addWidget( m_pButtonNKF, 1, 7 ); |
| 77 |
|
| 78 |
gl->setColStretch(8, 1); |
| 79 |
|
| 80 |
m_pLabel = new QLabel( this ); |
| 81 |
gl->addWidget( m_pLabel, 1, 9 ); |
| 82 |
|
| 83 |
//gl->setRowStretch(2, 1); |
| 84 |
|
| 85 |
// signals and slots connections |
| 86 |
connect( m_pSlider, SIGNAL( sliderMoved( int ) ), this, SLOT( sliderMoved( int ) ) ); |
| 87 |
#if QT_VERSION > 220 |
| 88 |
// connect( m_pSlider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
| 89 |
// connect( m_pSlider, SIGNAL( valueChanged( int ) ), this, SLOT( valueChanged( int ) ) ); |
| 90 |
#endif |
| 91 |
connect( m_pButtonPF, SIGNAL( clicked() ), this, SLOT( prevFrame() ) ); |
| 92 |
connect( m_pButtonPFF, SIGNAL( clicked() ), this, SLOT( prevFiveFrames() ) ); |
| 93 |
connect( m_pButtonPTF, SIGNAL( clicked() ), this, SLOT( prevTwentyFrames() ) ); |
| 94 |
connect( m_pButtonPKF, SIGNAL( clicked() ), this, SLOT( prevKeyFrame() ) ); |
| 95 |
|
| 96 |
connect( m_pButtonNF, SIGNAL( clicked() ), this, SLOT( nextFrame() ) ); |
| 97 |
connect( m_pButtonNFF, SIGNAL( clicked() ), this, SLOT( nextFiveFrames() ) ); |
| 98 |
connect( m_pButtonNTF, SIGNAL( clicked() ), this, SLOT( nextTwentyFrames() ) ); |
| 99 |
connect( m_pButtonNKF, SIGNAL( clicked() ), this, SLOT( nextKeyFrame() ) ); |
| 100 |
} |
| 101 |
|
| 102 |
/* |
| 103 |
* Destroys the object and frees any allocated resources |
| 104 |
*/ |
| 105 |
SourceControlDialog::~SourceControlDialog() |
| 106 |
{ |
| 107 |
// no need to delete child widgets, Qt does it all for us |
| 108 |
} |