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->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->editPassword->setEnabled(false);
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/eye.png</normaloff>:/resources/icons/eye.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
@@ -104,7 +104,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/exchange.png</normaloff>:/resources/icons/exchange.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -141,7 +141,7 @@
|
||||
<string>Administrator</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/admin.png</normaloff>
|
||||
<disabledoff>:/resources/icons/admin.png</disabledoff>:/resources/icons/admin.png</iconset>
|
||||
</property>
|
||||
@@ -168,7 +168,7 @@
|
||||
<string>Archived</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/archive.png</normaloff>
|
||||
<disabledoff>:/resources/icons/archive.png</disabledoff>:/resources/icons/archive.png</iconset>
|
||||
</property>
|
||||
@@ -192,10 +192,10 @@
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Logged</string>
|
||||
<string>Online</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/circleGreen.png</normaloff>
|
||||
<disabledoff>:/resources/icons/circleGreen.png</disabledoff>:/resources/icons/circleGreen.png</iconset>
|
||||
</property>
|
||||
@@ -241,7 +241,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
<include location="../InstructorsAndTrainees.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -195,10 +195,14 @@ void FIMtasksWidget::on_treeWidgetItemClicked(QTreeWidgetItem *item, int column)
|
||||
}
|
||||
else
|
||||
{
|
||||
setCurrentParentTask(item);
|
||||
|
||||
/*
|
||||
ui->btnAssignTask->setEnabled(false);
|
||||
|
||||
ui->btnDelete->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 setCurrentTask(int id);
|
||||
void setCurrentParentTask(QTreeWidgetItem *item);
|
||||
|
||||
Q_SIGNALS:
|
||||
void signal_prepareFIMListItems(QByteArray array);
|
||||
|
||||
@@ -611,6 +611,7 @@ void TaskAMMFIMTreePreparation::slot_prepareFIMListItems(QByteArray array)
|
||||
Malfunction malfunction = task.malfunctionList.at(j);
|
||||
|
||||
QTreeWidgetItem* itemMalfunction = new QTreeWidgetItem();
|
||||
itemMalfunction->setFlags(itemMalfunction->flags() ^ Qt::ItemIsSelectable);
|
||||
|
||||
itemMalfunction->setText(ColumnsTreeFIM::clmnFIM_Title, malfunction.description);
|
||||
if(type == TypeListTreeAMMFIM::listCommon)
|
||||
@@ -629,6 +630,7 @@ void TaskAMMFIMTreePreparation::slot_prepareFIMListItems(QByteArray array)
|
||||
MalfunctionSign sign = malfunction.malfunctionSigns.at(k);
|
||||
|
||||
QTreeWidgetItem* itemSign = new QTreeWidgetItem();
|
||||
itemSign->setFlags(itemSign->flags() ^ Qt::ItemIsSelectable);
|
||||
|
||||
itemSign->setText(ColumnsTreeFIM::clmnFIM_Title, sign.description);
|
||||
//itemSign->setFlags(itemSign->flags() | Qt::ItemIsUserCheckable);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "dialogeditgroup.h"
|
||||
#include "computersLocations.h"
|
||||
#include <QPushButton>
|
||||
#include <QRegExpValidator>
|
||||
|
||||
DialogEditGroup::DialogEditGroup(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
@@ -10,6 +11,8 @@ DialogEditGroup::DialogEditGroup(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
verify();
|
||||
|
||||
ui->editName->setValidator(new QRegExpValidator(QRegExp("[A-Za-zА-Яа-я0-9 _\\d]+"), this));
|
||||
|
||||
ui->editName->setProperty("mandatoryField", true);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ DialogEditTrainee::DialogEditTrainee(bool adminMode, QWidget *parent) :
|
||||
ui->btnViewPassword->setObjectName("btnViewPassword");
|
||||
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->editPassword->setEnabled(false);
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/eye.png</normaloff>:/resources/icons/eye.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -112,7 +112,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/exchange.png</normaloff>:/resources/icons/exchange.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -149,7 +149,7 @@
|
||||
<string>Archived</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/archive.png</normaloff>
|
||||
<disabledoff>:/resources/icons/archive.png</disabledoff>:/resources/icons/archive.png</iconset>
|
||||
</property>
|
||||
@@ -173,10 +173,10 @@
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Logged</string>
|
||||
<string>Online</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/circleGreen.png</normaloff>
|
||||
<disabledoff>:/resources/icons/circleGreen.png</disabledoff>:/resources/icons/circleGreen.png</iconset>
|
||||
</property>
|
||||
@@ -222,7 +222,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
<include location="../InstructorsAndTrainees.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user