author | harlekin <harlekin> | 2002-06-23 23:32:29 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-23 23:32:29 (UTC) |
commit | 340e6e7830df8dcc9cf73fb1bf8a29130e34211d (patch) (unidiff) | |
tree | 38f5c6a7c82d4c0758b8640be96c8e318008939c | |
parent | 5713a36f24973c01a46fdff6203acf4590927f49 (diff) | |
download | opie-340e6e7830df8dcc9cf73fb1bf8a29130e34211d.zip opie-340e6e7830df8dcc9cf73fb1bf8a29130e34211d.tar.gz opie-340e6e7830df8dcc9cf73fb1bf8a29130e34211d.tar.bz2 |
now cardmon should even start
-rw-r--r-- | core/applets/cardmon/cardmon.cpp | 20 | ||||
-rw-r--r-- | core/applets/cardmon/cardmon.h | 2 |
2 files changed, 13 insertions, 9 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp index de02fe6..0addb89 100644 --- a/core/applets/cardmon/cardmon.cpp +++ b/core/applets/cardmon/cardmon.cpp | |||
@@ -65,5 +65,5 @@ CardMonitor::~CardMonitor() { | |||
65 | } | 65 | } |
66 | 66 | ||
67 | void CardMonitor::popup(QString message, QString icon="") { | 67 | void CardMonitor::popUp(QString message, QString icon="") { |
68 | if ( ! popupMenu ) { | 68 | if ( ! popupMenu ) { |
69 | popupMenu = new QPopupMenu(); | 69 | popupMenu = new QPopupMenu(); |
@@ -83,5 +83,9 @@ void CardMonitor::popup(QString message, QString icon="") { | |||
83 | p. y ( ) - s. height ( ) ), 0); | 83 | p. y ( ) - s. height ( ) ), 0); |
84 | 84 | ||
85 | QTimer::singleShot( 2000, this, SLOT(popupMenuTimeout()) ); | 85 | QTimer::singleShot( 2000, this, SLOT(popupTimeout()) ); |
86 | } | ||
87 | |||
88 | void CardMonitor::popupTimeout() { | ||
89 | popupMenu->hide(); | ||
86 | } | 90 | } |
87 | 91 | ||
@@ -117,5 +121,5 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) { | |||
117 | if ( ( err == 127 ) || ( err < 0 ) ) { | 121 | if ( ( err == 127 ) || ( err < 0 ) ) { |
118 | qDebug("Could not execute `/sbin/cardctl eject 0'! err=%d", err); | 122 | qDebug("Could not execute `/sbin/cardctl eject 0'! err=%d", err); |
119 | popup( tr("CF/PCMCIA card eject failed!")); | 123 | popUp( tr("CF/PCMCIA card eject failed!")); |
120 | } | 124 | } |
121 | } else if ( opt == 0 ) { | 125 | } else if ( opt == 0 ) { |
@@ -124,5 +128,5 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) { | |||
124 | if ( ( err != 0 ) ) { | 128 | if ( ( err != 0 ) ) { |
125 | qDebug("Could not execute `/etc/sdcontrol comeject'! err=%d", err); | 129 | qDebug("Could not execute `/etc/sdcontrol comeject'! err=%d", err); |
126 | popup( tr("SD/MMC card eject failed!")); | 130 | popUp( tr("SD/MMC card eject failed!")); |
127 | } | 131 | } |
128 | } else if ( opt == 2 ) { | 132 | } else if ( opt == 2 ) { |
@@ -131,5 +135,5 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) { | |||
131 | if ( ( err == 127 ) || ( err < 0 ) ) { | 135 | if ( ( err == 127 ) || ( err < 0 ) ) { |
132 | qDebug("Could not execute `/sbin/cardctl eject 1'! err=%d", err); | 136 | qDebug("Could not execute `/sbin/cardctl eject 1'! err=%d", err); |
133 | popup( tr("CF/PCMCIA card eject failed!")); | 137 | popUp( tr("CF/PCMCIA card eject failed!")); |
134 | } | 138 | } |
135 | } | 139 | } |
@@ -221,5 +225,5 @@ bool CardMonitor::getStatusPcmcia( int showPopUp ) { | |||
221 | else { text += tr("Ejected: "); } | 225 | else { text += tr("Ejected: "); } |
222 | text += cardInPcmcia0Name; | 226 | text += cardInPcmcia0Name; |
223 | popup( text, getIconName( cardInPcmcia0Type ) ); | 227 | popUp( text, getIconName( cardInPcmcia0Type ) ); |
224 | } | 228 | } |
225 | if(cardWas1 != cardInPcmcia1) { | 229 | if(cardWas1 != cardInPcmcia1) { |
@@ -227,5 +231,5 @@ bool CardMonitor::getStatusPcmcia( int showPopUp ) { | |||
227 | else { text += tr("Ejected: "); } | 231 | else { text += tr("Ejected: "); } |
228 | text += cardInPcmcia1Name; | 232 | text += cardInPcmcia1Name; |
229 | popup( text, getIconName( cardInPcmcia1Type ) ); | 233 | popUp( text, getIconName( cardInPcmcia1Type ) ); |
230 | } | 234 | } |
231 | } | 235 | } |
@@ -258,5 +262,5 @@ bool CardMonitor::getStatusSd( int showPopUp ) { | |||
258 | if(cardInSd) { text += "SD Inserted"; } | 262 | if(cardInSd) { text += "SD Inserted"; } |
259 | else { text += "SD Removed"; } | 263 | else { text += "SD Removed"; } |
260 | popup( text); // XX add SD pic | 264 | popUp( text); // XX add SD pic |
261 | } | 265 | } |
262 | 266 | ||
diff --git a/core/applets/cardmon/cardmon.h b/core/applets/cardmon/cardmon.h index e424192..3dcf235 100644 --- a/core/applets/cardmon/cardmon.h +++ b/core/applets/cardmon/cardmon.h | |||
@@ -52,5 +52,5 @@ private: | |||
52 | void iconShow(); | 52 | void iconShow(); |
53 | QPopupMenu *popupMenu; | 53 | QPopupMenu *popupMenu; |
54 | void popup(QString message, QString icon=""); | 54 | void popUp(QString message, QString icon=""); |
55 | QString getIconName(QString type); | 55 | QString getIconName(QString type); |
56 | }; | 56 | }; |