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 | |||
@@ -75,19 +75,42 @@ PcmciaManager::PcmciaManager( QWidget * parent ) : QWidget( parent ) | |||
75 | 75 | ||
76 | setFocusPolicy( NoFocus ); | 76 | setFocusPolicy( NoFocus ); |
77 | setFixedWidth ( AppLnk::smallIconSize() ); | 77 | setFixedWidth ( AppLnk::smallIconSize() ); |
78 | setFixedHeight ( AppLnk::smallIconSize() ); | 78 | setFixedHeight ( AppLnk::smallIconSize() ); |
79 | pm = Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ); | 79 | pm = Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ); |
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 | } |
82 | 86 | ||
83 | 87 | ||
84 | PcmciaManager::~PcmciaManager() | 88 | PcmciaManager::~PcmciaManager() |
85 | { | 89 | { |
86 | } | 90 | } |
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 | ||
89 | void PcmciaManager::popUp( QString message, QString icon ) | 112 | void PcmciaManager::popUp( QString message, QString icon ) |
90 | { | 113 | { |
91 | if ( !popupMenu ) { | 114 | if ( !popupMenu ) { |
92 | popupMenu = new QPopupMenu( this ); | 115 | popupMenu = new QPopupMenu( this ); |
93 | } | 116 | } |
@@ -194,12 +217,14 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & ) | |||
194 | cfg.setGroup( cardSection ); | 217 | cfg.setGroup( cardSection ); |
195 | QString name = cfg.readEntry( "name" ); | 218 | QString name = cfg.readEntry( "name" ); |
196 | odebug << "pcmcia: comparing card '" << cardName << "' with known card '" << name << "'" << oendl; | 219 | odebug << "pcmcia: comparing card '" << cardName << "' with known card '" << name << "'" << oendl; |
197 | if ( cardName == name ) | 220 | if ( cardName == name ) |
198 | { | 221 | { |
199 | newCard = false; | 222 | newCard = false; |
223 | odebug << "pcmcia: we have seen this card before" << oendl; | ||
224 | executeInsertAction( theCard ); | ||
200 | break; | 225 | break; |
201 | } | 226 | } |
202 | } | 227 | } |
203 | if ( !newCard ) ++it; else break; | 228 | if ( !newCard ) ++it; else break; |
204 | } | 229 | } |
205 | } | 230 | } |
@@ -341,9 +366,19 @@ bool PcmciaManager::configure( OPcmciaSocket* card, QString& insertAction, QStri | |||
341 | driver = dialog.cbBindTo->currentText(); | 366 | driver = dialog.cbBindTo->currentText(); |
342 | conf = dialog.bindEntries[driver]; | 367 | conf = dialog.bindEntries[driver]; |
343 | } | 368 | } |
344 | return configresult; | 369 | return configresult; |
345 | } | 370 | } |
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 | ||
348 | EXPORT_OPIE_APPLET_v1( PcmciaManager ) | 383 | EXPORT_OPIE_APPLET_v1( PcmciaManager ) |
349 | 384 | ||