Diffstat (limited to 'noncore/applets/pcmcia/pcmcia.cpp') (more/less context) (ignore 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 | ||