diff options
| -rw-r--r-- | pica-client/mainwindow.cpp | 6 | ||||
| -rw-r--r-- | pica-client/mainwindow.h | 2 | ||||
| -rw-r--r-- | pica-client/msguirouter.cpp | 6 |
3 files changed, 8 insertions, 6 deletions
diff --git a/pica-client/mainwindow.cpp b/pica-client/mainwindow.cpp index c440e20..2081dbc 100644 --- a/pica-client/mainwindow.cpp +++ b/pica-client/mainwindow.cpp @@ -138,11 +138,13 @@ void MainWindow::showhide_click() hide_notifications(); } -void MainWindow::AddNotification(QString &text) +void MainWindow::AddNotification(QString &text, bool is_critical) { notifications->addItem(text); notifications->item(notifications->count() -1) ->setForeground(QBrush(QColor(230, 10, 10, 196))); - show_notifications(); + + if (is_critical) + show_notifications(); } diff --git a/pica-client/mainwindow.h b/pica-client/mainwindow.h index ba73c9a..4f5ee0d 100644 --- a/pica-client/mainwindow.h +++ b/pica-client/mainwindow.h @@ -23,7 +23,7 @@ public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); - void AddNotification(QString &text); + void AddNotification(QString &text, bool is_critical); protected: private: diff --git a/pica-client/msguirouter.cpp b/pica-client/msguirouter.cpp index 3264490..84bbf56 100644 --- a/pica-client/msguirouter.cpp +++ b/pica-client/msguirouter.cpp @@ -23,7 +23,7 @@ MsgUIRouter::MsgUIRouter(QObject *parent) : connect(skynet, SIGNAL(UnableToDeliver(QByteArray,QString)), this, SLOT(delivery_failed(QByteArray,QString))); connect(skynet, SIGNAL(Delivered(QByteArray)), this, SLOT(delivered(QByteArray))); connect(skynet, SIGNAL(CertificateForged(QByteArray,QString,QString)), this, SLOT(scary_cert_message(QByteArray,QString,QString))); - connect(skynet, SIGNAL(ErrMsgFromNode(QString)), this, SLOT(notification(QString))); + connect(skynet, SIGNAL(StatusMsg(QString, bool)), this, SLOT(notification(QString, bool))); connect(systray, SIGNAL(doubleclicked()), this, SLOT(trayicon_dclick())); } @@ -166,8 +166,8 @@ void MsgUIRouter::scary_cert_message(QByteArray peer_id, QString received_cert, fcd.exec(); } -void MsgUIRouter::notification(QString text) +void MsgUIRouter::notification(QString text, bool is_critical) { if (mainwindow) - mainwindow->AddNotification(text); + mainwindow->AddNotification(text, is_critical); } |
