summaryrefslogtreecommitdiff
path: root/noncore/applets/pcmcia/pcmcia.cpp
Unidiff
Diffstat (limited to 'noncore/applets/pcmcia/pcmcia.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/pcmcia/pcmcia.cpp40
1 files changed, 26 insertions, 14 deletions
diff --git a/noncore/applets/pcmcia/pcmcia.cpp b/noncore/applets/pcmcia/pcmcia.cpp
index 99c1bc9..1a2b619 100644
--- a/noncore/applets/pcmcia/pcmcia.cpp
+++ b/noncore/applets/pcmcia/pcmcia.cpp
@@ -205,13 +205,7 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & )
205 { 205 {
206 odebug << "pcmcia: new card detected" << oendl; 206 odebug << "pcmcia: unconfigured card detected" << oendl;
207 cfg.setGroup( QString( "Card_%1" ).arg( nCards ) ); 207 QString newCardName = theCard->productIdentity().join( " " ).stripWhiteSpace();
208 cfg.writeEntry( "name", theCard->productIdentity().join( " " ) );
209 cfg.writeEntry( "insert", "suspend" );
210 cfg.setGroup( "Global" );
211 cfg.writeEntry( "nCards", nCards+1 );
212 cfg.write();
213
214 int result = QMessageBox::information( qApp->desktop(), 208 int result = QMessageBox::information( qApp->desktop(),
215 tr( "PCMCIA/CF Subsystem" ), 209 tr( "PCMCIA/CF Subsystem" ),
216 tr( "You have inserted a new card:\n%1\nDo you want to configure?" ).arg( theCard->productIdentity().join( " " ) ), 210 tr( "<qt>You have inserted the card '%1'. This card is not yet configured. Do you want to configure it now?</qt>" ).arg( newCardName ),
217 tr( "Yes" ), tr( "No" ), 0, 0, 1 ); 211 tr( "Yes" ), tr( "No" ), 0, 0, 1 );
@@ -220,3 +214,18 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & )
220 { 214 {
221 configure( theCard ); 215 bool configured = configure( theCard );
216
217 if ( configured )
218 {
219 odebug << "card has been configured. writing out to dabase" << oendl;
220 cfg.setGroup( QString( "Card_%1" ).arg( nCards ) );
221 cfg.writeEntry( "name", newCardName );
222 cfg.writeEntry( "insert", "suspend" );
223 cfg.setGroup( "Global" );
224 cfg.writeEntry( "nCards", nCards+1 );
225 cfg.write();
226 }
227 else
228 {
229 odebug << "card has not been configured this time. leaving as unknown card" << oendl;
230 }
222 } 231 }
@@ -224,8 +233,10 @@ void PcmciaManager::cardMessage( const QCString & msg, const QByteArray & )
224 { 233 {
225 odebug << "pcmcia: user doesn't want to configure " << theCard->productIdentity().join( " " ) << " now." << oendl; 234 odebug << "pcmcia: user doesn't want to configure " << newCardName << " now." << oendl;
226 } 235 }
227 } 236 }
228 else 237 else // it's an already configured card
229 { 238 {
230 odebug << "pcmcia: card has been previously inserted" << oendl; 239 QString action = ConfigDialog::preferredAction( theCard );
240 odebug << "pcmcia: card has been previously configured" << oendl;
241 odebug << "pcmcia: need to perform action'" << action << "' now... sorry, not yet implemented..." << oendl;
231 } 242 }
@@ -286,3 +297,3 @@ void PcmciaManager::userCardAction( int action )
286 297
287void PcmciaManager::configure( OPcmciaSocket* card ) 298bool PcmciaManager::configure( OPcmciaSocket* card )
288{ 299{
@@ -293,2 +304,3 @@ void PcmciaManager::configure( OPcmciaSocket* card )
293 odebug << "pcmcia: configresult = " << configresult << oendl; 304 odebug << "pcmcia: configresult = " << configresult << oendl;
305 return configresult;
294} 306}