summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-05-21 15:43:07 (UTC)
committer mickeyl <mickeyl>2005-05-21 15:43:07 (UTC)
commite570da2879fb3220a46f1a19bb797512fca144c6 (patch) (side-by-side diff)
tree9ba374f101078fb5ba2e77ad9ab3beefa0a05415
parentc5cb180e37514584fd0015d7713fe07c041f3815 (diff)
downloadopie-e570da2879fb3220a46f1a19bb797512fca144c6.zip
opie-e570da2879fb3220a46f1a19bb797512fca144c6.tar.gz
opie-e570da2879fb3220a46f1a19bb797512fca144c6.tar.bz2
catch up with pcmcia changes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/pcmcia/pcmcia.cpp20
-rw-r--r--noncore/settings/sysinfo/devicesinfo.cpp2
2 files changed, 16 insertions, 6 deletions
diff --git a/noncore/applets/pcmcia/pcmcia.cpp b/noncore/applets/pcmcia/pcmcia.cpp
index 5183572..7f24371 100644
--- a/noncore/applets/pcmcia/pcmcia.cpp
+++ b/noncore/applets/pcmcia/pcmcia.cpp
@@ -118,21 +118,30 @@ void PcmciaManager::mousePressEvent( QMouseEvent* )
OPcmciaSystem* sys = OPcmciaSystem::instance();
OPcmciaSystem::CardIterator it = sys->iterator();
if ( !sys->count() ) return;
int i = 0;
while ( it.current() )
{
- menu->insertItem( tr( "Eject card %1: %2" ).arg( i++ ).arg( it.currentKey() ), 1 );
+
+ QPopupMenu* submenu = new QPopupMenu( menu );
+ submenu->insertItem( "Eject" );
+ submenu->insertItem( "Insert" );
+ submenu->insertItem( "Suspend" );
+ submenu->insertItem( "Resume" );
+ submenu->insertItem( "Configure" );
+
+ menu->insertItem( tr( "%1: %2" ).arg( i++ ).arg( it.current()->identity() ), submenu, 1 );
++it;
}
+
/* insert items depending on number of cards etc.
if ( cardInSd ) {
menu->insertItem( QIconSet( Opie::Core::OResource::loadPixmap( "cardmon/ide", Opie::Core::OResource::SmallIcon ) ),
tr( "Eject SD/MMC card" ), 0 );
}
@@ -163,47 +172,48 @@ void PcmciaManager::mousePressEvent( QMouseEvent* )
void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & )
{
odebug << "PcmciaManager::cardMessage( '" << msg << "' )" << oendl;
if ( msg != "stabChanged()" ) return;
/* check if a previously unknown card has been inserted */
OPcmciaSystem::instance()->synchronize();
- if ( !OPcmciaSystem::instance()->count() ) return;
+ if ( !OPcmciaSystem::instance()->cardCount() ) return;
OConfig cfg( "PCMCIA" );
cfg.setGroup( "Global" );
int nCards = cfg.readNumEntry( "nCards", 0 );
OPcmciaSystem* sys = OPcmciaSystem::instance();
OPcmciaSystem::CardIterator it = sys->iterator();
bool newCard = true;
- while ( it.current() && newCard )
+
+ while ( it.current() && !it.current()->isEmpty() && newCard )
{
- QString name = it.currentKey();
+ QString name = it.current()->identity();
for ( int i = 0; i < nCards; ++i )
{
QString cardSection = QString( "Card_%1" ).arg( i );
cfg.setGroup( cardSection );
QString cardName = cfg.readEntry( "name" );
odebug << "comparing card '" << name << "' with known card '" << cardName << "'" << oendl;
if ( cardName == name )
{
newCard = false;
break;
}
}
if ( !newCard ) ++it; else break;
}
- QString newCardName = it.currentKey();
if ( newCard )
{
+ QString newCardName = it.current()->identity();
odebug << "pcmcia: new card detected" << oendl;
cfg.setGroup( QString( "Card_%1" ).arg( nCards ) );
cfg.writeEntry( "name", newCardName );
cfg.setGroup( "Global" );
cfg.writeEntry( "nCards", nCards+1 );
cfg.write();
int result = QMessageBox::information( qApp->desktop(),
diff --git a/noncore/settings/sysinfo/devicesinfo.cpp b/noncore/settings/sysinfo/devicesinfo.cpp
index 945edea..4940286 100644
--- a/noncore/settings/sysinfo/devicesinfo.cpp
+++ b/noncore/settings/sysinfo/devicesinfo.cpp
@@ -203,17 +203,17 @@ CardsCategory::~CardsCategory()
void CardsCategory::populate()
{
odebug << "CardsCategory::populate()" << oendl;
OPcmciaSystem* sys = OPcmciaSystem::instance();
OPcmciaSystem::CardIterator it = sys->iterator();
while ( it.current() )
{
- new CardDevice( this, (const char*) it.currentKey() );
+ new CardDevice( this, it.current()->identity() );
++it;
}
}
//=================================================================================================
UsbCategory::UsbCategory( DevicesView* parent )
:Category( parent, "4. Universal Serial Bus" )
{