author | harlekin <harlekin> | 2002-06-24 21:05:01 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-24 21:05:01 (UTC) |
commit | 67b1be897a8c02b70b6e0805ff0c5ae19146905c (patch) (side-by-side diff) | |
tree | 02f0e45847959560f1912a06d31f5895618edc88 | |
parent | 2751bb111d21a5672c7caa7a6c2c45d14a642dbd (diff) | |
download | opie-67b1be897a8c02b70b6e0805ff0c5ae19146905c.zip opie-67b1be897a8c02b70b6e0805ff0c5ae19146905c.tar.gz opie-67b1be897a8c02b70b6e0805ff0c5ae19146905c.tar.bz2 |
fixed a segfault if a device is discovered on opie start and added sounds
-rw-r--r-- | core/applets/irdaapplet/irda.cpp | 24 | ||||
-rw-r--r-- | core/applets/irdaapplet/irda.h | 3 | ||||
-rw-r--r-- | core/applets/irdaapplet/irdaapplet.pro | 31 | ||||
-rw-r--r-- | core/applets/irdaapplet/opie-irdaapplet.control | 2 |
4 files changed, 34 insertions, 26 deletions
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp index c0f11c0..42bed5e 100644 --- a/core/applets/irdaapplet/irda.cpp +++ b/core/applets/irdaapplet/irda.cpp @@ -46,2 +46,3 @@ #include <qpopupmenu.h> +#include <qsound.h> @@ -66,4 +67,2 @@ IrdaApplet::IrdaApplet( QWidget *parent, const char *name ) receiveActive = false; - startTimer(5000); - timerEvent(NULL); popupMenu = 0; @@ -72,2 +71,7 @@ IrdaApplet::IrdaApplet( QWidget *parent, const char *name ) +void IrdaApplet::show() { + QWidget::show(); + startTimer(2000); +} + IrdaApplet::~IrdaApplet() { @@ -208,3 +212,3 @@ void IrdaApplet::showDiscovered() { for(QStringList::Iterator line=list.begin(); line!=list.end(); line++) { - qDebug( (*line) ); + // qDebug( (*line) ); if( (*line).startsWith("nickname:") ){ @@ -213,3 +217,3 @@ void IrdaApplet::showDiscovered() { - qDebug(discoveredDevice + "(" + deviceAddr + ")"); + // qDebug(discoveredDevice + "(" + deviceAddr + ")"); @@ -217,2 +221,3 @@ void IrdaApplet::showDiscovered() { popup( tr("Found:") + " " + discoveredDevice ); + QSound::play(Resource::findSound("irdaapplet/irdaon")); qcopsend = TRUE; @@ -226,7 +231,8 @@ void IrdaApplet::showDiscovered() { while ( it.current() ) { - qDebug("IrdaMon: delete " + it.currentKey() + "=" + *devicesAvailable[it.currentKey()] + "?"); + // qDebug("IrdaMon: delete " + it.currentKey() + "=" + *devicesAvailable[it.currentKey()] + "?"); if ( (*it.current()).left(3) == "+++" ) { popup( tr("Lost:") + " " + (*devicesAvailable[it.currentKey()]).mid(3) ); + QSound::play(Resource::findSound("irdaapplet/irdaoff")); devicesAvailable.remove( it.currentKey() ); - qDebug("IrdaMon: delete " + it.currentKey() + "!"); + // qDebug("IrdaMon: delete " + it.currentKey() + "!"); qcopsend = TRUE; @@ -254,3 +260,2 @@ void IrdaApplet::mousePressEvent( QMouseEvent *) { menu->insertItem( tr("Discovered Device:"), 9); - QDictIterator<QString> it( devicesAvailable ); @@ -318,5 +323,2 @@ void IrdaApplet::mousePressEvent( QMouseEvent *) { } - case 6: - qDebug("FIXME: Bring up pretty menu...\n"); - // With table of currently-detected devices. } @@ -351,3 +353,3 @@ void IrdaApplet::paintEvent( QPaintEvent* ) { QPainter p(this); - qDebug("paint irda pixmap"); + // qDebug("paint irda pixmap"); diff --git a/core/applets/irdaapplet/irda.h b/core/applets/irdaapplet/irda.h index 7b37847..e878946 100644 --- a/core/applets/irdaapplet/irda.h +++ b/core/applets/irdaapplet/irda.h @@ -49,2 +49,5 @@ private: +public slots: + void show(); + private slots: diff --git a/core/applets/irdaapplet/irdaapplet.pro b/core/applets/irdaapplet/irdaapplet.pro index 035b0c1..47267f7 100644 --- a/core/applets/irdaapplet/irdaapplet.pro +++ b/core/applets/irdaapplet/irdaapplet.pro @@ -11,15 +11,18 @@ VERSION = 1.0.0 -TRANSLATIONS = ../../i18n/de/libirdaapplet.ts -TRANSLATIONS += ../../i18n/en/libirdaapplet.ts -TRANSLATIONS += ../../i18n/es/libirdaapplet.ts -TRANSLATIONS += ../../i18n/fr/libirdaapplet.ts -TRANSLATIONS += ../../i18n/hu/libirdaapplet.ts -TRANSLATIONS += ../../i18n/ja/libirdaapplet.ts -TRANSLATIONS += ../../i18n/ko/libirdaapplet.ts -TRANSLATIONS += ../../i18n/no/libirdaapplet.ts -TRANSLATIONS += ../../i18n/pl/libirdaapplet.ts -TRANSLATIONS += ../../i18n/pt/libirdaapplet.ts -TRANSLATIONS += ../../i18n/pt_BR/libirdaapplet.ts -TRANSLATIONS += ../../i18n/sl/libirdaapplet.ts -TRANSLATIONS += ../../i18n/zh_CN/libirdaapplet.ts -TRANSLATIONS += ../../i18n/zh_TW/libirdaapplet.ts + + +TRANSLATIONS = ../../../i18n/de/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/en/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/es/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/fr/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/hu/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/ja/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/ko/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/no/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/pl/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/pt/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/pt_BR/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/sl/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/zh_CN/libirdaapplet.ts +TRANSLATIONS += ../../../i18n/zh_TW/libirdaapplet.ts + diff --git a/core/applets/irdaapplet/opie-irdaapplet.control b/core/applets/irdaapplet/opie-irdaapplet.control index 85c3386..5b901de 100644 --- a/core/applets/irdaapplet/opie-irdaapplet.control +++ b/core/applets/irdaapplet/opie-irdaapplet.control @@ -1,2 +1,2 @@ -Files: plugins/applets/libirdaapplet.so* pics/irdaapplet/* +Files: plugins/applets/libirdaapplet.so* pics/irdaapplet/* sounds/irdaapplet/*.wav Priority: optional |