refactor
This commit is contained in:
+30
-28
@@ -9,8 +9,10 @@
|
||||
#include <ulink.h>
|
||||
#include <udatabase.h>
|
||||
#include <soundmanager.h>
|
||||
#include "commandprocessor.h"
|
||||
#include "fcreatechat.h"
|
||||
#include "fcreatenotify.h"
|
||||
#include "logmanager.h"
|
||||
#include "neuralnetworkmanager.h"
|
||||
#include "ttw_api.h"
|
||||
#include "user_manager.h"
|
||||
@@ -71,17 +73,6 @@ public:
|
||||
RListCommands(const QString &r1, const QString &r2) : R1(r1), R2(r2) {}
|
||||
};
|
||||
|
||||
// Запись лога
|
||||
struct LogEntry {
|
||||
QDateTime time;
|
||||
QString module;
|
||||
QString method;
|
||||
QString message;
|
||||
int code;
|
||||
QString msgType;
|
||||
QColor color;
|
||||
};
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// ПУБЛИЧНЫЕ ЧЛЕНЫ КЛАССА
|
||||
@@ -95,7 +86,7 @@ public:
|
||||
TTwAPI *twitchAPI; // API для работы с Twitch
|
||||
|
||||
// Методы логирования и работы с командами
|
||||
void toLog(QString aModule, QString aMethod, QString aMessage, int aCode);
|
||||
|
||||
void toCommands(QString command, QString response);
|
||||
|
||||
private slots:
|
||||
@@ -128,7 +119,6 @@ private slots:
|
||||
void loadSettings(); // Загрузка настроек
|
||||
void on_btnImportSettings_clicked(); // Импорт настроек
|
||||
void on_btnExportSettings_clicked(); // Экспорт настроек
|
||||
void on_btnSaveSettings_clicked(); // Сохранение настроек
|
||||
|
||||
// ========================================================================
|
||||
// СЛОТЫ ДЛЯ РАБОТЫ С УВЕДОМЛЕНИЯМИ
|
||||
@@ -159,12 +149,7 @@ private slots:
|
||||
// СЛОТЫ ДЛЯ РАБОТЫ С КОМАНДАМИ И ОТВЕТАМИ
|
||||
// ========================================================================
|
||||
void execCommand(const QString &sender, const QString &message);
|
||||
QString ResponsParserStatic(const QString &inMess, const QString &adName, const QString &aCommandText);
|
||||
QString ResponsParserRandoms(const QString &inMess);
|
||||
QString ResponsParserSounds(const QString &inMess);
|
||||
QString ResponsParserText(const QString &inMess);
|
||||
QString ResponsParserAI(const QString &response, const QString &pall);
|
||||
QString responsParserAPI(const QString &inMess, const QString &adName);
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// СЛОТЫ ДЛЯ РАБОТЫ С ИСКУССТВЕННЫМ ИНТЕЛЛЕКТОМ
|
||||
@@ -199,9 +184,13 @@ private slots:
|
||||
// ========================================================================
|
||||
// СЛОТЫ ДЛЯ РАБОТЫ С ЛОГАМИ
|
||||
// ========================================================================
|
||||
void applyLogFilter();
|
||||
void onLogEntryAdded(const LogEntry& entry);
|
||||
void onLogCleared();
|
||||
|
||||
// Добавляем методы для фильтрации
|
||||
void addLogToTable(const LogEntry &entry, int row);
|
||||
bool shouldShowLogEntry(int code);
|
||||
void applyLogFilter();
|
||||
bool shouldShowLogEntry(LogLevel level); // Изменяем тип параметра
|
||||
|
||||
// ========================================================================
|
||||
// СЛОТЫ ДЛЯ РАБОТЫ С ТАБЛИЦАМИ И ГРИДАМИ
|
||||
@@ -305,8 +294,6 @@ private slots:
|
||||
|
||||
void on_edtDACode_editingFinished();
|
||||
|
||||
void on_cbDAAutoLogin_checkStateChanged(const Qt::CheckState &arg1);
|
||||
|
||||
void on_cbDAAutoLogin_stateChanged(int arg1);
|
||||
|
||||
void on_edtGPTPrefix_editingFinished();
|
||||
@@ -359,6 +346,7 @@ private slots:
|
||||
|
||||
void on_btnThemesFolder_clicked();
|
||||
|
||||
void onNotifyServerUpdated(HttpServer *server, const QString &name);
|
||||
public slots:
|
||||
// Установка статуса подключения к Twitch
|
||||
void setTwitchConnected(bool connected);
|
||||
@@ -372,15 +360,17 @@ private:
|
||||
TAuth *m_authBot; // Авторизация бота
|
||||
TAuth *m_authStreamer; // Авторизация стримера
|
||||
TAuth *m_authDA; // Авторизация DA
|
||||
|
||||
RandomResponses *m_randomResponses;
|
||||
uLink *fLinkForm; // Форма ссылок
|
||||
TTTVAuth *TTVAuth; // Данные авторизации Twitch
|
||||
UserManager *m_userManager; // Менеджер пользователей
|
||||
QList<LogEntry> allLogs; // Все записи логов
|
||||
|
||||
CommandProcessor* m_commandProcessor; // Процессор команд
|
||||
WebSocketClient *m_twitchClient; // WebSocket клиент для Twitch
|
||||
UserWidget* m_userWidget; // Виджет пользователя
|
||||
NeuralNetworkManager *nnManager; // Менеджер нейронных сетей
|
||||
RandomManager *m_randomManager;
|
||||
MediaFileManager *m_SoundFiles;
|
||||
MediaFileManager *m_TextFiles;
|
||||
|
||||
QList<TimerInfo> m_timers; // Список таймеров
|
||||
int m_nextTimerId = 1; // Следующий ID таймера
|
||||
@@ -430,7 +420,7 @@ private:
|
||||
// Метод для применения QSS темы
|
||||
void applyStyleSheet(const QString &filename);
|
||||
|
||||
QString getUserFilePath(const QString &type, const QString &fileName) const;
|
||||
|
||||
QString getUserDataPath() const;
|
||||
QString getSystemPath() const;
|
||||
void setupButtonIcons();
|
||||
@@ -455,7 +445,10 @@ private:
|
||||
// Воспроизведение уведомлений
|
||||
void playNotify(const bool &isMod, const bool &isVip, const bool &isSub);
|
||||
|
||||
|
||||
void loadCommandsFromTableWidget();
|
||||
void loadRandomRangesFromTableWidget();
|
||||
void loadRandomResponseGroupsFromDatabase();
|
||||
void loadSoundsFromDatabase();
|
||||
// Инициализация базы данных
|
||||
void initializeDatabase();
|
||||
// Настройка пользовательского интерфейса
|
||||
@@ -476,10 +469,19 @@ private:
|
||||
void loadEmoties();
|
||||
void loadChatBadges();
|
||||
|
||||
/**
|
||||
* @brief Инициализирует звуковые уведомления
|
||||
*/
|
||||
void initializeNotificationSounds();
|
||||
|
||||
// Обработка эмодзи
|
||||
void processEmotes(QString &message);
|
||||
|
||||
void loadSavedChats();
|
||||
void loadSavedNotifications();
|
||||
|
||||
void processUserCommand(const QString &username, const QString &commandText);
|
||||
void sendChatResponse(const QString &response);
|
||||
};
|
||||
|
||||
#endif // UGENERAL_H
|
||||
|
||||
Reference in New Issue
Block a user