feat(GODT-2540): pop-up notification error icon is loaded on startup.

This commit is contained in:
Xavier Michelon
2023-05-03 15:19:02 +02:00
parent 6a6ead8e6d
commit 333daa05c5
2 changed files with 5 additions and 4 deletions

View File

@ -159,8 +159,9 @@ QString qmlResourcePathToQt(QString const &path) {
//****************************************************************************************************************************************************
TrayIcon::TrayIcon()
: QSystemTrayIcon()
, menu_(new QMenu) {
, menu_(new QMenu)
, notificationErrorIcon_(loadIconFromSVG(":/qml/icons/ic-alert.svg"))
{
this->generateDotIcons();
this->setContextMenu(menu_.get());
@ -304,8 +305,7 @@ void TrayIcon::setState(TrayIcon::State state, QString const &stateString, QStri
/// \param[in] message The message.
//****************************************************************************************************************************************************
void TrayIcon::showErrorPopupNotification(QString const &title, QString const &message) {
// this->showMessage(title, message, loadIconFromSVG(":/qml/icons/ic-exclamation-circle-filled.svg", errorColor));
this->showMessage(title, message, loadIconFromSVG(":/qml/icons/ic-alert.svg"));
this->showMessage(title, message, notificationErrorIcon_);
}

View File

@ -67,6 +67,7 @@ private: // data members
QIcon greenDot_; ///< The green dot icon.
QIcon greyDot_; ///< The grey dot icon.
QIcon orangeDot_; ///< The orange dot icon.
QIcon const notificationErrorIcon_; ///< The error icon used for notifications.
QTimer iconRefreshTimer_; ///< The timer used to periodically refresh the icon when DPI changes.
QDateTime iconRefreshDeadline_; ///< The deadline for refreshing the icon