mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 12:22:05 +08:00
进度更新
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
// Created by rigoligo on 2021/5/8.
|
||||
//
|
||||
|
||||
#ifndef _DEEPINPLATFORM_H_
|
||||
#define _DEEPINPLATFORM_H_
|
||||
#pragma once
|
||||
|
||||
// Stub
|
||||
|
||||
|
||||
15
inc/dtk/spkdtkplugin.h
Normal file
15
inc/dtk/spkdtkplugin.h
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class SpkDtkPlugin
|
||||
{
|
||||
public:
|
||||
virtual ~SpkDtkPlugin() = default;
|
||||
|
||||
virtual void addWindow(QWidget* w, QObject* parent) = 0;
|
||||
};
|
||||
QT_BEGIN_NAMESPACE
|
||||
Q_DECLARE_INTERFACE(SpkDtkPlugin, "org.spark-store.client.dtkplugin")
|
||||
QT_END_NAMESPACE
|
||||
8
inc/gitver.h
Normal file
8
inc/gitver.h
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace GitVer
|
||||
{
|
||||
const char *DescribeTags();
|
||||
const char *CommitDate();
|
||||
}
|
||||
11
inc/spkabout.h
Normal file
11
inc/spkabout.h
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "spkdialog.h"
|
||||
|
||||
class SpkAbout : public SpkDialog
|
||||
{
|
||||
public:
|
||||
SpkAbout(QWidget* parent = nullptr);
|
||||
void Show();
|
||||
};
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef SPKDIALOG_H
|
||||
#define SPKDIALOG_H
|
||||
#pragma once
|
||||
|
||||
#include <QList>
|
||||
#include <QButtonGroup>
|
||||
@@ -33,5 +32,3 @@ class SpkDialog : public SpkWindow
|
||||
QButtonGroup *mBtnGroup;
|
||||
QList<QWidget*> mWidgetsList, mParentsList;
|
||||
};
|
||||
|
||||
#endif // SPKDIALOG_H
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* @brief Simple logging for Spark Store
|
||||
*/
|
||||
|
||||
#ifndef _SPKLOGGING_H_
|
||||
#define _SPKLOGGING_H_
|
||||
#pragma once
|
||||
|
||||
#pragma push_macro("signals")
|
||||
#undef signals
|
||||
@@ -43,5 +42,3 @@ class SpkLogger
|
||||
#define sErrPop(X) SpkLogger::GetInstance()->Error(X,true)
|
||||
#define sCritical(X) SpkLogger::GetInstance()->Critical(X)
|
||||
#define sNotify(X)
|
||||
|
||||
#endif //_SPKLOGGING_H_
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// Created by rigoligo on 2021/5/9.
|
||||
//
|
||||
|
||||
#ifndef _SPKMAINWINDOW_H_
|
||||
#define _SPKMAINWINDOW_H_
|
||||
#pragma once
|
||||
|
||||
#include "spkwindow.h"
|
||||
#include <QTextEdit>
|
||||
@@ -74,5 +73,3 @@ class SpkMainWindow : public SpkWindow
|
||||
|
||||
void PopulateCategories(QJsonObject);
|
||||
};
|
||||
|
||||
#endif //_SPKMAINWINDOW_H_
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef SPKMSGBOX_H
|
||||
#define SPKMSGBOX_H
|
||||
#pragma once
|
||||
|
||||
#include <QStyle>
|
||||
#include <QMessageBox>
|
||||
@@ -9,7 +8,7 @@ class SpkMsgBox : public SpkDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkMsgBox();
|
||||
SpkMsgBox(QWidget *parent = nullptr);
|
||||
static int StaticExec(QString msg, QString title, QMessageBox::Icon = QMessageBox::NoIcon,
|
||||
QMessageBox::StandardButtons = QMessageBox::Ok, QString extra = "");
|
||||
private:
|
||||
@@ -18,5 +17,3 @@ class SpkMsgBox : public SpkDialog
|
||||
static constexpr QSize IconSize {48, 48};
|
||||
static constexpr int Margin = 10;
|
||||
};
|
||||
|
||||
#endif // SPKMSGBOX_H
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef SPKPAGEQSSTEST_H
|
||||
#define SPKPAGEQSSTEST_H
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QSplitter>
|
||||
@@ -40,5 +39,3 @@ namespace SpkUi
|
||||
void FetchStylesheet();
|
||||
};
|
||||
}
|
||||
|
||||
#endif // SPKPAGEQSSTEST_H
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// Created by rigoligo on 2021/5/12.
|
||||
//
|
||||
|
||||
#ifndef _SPKSTORE_H_
|
||||
#define _SPKSTORE_H_
|
||||
#pragma once
|
||||
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
@@ -20,15 +19,14 @@ class SpkStore : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkStore *Instance;
|
||||
static SpkStore *Instance;
|
||||
SpkStore(bool aCli, QString &aLogPath);
|
||||
~SpkStore();
|
||||
|
||||
SpkMainWindow* GetRootWindow() { return mMainWindow; };
|
||||
|
||||
private:
|
||||
SpkLogger *mLogger;
|
||||
SpkMainWindow *mMainWindow;
|
||||
SpkMainWindow *mMainWindow = nullptr;
|
||||
|
||||
};
|
||||
|
||||
#endif //_SPKSTORE_H_
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// Created by rigoligo on 2021/5/8.
|
||||
//
|
||||
|
||||
#ifndef _SPKTITLEBAR_H_
|
||||
#define _SPKTITLEBAR_H_
|
||||
#pragma once
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
@@ -70,5 +69,3 @@ class SpkTitleBar : public QWidget
|
||||
void MinimizeWindow();
|
||||
void MaximizeRestoreWindow();
|
||||
};
|
||||
|
||||
#endif //_SPKTITLEBAR_H_
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
// Created by rigoligo on 2021/5/8.
|
||||
//
|
||||
|
||||
#ifndef _SPKUI_GENERAL_H_
|
||||
#define _SPKUI_GENERAL_H_
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QString>
|
||||
#include <QSize>
|
||||
#include <QColor>
|
||||
|
||||
#include "dtkplugin/spkdtkplugin.h"
|
||||
|
||||
namespace SpkUi
|
||||
{
|
||||
constexpr int StackTraceArraySize = 64;
|
||||
@@ -17,6 +19,7 @@ namespace SpkUi
|
||||
extern QString StylesheetLight, StylesheetDark, *CurrentStylesheet;
|
||||
extern QColor ColorLine, ColorBack;
|
||||
extern QSize PrimaryScreenSize;
|
||||
extern SpkDtkPlugin *DtkPlugin;
|
||||
enum SpkUiStyle { Light, Dark };
|
||||
enum SpkButtonStyle { Normal = 0, Recommend, Warn };
|
||||
|
||||
@@ -34,5 +37,3 @@ namespace SpkUi
|
||||
|
||||
void SetGlobalStyle(SpkUiStyle);
|
||||
};
|
||||
|
||||
#endif //_SPKUI_GENERAL_H_
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// Created by rigoligo on 2021/5/9.
|
||||
//
|
||||
|
||||
#ifndef _SPKUIMSG_H_
|
||||
#define _SPKUIMSG_H_
|
||||
#pragma once
|
||||
|
||||
#pragma push_macro("signals")
|
||||
#undef signals
|
||||
@@ -31,5 +30,3 @@ class SpkUiMessage : public QObject
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
#endif //_SPKUIMSG_H_
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// Created by rigoligo on 2021/5/8.
|
||||
//
|
||||
|
||||
#ifndef _SPKWINDOW_H_
|
||||
#define _SPKWINDOW_H_
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QFrame>
|
||||
@@ -32,7 +31,7 @@ class SpkWindow : public QMainWindow
|
||||
static constexpr int BorderWidth = 10;
|
||||
|
||||
public:
|
||||
SpkWindow(QWidget *parent = nullptr);
|
||||
SpkWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
|
||||
~SpkWindow() override;
|
||||
void SetCentralWidget(QWidget *);
|
||||
bool GetUseTitleBar();
|
||||
@@ -63,5 +62,3 @@ class SpkWindow : public QMainWindow
|
||||
private:
|
||||
void PopulateUi();
|
||||
};
|
||||
|
||||
#endif //_SPKWINDOW_H_
|
||||
|
||||
20
inc/telemetry/collectid.h
Normal file
20
inc/telemetry/collectid.h
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QFile>
|
||||
|
||||
namespace SpkTelemetry
|
||||
{
|
||||
void FunCollectId()
|
||||
{
|
||||
#if !defined(NDEBUG) || !defined(SPARK_FORCE_TELEMETRY) // Debug builds shouldn't transmit telemetry data unless asked for
|
||||
return;
|
||||
#else
|
||||
QFile idFile("/etc/machine-id");
|
||||
if(!idFile.open(QFile::ReadOnly))
|
||||
return;
|
||||
auto machineId = idFile.readAll();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user