@@ -373,7 +373,7 @@ int QtMessageBox::displayQuestionMessage (QWidget* parent, const UTF8String& tit
373373} // QtMessageBox::displayQuestionMessage
374374
375375
376- int QtMessageBox::systemNotification (const UTF8String& appTitle, const UTF8String& message, URGENCY_LEVEL level, size_t duration) // v 6.5 .0
376+ int QtMessageBox::systemNotification (const UTF8String& appTitle, const string& appIconFile, const UTF8String& message, URGENCY_LEVEL level, size_t duration) // v 6.6 .0
377377{
378378 static bool available = true ;
379379 if (false == available)
@@ -400,6 +400,11 @@ int QtMessageBox::systemNotification (const UTF8String& appTitle, const UTF8Stri
400400 notifySend->getOptions ( ).addOption (" -a" );
401401 notifySend->getOptions ( ).addOption (appTitle.utf8 ( ));
402402 } // if (false == appTitle.empty ( ))
403+ if (false == appIconFile.empty ( ))
404+ {
405+ notifySend->getOptions ( ).addOption (" -i" );
406+ notifySend->getOptions ( ).addOption (appIconFile);
407+ } // if (false == appIconFile.empty ( ))
403408 notifySend->getOptions ( ).addOption (message.utf8 ( ));
404409 notifySend->execute (false );
405410 notifySend->wait ( );
@@ -409,3 +414,39 @@ int QtMessageBox::systemNotification (const UTF8String& appTitle, const UTF8Stri
409414
410415 return notifySend->getCompletionCode ( );
411416} // QtMessageBox::systemNotification
417+
418+
419+ // ===========================================================================
420+ // LA CLASSE ActionCompletionNotifier
421+ // ===========================================================================
422+
423+ ActionCompletionNotifier::ActionCompletionNotifier (
424+ const UTF8String& appTitle, const string& appIconFile, const UTF8String& message, QtMessageBox::URGENCY_LEVEL level, size_t duration, size_t minimumTimeLapse)
425+ : _timer ( ), _appTitle (appTitle), _message (message), _appIconFile (appIconFile), _urgencyLevel (level), _duration (duration), _minimumTimeLapse (minimumTimeLapse)
426+ {
427+ if (0 != _minimumTimeLapse)
428+ _timer.start ( );
429+ }
430+
431+
432+ ActionCompletionNotifier::ActionCompletionNotifier (const ActionCompletionNotifier&)
433+ {
434+ assert (0 && " ActionCompletionNotifier copy constructor is not allowed." );
435+ } // ActionCompletionNotifier::ActionCompletionNotifier
436+
437+
438+ ActionCompletionNotifier& ActionCompletionNotifier::operator = (const ActionCompletionNotifier&)
439+ {
440+ assert (0 && " ActionCompletionNotifier assignment operator is not allowed." );
441+ return *this ;
442+ } // ActionCompletionNotifier::operator =
443+
444+
445+ ActionCompletionNotifier::~ActionCompletionNotifier ( )
446+ {
447+ if (0 != _minimumTimeLapse)
448+ _timer.stop ( );
449+
450+ if ((0 == _minimumTimeLapse) || (_timer.duration ( ) >= _minimumTimeLapse))
451+ QtMessageBox::systemNotification (_appTitle, _appIconFile, _message, _urgencyLevel, _duration);
452+ } // ActionCompletionNotifier::~ActionCompletionNotifier
0 commit comments