summaryrefslogtreecommitdiff
path: root/noncore/applets/pcmcia/configdialog.cpp
authormickeyl <mickeyl>2005-06-19 22:02:38 (UTC)
committer mickeyl <mickeyl>2005-06-19 22:02:38 (UTC)
commit34ecdb361924656b758da2073ef6ac0c1bffd210 (patch) (side-by-side diff)
treedbc91b753acae2f9f6a62e922e6707cfef55e171 /noncore/applets/pcmcia/configdialog.cpp
parent83fec70860e56af97d66e9505b913602505423d7 (diff)
downloadopie-34ecdb361924656b758da2073ef6ac0c1bffd210.zip
opie-34ecdb361924656b758da2073ef6ac0c1bffd210.tar.gz
opie-34ecdb361924656b758da2073ef6ac0c1bffd210.tar.bz2
- s/new card/unconfigured card/
- add note about unrecognized cards in configuration dialog - add ConfigDialog::preferredAction()
Diffstat (limited to 'noncore/applets/pcmcia/configdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/pcmcia/configdialog.cpp52
1 files changed, 31 insertions, 21 deletions
diff --git a/noncore/applets/pcmcia/configdialog.cpp b/noncore/applets/pcmcia/configdialog.cpp
index 9fcf58c..f961069 100644
--- a/noncore/applets/pcmcia/configdialog.cpp
+++ b/noncore/applets/pcmcia/configdialog.cpp
@@ -48,3 +48,3 @@ ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent )
{
- gbDetails->setTitle( QString( "Details for '%1'" ).arg( card->identity() ) );
+ gbDetails->setTitle( QString( "Details for card in socket #%1" ).arg( card->number() ) );
txtCardName->setText( card->productIdentity().join( " " ) );
@@ -53,25 +53,10 @@ ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent )
- OConfig cfg( "PCMCIA" );
- cfg.setGroup( "Global" );
- int nCards = cfg.readNumEntry( "nCards", 0 );
- QString insert;
+ QString action = preferredAction( card );
- for ( int i = 0; i < nCards; ++i )
- {
- QString cardSection = QString( "Card_%1" ).arg( i );
- cfg.setGroup( cardSection );
- QString name = cfg.readEntry( "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 '" << card->name() << "' seems to be '" << insert << "'" << oendl;
+ odebug << "preferred action for card '" << card->name() << "' seems to be '" << action << "'" << oendl;
- if ( !insert.isEmpty() )
+ if ( !action.isEmpty() )
{
for ( int i; i < cbAction->count(); ++i )
- if ( cbAction->text( i ) == insert ) cbAction->setCurrentItem( i );
+ if ( cbAction->text( i ) == action ) cbAction->setCurrentItem( i );
}
@@ -81,2 +66,3 @@ ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent )
odebug << "card is recognized - hiding bindings" << oendl;
+ textInfo->hide();
textBindTo->hide();
@@ -88,2 +74,3 @@ ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent )
odebug << "card is unsupported yet - showing possible bindings" << oendl;
+ textInfo->show();
textBindTo->show();
@@ -98,3 +85,3 @@ ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent )
- for ( int i = 0; i < pcmciaconfdir.count(); ++i )
+ for ( unsigned int i = 0; i < pcmciaconfdir.count(); ++i )
{
@@ -136 +123,24 @@ ConfigDialog::~ConfigDialog()
}
+
+QString ConfigDialog::preferredAction( const OPcmciaSocket* card )
+{
+ OConfig cfg( "PCMCIA" );
+ cfg.setGroup( "Global" );
+ int nCards = cfg.readNumEntry( "nCards", 0 );
+ QString action;
+
+ for ( int i = 0; i < nCards; ++i )
+ {
+ QString cardSection = QString( "Card_%1" ).arg( i );
+ cfg.setGroup( cardSection );
+ QString name = cfg.readEntry( "name" );
+ odebug << "comparing card '" << card->name() << "' with known card '" << name << "'" << oendl;
+ if ( card->name() == name )
+ {
+ action = cfg.readEntry( "action" );
+ break;
+ }
+ }
+
+ return action;
+}