From 7d8d317205a74bc2e23291ab4909472db6694091 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Tue, 14 Jun 2005 13:15:05 +0000 Subject: more work on configuring unsupported cards --- (limited to 'noncore/applets/pcmcia/configdialog.cpp') diff --git a/noncore/applets/pcmcia/configdialog.cpp b/noncore/applets/pcmcia/configdialog.cpp index e161d18..9fcf58c 100644 --- a/noncore/applets/pcmcia/configdialog.cpp +++ b/noncore/applets/pcmcia/configdialog.cpp @@ -32,20 +32,24 @@ /* OPIE */ #include #include +#include using namespace Opie::Core; /* QT */ #include #include #include +#include #include #include -ConfigDialog::ConfigDialog( const QString& cardname, QWidget* parent ) +ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent ) :ConfigDialogBase( parent, "pcmcia config dialog", true ) { - //setCaption( tr( "Configure %1" ).arg( cardname ) ); - txtCardName->setText( cardname ); + gbDetails->setTitle( QString( "Details for '%1'" ).arg( card->identity() ) ); + txtCardName->setText( card->productIdentity().join( " " ) ); + txtManfid->setText( card->manufacturerIdentity() ); + txtFunction->setText( card->function() ); OConfig cfg( "PCMCIA" ); cfg.setGroup( "Global" ); @@ -57,14 +61,14 @@ ConfigDialog::ConfigDialog( const QString& cardname, QWidget* parent ) QString cardSection = QString( "Card_%1" ).arg( i ); cfg.setGroup( cardSection ); QString name = cfg.readEntry( "name" ); - odebug << "comparing card '" << cardname << "' with known card '" << name << "'" << oendl; - if ( cardname == name ) + odebug << "comparing card '" << card->name() << "' with known card '" << name << "'" << oendl; + if ( card->name() == name ) { insert = cfg.readEntry( "insert" ); break; } } - odebug << "preferred action for card '" << cardname << "' seems to be '" << insert << "'" << oendl; + odebug << "preferred action for card '" << card->name() << "' seems to be '" << insert << "'" << oendl; if ( !insert.isEmpty() ) { @@ -72,6 +76,20 @@ ConfigDialog::ConfigDialog( const QString& cardname, QWidget* parent ) if ( cbAction->text( i ) == insert ) cbAction->setCurrentItem( i ); } + if ( !card->isUnsupported() ) + { + odebug << "card is recognized - hiding bindings" << oendl; + textBindTo->hide(); + cbBindTo->hide(); + return; + } + else + { + odebug << "card is unsupported yet - showing possible bindings" << oendl; + textBindTo->show(); + cbBindTo->show(); + } + // parse possible bind entries out of /etc/pcmcia/*.conf typedef QMap StringMap; StringMap bindEntries; @@ -108,7 +126,7 @@ ConfigDialog::ConfigDialog( const QString& cardname, QWidget* parent ) for ( StringMap::Iterator it = bindEntries.begin(); it != bindEntries.end(); ++it ) { - odebug << "found device '" << it.key() << "' defined in '" << it.data().latin1() << "'" << oendl; + odebug << "found binding '" << it.key() << "' defined in '" << it.data().latin1() << "'" << oendl; cbBindTo->insertItem( it.key() ); } } -- cgit v0.9.0.2