author | mickeyl <mickeyl> | 2005-06-14 13:15:05 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-06-14 13:15:05 (UTC) |
commit | 7d8d317205a74bc2e23291ab4909472db6694091 (patch) (unidiff) | |
tree | 7fdf8d039a30f26316fb57edbe53462d1b38b654 /noncore/applets/pcmcia/pcmcia.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/pcmcia.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/applets/pcmcia/pcmcia.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/noncore/applets/pcmcia/pcmcia.cpp b/noncore/applets/pcmcia/pcmcia.cpp index 6c18e86..fac7065 100644 --- a/noncore/applets/pcmcia/pcmcia.cpp +++ b/noncore/applets/pcmcia/pcmcia.cpp | |||
@@ -74,6 +74,7 @@ PcmciaManager::PcmciaManager( QWidget * parent ) : QWidget( parent ) | |||
74 | setFixedWidth ( AppLnk::smallIconSize() ); | 74 | setFixedWidth ( AppLnk::smallIconSize() ); |
75 | setFixedHeight ( AppLnk::smallIconSize() ); | 75 | setFixedHeight ( AppLnk::smallIconSize() ); |
76 | pm = Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ); | 76 | pm = Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ); |
77 | configuring = false; | ||
77 | } | 78 | } |
78 | 79 | ||
79 | 80 | ||
@@ -110,7 +111,7 @@ void PcmciaManager::popupTimeout() | |||
110 | popupMenu->hide(); | 111 | popupMenu->hide(); |
111 | } | 112 | } |
112 | 113 | ||
113 | enum { EJECT, INSERT, SUSPEND, RESUME, CONFIGURE }; | 114 | enum { EJECT, INSERT, SUSPEND, RESUME, RESET, CONFIGURE }; |
114 | 115 | ||
115 | void PcmciaManager::mousePressEvent( QMouseEvent* ) | 116 | void PcmciaManager::mousePressEvent( QMouseEvent* ) |
116 | { | 117 | { |
@@ -130,13 +131,14 @@ void PcmciaManager::mousePressEvent( QMouseEvent* ) | |||
130 | submenu->insertItem( "&Insert", INSERT+i*100 ); | 131 | submenu->insertItem( "&Insert", INSERT+i*100 ); |
131 | submenu->insertItem( "&Suspend", SUSPEND+i*100 ); | 132 | submenu->insertItem( "&Suspend", SUSPEND+i*100 ); |
132 | submenu->insertItem( "&Resume", RESUME+i*100 ); | 133 | submenu->insertItem( "&Resume", RESUME+i*100 ); |
134 | submenu->insertItem( "Rese&t", RESET+i*100 ); | ||
133 | submenu->insertItem( "&Configure", CONFIGURE+i*100 ); | 135 | submenu->insertItem( "&Configure", CONFIGURE+i*100 ); |
134 | 136 | ||
135 | submenu->setItemEnabled( EJECT+i*100, !it.current()->isEmpty() ); | 137 | submenu->setItemEnabled( EJECT+i*100, !it.current()->isEmpty() ); |
136 | submenu->setItemEnabled( INSERT+i*100, it.current()->isEmpty() ); | 138 | submenu->setItemEnabled( INSERT+i*100, it.current()->isEmpty() ); |
137 | submenu->setItemEnabled( SUSPEND+i*100, !it.current()->isEmpty() && !it.current()->isSuspended() ); | 139 | submenu->setItemEnabled( SUSPEND+i*100, !it.current()->isEmpty() && !it.current()->isSuspended() ); |
138 | submenu->setItemEnabled( RESUME+i*100, !it.current()->isEmpty() && it.current()->isSuspended() ); | 140 | submenu->setItemEnabled( RESUME+i*100, !it.current()->isEmpty() && it.current()->isSuspended() ); |
139 | submenu->setItemEnabled( CONFIGURE+i*100, !it.current()->isEmpty() ); | 141 | submenu->setItemEnabled( CONFIGURE+i*100, !it.current()->isEmpty() && !configuring ); |
140 | 142 | ||
141 | connect( submenu, SIGNAL(activated(int)), this, SLOT(userCardAction(int)) ); | 143 | connect( submenu, SIGNAL(activated(int)), this, SLOT(userCardAction(int)) ); |
142 | menu->insertItem( tr( "%1: %2" ).arg( i++ ).arg( it.current()->identity() ), submenu, 1 ); | 144 | menu->insertItem( tr( "%1: %2" ).arg( i++ ).arg( it.current()->identity() ), submenu, 1 ); |
@@ -271,8 +273,10 @@ void PcmciaManager::userCardAction( int action ) | |||
271 | 273 | ||
272 | void PcmciaManager::configure( OPcmciaSocket* card ) | 274 | void PcmciaManager::configure( OPcmciaSocket* card ) |
273 | { | 275 | { |
274 | ConfigDialog dialog( card->identity(), qApp->desktop() ); | 276 | configuring = true; |
275 | int configresult = dialog.exec(); | 277 | ConfigDialog dialog( card, qApp->desktop() ); |
278 | int configresult = QPEApplication::execDialog( &dialog, false ); | ||
279 | configuring = false; | ||
276 | odebug << "pcmcia: configresult = " << configresult << oendl; | 280 | odebug << "pcmcia: configresult = " << configresult << oendl; |
277 | } | 281 | } |
278 | 282 | ||