author | mickeyl <mickeyl> | 2005-06-14 13:15:05 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-06-14 13:15:05 (UTC) |
commit | 7d8d317205a74bc2e23291ab4909472db6694091 (patch) (side-by-side diff) | |
tree | 7fdf8d039a30f26316fb57edbe53462d1b38b654 /noncore/applets/pcmcia/configdialog.cpp | |
parent | c1194d42d8456417452b125bd6c2c5048d7bbe02 (diff) | |
download | opie-7d8d317205a74bc2e23291ab4909472db6694091.zip opie-7d8d317205a74bc2e23291ab4909472db6694091.tar.gz opie-7d8d317205a74bc2e23291ab4909472db6694091.tar.bz2 |
more work on configuring unsupported cards
Diffstat (limited to 'noncore/applets/pcmcia/configdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/pcmcia/configdialog.cpp | 32 |
1 files changed, 25 insertions, 7 deletions
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 @@ -33,4 +33,5 @@ #include <opie2/oconfig.h> #include <opie2/odebug.h> +#include <opie2/opcmciasystem.h> using namespace Opie::Core; @@ -39,12 +40,15 @@ using namespace Opie::Core; #include <qdir.h> #include <qfile.h> +#include <qgroupbox.h> #include <qlabel.h> #include <qtextstream.h> -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" ); @@ -58,6 +62,6 @@ ConfigDialog::ConfigDialog( const QString& cardname, QWidget* parent ) 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" ); @@ -65,5 +69,5 @@ ConfigDialog::ConfigDialog( const QString& cardname, QWidget* parent ) } } - 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() ) @@ -73,4 +77,18 @@ ConfigDialog::ConfigDialog( const QString& cardname, QWidget* parent ) } + 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<QString,QString> StringMap; @@ -109,5 +127,5 @@ 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() ); } |