summaryrefslogtreecommitdiff
path: root/noncore/applets/pcmcia/pcmcia.cpp
authormickeyl <mickeyl>2005-06-25 15:28:21 (UTC)
committer mickeyl <mickeyl>2005-06-25 15:28:21 (UTC)
commit3d434ac35915afe7f7035468ca18656264a91c52 (patch) (side-by-side diff)
treef71edcbb83d4566f098da4de68f77a2f6058062f /noncore/applets/pcmcia/pcmcia.cpp
parent3ec008c17167a17f89cc096779113c6b8369b257 (diff)
downloadopie-3d434ac35915afe7f7035468ca18656264a91c52.zip
opie-3d434ac35915afe7f7035468ca18656264a91c52.tar.gz
opie-3d434ac35915afe7f7035468ca18656264a91c52.tar.bz2
fix enable/disable logic for menu entries in popup
Diffstat (limited to 'noncore/applets/pcmcia/pcmcia.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/pcmcia/pcmcia.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/noncore/applets/pcmcia/pcmcia.cpp b/noncore/applets/pcmcia/pcmcia.cpp
index af23f58..c6386cb 100644
--- a/noncore/applets/pcmcia/pcmcia.cpp
+++ b/noncore/applets/pcmcia/pcmcia.cpp
@@ -78,3 +78,3 @@ PcmciaManager::PcmciaManager( QWidget * parent ) : QWidget( parent ), popupMenu(
setFixedHeight ( AppLnk::smallIconSize() );
- pm = Opie::Core::OResource::loadPixmap( "pcmcia/pcmcia", Opie::Core::OResource::SmallIcon );
+ pm = Opie::Core::OResource::loadPixmap( "pcmcia", Opie::Core::OResource::SmallIcon );
configuring = false;
@@ -165,7 +165,11 @@ void PcmciaManager::mousePressEvent( QMouseEvent* )
- submenu->setItemEnabled( EJECT+i*100, !it.current()->isEmpty() );
- submenu->setItemEnabled( INSERT+i*100, it.current()->isEmpty() );
- submenu->setItemEnabled( SUSPEND+i*100, !it.current()->isEmpty() && it.current()->isSuspended() );
- submenu->setItemEnabled( RESUME+i*100, !it.current()->isEmpty() && !it.current()->isSuspended() );
- submenu->setItemEnabled( CONFIGURE+i*100, !it.current()->isEmpty() && !configuring );
+ bool isSuspended = it.current()->isSuspended();
+ bool isEmpty = it.current()->isEmpty();
+
+ submenu->setItemEnabled( EJECT+i*100, !isEmpty );
+ submenu->setItemEnabled( INSERT+i*100, isEmpty );
+ submenu->setItemEnabled( SUSPEND+i*100, !isEmpty && !isSuspended );
+ submenu->setItemEnabled( RESUME+i*100, !isEmpty && isSuspended );
+ submenu->setItemEnabled( RESET+i*100, !isEmpty && !isSuspended );
+ submenu->setItemEnabled( CONFIGURE+i*100, !isEmpty && !configuring );
@@ -215,3 +219,3 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & )
theCard = it.current();
- QString cardName = theCard->productIdentity().join( " " ).stripWhiteSpace();
+ QString cardName = theCard->productIdentity();
for ( int i = 0; i < nCards; ++i )
@@ -236,3 +240,3 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & )
odebug << "pcmcia: unconfigured card detected" << oendl;
- QString newCardName = theCard->productIdentity().join( " " ).stripWhiteSpace();
+ QString newCardName = theCard->productIdentity();
int result = QMessageBox::information( qApp->desktop(),
@@ -263,3 +267,3 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & )
QString entryVersion( " version " );
- for ( QStringList::Iterator it = theCard->productIdentity().begin(); it != theCard->productIdentity().end(); ++it )
+ for ( QStringList::Iterator it = theCard->productIdentityVector().begin(); it != theCard->productIdentityVector().end(); ++it )
{