mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-06-23 06:33:49 +08:00
添加商店内弹出窗消息
使用SpkUiMessage::SendStoreNotification激活,必须在SpkStore构造函数加载完全局SpkPopup类之后才可 使用。
This commit is contained in:
+2
-1
@@ -6,6 +6,7 @@
|
||||
#include <QFileInfo>
|
||||
#include "spklogging.h"
|
||||
#include "spkmsgbox.h"
|
||||
#include "spkuimsg.h"
|
||||
|
||||
SpkLogger *SpkLogger::Instance = nullptr;
|
||||
|
||||
@@ -124,6 +125,6 @@ void SpkLogger::Critical(QString message)
|
||||
|
||||
void SpkLogger::Notify(QString message)
|
||||
{
|
||||
Q_UNUSED(message);
|
||||
SpkUiMessage::SendStoreNotification(message);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
#include <QDir>
|
||||
#include <QApplication>
|
||||
#include <QtNetwork/QNetworkProxy>
|
||||
|
||||
#include "dtk/spkdtkplugin.h"
|
||||
#include "gitver.h"
|
||||
#include "spkpopup.h"
|
||||
#include "spkstore.h"
|
||||
#include "spkutils.h"
|
||||
|
||||
@@ -50,6 +52,7 @@ SpkStore::SpkStore(bool aCli, QString &aLogPath)
|
||||
// UI Initialization
|
||||
SpkUi::Initialize();
|
||||
mMainWindow = new SpkMainWindow;
|
||||
SpkUi::Popup = new SpkUi::SpkPopup(mMainWindow);
|
||||
|
||||
mMainWindow->show();
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "spkuimsg.h"
|
||||
#include "spkpopup.h"
|
||||
|
||||
NotifyNotification *SpkUiMessage::_notify = nullptr; // Initialize statics
|
||||
int SpkUiMessage::mTimeoutDesktop = 5000;
|
||||
@@ -25,7 +26,7 @@ void SpkUiMessage::SendDesktopNotification(QString s, const char * const icon)
|
||||
|
||||
void SpkUiMessage::SendStoreNotification(QString s) // TODO: IMPLEMENT IN-APP NOTIFICATION
|
||||
{
|
||||
Q_UNUSED(s);
|
||||
SpkUi::Popup->Show(s);
|
||||
}
|
||||
|
||||
void SpkUiMessage::SetDesktopNotifyTimeout(int ms)
|
||||
|
||||
+3
-1
@@ -1,4 +1,5 @@
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <QDebug>
|
||||
#include "spkutils.h"
|
||||
|
||||
@@ -14,7 +15,8 @@ void SpkUtils::VerifySingleRequest(QPointer<QNetworkReply> aReply)
|
||||
QString SpkUtils::GetDistroName()
|
||||
{
|
||||
QSettings osRelease("/etc/os-release", QSettings::IniFormat);
|
||||
return osRelease.value("PRETTY_NAME", "Unknown Distro").toString();
|
||||
return osRelease.value("PRETTY_NAME", "Unknown Distro").toString() + "-" +
|
||||
osRelease.value("BUILD_ID", "Unknown Build").toString();
|
||||
}
|
||||
|
||||
bool SpkUtils::VerifyReplyJson(QNetworkReply *aReply, QJsonValue &aRetDoc)
|
||||
|
||||
Reference in New Issue
Block a user