summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-07-12 04:53:07 (UTC)
committer llornkcor <llornkcor>2002-07-12 04:53:07 (UTC)
commit7c12000481b535ce54951ef8a53b439814f8fcd6 (patch) (unidiff)
treeeed9230c9d4defd43b0735710fec49788ca17fd5
parent5f010888acabe5d00504b05d159b2837ff115f05 (diff)
downloadopie-7c12000481b535ce54951ef8a53b439814f8fcd6.zip
opie-7c12000481b535ce54951ef8a53b439814f8fcd6.tar.gz
opie-7c12000481b535ce54951ef8a53b439814f8fcd6.tar.bz2
try to fix taskbar icon foofaa
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp42
1 files changed, 34 insertions, 8 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 2c3edf1..b77e3b8 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -254,9 +254,11 @@ void VMemo::receive( const QCString &msg, const QByteArray &data )
254 if (msg == "toggleRecord()") { 254 if (msg == "toggleRecord()") {
255 if (recording) { 255 if (recording) {
256 fromToggle = TRUE; 256 fromToggle = TRUE;
257 stopRecording(); 257 mouseReleaseEvent(NULL);
258// stopRecording();
258 } else { 259 } else {
259 fromToggle = TRUE; 260 fromToggle = TRUE;
261 // mousePressEvent(NULL);
260 startRecording(); 262 startRecording();
261 } 263 }
262 } 264 }
@@ -268,8 +270,20 @@ void VMemo::paintEvent( QPaintEvent* )
268 p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); 270 p.drawPixmap( 0, 1,( const char** ) vmemo_xpm );
269} 271}
270 272
271void VMemo::mousePressEvent( QMouseEvent * ) 273void VMemo::mousePressEvent( QMouseEvent * me)
272{ 274{
275 // just to be safe
276 if (recording) {
277 recording = FALSE;
278 return;
279 }
280 /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions
281 mousePressEvent and mouseReleaseEvent with a NULL parameter. */
282 if ( me->button() != LeftButton)
283
284 // if (!systemZaurus && me != NULL)
285 return;
286
273 if(!recording) 287 if(!recording)
274 startRecording(); 288 startRecording();
275 else 289 else
@@ -347,13 +361,25 @@ bool VMemo::startRecording() {
347 fileName.replace(QRegExp(":"),"."); 361 fileName.replace(QRegExp(":"),".");
348 fileName.replace(QRegExp(","),""); 362 fileName.replace(QRegExp(","),"");
349 363
350 if(openWAV(fileName.latin1()) == -1) { 364// open tmp file here
351 // QString err("Could not open the output file\n"); 365 char *pointer;
352 // err += fileName; 366 pointer=tmpnam(NULL);
353 // QMessageBox::critical(0, "vmemo", err, "Abort"); 367 qDebug("Opening tmp file %s",pointer);
354 close(dsp); 368
369 if(openWAV(pointer ) == -1) {
370
371// if(openWAV(fileName.latin1()) == -1) {
372 QString err("Could not open the temp file\n");
373 err += fileName;
374 QMessageBox::critical(0, "vmemo", err, "Abort");
375 ::close(dsp);
355 return FALSE; 376 return FALSE;
356 } 377 }
378 QString cmd;
379 cmd.sprintf("mv %s "+fileName,pointer);
380
381// move tmp file to regular file here
382 system(cmd.latin1());
357 383
358 QArray<int> cats(1); 384 QArray<int> cats(1);
359 cats[0] = config.readNumEntry("Category", 0); 385 cats[0] = config.readNumEntry("Category", 0);
@@ -647,5 +673,5 @@ int VMemo::setToggleButton(int tog) {
647void VMemo::timerBreak() { 673void VMemo::timerBreak() {
648 //stop 674 //stop
649 stopRecording(); 675 stopRecording();
650 QMessageBox::message("Vmemo","Vmemo recording has \ntimed out"); 676 QMessageBox::message("Vmemo","Vmemo recording has ended");
651} 677}