Notify when updates are not possible.

This commit is contained in:
Martin Rotter 2014-02-02 09:10:24 +01:00
parent 8527fa5657
commit f1229f9003
1 changed files with 23 additions and 2 deletions

View File

@ -12,6 +12,7 @@
#include "gui/feedsview.h"
#include "gui/statusbar.h"
#include "gui/systemtrayicon.h"
#include "gui/messagebox.h"
#include <QVBoxLayout>
#include <QSplitter>
@ -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."));
}
}
}