summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index f088bef..b80b378 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -266,97 +266,97 @@ void VMemo::receive( const QCString &msg, const QByteArray &data ) {
266 266
267void VMemo::paintEvent( QPaintEvent* ) { 267void VMemo::paintEvent( QPaintEvent* ) {
268 QPainter p(this); 268 QPainter p(this);
269 p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); 269 p.drawPixmap( 0, 1,( const char** ) vmemo_xpm );
270} 270}
271 271
272void VMemo::mousePressEvent( QMouseEvent * /*me*/) { 272void VMemo::mousePressEvent( QMouseEvent * /*me*/) {
273 /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions 273 /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions
274 mousePressEvent and mouseReleaseEvent with a NULL parameter. */ 274 mousePressEvent and mouseReleaseEvent with a NULL parameter. */
275 275
276// if (!systemZaurus && me != NULL) 276// if (!systemZaurus && me != NULL)
277// return; 277// return;
278// } 278// }
279 279
280 if(!recording) 280 if(!recording)
281 startRecording(); 281 startRecording();
282 else 282 else
283 stopRecording(); 283 stopRecording();
284} 284}
285 285
286void VMemo::mouseReleaseEvent( QMouseEvent * ) { 286void VMemo::mouseReleaseEvent( QMouseEvent * ) {
287} 287}
288 288
289bool VMemo::startRecording() { 289bool VMemo::startRecording() {
290 Config config( "Vmemo" ); 290 Config config( "Vmemo" );
291 config.setGroup( "System" ); 291 config.setGroup( "System" );
292 292
293 useAlerts = config.readBoolEntry("Alert",1); 293 useAlerts = config.readBoolEntry("Alert",1);
294 if(useAlerts) { 294 if(useAlerts) {
295 295
296 msgLabel = new QLabel( 0, "alertLabel" ); 296 msgLabel = new QLabel( 0, "alertLabel" );
297 msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); 297 msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>");
298 msgLabel->show(); 298 msgLabel->show();
299 } 299 }
300 300
301 odebug << "Start recording engines" << oendl; 301 odebug << "Start recording engines" << oendl;
302 recording = TRUE; 302 recording = TRUE;
303 303
304 if (openDSP() == -1) { 304 if (openDSP() == -1) {
305 recording = FALSE; 305 recording = FALSE;
306 return FALSE; 306 return FALSE;
307 } 307 }
308 308
309 config.setGroup("Defaults"); 309 config.setGroup("Defaults");
310 310
311 date = TimeString::dateString( QDateTime::currentDateTime(),false,true); 311 date = TimeString::dateString( QDateTime::currentDateTime(),false,true);
312 date.replace(QRegExp("'"),""); 312 date.replace(QRegExp("'"),"");
313 date.replace(QRegExp(" "),"_"); 313 date.replace(QRegExp(" "),"_");
314 date.replace(QRegExp(":"),"."); 314 date.replace(QRegExp(":"),"-");
315 date.replace(QRegExp(","),""); 315 date.replace(QRegExp(","),"");
316 316
317 QString fName; 317 QString fName;
318 config.setGroup( "System" ); 318 config.setGroup( "System" );
319 fName = QPEApplication::documentDir() ; 319 fName = QPEApplication::documentDir() ;
320 fileName = config.readEntry("RecLocation", fName); 320 fileName = config.readEntry("RecLocation", fName);
321 321
322 int s; 322 int s;
323 s=fileName.find(':'); 323 s=fileName.find(':');
324 if(s) 324 if(s)
325 fileName=fileName.right(fileName.length()-s-2); 325 fileName=fileName.right(fileName.length()-s-2);
326 odebug << "pathname will be "+fileName << oendl; 326 odebug << "pathname will be "+fileName << oendl;
327 327
328 if( fileName.left(1).find('/') == -1) 328 if( fileName.left(1).find('/') == -1)
329 fileName="/"+fileName; 329 fileName="/"+fileName;
330 if( fileName.right(1).find('/') == -1) 330 if( fileName.right(1).find('/') == -1)
331 fileName+="/"; 331 fileName+="/";
332 fName = "vm_"+ date + ".wav"; 332 fName = "vm_"+ date + ".wav";
333 333
334 fileName+=fName; 334 fileName+=fName;
335 odebug << "filename is " + fileName << oendl; 335 odebug << "filename is " + fileName << oendl;
336// open tmp file here 336// open tmp file here
337 char *pointer; 337 char *pointer;
338 pointer=tmpnam(NULL); 338 pointer=tmpnam(NULL);
339 odebug << "Opening tmp file " << pointer << "" << oendl; 339 odebug << "Opening tmp file " << pointer << "" << oendl;
340 340
341 if(openWAV(pointer ) == -1) { 341 if(openWAV(pointer ) == -1) {
342 342
343 QString err("Could not open the temp file\n"); 343 QString err("Could not open the temp file\n");
344 err += fileName; 344 err += fileName;
345 QMessageBox::critical(0, "vmemo", err, "Abort"); 345 QMessageBox::critical(0, "vmemo", err, "Abort");
346 ::close(dsp); 346 ::close(dsp);
347 return FALSE; 347 return FALSE;
348 } 348 }
349 if( record() ) { 349 if( record() ) {
350 350
351 QString cmd; 351 QString cmd;
352 if( fileName.find(".wav",0,TRUE) == -1) 352 if( fileName.find(".wav",0,TRUE) == -1)
353 fileName += ".wav"; 353 fileName += ".wav";
354 354
355 cmd.sprintf("mv %s "+fileName, pointer); 355 cmd.sprintf("mv %s "+fileName, pointer);
356// move tmp file to regular file here 356// move tmp file to regular file here
357 357
358 system(cmd.latin1()); 358 system(cmd.latin1());
359 359
360 QArray<int> cats(1); 360 QArray<int> cats(1);
361 cats[0] = config.readNumEntry("Category", 0); 361 cats[0] = config.readNumEntry("Category", 0);
362 362