From f1229f9003b21a6b3236c4a1c2624e15027e84dd Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sun, 2 Feb 2014 09:10:24 +0100 Subject: [PATCH] Notify when updates are not possible. --- src/gui/feedmessageviewer.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp index 5d79a4ab6..406fdd242 100644 --- a/src/gui/feedmessageviewer.cpp +++ b/src/gui/feedmessageviewer.cpp @@ -12,6 +12,7 @@ #include "gui/feedsview.h" #include "gui/statusbar.h" #include "gui/systemtrayicon.h" +#include "gui/messagebox.h" #include #include @@ -102,7 +103,17 @@ void FeedMessageViewer::updateSelectedFeeds() { emit feedsUpdateRequested(m_feedsView->selectedFeeds()); } else { - qDebug("Lock for feed updates was NOT obtained."); + if (SystemTrayIcon::isSystemTrayActivated()) { + SystemTrayIcon::instance()->showMessage(tr("Cannot update selected items"), + tr("You cannot update selected items because another feed update is ongoing."), + QSystemTrayIcon::Warning); + } + else { + MessageBox::show(this, + QMessageBox::Warning, + tr("Cannot update selected items"), + tr("You cannot update selected items because another feed update is ongoing.")); + } } } @@ -111,7 +122,17 @@ void FeedMessageViewer::updateAllFeeds() { emit feedsUpdateRequested(m_feedsView->allFeeds()); } else { - qDebug("Lock for feed updates was NOT obtained."); + if (SystemTrayIcon::isSystemTrayActivated()) { + SystemTrayIcon::instance()->showMessage(tr("Cannot update all items"), + tr("You cannot update all items because another feed update is ongoing."), + QSystemTrayIcon::Warning); + } + else { + MessageBox::show(this, + QMessageBox::Warning, + tr("Cannot update all items"), + tr("You cannot update all items because another feed update is ongoing.")); + } } }