notifyController убрал

This commit is contained in:
2025-11-30 19:28:08 +03:00
parent fb493aca9f
commit d129fbded0
20 changed files with 82 additions and 206 deletions

View File

@@ -13,7 +13,7 @@ NotifyController::NotifyController(QWidget *parentWidget, QObject *parent) :
void NotifyController::showWarning(QString text, QWidget *parentWidget)
{
if(parentWidget)
SpecMsgBox(parentWidget, SpecMsgBox::TypeSpecMsgBox::warningClose, text).exec();
SpecMsgBox::WarningClose(parentWidget, text);
else
SpecMsgBox(this->parentWidget, SpecMsgBox::TypeSpecMsgBox::warningClose, text).exec();
SpecMsgBox::WarningClose(this->parentWidget, text);
}

View File

@@ -45,29 +45,29 @@ SpecMsgBox::~SpecMsgBox()
delete ui;
}
int SpecMsgBox::WarningYesNo(SpecMsgBox *msgBox, QWidget *parent, const QString &text)
int SpecMsgBox::WarningYesNo(QWidget *parent, const QString &text)
{
return SpecMsgBox::work(msgBox, parent, TypeSpecMsgBox::warningYesNo, text);
return SpecMsgBox::work(parent, TypeSpecMsgBox::warningYesNo, text);
}
int SpecMsgBox::WarningClose(SpecMsgBox *msgBox, QWidget *parent, const QString &text)
int SpecMsgBox::WarningClose(QWidget *parent, const QString &text)
{
return SpecMsgBox::work(msgBox, parent, TypeSpecMsgBox::warningClose, text);
return SpecMsgBox::work(parent, TypeSpecMsgBox::warningClose, text);
}
int SpecMsgBox::CriticalClose(SpecMsgBox *msgBox, QWidget *parent, const QString &text)
int SpecMsgBox::CriticalClose(QWidget *parent, const QString &text)
{
return SpecMsgBox::work(msgBox, parent, TypeSpecMsgBox::criticalClose, text);
return SpecMsgBox::work(parent, TypeSpecMsgBox::criticalClose, text);
}
int SpecMsgBox::InfoOk(SpecMsgBox *msgBox, QWidget *parent, const QString &text)
int SpecMsgBox::InfoOk(QWidget *parent, const QString &text)
{
return SpecMsgBox::work(msgBox, parent, TypeSpecMsgBox::infoOk, text);
return SpecMsgBox::work(parent, TypeSpecMsgBox::infoOk, text);
}
int SpecMsgBox::work(SpecMsgBox *msgBox, QWidget *parent, TypeSpecMsgBox type, const QString& text)
int SpecMsgBox::work(QWidget *parent, TypeSpecMsgBox type, const QString& text)
{
msgBox = new SpecMsgBox(parent, type, text);
SpecMsgBox *msgBox = new SpecMsgBox(parent, type, text);
return msgBox->exec();
}

View File

@@ -19,18 +19,19 @@ public:
infoOk
};
public:
private:
explicit SpecMsgBox(QWidget *parent, TypeSpecMsgBox type, const QString& text);
public:
~SpecMsgBox();
public:
static int WarningYesNo(SpecMsgBox* msgBox, QWidget *parent, const QString& text);
static int WarningClose(SpecMsgBox* msgBox, QWidget *parent, const QString& text);
static int CriticalClose(SpecMsgBox* msgBox, QWidget *parent, const QString& text);
static int InfoOk(SpecMsgBox* msgBox, QWidget *parent, const QString& text);
static int WarningYesNo(QWidget *parent, const QString& text);
static int WarningClose(QWidget *parent, const QString& text);
static int CriticalClose(QWidget *parent, const QString& text);
static int InfoOk(QWidget *parent, const QString& text);
private:
static int work(SpecMsgBox* msgBox, QWidget *parent, TypeSpecMsgBox type, const QString& text);
static int work(QWidget *parent, TypeSpecMsgBox type, const QString& text);
private slots:
void on_btnYes_clicked();