summaryrefslogtreecommitdiff
path: root/noncore/applets
authormickeyl <mickeyl>2005-06-21 14:11:55 (UTC)
committer mickeyl <mickeyl>2005-06-21 14:11:55 (UTC)
commitae85d18a1f8a63323ad47631724516f3aa355a75 (patch) (side-by-side diff)
tree9238ab79beabca8f035714f3e339513c06685d2a /noncore/applets
parent65ea54f43ee7dcbd95ffb474c8dfbb8b076d43e5 (diff)
downloadopie-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') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/pcmcia/pcmcia.cpp35
-rw-r--r--noncore/applets/pcmcia/pcmcia.h5
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 )
configuring = false;
+
+ QCopChannel *channel = new QCopChannel( "QPE/System", this );
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(handleSystemChannel(const QCString&,const QByteArray&)) );
}
@@ -87,2 +91,21 @@ 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;
+ }
+ }
+}
@@ -199,2 +222,4 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & )
newCard = false;
+ odebug << "pcmcia: we have seen this card before" << oendl;
+ executeInsertAction( theCard );
break;
@@ -346,2 +371,12 @@ bool PcmciaManager::configure( OPcmciaSocket* card, QString& insertAction, QStri
+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;
+}
+
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
private slots:
- void cardMessage( const QCString& msg, const QByteArray& );
+ void handleSystemChannel( const QCString&, const QByteArray& );
+ void cardMessage( const QCString&, const QByteArray& );
void userCardAction( int action );
@@ -58,2 +59,4 @@ class PcmciaManager : public QWidget
void execCommand( const QStringList &command );
+ void executeInsertAction( Opie::Core::OPcmciaSocket* );
+ void executeResumeAction( Opie::Core::OPcmciaSocket* );
void popUp(QString message, QString icon = QString::null );