notifyController -> specialWB

This commit is contained in:
2025-11-26 11:19:11 +03:00
parent f6e96e002c
commit 44b6299e59
12 changed files with 53 additions and 43 deletions

View File

@@ -12,6 +12,7 @@ kanban-plugin: board
## Completed
- [ ] Сделать крутилку на начальную загрузку Сервера
- [ ] Логин суперпользователя PostgreSQL предлагать по умолчанию postgres
- [ ] Сделать несколько попыток подключения к серверу
- [ ] Переобновление docs.xml в пределах версии (если инструктор изменяет процедуры)
@@ -59,9 +60,6 @@ kanban-plugin: board
(Так как сейчас может вызвать проблемы при смене логина юзера!!!)
- [ ] Зарефакторить databaselms_PostgreSQL.cpp
(возможно, нужно использовать транзакции при восстановлении БД!)
- [ ] Отображать текущую версию data в статус баре
- [ ] Сделать крутилку на начальную загрузку Сервера
- [ ] Не блочится Сервер при смене версии
## GUI Messenger
@@ -74,6 +72,7 @@ kanban-plugin: board
## GUI общие
- [ ] Отображать текущую версию data в статус баре
- [ ] Текстовый поиск в задачах

View File

@@ -24,6 +24,7 @@ target_include_directories(GUIdataBaseLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
target_include_directories(GUIdataBaseLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/connectorToServer/Core)
target_include_directories(GUIdataBaseLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/messanger)
target_include_directories(GUIdataBaseLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/widgets)
target_include_directories(GUIdataBaseLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/specialmessagebox)
if(PROJECT_TYPE_DEBUG)
target_link_directories(GUIdataBaseLMS PUBLIC ${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees)
else()

View File

@@ -21,6 +21,8 @@ add_library(InstructorsAndTrainees SHARED
specialmessagebox/specialmessagebox.cpp
specialmessagebox/specialmessagebox.h
specialmessagebox/specialmessagebox.ui
specialmessagebox/notifycontroller.cpp
specialmessagebox/notifycontroller.h
authorization/dialogauthorization.cpp
authorization/dialogauthorization.h
@@ -80,8 +82,6 @@ add_library(InstructorsAndTrainees SHARED
connectorToServer/Core/tools.cpp
connectorToServer/Core/tools.h
connectorToServer/Core/FileData.h
connectorToServer/Core/notifycontroller.cpp
connectorToServer/Core/notifycontroller.h
connectorToServer/Core/versioncontainer.cpp
connectorToServer/Core/versioncontainer.h
connectorToServer/Datas.h

View File

@@ -1,12 +0,0 @@
#include "notifycontroller.h"
#include "specialmessagebox.h"
NotifyController::NotifyController(QObject *parent) : QObject(parent)
{
}
void NotifyController::showWarning(QString text)
{
SpecialMessageBox(nullptr, SpecialMessageBox::TypeSpecMsgBox::warningClose, text).exec();
}

View File

@@ -1,18 +0,0 @@
#ifndef NOTIFYCONTROLLER_H
#define NOTIFYCONTROLLER_H
#include <QObject>
#include <QMessageBox>
class NotifyController : public QObject
{
Q_OBJECT
public:
explicit NotifyController(QObject *parent = nullptr);
void showWarning(QString text);
signals:
};
#endif // NOTIFYCONTROLLER_H

View File

@@ -55,7 +55,7 @@ signals:
void sigAnswerQueryTasksXML_AMM(QByteArray array);
void sigShowServerDataList(QList<StreamingVersionData*> *versions);
void sigSetVersion(StreamingVersionData* serverVersion);
void sigNotify(QString text);
void sigNotify(QString text, QWidget *parentWidget = nullptr);
void sigAnimationActivated(bool flag);
void sigHashReady();
void sigAnswerQuerySubProc(QList<SubProc> listSubProc, QString parentTask_dmCode);

View File

@@ -144,7 +144,7 @@ void ConnectorToServer::createObjects()
recognizeSystem = new RecognizeSystem;
recognizeSystem->moveToThread(connectionThread);
notifyController = new NotifyController;
notifyController = new NotifyController(parentWidget);
versionContainer = new VersionContainer;
versionSelectWidget = new VersionSelectWidget(parentWidget);
versionSelectWidget->initialize(sendSystem,versionContainer,notifyController, recognizeSystem);

View File

@@ -0,0 +1,19 @@
#include <QMessageBox>
#include "notifycontroller.h"
#include "specialmessagebox.h"
NotifyController::NotifyController(QWidget *parentWidget, QObject *parent) :
QObject(parent),
parentWidget(parentWidget)
{
}
void NotifyController::showWarning(QString text, QWidget *parentWidget)
{
if(parentWidget)
SpecialMessageBox(parentWidget, SpecialMessageBox::TypeSpecMsgBox::warningClose, text).exec();
else
SpecialMessageBox(this->parentWidget, SpecialMessageBox::TypeSpecMsgBox::warningClose, text).exec();
}

View File

@@ -0,0 +1,20 @@
#ifndef NOTIFYCONTROLLER_H
#define NOTIFYCONTROLLER_H
#include <QObject>
#include <QWidget>
class NotifyController : public QObject
{
Q_OBJECT
public:
explicit NotifyController(QWidget *parentWidget = nullptr, QObject *parent = nullptr);
void showWarning(QString text, QWidget *parentWidget = nullptr);
private:
QWidget *parentWidget;
};
#endif // NOTIFYCONTROLLER_H

View File

@@ -1,6 +1,7 @@
#ifndef DIALOGNEWVERSION_H
#define DIALOGNEWVERSION_H
#include <QDialog>
#include <QWidget>
#include <QLineEdit>
#include <QToolTip>

View File

@@ -79,7 +79,7 @@ void VersionSelectWidget::on_createDuplicateButton_clicked()
if (selectedVersion == nullptr)
{
emit sigSendNotify(tr("Version not selected"));
emit sigSendNotify(tr("Version not selected"), this);
return;
}
@@ -95,7 +95,7 @@ void VersionSelectWidget::sendCopyEmit(QString newName)
if (selectedVersion == nullptr)
{
emit sigSendNotify(tr("Version not selected"));
emit sigSendNotify(tr("Version not selected"), this);
return;
}
@@ -107,7 +107,7 @@ void VersionSelectWidget::on_DeleteVersionButton_clicked()
{
if (selectedVersion == nullptr)
{
emit sigSendNotify(tr("Version not selected"));
emit sigSendNotify(tr("Version not selected"), this);
return;
}
@@ -118,7 +118,7 @@ void VersionSelectWidget::on_switchServerVersionButton_clicked()
{
if (selectedVersion == nullptr)
{
emit sigSendNotify(tr("Version not selected"));
emit sigSendNotify(tr("Version not selected"), this);
return;
}

View File

@@ -6,7 +6,7 @@
#include <Core/sendsystem.h>
#include <Core/versioncontainer.h>
#include <Core/notifycontroller.h>
#include <notifycontroller.h>
#include <streamingversiondata.h>
#include <dialognewversion.h>
#include <waitanimationwidget.h>
@@ -44,7 +44,7 @@ signals:
void sigSendDeleteVersion(StreamingVersionData *streaming);
void sigSendSwitchVersion(StreamingVersionData *selectVersion);
void sigSendCopyVersion(QString versionPair);
void sigSendNotify(QString message);
void sigSendNotify(QString message, QWidget *parentWidget = nullptr);
private: