New Non-DTK store client prototype

This commit is contained in:
RigoLigoRLC
2021-06-15 21:39:04 +08:00
parent 0ab9f4dda6
commit 479d218651
145 changed files with 3691 additions and 9935 deletions

37
src/spkuimsg.cpp Normal file
View File

@@ -0,0 +1,37 @@
#include "spkuimsg.h"
NotifyNotification *SpkUiMessage::_notify = nullptr; // Initialize statics
int SpkUiMessage::mTimeoutDesktop = 5000;
void SpkUiMessage::SendDesktopNotification(QString s, const char * const icon)
{
if(_notify == nullptr)
{
_notify = notify_notification_new(tr("Spark\\ Store").toLocal8Bit(),
s.toLocal8Bit(),
icon);
notify_notification_set_timeout(_notify, mTimeoutDesktop);
}
else
{
notify_notification_update(_notify, tr("Spark\\ Store").toLocal8Bit(),
s.toLocal8Bit(),
icon);
}
notify_notification_show(_notify, nullptr);
}
void SpkUiMessage::SendStoreNotification(QString s) // TODO: IMPLEMENT IN-APP NOTIFICATION
{
Q_UNUSED(s);
}
void SpkUiMessage::SetDesktopNotifyTimeout(int ms)
{
if(!_notify)
_notify = notify_notification_new("", "", "");
notify_notification_set_timeout(_notify, ms);
mTimeoutDesktop = ms;
}