mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
refact0
This commit is contained in:
@@ -21,6 +21,7 @@ DialogEditInstructor::DialogEditInstructor(bool adminMode, QWidget *parent) :
|
|||||||
ui->btnViewPassword->setObjectName("btnViewPassword");
|
ui->btnViewPassword->setObjectName("btnViewPassword");
|
||||||
ui->btnChangePassword->setObjectName("btnChangePassword");
|
ui->btnChangePassword->setObjectName("btnChangePassword");
|
||||||
|
|
||||||
|
ui->editName->setValidator(new QRegExpValidator(QRegExp("[A-Za-zА-Яа-я0-9 _\\d]+"), this));
|
||||||
ui->editLogin->setValidator(new QRegExpValidator(QRegExp("[A-Za-z\\d]+"), this));
|
ui->editLogin->setValidator(new QRegExpValidator(QRegExp("[A-Za-z\\d]+"), this));
|
||||||
|
|
||||||
ui->editPassword->setEnabled(false);
|
ui->editPassword->setEnabled(false);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/eye.png</normaloff>:/resources/icons/eye.png</iconset>
|
<normaloff>:/resources/icons/eye.png</normaloff>:/resources/icons/eye.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/exchange.png</normaloff>:/resources/icons/exchange.png</iconset>
|
<normaloff>:/resources/icons/exchange.png</normaloff>:/resources/icons/exchange.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
<string>Administrator</string>
|
<string>Administrator</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/admin.png</normaloff>
|
<normaloff>:/resources/icons/admin.png</normaloff>
|
||||||
<disabledoff>:/resources/icons/admin.png</disabledoff>:/resources/icons/admin.png</iconset>
|
<disabledoff>:/resources/icons/admin.png</disabledoff>:/resources/icons/admin.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
<string>Archived</string>
|
<string>Archived</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/archive.png</normaloff>
|
<normaloff>:/resources/icons/archive.png</normaloff>
|
||||||
<disabledoff>:/resources/icons/archive.png</disabledoff>:/resources/icons/archive.png</iconset>
|
<disabledoff>:/resources/icons/archive.png</disabledoff>:/resources/icons/archive.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
@@ -192,10 +192,10 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Logged</string>
|
<string>Online</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/circleGreen.png</normaloff>
|
<normaloff>:/resources/icons/circleGreen.png</normaloff>
|
||||||
<disabledoff>:/resources/icons/circleGreen.png</disabledoff>:/resources/icons/circleGreen.png</iconset>
|
<disabledoff>:/resources/icons/circleGreen.png</disabledoff>:/resources/icons/circleGreen.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
@@ -241,7 +241,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../InstructorsAndTrainees.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -195,10 +195,14 @@ void FIMtasksWidget::on_treeWidgetItemClicked(QTreeWidgetItem *item, int column)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
setCurrentParentTask(item);
|
||||||
|
|
||||||
|
/*
|
||||||
ui->btnAssignTask->setEnabled(false);
|
ui->btnAssignTask->setEnabled(false);
|
||||||
|
|
||||||
ui->btnDelete->setEnabled(false);
|
ui->btnDelete->setEnabled(false);
|
||||||
ui->btnCheck->setEnabled(false);
|
ui->btnCheck->setEnabled(false);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,4 +466,37 @@ void FIMtasksWidget::setCurrentTask(int id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FIMtasksWidget::setCurrentParentTask(QTreeWidgetItem *item)
|
||||||
|
{
|
||||||
|
if(item == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int id = 0;
|
||||||
|
|
||||||
|
QTreeWidgetItem *treeItemParent = item->parent();
|
||||||
|
if(treeItemParent == nullptr)
|
||||||
|
{//задача
|
||||||
|
id = item->text(ColumnsTreeFIM::clmnFIM_ID).toInt();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *treeItemParent1 = treeItemParent->parent();
|
||||||
|
if(treeItemParent1 == nullptr)
|
||||||
|
{//задача
|
||||||
|
id = treeItemParent->text(ColumnsTreeFIM::clmnFIM_ID).toInt();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *treeItemParent2 = treeItemParent1->parent();
|
||||||
|
if(treeItemParent2 == nullptr)
|
||||||
|
{//задача
|
||||||
|
id = treeItemParent1->text(ColumnsTreeFIM::clmnFIM_ID).toInt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(id)
|
||||||
|
setCurrentTask(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ private:
|
|||||||
void updateTaskItem(QTreeWidgetItem *itemTask);
|
void updateTaskItem(QTreeWidgetItem *itemTask);
|
||||||
|
|
||||||
void setCurrentTask(int id);
|
void setCurrentTask(int id);
|
||||||
|
void setCurrentParentTask(QTreeWidgetItem *item);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void signal_prepareFIMListItems(QByteArray array);
|
void signal_prepareFIMListItems(QByteArray array);
|
||||||
|
|||||||
@@ -611,6 +611,7 @@ void TaskAMMFIMTreePreparation::slot_prepareFIMListItems(QByteArray array)
|
|||||||
Malfunction malfunction = task.malfunctionList.at(j);
|
Malfunction malfunction = task.malfunctionList.at(j);
|
||||||
|
|
||||||
QTreeWidgetItem* itemMalfunction = new QTreeWidgetItem();
|
QTreeWidgetItem* itemMalfunction = new QTreeWidgetItem();
|
||||||
|
itemMalfunction->setFlags(itemMalfunction->flags() ^ Qt::ItemIsSelectable);
|
||||||
|
|
||||||
itemMalfunction->setText(ColumnsTreeFIM::clmnFIM_Title, malfunction.description);
|
itemMalfunction->setText(ColumnsTreeFIM::clmnFIM_Title, malfunction.description);
|
||||||
if(type == TypeListTreeAMMFIM::listCommon)
|
if(type == TypeListTreeAMMFIM::listCommon)
|
||||||
@@ -629,6 +630,7 @@ void TaskAMMFIMTreePreparation::slot_prepareFIMListItems(QByteArray array)
|
|||||||
MalfunctionSign sign = malfunction.malfunctionSigns.at(k);
|
MalfunctionSign sign = malfunction.malfunctionSigns.at(k);
|
||||||
|
|
||||||
QTreeWidgetItem* itemSign = new QTreeWidgetItem();
|
QTreeWidgetItem* itemSign = new QTreeWidgetItem();
|
||||||
|
itemSign->setFlags(itemSign->flags() ^ Qt::ItemIsSelectable);
|
||||||
|
|
||||||
itemSign->setText(ColumnsTreeFIM::clmnFIM_Title, sign.description);
|
itemSign->setText(ColumnsTreeFIM::clmnFIM_Title, sign.description);
|
||||||
//itemSign->setFlags(itemSign->flags() | Qt::ItemIsUserCheckable);
|
//itemSign->setFlags(itemSign->flags() | Qt::ItemIsUserCheckable);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "dialogeditgroup.h"
|
#include "dialogeditgroup.h"
|
||||||
#include "computersLocations.h"
|
#include "computersLocations.h"
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QRegExpValidator>
|
||||||
|
|
||||||
DialogEditGroup::DialogEditGroup(QWidget *parent) :
|
DialogEditGroup::DialogEditGroup(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
@@ -10,6 +11,8 @@ DialogEditGroup::DialogEditGroup(QWidget *parent) :
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
verify();
|
verify();
|
||||||
|
|
||||||
|
ui->editName->setValidator(new QRegExpValidator(QRegExp("[A-Za-zА-Яа-я0-9 _\\d]+"), this));
|
||||||
|
|
||||||
ui->editName->setProperty("mandatoryField", true);
|
ui->editName->setProperty("mandatoryField", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ DialogEditTrainee::DialogEditTrainee(bool adminMode, QWidget *parent) :
|
|||||||
ui->btnViewPassword->setObjectName("btnViewPassword");
|
ui->btnViewPassword->setObjectName("btnViewPassword");
|
||||||
ui->btnChangePassword->setObjectName("btnChangePassword");
|
ui->btnChangePassword->setObjectName("btnChangePassword");
|
||||||
|
|
||||||
|
ui->editName->setValidator(new QRegExpValidator(QRegExp("[A-Za-zА-Яа-я0-9 _\\d]+"), this));
|
||||||
ui->editLogin->setValidator(new QRegExpValidator(QRegExp("[A-Za-z\\d]+"), this));
|
ui->editLogin->setValidator(new QRegExpValidator(QRegExp("[A-Za-z\\d]+"), this));
|
||||||
|
|
||||||
ui->editPassword->setEnabled(false);
|
ui->editPassword->setEnabled(false);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/eye.png</normaloff>:/resources/icons/eye.png</iconset>
|
<normaloff>:/resources/icons/eye.png</normaloff>:/resources/icons/eye.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/exchange.png</normaloff>:/resources/icons/exchange.png</iconset>
|
<normaloff>:/resources/icons/exchange.png</normaloff>:/resources/icons/exchange.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
<string>Archived</string>
|
<string>Archived</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/archive.png</normaloff>
|
<normaloff>:/resources/icons/archive.png</normaloff>
|
||||||
<disabledoff>:/resources/icons/archive.png</disabledoff>:/resources/icons/archive.png</iconset>
|
<disabledoff>:/resources/icons/archive.png</disabledoff>:/resources/icons/archive.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
@@ -173,10 +173,10 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Logged</string>
|
<string>Online</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/circleGreen.png</normaloff>
|
<normaloff>:/resources/icons/circleGreen.png</normaloff>
|
||||||
<disabledoff>:/resources/icons/circleGreen.png</disabledoff>:/resources/icons/circleGreen.png</iconset>
|
<disabledoff>:/resources/icons/circleGreen.png</disabledoff>:/resources/icons/circleGreen.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../InstructorsAndTrainees.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user