-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 7965b59..cb3e45e 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -238,97 +238,97 @@ VMemo::VMemo( QWidget *parent, const char *_name ) | |||
238 | if( vmCfg.readNumEntry("hideIcon",0) == 1) | 238 | if( vmCfg.readNumEntry("hideIcon",0) == 1) |
239 | hide(); | 239 | hide(); |
240 | } | 240 | } |
241 | } | 241 | } |
242 | 242 | ||
243 | VMemo::~VMemo() | 243 | VMemo::~VMemo() |
244 | { | 244 | { |
245 | } | 245 | } |
246 | 246 | ||
247 | void VMemo::receive( const QCString &msg, const QByteArray &data ) | 247 | void VMemo::receive( const QCString &msg, const QByteArray &data ) |
248 | { | 248 | { |
249 | qDebug("receive"); | 249 | qDebug("receive"); |
250 | QDataStream stream( data, IO_ReadOnly ); | 250 | QDataStream stream( data, IO_ReadOnly ); |
251 | if (msg == "toggleRecord()") { | 251 | if (msg == "toggleRecord()") { |
252 | if (recording) { | 252 | if (recording) { |
253 | fromToggle = TRUE; | 253 | fromToggle = TRUE; |
254 | stopRecording(); | 254 | stopRecording(); |
255 | } else { | 255 | } else { |
256 | fromToggle = TRUE; | 256 | fromToggle = TRUE; |
257 | startRecording(); | 257 | startRecording(); |
258 | } | 258 | } |
259 | } | 259 | } |
260 | } | 260 | } |
261 | 261 | ||
262 | void VMemo::paintEvent( QPaintEvent* ) | 262 | void VMemo::paintEvent( QPaintEvent* ) |
263 | { | 263 | { |
264 | QPainter p(this); | 264 | QPainter p(this); |
265 | p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); | 265 | p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); |
266 | } | 266 | } |
267 | 267 | ||
268 | void VMemo::mousePressEvent( QMouseEvent * ) | 268 | void VMemo::mousePressEvent( QMouseEvent * ) |
269 | { | 269 | { |
270 | startRecording(); | 270 | startRecording(); |
271 | } | 271 | } |
272 | 272 | ||
273 | void VMemo::mouseReleaseEvent( QMouseEvent * ) | 273 | void VMemo::mouseReleaseEvent( QMouseEvent * ) |
274 | { | 274 | { |
275 | stopRecording(); | 275 | stopRecording(); |
276 | } | 276 | } |
277 | 277 | ||
278 | bool VMemo::startRecording() { | 278 | bool VMemo::startRecording() { |
279 | 279 | ||
280 | if ( recording) | 280 | if ( recording) |
281 | return FALSE; | 281 | return FALSE; |
282 | 282 | ||
283 | Config config( "Vmemo" ); | 283 | Config config( "Vmemo" ); |
284 | config.setGroup( "System" ); | 284 | config.setGroup( "System" ); |
285 | 285 | ||
286 | useAlerts = config.readBoolEntry("Alert"); | 286 | useAlerts = config.readBoolEntry("Alert",1); |
287 | if(useAlerts) { | 287 | if(useAlerts) { |
288 | 288 | ||
289 | msgLabel = new QLabel( 0, "alertLabel" ); | 289 | msgLabel = new QLabel( 0, "alertLabel" ); |
290 | msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); | 290 | msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); |
291 | msgLabel->show(); | 291 | msgLabel->show(); |
292 | } | 292 | } |
293 | 293 | ||
294 | // if(useAlerts) | 294 | // if(useAlerts) |
295 | // QMessageBox::message("VMemo","Really Record?");//) ==1) | 295 | // QMessageBox::message("VMemo","Really Record?");//) ==1) |
296 | // return; | 296 | // return; |
297 | // } else { | 297 | // } else { |
298 | // if (!systemZaurus ) | 298 | // if (!systemZaurus ) |
299 | // QSound::play(Resource::findSound("vmemob")); | 299 | // QSound::play(Resource::findSound("vmemob")); |
300 | // } | 300 | // } |
301 | qDebug("Start recording engines"); | 301 | qDebug("Start recording engines"); |
302 | recording = TRUE; | 302 | recording = TRUE; |
303 | 303 | ||
304 | if (openDSP() == -1) { | 304 | if (openDSP() == -1) { |
305 | // QMessageBox::critical(0, "vmemo", "Could not open dsp device.\n"+errorMsg, "Abort"); | 305 | // QMessageBox::critical(0, "vmemo", "Could not open dsp device.\n"+errorMsg, "Abort"); |
306 | // delete msgLabel; | 306 | // delete msgLabel; |
307 | recording = FALSE; | 307 | recording = FALSE; |
308 | msgLabel=0; | 308 | msgLabel=0; |
309 | delete msgLabel; | 309 | delete msgLabel; |
310 | 310 | ||
311 | return FALSE; | 311 | return FALSE; |
312 | } | 312 | } |
313 | 313 | ||
314 | config.setGroup("Defaults"); | 314 | config.setGroup("Defaults"); |
315 | 315 | ||
316 | QDateTime dt = QDateTime::currentDateTime(); | 316 | QDateTime dt = QDateTime::currentDateTime(); |
317 | 317 | ||
318 | QString fName; | 318 | QString fName; |
319 | config.setGroup( "System" ); | 319 | config.setGroup( "System" ); |
320 | fName = QPEApplication::documentDir() ; | 320 | fName = QPEApplication::documentDir() ; |
321 | fileName = config.readEntry("RecLocation", fName); | 321 | fileName = config.readEntry("RecLocation", fName); |
322 | 322 | ||
323 | int s; | 323 | int s; |
324 | s=fileName.find(':'); | 324 | s=fileName.find(':'); |
325 | if(s) | 325 | if(s) |
326 | fileName=fileName.right(fileName.length()-s-2); | 326 | fileName=fileName.right(fileName.length()-s-2); |
327 | qDebug("pathname will be "+fileName); | 327 | qDebug("pathname will be "+fileName); |
328 | 328 | ||
329 | if( fileName.left(1).find('/') == -1) | 329 | if( fileName.left(1).find('/') == -1) |
330 | fileName="/"+fileName; | 330 | fileName="/"+fileName; |
331 | if( fileName.right(1).find('/') == -1) | 331 | if( fileName.right(1).find('/') == -1) |
332 | fileName+="/"; | 332 | fileName+="/"; |
333 | fName = "vm_"+ dt.toString()+ ".wav"; | 333 | fName = "vm_"+ dt.toString()+ ".wav"; |
334 | 334 | ||