author | mickeyl <mickeyl> | 2005-06-21 14:11:55 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-06-21 14:11:55 (UTC) |
commit | ae85d18a1f8a63323ad47631724516f3aa355a75 (patch) (unidiff) | |
tree | 9238ab79beabca8f035714f3e339513c06685d2a | |
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()'
-rw-r--r-- | noncore/applets/pcmcia/pcmcia.cpp | 35 | ||||
-rw-r--r-- | noncore/applets/pcmcia/pcmcia.h | 5 |
2 files changed, 39 insertions, 1 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 | |||
@@ -80,2 +80,6 @@ PcmciaManager::PcmciaManager( QWidget * parent ) : QWidget( parent ) | |||
80 | configuring = false; | 80 | configuring = false; |
81 | |||
82 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); | ||
83 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), | ||
84 | this, SLOT(handleSystemChannel(const QCString&,const QByteArray&)) ); | ||
81 | } | 85 | } |
@@ -87,2 +91,21 @@ PcmciaManager::~PcmciaManager() | |||
87 | 91 | ||
92 | void PcmciaManager::handleSystemChannel( const QCString&msg, const QByteArray& ) | ||
93 | { | ||
94 | if ( msg == "returnFromSuspend()" ) | ||
95 | { | ||
96 | if ( !OPcmciaSystem::instance()->cardCount() ) return; | ||
97 | OPcmciaSystem* sys = OPcmciaSystem::instance(); | ||
98 | OPcmciaSystem::CardIterator it = sys->iterator(); | ||
99 | OPcmciaSocket* theCard = 0; | ||
100 | |||
101 | while ( it.current() ) | ||
102 | { | ||
103 | if ( it.current()->isEmpty() ) | ||
104 | { | ||
105 | executeResumeAction( theCard ); | ||
106 | } | ||
107 | ++it; | ||
108 | } | ||
109 | } | ||
110 | } | ||
88 | 111 | ||
@@ -199,2 +222,4 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & ) | |||
199 | newCard = false; | 222 | newCard = false; |
223 | odebug << "pcmcia: we have seen this card before" << oendl; | ||
224 | executeInsertAction( theCard ); | ||
200 | break; | 225 | break; |
@@ -346,2 +371,12 @@ bool PcmciaManager::configure( OPcmciaSocket* card, QString& insertAction, QStri | |||
346 | 371 | ||
372 | void PcmciaManager::executeInsertAction( Opie::Core::OPcmciaSocket* card ) | ||
373 | { | ||
374 | odebug << "pcmcia: execute insert action" << oendl; | ||
375 | } | ||
376 | |||
377 | void PcmciaManager::executeResumeAction( Opie::Core::OPcmciaSocket* card ) | ||
378 | { | ||
379 | odebug << "pcmcia: execute resume action" << oendl; | ||
380 | } | ||
381 | |||
347 | 382 | ||
diff --git a/noncore/applets/pcmcia/pcmcia.h b/noncore/applets/pcmcia/pcmcia.h index 94203d3..6567cd7 100644 --- a/noncore/applets/pcmcia/pcmcia.h +++ b/noncore/applets/pcmcia/pcmcia.h | |||
@@ -47,3 +47,4 @@ class PcmciaManager : public QWidget | |||
47 | private slots: | 47 | private slots: |
48 | void cardMessage( const QCString& msg, const QByteArray& ); | 48 | void handleSystemChannel( const QCString&, const QByteArray& ); |
49 | void cardMessage( const QCString&, const QByteArray& ); | ||
49 | void userCardAction( int action ); | 50 | void userCardAction( int action ); |
@@ -58,2 +59,4 @@ class PcmciaManager : public QWidget | |||
58 | void execCommand( const QStringList &command ); | 59 | void execCommand( const QStringList &command ); |
60 | void executeInsertAction( Opie::Core::OPcmciaSocket* ); | ||
61 | void executeResumeAction( Opie::Core::OPcmciaSocket* ); | ||
59 | void popUp(QString message, QString icon = QString::null ); | 62 | void popUp(QString message, QString icon = QString::null ); |