Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/mainwin.cpp b/src/mainwin.cpp
- index 29a96a49..0ddd8b93 100644
- --- a/src/mainwin.cpp
- +++ b/src/mainwin.cpp
- @@ -551,6 +551,7 @@ MainWin::MainWin(bool _onTop, bool _asTool, PsiCon *psi) :
- reinitAutoHide();
- #ifdef USE_TASKBARNOTIFIER
- d->taskBarNotifier = new TaskBarNotifier(this);
- + d->taskBarNotifier->enableFlashWindow(d->allInOne && PsiOptions::instance()->getOption("options.ui.flash-windows").toBool());
- #endif
- }
- @@ -589,10 +590,12 @@ void MainWin::optionChanged(const QString &option)
- if (option == toolbarsStateOptionPath) {
- loadToolbarsState();
- } else if (option == "options.ui.contactlist.css") {
- - const QString css = PsiOptions::instance()->getOption("options.ui.contactlist.css").toString();
- + const QString css = PsiOptions::instance()->getOption(option).toString();
- if (!css.isEmpty()) {
- setStyleSheet(css);
- }
- + } else if (d->allInOne && option == "options.ui.flash-windows") {
- + d->taskBarNotifier->enableFlashWindow(PsiOptions::instance()->getOption(option).toBool());
- }
- }
- diff --git a/src/widgets/taskbarnotifier.cpp b/src/widgets/taskbarnotifier.cpp
- index 908d7173..2343492e 100644
- --- a/src/widgets/taskbarnotifier.cpp
- +++ b/src/widgets/taskbarnotifier.cpp
- @@ -71,6 +71,9 @@ public:
- #ifdef USE_DBUS
- void setDesktopPath(const QString &appName);
- #endif
- +#ifdef Q_OS_WIN
- + void setFlashWindow(bool enabled);
- +#endif
- private:
- #ifdef Q_OS_WIN
- void setTaskBarIcon(const HICON &icon = {});
- @@ -92,6 +95,7 @@ private:
- #ifdef Q_OS_WIN
- HWND hwnd_;
- HICON icon_;
- + bool flashWindow_ = false;
- #else
- QImage *image_;
- #endif
- @@ -222,6 +226,11 @@ void TaskBarNotifier::Private::sendDBusSignal(bool isVisible, uint number)
- }
- #elif defined(Q_OS_WIN)
- +void TaskBarNotifier::Private::setFlashWindow(bool enabled)
- +{
- + flashWindow_ = enabled;
- +}
- +
- void TaskBarNotifier::Private::setTaskBarIcon(const HICON &icon)
- {
- if (icon_)
- @@ -286,7 +295,10 @@ void TaskBarNotifier::Private::doFlashTaskbarIcon()
- FLASHWINFO fi;
- fi.cbSize = sizeof(FLASHWINFO);
- fi.hwnd = hwnd_;
- - fi.dwFlags = (urgent_) ? FLASHW_ALL | FLASHW_TIMER : FLASHW_STOP;
- + if(urgent_)
- + fi.dwFlags = ((flashWindow_) ? FLASHW_ALL : FLASHW_TRAY) | FLASHW_TIMER;
- + else
- + fi.dwFlags = FLASHW_STOP;
- fi.uCount = 0;
- fi.dwTimeout = 0;
- FlashWindowEx(&fi);
- @@ -306,3 +318,13 @@ void TaskBarNotifier::setIconCountCaption(int count) { d->setIconCount(count); }
- void TaskBarNotifier::removeIconCountCaption() { d->restoreDefaultIcon(); }
- bool TaskBarNotifier::isActive() { return d->active(); }
- +
- +void TaskBarNotifier::enableFlashWindow(bool enabled)
- +{
- +#ifdef Q_OS_WIN
- + if(d)
- + d->setFlashWindow(enabled);
- +#else
- + Q_UNUSED(enabled);
- +#endif
- +}
- diff --git a/src/widgets/taskbarnotifier.h b/src/widgets/taskbarnotifier.h
- index 11525360..6312970c 100644
- --- a/src/widgets/taskbarnotifier.h
- +++ b/src/widgets/taskbarnotifier.h
- @@ -31,6 +31,7 @@ public:
- void setIconCountCaption(int count);
- void removeIconCountCaption();
- bool isActive();
- + void enableFlashWindow(bool enabled);
- private:
- class Private;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement