mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
refact struct projects
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
#include <QTranslator>
|
||||
#include "specialmessagebox.h"
|
||||
#include "ui_specialmessagebox.h"
|
||||
|
||||
SpecialMessageBox::SpecialMessageBox(QWidget *parent, TypeSpecMsgBox type, const QString& text) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::SpecialMessageBox)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
if(type == TypeSpecMsgBox::warningYesNo)
|
||||
{
|
||||
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png")));
|
||||
this->setWindowTitle(tr("Attention!"));
|
||||
}
|
||||
else if(type == TypeSpecMsgBox::warningClose)
|
||||
{
|
||||
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png")));
|
||||
this->setWindowTitle(tr("Attention!"));
|
||||
ui->btnNo->setVisible(false);
|
||||
ui->btnYes->setText(tr("Close"));
|
||||
}
|
||||
else if(type == TypeSpecMsgBox::critical)
|
||||
{
|
||||
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/critical.png")));
|
||||
this->setWindowTitle(tr("Error!"));
|
||||
ui->btnNo->setVisible(false);
|
||||
ui->btnYes->setText(tr("Close"));
|
||||
}
|
||||
else if(type == TypeSpecMsgBox::info)
|
||||
{
|
||||
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/info.png")));
|
||||
this->setWindowTitle(tr("Information"));
|
||||
ui->btnNo->setVisible(false);
|
||||
ui->btnYes->setText(tr("Ok"));
|
||||
}
|
||||
|
||||
ui->lblText->setText(text);
|
||||
}
|
||||
|
||||
SpecialMessageBox::~SpecialMessageBox()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SpecialMessageBox::on_btnYes_clicked()
|
||||
{
|
||||
this->accept();
|
||||
}
|
||||
|
||||
void SpecialMessageBox::on_btnNo_clicked()
|
||||
{
|
||||
this->reject();
|
||||
}
|
||||
Reference in New Issue
Block a user