Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Qarma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
#include <QColorDialog>
#include <QComboBox>
#include <QDate>
#ifdef DBUS_ENABLED
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusInterface>
#endif
#include <QDialogButtonBox>
#include <QEvent>
#include <QFileDialog>
Expand Down Expand Up @@ -954,6 +956,7 @@ char Qarma::showList(const QStringList &args)

void Qarma::notify(const QString message, bool noClose)
{
#ifdef DBUS_ENABLED
if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.freedesktop.Notifications")) {
QDBusInterface notifications("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications");
const QString summary = (message.length() < 32) ? message : message.left(25) + "...";
Expand Down Expand Up @@ -985,6 +988,7 @@ void Qarma::notify(const QString message, bool noClose)
SHOW_DIALOG
dlg->adjustSize();
dlg->move(QGuiApplication::screens().at(0)->availableGeometry().topRight() - QPoint(dlg->width() + 20, -20));
#endif
}

char Qarma::showNotification(const QStringList &args)
Expand Down
7 changes: 6 additions & 1 deletion qarma.pro
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
HEADERS = Qarma.h
SOURCES = Qarma.cpp
QT += dbus gui widgets
QT += gui widgets
lessThan(QT_MAJOR_VERSION, 6){
unix:!macx:QT += x11extras
}
TARGET = qarma

!DISABLE_DBUS {
DEFINES += DBUS_ENABLED
QT += dbus
}

unix:!macx:LIBS += -lX11
unix:!macx:DEFINES += WS_X11

Expand Down