-rw-r--r-- | core/launcher/taskbar.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index 46bcdb3..7d1aaf1 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp | |||
@@ -182,46 +182,50 @@ TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOn | |||
182 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 182 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
183 | #endif | 183 | #endif |
184 | #endif | 184 | #endif |
185 | waitTimer = new QTimer( this ); | 185 | waitTimer = new QTimer( this ); |
186 | connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) ); | 186 | connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) ); |
187 | clearer = new QTimer( this ); | 187 | clearer = new QTimer( this ); |
188 | QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar())); | 188 | QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar())); |
189 | QObject::connect(clearer, SIGNAL(timeout()), sysTray, SLOT(show())); | 189 | QObject::connect(clearer, SIGNAL(timeout()), sysTray, SLOT(show())); |
190 | } | 190 | } |
191 | 191 | ||
192 | void TaskBar::setStatusMessage( const QString &text ) | 192 | void TaskBar::setStatusMessage( const QString &text ) |
193 | { | 193 | { |
194 | label->setText( text ); | 194 | if ( !text.isEmpty() ) { |
195 | stack->raiseWidget( label ); | 195 | label->setText( text ); |
196 | if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) ) | 196 | stack->raiseWidget( label ); |
197 | sysTray->hide(); | 197 | if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) ) |
198 | clearer->start( 3000 ); | 198 | sysTray->hide(); |
199 | clearer->start( 3000, TRUE ); | ||
200 | } else { | ||
201 | clearStatusBar(); | ||
202 | } | ||
199 | } | 203 | } |
200 | 204 | ||
201 | void TaskBar::clearStatusBar() | 205 | void TaskBar::clearStatusBar() |
202 | { | 206 | { |
203 | label->clear(); | 207 | label->clear(); |
204 | stack->raiseWidget(runningAppBar); | 208 | stack->raiseWidget(runningAppBar); |
205 | // stack->raiseWidget( mru ); | 209 | // stack->raiseWidget( mru ); |
206 | } | 210 | } |
207 | 211 | ||
208 | void TaskBar::startWait() | 212 | void TaskBar::startWait() |
209 | { | 213 | { |
210 | waitIcon->setWaiting( true ); | 214 | waitIcon->setWaiting( true ); |
211 | // a catchall stop after 10 seconds... | 215 | // a catchall stop after 10 seconds... |
212 | waitTimer->start( 10 * 1000, true ); | 216 | waitTimer->start( 10 * 1000, true ); |
213 | } | 217 | } |
214 | 218 | ||
215 | void TaskBar::stopWait(const QString& app) | 219 | void TaskBar::stopWait(const QString& /*app*/) |
216 | { | 220 | { |
217 | waitTimer->stop(); | 221 | waitTimer->stop(); |
218 | //mru->addTask(sm->execToLink(app)); | 222 | //mru->addTask(sm->execToLink(app)); |
219 | waitIcon->setWaiting( false ); | 223 | waitIcon->setWaiting( false ); |
220 | } | 224 | } |
221 | 225 | ||
222 | void TaskBar::stopWait() | 226 | void TaskBar::stopWait() |
223 | { | 227 | { |
224 | waitTimer->stop(); | 228 | waitTimer->stop(); |
225 | 229 | ||
226 | waitIcon->setWaiting( false ); | 230 | waitIcon->setWaiting( false ); |
227 | } | 231 | } |
@@ -264,27 +268,30 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data ) | |||
264 | { | 268 | { |
265 | QDataStream stream( data, IO_ReadOnly ); | 269 | QDataStream stream( data, IO_ReadOnly ); |
266 | if ( msg == "message(QString)" ) { | 270 | if ( msg == "message(QString)" ) { |
267 | QString text; | 271 | QString text; |
268 | stream >> text; | 272 | stream >> text; |
269 | setStatusMessage( text ); | 273 | setStatusMessage( text ); |
270 | } else if ( msg == "hideInputMethod()" ) { | 274 | } else if ( msg == "hideInputMethod()" ) { |
271 | inputMethods->hideInputMethod(); | 275 | inputMethods->hideInputMethod(); |
272 | } else if ( msg == "showInputMethod()" ) { | 276 | } else if ( msg == "showInputMethod()" ) { |
273 | inputMethods->showInputMethod(); | 277 | inputMethods->showInputMethod(); |
274 | } else if ( msg == "reloadInputMethods()" ) { | 278 | } else if ( msg == "reloadInputMethods()" ) { |
275 | inputMethods->loadInputMethods(); | 279 | inputMethods->loadInputMethods(); |
280 | } else if ( msg == "reloadApps()" ) { | ||
281 | sm->reloadApps(); | ||
276 | } else if ( msg == "reloadApplets()" ) { | 282 | } else if ( msg == "reloadApplets()" ) { |
277 | sysTray->clearApplets(); | 283 | sysTray->clearApplets(); |
278 | sysTray->addApplets(); | 284 | sysTray->addApplets(); |
285 | sm->reloadApplets(); | ||
279 | } else if ( msg == "soundAlarm()" ) { | 286 | } else if ( msg == "soundAlarm()" ) { |
280 | Desktop::soundAlarm(); | 287 | Desktop::soundAlarm(); |
281 | } | 288 | } |
282 | else if ( msg == "setLed(int,bool)" ) { | 289 | else if ( msg == "setLed(int,bool)" ) { |
283 | int led, status; | 290 | int led, status; |
284 | stream >> led >> status; | 291 | stream >> led >> status; |
285 | 292 | ||
286 | QValueList <OLed> ll = ODevice::inst ( )-> ledList ( ); | 293 | QValueList <OLed> ll = ODevice::inst ( )-> ledList ( ); |
287 | if ( ll. count ( )){ | 294 | if ( ll. count ( )){ |
288 | OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0]; | 295 | OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0]; |
289 | bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow ); | 296 | bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow ); |
290 | 297 | ||