From 1c8358999ed0fc8cb69ab29dfca45fafa8669544 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 12 Sep 2014 07:28:06 +0200 Subject: [PATCH] Tray icon tweaks. --- resources/text/CHANGELOG | 1 + src/gui/feedsview.cpp | 14 ++------------ src/gui/systemtrayicon.cpp | 7 +++++-- src/miscellaneous/application.cpp | 1 - 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG index 5401918a9..46cff9737 100644 --- a/resources/text/CHANGELOG +++ b/resources/text/CHANGELOG @@ -13,6 +13,7 @@ Fixed: Added: diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index 77bf9eabc..d4afae555 100755 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -339,7 +339,6 @@ void FeedsView::deleteSelectedItem() { } QModelIndex current_index = currentIndex(); - QItemSelectionModel *selection_model = selectionModel(); if (!current_index.isValid()) { // Changes are done, unlock the update master lock and exit. @@ -347,17 +346,8 @@ void FeedsView::deleteSelectedItem() { return; } - if (selection_model->selectedRows().size() > 1) { - selection_model->clearSelection(); - selection_model->select(current_index, QItemSelectionModel::Rows | QItemSelectionModel::SelectCurrent); - - qApp->showGuiMessage(tr("You selected multiple items for deletion."), - tr("You can delete feeds/categories only one by one."), - QSystemTrayIcon::Warning, qApp->mainForm()); - } - - if (MessageBox::show(qApp->mainForm(), QMessageBox::Question, tr("Deleting feed or category."), - tr("You are about to delete selected feed or category."), tr("Do you really want to remove selected item?"), + if (MessageBox::show(qApp->mainForm(), QMessageBox::Question, tr("Deleting feed or category"), + tr("You are about to delete selected feed or category."), tr("Do you really want to delete selected item?"), QString(), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No) { // User changed his mind. qApp->closeLock()->unlock(); diff --git a/src/gui/systemtrayicon.cpp b/src/gui/systemtrayicon.cpp index 76eec5a07..4049e5113 100755 --- a/src/gui/systemtrayicon.cpp +++ b/src/gui/systemtrayicon.cpp @@ -28,8 +28,7 @@ #if defined(Q_OS_WIN) -TrayIconMenu::TrayIconMenu(const QString &title, QWidget *parent) - : QMenu(title, parent) { +TrayIconMenu::TrayIconMenu(const QString &title, QWidget *parent) : QMenu(title, parent) { } TrayIconMenu::~TrayIconMenu() { @@ -119,9 +118,13 @@ void SystemTrayIcon::show() { void SystemTrayIcon::setNumber(int number) { if (number <= 0) { + setToolTip(APP_LONG_NAME); + QSystemTrayIcon::setIcon(QIcon(m_normalIcon)); } else { + setToolTip(tr("%1\nUnread news: %2").arg(APP_LONG_NAME, QString::number(number))); + QPixmap background(m_plainPixmap); QPainter tray_painter; diff --git a/src/miscellaneous/application.cpp b/src/miscellaneous/application.cpp index acb2c07fb..809b079cd 100755 --- a/src/miscellaneous/application.cpp +++ b/src/miscellaneous/application.cpp @@ -60,7 +60,6 @@ IconFactory *Application::icons() { SystemTrayIcon *Application::trayIcon() { if (m_trayIcon == NULL) { m_trayIcon = new SystemTrayIcon(APP_ICON_PATH, APP_ICON_PLAIN_PATH, m_mainForm); - m_trayIcon->setToolTip(APP_LONG_NAME); } return m_trayIcon;