-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index c5d0a5b..4c07b3a 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -210,10 +210,8 @@ VMemo::VMemo( QWidget *parent, const char *_name ) : QWidget( parent, _name ) { setFixedHeight( 18 ); setFixedWidth( 14 ); - recording = FALSE; - t_timer = new QTimer( this ); connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); struct utsname name; /* check for embedix kernel running on the zaurus*/ @@ -236,9 +234,8 @@ VMemo::VMemo( QWidget *parent, const char *_name ) connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), this, SLOT(receive(const QCString&, const QByteArray&)) ); if( toggleKey != -1 ) { - // QPEApplication::grabKeyboard(); QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)"); // e << 4096; // Key_Escape // e << Key_F5; //4148 e << toggleKey; @@ -250,8 +247,9 @@ VMemo::VMemo( QWidget *parent, const char *_name ) else usingIcon=FALSE; if( vmCfg.readNumEntry("hideIcon",0) == 1) hide(); + recording = FALSE; } } VMemo::~VMemo() { @@ -261,16 +259,13 @@ void VMemo::receive( const QCString &msg, const QByteArray &data ) { qDebug("receive"); QDataStream stream( data, IO_ReadOnly ); if (msg == "toggleRecord()") { - if (recording) { fromToggle = TRUE; - mouseReleaseEvent(NULL); stopRecording(); } else { fromToggle = TRUE; - // mousePressEvent(NULL); startRecording(); } } } @@ -280,18 +275,12 @@ void VMemo::paintEvent( QPaintEvent* ) { p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); } void VMemo::mousePressEvent( QMouseEvent * me) { - // just to be safe -// if (recording) { -// recording = FALSE; -// return; -// } /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions mousePressEvent and mouseReleaseEvent with a NULL parameter. */ -// if ( me->button() != LeftButton && me != NULL /*&& !systemZaurus*/) { - // if (!systemZaurus && me != NULL) +// if (!systemZaurus && me != NULL) // return; // } if(!recording) @@ -300,17 +289,11 @@ void VMemo::mousePressEvent( QMouseEvent * me) { stopRecording(); } void VMemo::mouseReleaseEvent( QMouseEvent * ) { -// if(usingIcon && !recording) -// stopRecording(); } bool VMemo::startRecording() { - - if ( recording) - return FALSE; - Config config( "Vmemo" ); config.setGroup( "System" ); useAlerts = config.readBoolEntry("Alert",1); @@ -320,21 +303,12 @@ bool VMemo::startRecording() { msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); msgLabel->show(); } - // if(useAlerts) - // QMessageBox::message("VMemo","Really Record?");//) ==1) - // return; - // } else { - // if (!systemZaurus ) - // QSound::play(Resource::findSound("vmemob")); - // } qDebug("Start recording engines"); recording = TRUE; if (openDSP() == -1) { - // QMessageBox::critical(0, "vmemo", "Could not open dsp device.\n"+errorMsg, "Abort"); - // delete msgLabel; recording = FALSE; msgLabel=0; delete msgLabel; @@ -575,9 +549,9 @@ bool VMemo::record() { if(length<0) { recording=false; perror("dev/dsp's is a lookin' messy"); - QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); + QMessageBox::message("Vmemo","Error writing to file\n"+ fileName); break; return FALSE; } // printf("%d\r",length); @@ -605,14 +579,10 @@ bool VMemo::record() { perror("ioctl(\"SNDCTL_DSP_RESET\")"); ::close(dsp); - // if(useAlerts) - // QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); qDebug("done recording "+fileName); -// QSound::play(Resource::findSound("vmemoe")); - Config cfg("qpe"); cfg.setGroup("Volume"); QString foo = cfg.readEntry("Mute","TRUE"); if(foo.find("TRUE",0,TRUE) != -1) |