author | mickeyl <mickeyl> | 2005-06-25 15:28:21 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-06-25 15:28:21 (UTC) |
commit | 3d434ac35915afe7f7035468ca18656264a91c52 (patch) (unidiff) | |
tree | f71edcbb83d4566f098da4de68f77a2f6058062f | |
parent | 3ec008c17167a17f89cc096779113c6b8369b257 (diff) | |
download | opie-3d434ac35915afe7f7035468ca18656264a91c52.zip opie-3d434ac35915afe7f7035468ca18656264a91c52.tar.gz opie-3d434ac35915afe7f7035468ca18656264a91c52.tar.bz2 |
fix enable/disable logic for menu entries in popup
-rw-r--r-- | noncore/applets/pcmcia/configdialog.cpp | 10 | ||||
-rw-r--r-- | noncore/applets/pcmcia/pcmcia.cpp | 22 |
2 files changed, 18 insertions, 14 deletions
diff --git a/noncore/applets/pcmcia/configdialog.cpp b/noncore/applets/pcmcia/configdialog.cpp index f94edde..3b1b40c 100644 --- a/noncore/applets/pcmcia/configdialog.cpp +++ b/noncore/applets/pcmcia/configdialog.cpp | |||
@@ -49,3 +49,3 @@ ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent ) | |||
49 | gbDetails->setTitle( QString( "Details for card in socket #%1" ).arg( card->number() ) ); | 49 | gbDetails->setTitle( QString( "Details for card in socket #%1" ).arg( card->number() ) ); |
50 | txtCardName->setText( card->productIdentity().join( " " ) ); | 50 | txtCardName->setText( card->productIdentity() ); |
51 | txtManfid->setText( card->manufacturerIdentity() ); | 51 | txtManfid->setText( card->manufacturerIdentity() ); |
@@ -56,4 +56,4 @@ ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent ) | |||
56 | 56 | ||
57 | odebug << "pcmcia: preferred insertion action for card '" << card->name() << "' seems to be '" << insertAction << "'" << oendl; | 57 | odebug << "pcmcia: preferred insertion action for card '" << card->productIdentity() << "' seems to be '" << insertAction << "'" << oendl; |
58 | odebug << "pcmcia: preferred resume action for card '" << card->name() << "' seems to be '" << resumeAction << "'" << oendl; | 58 | odebug << "pcmcia: preferred resume action for card '" << card->productIdentity() << "' seems to be '" << resumeAction << "'" << oendl; |
59 | 59 | ||
@@ -134,3 +134,3 @@ void ConfigDialog::writeConfigEntry( const OPcmciaSocket* card, const QString& k | |||
134 | int nCards = cfg.readNumEntry( "nCards", 0 ); | 134 | int nCards = cfg.readNumEntry( "nCards", 0 ); |
135 | QString cardName = card->productIdentity().join( " " ).stripWhiteSpace(); | 135 | QString cardName = card->productIdentity(); |
136 | QString action; | 136 | QString action; |
@@ -156,3 +156,3 @@ QString ConfigDialog::readConfigEntry( const OPcmciaSocket* card, const QString& | |||
156 | int nCards = cfg.readNumEntry( "nCards", 0 ); | 156 | int nCards = cfg.readNumEntry( "nCards", 0 ); |
157 | QString cardName = card->productIdentity().join( " " ).stripWhiteSpace(); | 157 | QString cardName = card->productIdentity(); |
158 | QString value; | 158 | QString value; |
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( | |||
78 | setFixedHeight ( AppLnk::smallIconSize() ); | 78 | setFixedHeight ( AppLnk::smallIconSize() ); |
79 | pm = Opie::Core::OResource::loadPixmap( "pcmcia/pcmcia", Opie::Core::OResource::SmallIcon ); | 79 | pm = Opie::Core::OResource::loadPixmap( "pcmcia", Opie::Core::OResource::SmallIcon ); |
80 | configuring = false; | 80 | configuring = false; |
@@ -165,7 +165,11 @@ void PcmciaManager::mousePressEvent( QMouseEvent* ) | |||
165 | 165 | ||
166 | submenu->setItemEnabled( EJECT+i*100, !it.current()->isEmpty() ); | 166 | bool isSuspended = it.current()->isSuspended(); |
167 | submenu->setItemEnabled( INSERT+i*100, it.current()->isEmpty() ); | 167 | bool isEmpty = it.current()->isEmpty(); |
168 | submenu->setItemEnabled( SUSPEND+i*100, !it.current()->isEmpty() && it.current()->isSuspended() ); | 168 | |
169 | submenu->setItemEnabled( RESUME+i*100, !it.current()->isEmpty() && !it.current()->isSuspended() ); | 169 | submenu->setItemEnabled( EJECT+i*100, !isEmpty ); |
170 | submenu->setItemEnabled( CONFIGURE+i*100, !it.current()->isEmpty() && !configuring ); | 170 | submenu->setItemEnabled( INSERT+i*100, isEmpty ); |
171 | submenu->setItemEnabled( SUSPEND+i*100, !isEmpty && !isSuspended ); | ||
172 | submenu->setItemEnabled( RESUME+i*100, !isEmpty && isSuspended ); | ||
173 | submenu->setItemEnabled( RESET+i*100, !isEmpty && !isSuspended ); | ||
174 | submenu->setItemEnabled( CONFIGURE+i*100, !isEmpty && !configuring ); | ||
171 | 175 | ||
@@ -215,3 +219,3 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & ) | |||
215 | theCard = it.current(); | 219 | theCard = it.current(); |
216 | QString cardName = theCard->productIdentity().join( " " ).stripWhiteSpace(); | 220 | QString cardName = theCard->productIdentity(); |
217 | for ( int i = 0; i < nCards; ++i ) | 221 | for ( int i = 0; i < nCards; ++i ) |
@@ -236,3 +240,3 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & ) | |||
236 | odebug << "pcmcia: unconfigured card detected" << oendl; | 240 | odebug << "pcmcia: unconfigured card detected" << oendl; |
237 | QString newCardName = theCard->productIdentity().join( " " ).stripWhiteSpace(); | 241 | QString newCardName = theCard->productIdentity(); |
238 | int result = QMessageBox::information( qApp->desktop(), | 242 | int result = QMessageBox::information( qApp->desktop(), |
@@ -263,3 +267,3 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & ) | |||
263 | QString entryVersion( " version " ); | 267 | QString entryVersion( " version " ); |
264 | for ( QStringList::Iterator it = theCard->productIdentity().begin(); it != theCard->productIdentity().end(); ++it ) | 268 | for ( QStringList::Iterator it = theCard->productIdentityVector().begin(); it != theCard->productIdentityVector().end(); ++it ) |
265 | { | 269 | { |