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

@@ -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: