fix #973
This commit is contained in:
parent
fd86810fce
commit
a3442c1829
2 changed files with 14 additions and 11 deletions
|
@ -15,10 +15,10 @@
|
||||||
TrayIconMenu::TrayIconMenu(const QString& title, QWidget* parent) : QMenu(title, parent) {}
|
TrayIconMenu::TrayIconMenu(const QString& title, QWidget* parent) : QMenu(title, parent) {}
|
||||||
|
|
||||||
bool TrayIconMenu::event(QEvent* event) {
|
bool TrayIconMenu::event(QEvent* event) {
|
||||||
if (event->type() == QEvent::Type::Show && Application::activeModalWidget() != nullptr) {
|
if (event->type() == QEvent::Type::Show && QApplication::activeModalWidget() != nullptr) {
|
||||||
QTimer::singleShot(0, this, &TrayIconMenu::hide);
|
QTimer::singleShot(0, this, &TrayIconMenu::hide);
|
||||||
qApp->showGuiMessage(Notification::Event::GeneralEvent, {
|
qApp->showGuiMessage(Notification::Event::GeneralEvent,
|
||||||
tr("Close dialogs"),
|
{tr("Close dialogs"),
|
||||||
tr("Close opened modal dialogs first."),
|
tr("Close opened modal dialogs first."),
|
||||||
QSystemTrayIcon::MessageIcon::Warning});
|
QSystemTrayIcon::MessageIcon::Warning});
|
||||||
}
|
}
|
||||||
|
@ -29,9 +29,7 @@ bool TrayIconMenu::event(QEvent* event) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SystemTrayIcon::SystemTrayIcon(const QString& normal_icon, const QString& plain_icon, FormMain* parent)
|
SystemTrayIcon::SystemTrayIcon(const QString& normal_icon, const QString& plain_icon, FormMain* parent)
|
||||||
: QSystemTrayIcon(parent),
|
: QSystemTrayIcon(parent), m_normalIcon(normal_icon), m_plainPixmap(plain_icon) {
|
||||||
m_normalIcon(normal_icon),
|
|
||||||
m_plainPixmap(plain_icon) {
|
|
||||||
qDebugNN << LOGSEC_GUI << "Creating SystemTrayIcon instance.";
|
qDebugNN << LOGSEC_GUI << "Creating SystemTrayIcon instance.";
|
||||||
m_font.setBold(true);
|
m_font.setBold(true);
|
||||||
|
|
||||||
|
@ -150,8 +148,11 @@ void SystemTrayIcon::setNumber(int number, bool any_feed_has_new_unread_messages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemTrayIcon::showMessage(const QString& title, const QString& message, QSystemTrayIcon::MessageIcon icon,
|
void SystemTrayIcon::showMessage(const QString& title,
|
||||||
int milliseconds_timeout_hint, const std::function<void()>& functor) {
|
const QString& message,
|
||||||
|
QSystemTrayIcon::MessageIcon icon,
|
||||||
|
int milliseconds_timeout_hint,
|
||||||
|
const std::function<void()>& functor) {
|
||||||
if (m_connection != nullptr) {
|
if (m_connection != nullptr) {
|
||||||
// Disconnect previous bubble click signalling.
|
// Disconnect previous bubble click signalling.
|
||||||
disconnect(m_connection);
|
disconnect(m_connection);
|
||||||
|
|
|
@ -285,7 +285,9 @@ MessagesModel* FeedReader::messagesModel() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedReader::executeNextAutoUpdate() {
|
void FeedReader::executeNextAutoUpdate() {
|
||||||
bool disable_update_with_window = qApp->mainFormWidget()->isActiveWindow() && m_globalAutoUpdateOnlyUnfocused;
|
bool disable_update_with_window =
|
||||||
|
(qApp->mainFormWidget()->isActiveWindow() || QApplication::activeModalWidget() != nullptr) &&
|
||||||
|
m_globalAutoUpdateOnlyUnfocused;
|
||||||
auto roots = qApp->feedReader()->feedsModel()->serviceRoots();
|
auto roots = qApp->feedReader()->feedsModel()->serviceRoots();
|
||||||
std::list<CacheForServiceRoot*> full_caches = boolinq::from(roots)
|
std::list<CacheForServiceRoot*> full_caches = boolinq::from(roots)
|
||||||
.select([](ServiceRoot* root) -> CacheForServiceRoot* {
|
.select([](ServiceRoot* root) -> CacheForServiceRoot* {
|
||||||
|
|
Loading…
Add table
Reference in a new issue