сохранение веб сервисов с чатом
This commit is contained in:
+36
@@ -12,12 +12,35 @@
|
||||
#include <QFile>
|
||||
#include <QTableWidget>
|
||||
#include "timerinfo.h"
|
||||
#include "webserverchat.h"
|
||||
|
||||
struct ChatSettings {
|
||||
int id;
|
||||
QString name;
|
||||
QString type; // "chat" или "notification"
|
||||
int port;
|
||||
QStringList fontList;
|
||||
QString backgroundColor;
|
||||
QString blockColor;
|
||||
QString borderColor;
|
||||
int borderSize;
|
||||
int padding;
|
||||
int transparency;
|
||||
QString fontFamily;
|
||||
int fontSize;
|
||||
QString fontColor;
|
||||
bool freez;
|
||||
int messageTimeout;
|
||||
int maxMsgCount;
|
||||
bool deleteByTime;
|
||||
};
|
||||
|
||||
class uDataBase : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
// Информация о таймере
|
||||
|
||||
|
||||
public:
|
||||
// Конструктор с указанием файла базы данных
|
||||
explicit uDataBase(const QString& dbFileName, QObject* parent = nullptr);
|
||||
@@ -25,6 +48,8 @@ public:
|
||||
// Деструктор
|
||||
~uDataBase();
|
||||
|
||||
|
||||
|
||||
// Чтение настройки
|
||||
QString readSetting(const QString& aName, const QString& aDefault = "");
|
||||
|
||||
@@ -50,6 +75,16 @@ public:
|
||||
bool LoadRandomGroups(QListWidget *listWidget);
|
||||
QString ProcessResponseTemplateRecursive(const QString &templateText, int depth);
|
||||
|
||||
|
||||
bool createChatsTable();
|
||||
bool saveChat(const QString &name, const QString &type,
|
||||
HttpServerChat *server, const QString &fontList);
|
||||
bool updateChat(const QString &name, HttpServerChat *server,
|
||||
const QString &fontList, int oldPort);
|
||||
bool deleteChat(int port);
|
||||
QList<ChatSettings> loadAllChats();
|
||||
|
||||
|
||||
// Проверка подключения к БД
|
||||
bool isConnected() const;
|
||||
|
||||
@@ -60,6 +95,7 @@ public:
|
||||
private:
|
||||
|
||||
|
||||
|
||||
// Инициализация базы данных (создание таблицы, если нужно)
|
||||
bool initializeDatabase();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user