diff --git a/resources/graphics/icons/mini-kfaenza/rssguard.png b/resources/graphics/icons/mini-kfaenza/rssguard.png new file mode 100644 index 000000000..99e3bab2b Binary files /dev/null and b/resources/graphics/icons/mini-kfaenza/rssguard.png differ diff --git a/src/definitions/definitions.h.in b/src/definitions/definitions.h.in index b5acf1709..aebd05a72 100755 --- a/src/definitions/definitions.h.in +++ b/src/definitions/definitions.h.in @@ -68,7 +68,7 @@ #define INTERNAL_URL_BLANK "about:blank" #define DEFAULT_AUTO_UPDATE_INTERVAL 15 #define AUTO_UPDATE_INTERVAL 60000 -#define STARTUP_UPDATE_DELAY 1500 +#define STARTUP_UPDATE_DELAY 15000 #define TIMEZONE_OFFSET_LIMIT 6 #define CHANGE_EVENT_DELAY 250 #define FLAG_ICON_SUBFOLDER "flags" diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp index 8ffb92e9a..41f40369f 100755 --- a/src/gui/feedmessageviewer.cpp +++ b/src/gui/feedmessageviewer.cpp @@ -277,8 +277,6 @@ void FeedMessageViewer::updateMessageButtonsAvailability() { form_main->m_ui->m_actionSwitchImportanceOfSelectedMessages->setEnabled(atleast_one_message_selected); form_main->m_ui->m_actionRestoreSelectedMessagesFromRecycleBin->setEnabled(recycle_bin_selected && atleast_one_message_selected); - - // TODO: To samo udělat s feedy, řešit pouze buttony, které se týkají výběru, ale také vzít v potaz, zda zrovna běží update. } void FeedMessageViewer::updateFeedButtonsAvailability() { diff --git a/src/gui/notifications/notification.cpp b/src/gui/notifications/notification.cpp index a0067e8fb..d51075b19 100644 --- a/src/gui/notifications/notification.cpp +++ b/src/gui/notifications/notification.cpp @@ -35,7 +35,7 @@ Notification::Notification() : QWidget(0), m_title(QString()), m_text(QString()), m_icon(QPixmap()), m_screen(-1), - m_width(-1), m_height(-1), m_padding(5), m_widgetMargin(2 * m_padding) { + m_width(-1), m_height(-1), m_padding(5), m_widgetMargin(2 * m_padding), m_timerId(0) { setupWidget(); loadSettings(); } @@ -49,7 +49,7 @@ bool Notification::areNotificationsActivated() { } void Notification::notify(const QString &text, const QString &title, const QIcon &icon) { - hide(); + cancel(); // Set new values. m_text = text; @@ -60,12 +60,22 @@ void Notification::notify(const QString &text, const QString &title, const QIcon updateGeometries(); repaint(); show(); + + m_timerId = startTimer(10000); } void Notification::notify(const QString &text, const QString &title, QSystemTrayIcon::MessageIcon icon) { notify(text, title, MessageBox::iconForStatus((QMessageBox::Icon) icon)); } +void Notification::cancel() { + hide(); + + if (m_timerId != 0) { + killTimer(m_timerId); + } +} + void Notification::updateGeometries() { // Calculate width and height of notification with given icon and text. m_width = m_padding + @@ -159,7 +169,7 @@ void Notification::paintEvent(QPaintEvent *event) { void Notification::mousePressEvent(QMouseEvent *event) { QWidget::mousePressEvent(event); - QTimer::singleShot(0, this, SLOT(hide())); + cancel(); } void Notification::enterEvent(QEvent *event) { @@ -172,6 +182,11 @@ void Notification::leaveEvent(QEvent *event) { repaint(); } +void Notification::timerEvent(QTimerEvent *event) { + QWidget::timerEvent(event); + cancel(); +} + void Notification::loadSettings() { m_position = static_cast(qApp->settings()->value(GROUP(GUI), SETTING(GUI::FancyNotificationsPosition)).toInt()); } diff --git a/src/gui/notifications/notification.h b/src/gui/notifications/notification.h index 0390d57c4..2473b99bf 100644 --- a/src/gui/notifications/notification.h +++ b/src/gui/notifications/notification.h @@ -37,11 +37,14 @@ class Notification : public QWidget { void notify(const QString &text, const QString &title, const QIcon &icon); void notify(const QString &text, const QString &title, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information); + void cancel(); + protected: void paintEvent(QPaintEvent *event); void mousePressEvent(QMouseEvent *event); void enterEvent(QEvent *event); void leaveEvent(QEvent *event); + void timerEvent(QTimerEvent *event); private: void loadSettings(); @@ -61,6 +64,7 @@ class Notification : public QWidget { int m_height; int m_padding; int m_widgetMargin; + int m_timerId; }; #endif // NOTIFICATION_H diff --git a/src/gui/systemtrayicon.cpp b/src/gui/systemtrayicon.cpp index 4bbadd712..63bfc9ea9 100755 --- a/src/gui/systemtrayicon.cpp +++ b/src/gui/systemtrayicon.cpp @@ -37,9 +37,9 @@ TrayIconMenu::~TrayIconMenu() { bool TrayIconMenu::event(QEvent *event) { if (Application::activeModalWidget() != NULL && event->type() == QEvent::Show) { QTimer::singleShot(0, this, SLOT(hide())); - qApp->trayIcon()->showMessage(QSL(APP_LONG_NAME), - tr("Close opened modal dialogs first."), - QSystemTrayIcon::Warning); + qApp->showGuiMessage(QSL(APP_LONG_NAME), + tr("Close opened modal dialogs first."), + QSystemTrayIcon::Warning, qApp->mainForm(), true); } return QMenu::event(event); }