Tray icon tweaks.

This commit is contained in:
Martin Rotter 2014-09-12 07:28:06 +02:00
parent b1258d48fe
commit 1c8358999e
4 changed files with 8 additions and 15 deletions

View File

@ -13,6 +13,7 @@ Fixed:
Added: Added:
<ul> <ul>
<li>Tray icon tooltips now displays number of unread messages if there is at least one unread message.</li>
<li>Re-introduced "blau" (dark) skin.</li> <li>Re-introduced "blau" (dark) skin.</li>
<li>Import/export dialog now offers "Check/uncheck all items" button.</li> <li>Import/export dialog now offers "Check/uncheck all items" button.</li>
</ul> </ul>

View File

@ -339,7 +339,6 @@ void FeedsView::deleteSelectedItem() {
} }
QModelIndex current_index = currentIndex(); QModelIndex current_index = currentIndex();
QItemSelectionModel *selection_model = selectionModel();
if (!current_index.isValid()) { if (!current_index.isValid()) {
// Changes are done, unlock the update master lock and exit. // Changes are done, unlock the update master lock and exit.
@ -347,17 +346,8 @@ void FeedsView::deleteSelectedItem() {
return; return;
} }
if (selection_model->selectedRows().size() > 1) { if (MessageBox::show(qApp->mainForm(), QMessageBox::Question, tr("Deleting feed or category"),
selection_model->clearSelection(); tr("You are about to delete selected feed or category."), tr("Do you really want to delete selected item?"),
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?"),
QString(), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No) { QString(), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No) {
// User changed his mind. // User changed his mind.
qApp->closeLock()->unlock(); qApp->closeLock()->unlock();

View File

@ -28,8 +28,7 @@
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
TrayIconMenu::TrayIconMenu(const QString &title, QWidget *parent) TrayIconMenu::TrayIconMenu(const QString &title, QWidget *parent) : QMenu(title, parent) {
: QMenu(title, parent) {
} }
TrayIconMenu::~TrayIconMenu() { TrayIconMenu::~TrayIconMenu() {
@ -119,9 +118,13 @@ void SystemTrayIcon::show() {
void SystemTrayIcon::setNumber(int number) { void SystemTrayIcon::setNumber(int number) {
if (number <= 0) { if (number <= 0) {
setToolTip(APP_LONG_NAME);
QSystemTrayIcon::setIcon(QIcon(m_normalIcon)); QSystemTrayIcon::setIcon(QIcon(m_normalIcon));
} }
else { else {
setToolTip(tr("%1\nUnread news: %2").arg(APP_LONG_NAME, QString::number(number)));
QPixmap background(m_plainPixmap); QPixmap background(m_plainPixmap);
QPainter tray_painter; QPainter tray_painter;

View File

@ -60,7 +60,6 @@ IconFactory *Application::icons() {
SystemTrayIcon *Application::trayIcon() { SystemTrayIcon *Application::trayIcon() {
if (m_trayIcon == NULL) { if (m_trayIcon == NULL) {
m_trayIcon = new SystemTrayIcon(APP_ICON_PATH, APP_ICON_PLAIN_PATH, m_mainForm); m_trayIcon = new SystemTrayIcon(APP_ICON_PATH, APP_ICON_PLAIN_PATH, m_mainForm);
m_trayIcon->setToolTip(APP_LONG_NAME);
} }
return m_trayIcon; return m_trayIcon;