Skip to content

Commit

Permalink
Current version of Psi+ is 1.5.1938
Browse files Browse the repository at this point in the history
It is based on:
* psi: 32df7c5f
* plugins: 7a65467
* psimedia: 478567e
* resources: e32ef4b
  • Loading branch information
tehnick committed May 30, 2024
1 parent c019595 commit 86b7993
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
11 changes: 10 additions & 1 deletion src/mainwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,10 @@ MainWin::MainWin(bool _onTop, bool _asTool, PsiCon *psi) :
reinitAutoHide();
#ifdef USE_TASKBARNOTIFIER
d->taskBarNotifier = new TaskBarNotifier(this);
#ifdef Q_OS_WIN
d->taskBarNotifier->enableFlashWindow(d->allInOne
&& PsiOptions::instance()->getOption("options.ui.flash-windows").toBool());
#endif
#endif
}

Expand Down Expand Up @@ -589,11 +593,16 @@ 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);
}
}
#if defined(USE_TASKBARNOTIFIER) && defined(Q_OS_WIN)
else if (d->allInOne && option == "options.ui.flash-windows") {
d->taskBarNotifier->enableFlashWindow(PsiOptions::instance()->getOption(option).toBool());
}
#endif
}

void MainWin::registerAction(IconAction *action)
Expand Down
23 changes: 20 additions & 3 deletions src/widgets/taskbarnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class TaskBarNotifier::Private {
#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 = {});
Expand All @@ -92,6 +95,7 @@ class TaskBarNotifier::Private {
#ifdef Q_OS_WIN
HWND hwnd_;
HICON icon_;
bool flashWindow_ = false;
#else
QImage *image_;
#endif
Expand Down Expand Up @@ -222,6 +226,8 @@ 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_)
Expand Down Expand Up @@ -284,9 +290,12 @@ HICON TaskBarNotifier::Private::getHICONfromQImage(const QImage &image) const
void TaskBarNotifier::Private::doFlashTaskbarIcon()
{
FLASHWINFO fi;
fi.cbSize = sizeof(FLASHWINFO);
fi.hwnd = hwnd_;
fi.dwFlags = (urgent_) ? FLASHW_ALL | FLASHW_TIMER : FLASHW_STOP;
fi.cbSize = sizeof(FLASHWINFO);
fi.hwnd = hwnd_;
if (urgent_)
fi.dwFlags = ((flashWindow_) ? FLASHW_ALL : FLASHW_TRAY) | FLASHW_TIMER;
else
fi.dwFlags = FLASHW_STOP;
fi.uCount = 0;
fi.dwTimeout = 0;
FlashWindowEx(&fi);
Expand All @@ -306,3 +315,11 @@ void TaskBarNotifier::setIconCountCaption(int count) { d->setIconCount(count); }
void TaskBarNotifier::removeIconCountCaption() { d->restoreDefaultIcon(); }

bool TaskBarNotifier::isActive() { return d->active(); }

#ifdef Q_OS_WIN
void TaskBarNotifier::enableFlashWindow(bool enabled)
{
if (d)
d->setFlashWindow(enabled);
}
#endif
4 changes: 4 additions & 0 deletions src/widgets/taskbarnotifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define TASKBARNOTIFIER_H

#include <memory>
#include <qglobal.h>

class QWidget;

Expand All @@ -31,6 +32,9 @@ class TaskBarNotifier {
void setIconCountCaption(int count);
void removeIconCountCaption();
bool isActive();
#ifdef Q_OS_WIN
void enableFlashWindow(bool enabled);
#endif

private:
class Private;
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.1937 (2024-05-30, 43863b93)
1.5.1938 (2024-05-30, 32df7c5f)

0 comments on commit 86b7993

Please sign in to comment.