# HG changeset patch # User lbarthelemy # Date 1206720373 0 # Node ID 87ccc62d9ea5490c28db1ee3dce77a88e24fb5ab # Parent ec2ca3fbd957bccc0740b32ed9bfb0236f2f9e43 the audio recorder widget diff -r ec2ca3fbd957 -r 87ccc62d9ea5 widgets/AudioRecorderWidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/AudioRecorderWidget.cpp Fri Mar 28 16:06:13 2008 +0000 @@ -0,0 +1,66 @@ +#include +#include "AudioRecorderWidget.h" + + +AudioRecorderWidget::AudioRecorderWidget(QWidget *parent){ +this->setWindowFlags(Qt::ToolTip); + + QLabel *labelTitle = new QLabel(tr("Voice recorder:")); + + m_buttonBox = new QDialogButtonBox(Qt::Horizontal); + m_okButton = new QPushButton(tr("Ok")); + m_cancelButton = new QPushButton(tr("Cancel")); + m_startButton = new QPushButton(tr("Start")); + m_stopButton = new QPushButton(tr("Stop")); + m_playButton = new QPushButton(tr("Play")); + + QFrame *auxFrame = new QFrame(); + QVBoxLayout *mainLayout = new QVBoxLayout; + QVBoxLayout *auxLayout = new QVBoxLayout; + QHBoxLayout *centralLayout = new QHBoxLayout(); + QFrame *centralFrame = new QFrame(); + + //populate the central layout + centralLayout->addWidget(m_startButton); + centralLayout->addWidget(m_stopButton); + centralLayout->addWidget(m_playButton); + + ////// + + + centralFrame->setLayout(centralLayout); + + labelTitle->setAlignment(Qt::AlignCenter); + + // default button for enter key + m_okButton->setDefault(true); + + m_buttonBox->addButton(m_okButton, QDialogButtonBox::AcceptRole); + m_buttonBox->addButton(m_cancelButton, QDialogButtonBox::RejectRole); + + connect(m_okButton, SIGNAL(clicked()), this, SLOT(accept())); + connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject())); + + auxLayout->addWidget(labelTitle); + auxLayout->addWidget(centralFrame); + auxLayout->addWidget(m_buttonBox); + auxLayout->setSizeConstraint(QLayout::SetFixedSize); + + auxFrame->setLayout(auxLayout); + auxFrame->setFrameStyle(QFrame::Panel | QFrame::Plain); + + mainLayout->addWidget(auxFrame); + mainLayout->setMargin(0); + mainLayout->setSpacing(0); + mainLayout->setSizeConstraint(QLayout::SetFixedSize); + + setLayout(mainLayout); +} + + void AudioRecorderWidget::setLocation(int x, int y){ + this->setGeometry(x,y,this->width(),this->height()); + } + + void AudioRecorderWidget::setOpacity(qreal value){ + this->setWindowOpacity(value); + } \ No newline at end of file diff -r ec2ca3fbd957 -r 87ccc62d9ea5 widgets/AudioRecorderWidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/AudioRecorderWidget.h Fri Mar 28 16:06:13 2008 +0000 @@ -0,0 +1,30 @@ +#ifndef _AUDIO_RECODER_WIDGET_H_ +#define _AUDIO_RECODER_WIDGET_H_ + +#include +#include +#include +#include +#include + + +class AudioRecorderWidget : public QDialog +{ + Q_OBJECT +public: + + AudioRecorderWidget(QWidget *parent = 0); + void setLocation(int x, int y); + void setOpacity(qreal value); + +private : + QPushButton *m_okButton; + QPushButton *m_cancelButton; + QDialogButtonBox *m_buttonBox; + QPushButton *m_startButton; + QPushButton *m_stopButton; + QPushButton *m_playButton; + +}; + +#endif \ No newline at end of file diff -r ec2ca3fbd957 -r 87ccc62d9ea5 widgets/svwidgets.vcproj --- a/widgets/svwidgets.vcproj Fri Mar 28 12:22:56 2008 +0000 +++ b/widgets/svwidgets.vcproj Fri Mar 28 16:06:13 2008 +0000 @@ -264,6 +264,10 @@ > + + @@ -571,6 +575,32 @@ + + + + + + + + @@ -1452,7 +1482,7 @@ @@ -2299,6 +2329,10 @@ > + +