author | mickeyl <mickeyl> | 2005-06-21 14:11:55 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-06-21 14:11:55 (UTC) |
commit | ae85d18a1f8a63323ad47631724516f3aa355a75 (patch) (side-by-side diff) | |
tree | 9238ab79beabca8f035714f3e339513c06685d2a /noncore/applets/pcmcia/pcmcia.cpp | |
parent | 65ea54f43ee7dcbd95ffb474c8dfbb8b076d43e5 (diff) | |
download | opie-ae85d18a1f8a63323ad47631724516f3aa355a75.zip opie-ae85d18a1f8a63323ad47631724516f3aa355a75.tar.gz opie-ae85d18a1f8a63323ad47631724516f3aa355a75.tar.bz2 |
- prepare methods to execute the preferred actions on insertion and suspend
- intercept QPE/System channel to listen for 'resumeFromSuspend()'
Diffstat (limited to 'noncore/applets/pcmcia/pcmcia.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/pcmcia/pcmcia.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/noncore/applets/pcmcia/pcmcia.cpp b/noncore/applets/pcmcia/pcmcia.cpp index 186dfea..0787c3c 100644 --- a/noncore/applets/pcmcia/pcmcia.cpp +++ b/noncore/applets/pcmcia/pcmcia.cpp @@ -77,15 +77,38 @@ PcmciaManager::PcmciaManager( QWidget * parent ) : QWidget( parent ) setFixedWidth ( AppLnk::smallIconSize() ); setFixedHeight ( AppLnk::smallIconSize() ); pm = Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ); configuring = false; + + QCopChannel *channel = new QCopChannel( "QPE/System", this ); + connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), + this, SLOT(handleSystemChannel(const QCString&,const QByteArray&)) ); } PcmciaManager::~PcmciaManager() { } +void PcmciaManager::handleSystemChannel( const QCString&msg, const QByteArray& ) +{ + if ( msg == "returnFromSuspend()" ) + { + if ( !OPcmciaSystem::instance()->cardCount() ) return; + OPcmciaSystem* sys = OPcmciaSystem::instance(); + OPcmciaSystem::CardIterator it = sys->iterator(); + OPcmciaSocket* theCard = 0; + + while ( it.current() ) + { + if ( it.current()->isEmpty() ) + { + executeResumeAction( theCard ); + } + ++it; + } + } +} void PcmciaManager::popUp( QString message, QString icon ) { if ( !popupMenu ) { @@ -196,8 +219,10 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & ) odebug << "pcmcia: comparing card '" << cardName << "' with known card '" << name << "'" << oendl; if ( cardName == name ) { newCard = false; + odebug << "pcmcia: we have seen this card before" << oendl; + executeInsertAction( theCard ); break; } } if ( !newCard ) ++it; else break; @@ -343,7 +368,17 @@ bool PcmciaManager::configure( OPcmciaSocket* card, QString& insertAction, QStri } return configresult; } +void PcmciaManager::executeInsertAction( Opie::Core::OPcmciaSocket* card ) +{ + odebug << "pcmcia: execute insert action" << oendl; +} + +void PcmciaManager::executeResumeAction( Opie::Core::OPcmciaSocket* card ) +{ + odebug << "pcmcia: execute resume action" << oendl; +} + EXPORT_OPIE_APPLET_v1( PcmciaManager ) |