refact1
200
LibInstructorsAndTrainees/CMakeLists.txt
Normal file
@@ -0,0 +1,200 @@
|
||||
project(InstructorsAndTrainees LANGUAGES CXX)
|
||||
|
||||
common_info_for_project(InstructorsAndTrainees)
|
||||
|
||||
add_library(InstructorsAndTrainees SHARED
|
||||
metatypes.h
|
||||
metatypes.cpp
|
||||
|
||||
instructorsAndTrainees_global.h
|
||||
instructorsandtraineeswidget.cpp
|
||||
instructorsandtraineeswidget.h
|
||||
instructorsandtraineeswidget.ui
|
||||
|
||||
commonview.cpp
|
||||
commonview.h
|
||||
|
||||
settings/dialogsettings.cpp
|
||||
settings/dialogsettings.h
|
||||
settings/dialogsettings.ui
|
||||
settings/dialognewversion.cpp
|
||||
settings/dialognewversion.h
|
||||
settings/dialognewversion.ui
|
||||
settings/dialogversioncontrol.cpp
|
||||
settings/dialogversioncontrol.h
|
||||
settings/dialogversioncontrol.ui
|
||||
|
||||
specialmessagebox/specialmessagebox.cpp
|
||||
specialmessagebox/specialmessagebox.h
|
||||
specialmessagebox/specialmessagebox.ui
|
||||
|
||||
authorization/dialogauthorization.cpp
|
||||
authorization/dialogauthorization.h
|
||||
authorization/dialogauthorization.ui
|
||||
|
||||
trainees/editortrainees.cpp
|
||||
trainees/editortrainees.h
|
||||
trainees/editortrainees.ui
|
||||
trainees/dialogeditgroup.cpp
|
||||
trainees/dialogeditgroup.h
|
||||
trainees/dialogeditgroup.ui
|
||||
trainees/dialogedittrainee.cpp
|
||||
trainees/dialogedittrainee.h
|
||||
trainees/dialogedittrainee.ui
|
||||
trainees/computersLocations.h
|
||||
trainees/computersLocations.cpp
|
||||
trainees/viewertrainees.cpp
|
||||
trainees/viewertrainees.h
|
||||
trainees/viewertrainees.ui
|
||||
trainees/traineesview.cpp
|
||||
trainees/traineesview.h
|
||||
trainees/personalcardtrainee.cpp
|
||||
trainees/personalcardtrainee.h
|
||||
trainees/personalcardtrainee.ui
|
||||
trainees/dialogcardtrainee.cpp
|
||||
trainees/dialogcardtrainee.h
|
||||
trainees/dialogredactortrainees.cpp
|
||||
trainees/dialogredactortrainees.h
|
||||
|
||||
instructors/viewerinstructors.cpp
|
||||
instructors/viewerinstructors.h
|
||||
instructors/viewerinstructors.ui
|
||||
instructors/editorinstructors.cpp
|
||||
instructors/editorinstructors.h
|
||||
instructors/editorinstructors.ui
|
||||
instructors/dialogeditinstructor.cpp
|
||||
instructors/dialogeditinstructor.h
|
||||
instructors/dialogeditinstructor.ui
|
||||
instructors/instructorsview.cpp
|
||||
instructors/instructorsview.h
|
||||
instructors/dialogredactorinstructors.cpp
|
||||
instructors/dialogredactorinstructors.h
|
||||
|
||||
connectorToServer/connectortoserver.cpp
|
||||
connectorToServer/connectortoserver.h
|
||||
connectorToServer/connectortoserver_LocalModelDB.cpp
|
||||
connectorToServer/connectortoserver_AnswerQueryToDB.cpp
|
||||
connectorToServer/connectortoserver_Send.cpp
|
||||
connectorToServer/Core/sendsystem.cpp
|
||||
connectorToServer/Core/sendsystem.h
|
||||
connectorToServer/Core/dataparser.cpp
|
||||
connectorToServer/Core/dataparser.h
|
||||
connectorToServer/Core/recognizesystem.cpp
|
||||
connectorToServer/Core/recognizesystem.h
|
||||
connectorToServer/Core/tcpclient.cpp
|
||||
connectorToServer/Core/tcpclient.h
|
||||
connectorToServer/Core/tools.cpp
|
||||
connectorToServer/Core/tools.h
|
||||
connectorToServer/Core/FileData.h
|
||||
connectorToServer/Core/versioncontainer.cpp
|
||||
connectorToServer/Core/versioncontainer.h
|
||||
connectorToServer/Datas.h
|
||||
connectorToServer/streamingversiondata.h
|
||||
|
||||
messanger/messangerwidget.cpp
|
||||
messanger/messangerwidget.h
|
||||
messanger/messangerwidget.ui
|
||||
messanger/msgwidget.cpp
|
||||
messanger/msgwidget.h
|
||||
messanger/msgwidget.ui
|
||||
messanger/tabdialogmessenger.cpp
|
||||
messanger/tabdialogmessenger.h
|
||||
messanger/messangercontroller.cpp
|
||||
messanger/messangercontroller.h
|
||||
|
||||
tasks/ammtaskswidget.cpp
|
||||
tasks/ammtaskswidget.h
|
||||
tasks/ammtaskswidget.ui
|
||||
tasks/module.cpp
|
||||
tasks/module.h
|
||||
tasks/fimtaskswidget.cpp
|
||||
tasks/fimtaskswidget.h
|
||||
tasks/fimtaskswidget.ui
|
||||
tasks/tasktreepreparation.cpp
|
||||
tasks/tasktreepreparation.h
|
||||
tasks/checkertask.cpp
|
||||
tasks/checkertask.h
|
||||
tasks/checkertask.ui
|
||||
tasks/dialogchekertask.cpp
|
||||
tasks/dialogchekertask.h
|
||||
|
||||
tasks/dialogtaskscommon.cpp
|
||||
tasks/dialogtaskscommon.h
|
||||
|
||||
tasks/viewertaskscommon.cpp
|
||||
tasks/viewertaskscommon.h
|
||||
tasks/viewertaskscommon.ui
|
||||
|
||||
tasks/dialoglistsubproc.cpp
|
||||
tasks/dialoglistsubproc.h
|
||||
|
||||
tasks/listsubproc.cpp
|
||||
tasks/listsubproc.h
|
||||
tasks/listsubproc.ui
|
||||
|
||||
tasks/subprocitemwidget.cpp
|
||||
tasks/subprocitemwidget.h
|
||||
tasks/subprocitemwidget.ui
|
||||
|
||||
widgets/waitanimationwidget.cpp
|
||||
widgets/waitanimationwidget.h
|
||||
widgets/waitanimationwidget.ui
|
||||
widgets/widgettools.cpp
|
||||
widgets/widgettools.h
|
||||
|
||||
InstructorsAndTrainees.qrc
|
||||
)
|
||||
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Widgets)
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Sql)
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Xml)
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Network)
|
||||
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/authorization)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/instructors)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/trainees)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tasks)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/connectorToServer)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/connectorToServer/Core)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/messanger)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/settings)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/specialmessagebox)
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/widgets)
|
||||
|
||||
target_compile_definitions(InstructorsAndTrainees PRIVATE INSTRUCTORSANDTRAINEES_LIBRARY)
|
||||
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../LibDataBaseInterface)
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
target_link_directories(InstructorsAndTrainees PUBLIC ${REPO_PATH}/BUILDS/Debug64/LibDataBaseInterface)
|
||||
else()
|
||||
target_link_directories(InstructorsAndTrainees PUBLIC ${REPO_PATH}/BUILDS/Release64/LibDataBaseInterface)
|
||||
endif()
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE libDataBaseInterface.dll)
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_custom_command(TARGET InstructorsAndTrainees
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${REPO_PATH}/BUILDS/Debug64/LibInstructorsAndTrainees/libInstructorsAndTrainees.dll
|
||||
${REPO_PATH}/BUILDS/Debug64/ProgramAWSinstructorMPS)
|
||||
|
||||
add_custom_command(TARGET InstructorsAndTrainees
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${REPO_PATH}/BUILDS/Debug64/LibInstructorsAndTrainees/libInstructorsAndTrainees.dll
|
||||
${REPO_PATH}/BUILDS/Debug64/ProgramServerMPS)
|
||||
else()
|
||||
add_custom_command(TARGET InstructorsAndTrainees
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${REPO_PATH}/BUILDS/Release64/LibInstructorsAndTrainees/libInstructorsAndTrainees.dll
|
||||
${REPO_PATH}/BUILDS/Release64/ProgramAWSinstructorMPS)
|
||||
add_custom_command(TARGET InstructorsAndTrainees
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${REPO_PATH}/BUILDS/Release64/LibInstructorsAndTrainees/libInstructorsAndTrainees.dll
|
||||
${REPO_PATH}/BUILDS/Release64/ProgramServerMPS)
|
||||
endif()
|
||||
|
||||
#Только для TSMP!
|
||||
#install(TARGETS InstructorsAndTrainees DESTINATION ${VEYON_LIB_DIR})
|
||||
618
LibInstructorsAndTrainees/CMakeLists.txt.user.00ce76f
Normal file
@@ -0,0 +1,618 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.11.1, 2024-12-28T11:57:36. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{00ce76f6-77cf-4587-a216-9a8e243377cb}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
|
||||
<value type="QString">-fno-delayed-template-parsing</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win64_mingw73_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/BUILDS/LMS/DB_IaT/Debug64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Отладка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/LMS/DB_IaT/Release64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/SUO/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_64_bit-RelWithDebInfo</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск с отладочной информацией</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/SUO/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_64_bit-MinSizeRel</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск минимального размера</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
|
||||
<value type="QString">-e</value>
|
||||
<value type="QString">cpu-cycles</value>
|
||||
<value type="QString">--call-graph</value>
|
||||
<value type="QString">dwarf,4096</value>
|
||||
<value type="QString">-F</value>
|
||||
<value type="QString">250</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||
<value type="QString" key="RunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
|
||||
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.1</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 32-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 32-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win32_mingw73_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/SUO/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_32_bit-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Отладка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/SUO/Release64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/SUO/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_32_bit-RelWithDebInfo</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск с отладочной информацией</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/VEYON/SUO/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_32_bit-MinSizeRel</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск минимального размера</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
|
||||
<value type="QString">-e</value>
|
||||
<value type="QString">cpu-cycles</value>
|
||||
<value type="QString">--call-graph</value>
|
||||
<value type="QString">dwarf,4096</value>
|
||||
<value type="QString">-F</value>
|
||||
<value type="QString">250</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||
<value type="QString" key="RunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
|
||||
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">2</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
390
LibInstructorsAndTrainees/CMakeLists.txt.user.15ef247
Normal file
@@ -0,0 +1,390 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.11.1, 2025-01-10T12:59:45. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{15ef2478-2444-4b00-88b8-fead51c6fef5}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
|
||||
<value type="QString">-fno-delayed-template-parsing</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win64_mingw73_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">4</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/BUILDS/DB_IaT/Debug64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Отладка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/DB_IaT/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_64_bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/DB_IaT/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_64_bit-RelWithDebInfo</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск с отладочной информацией</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/DB_IaT/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_64_bit-MinSizeRel</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск минимального размера</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.4">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/BUILDS/DB_IaT/Debug64</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">5</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
|
||||
<value type="QString">-e</value>
|
||||
<value type="QString">cpu-cycles</value>
|
||||
<value type="QString">--call-graph</value>
|
||||
<value type="QString">dwarf,4096</value>
|
||||
<value type="QString">-F</value>
|
||||
<value type="QString">250</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||
<value type="QString" key="RunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
|
||||
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
319
LibInstructorsAndTrainees/CMakeLists.txt.user.88628a1
Normal file
@@ -0,0 +1,319 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 6.0.2, 2024-05-27T09:37:39. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{88628a15-8b1c-4544-92e6-5683c5f27136}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
|
||||
<value type="bool" key="AutoTest.Framework.Boost">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.CTest">false</value>
|
||||
<value type="bool" key="AutoTest.Framework.Catch">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.GTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
|
||||
<value type="int" key="AutoTest.RunAfterBuild">0</value>
|
||||
<value type="bool" key="AutoTest.UseGlobal">true</value>
|
||||
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
|
||||
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
|
||||
<value type="QString" key="ClangCodeModel.WarningConfigId">Builtin.BuildSystem</value>
|
||||
<valuemap type="QVariantMap" key="ClangTools">
|
||||
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
|
||||
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
|
||||
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
|
||||
<value type="int" key="ClangTools.ParallelJobs">8</value>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{ec5f7042-f1c7-4b2e-9c22-2340fe1a69bd}</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="QString" key="CMake.Build.Type">Debug</value>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-GUnix Makefiles
|
||||
-DCMAKE_BUILD_TYPE:STRING=Debug
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
|
||||
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/andrey/VEYON/SUO/Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Отладка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="CMake.Build.Type">Release</value>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-GUnix Makefiles
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
|
||||
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/andrey/VEYON/SUO/build-InstructorsAndTrainees-Desktop-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<value type="QString" key="CMake.Build.Type">RelWithDebInfo</value>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-GUnix Makefiles
|
||||
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
|
||||
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/andrey/VEYON/SUO/build-InstructorsAndTrainees-Desktop-RelWithDebInfo</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
|
||||
<value type="QString" key="CMake.Build.Type">MinSizeRel</value>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-GUnix Makefiles
|
||||
-DCMAKE_BUILD_TYPE:STRING=MinSizeRel
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
|
||||
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/andrey/VEYON/SUO/build-InstructorsAndTrainees-Desktop-MinSizeRel</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Развёртывание</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
60
LibInstructorsAndTrainees/InstructorsAndTrainees.qrc
Normal file
@@ -0,0 +1,60 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>resources/icons/addInstructor.png</file>
|
||||
<file>resources/icons/addTrainee.png</file>
|
||||
<file>resources/icons/admin.png</file>
|
||||
<file>resources/icons/archive.png</file>
|
||||
<file>resources/icons/branch-closed.png</file>
|
||||
<file>resources/icons/branch-end.png</file>
|
||||
<file>resources/icons/branch-more.png</file>
|
||||
<file>resources/icons/branch-open.png</file>
|
||||
<file>resources/icons/chekNo.png</file>
|
||||
<file>resources/icons/chekYes.png</file>
|
||||
<file>resources/icons/circleGray.png</file>
|
||||
<file>resources/icons/circleGreen.png</file>
|
||||
<file>resources/icons/connectDB.png</file>
|
||||
<file>resources/icons/DB-instructors.png</file>
|
||||
<file>resources/icons/DB-trainees.png</file>
|
||||
<file>resources/icons/deleteGroup.png</file>
|
||||
<file>resources/icons/deleteInstructor.png</file>
|
||||
<file>resources/icons/deleteTrainee.png</file>
|
||||
<file>resources/icons/docTasks.png</file>
|
||||
<file>resources/icons/edit.png</file>
|
||||
<file>resources/icons/group.png</file>
|
||||
<file>resources/icons/instructor.png</file>
|
||||
<file>resources/icons/instructorAdmin.png</file>
|
||||
<file>resources/icons/instructorArchive.png</file>
|
||||
<file>resources/icons/instructorFromArchive.png</file>
|
||||
<file>resources/icons/login-user.png</file>
|
||||
<file>resources/icons/newGroup.png</file>
|
||||
<file>resources/icons/rectGray.png</file>
|
||||
<file>resources/icons/rectGreen.png</file>
|
||||
<file>resources/icons/sendMsg.png</file>
|
||||
<file>resources/icons/trainee.png</file>
|
||||
<file>resources/icons/traineeArchive.png</file>
|
||||
<file>resources/icons/traineeFromArchive.png</file>
|
||||
<file>resources/icons/vline.png</file>
|
||||
<file>resources/icons/sign.png</file>
|
||||
<file>resources/icons/procedure.png</file>
|
||||
<file>resources/icons/malfunction.png</file>
|
||||
<file>resources/icons/762.gif</file>
|
||||
<file>resources/icons/assignTask.png</file>
|
||||
<file>resources/icons/delete.png</file>
|
||||
<file>resources/icons/filter.png</file>
|
||||
<file>resources/icons/check.png</file>
|
||||
<file>resources/icons/circleRed.png</file>
|
||||
<file>resources/icons/circleYellow.png</file>
|
||||
<file>resources/icons/settings.png</file>
|
||||
<file>resources/icons/style.png</file>
|
||||
<file>resources/icons/updateVersion.png</file>
|
||||
<file>resources/icons/editorDB.png</file>
|
||||
<file>resources/icons/lms.png</file>
|
||||
<file>resources/icons/critical.png</file>
|
||||
<file>resources/icons/warning.png</file>
|
||||
<file>resources/icons/info.png</file>
|
||||
<file>resources/icons/personalCard.png</file>
|
||||
<file>resources/icons/eye.png</file>
|
||||
<file>resources/icons/exchange.png</file>
|
||||
<file>resources/icons/link.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1,65 @@
|
||||
#include <QRegExpValidator>
|
||||
#include <QToolTip>
|
||||
#include "dialogauthorization.h"
|
||||
#include "ui_dialogauthorization.h"
|
||||
|
||||
DialogAuthorization::DialogAuthorization(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogAuthorization)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->editLogin->setProperty("mandatoryField", true);
|
||||
ui->editPassword->setProperty("mandatoryField", true);
|
||||
|
||||
ui->btnViewPassword->setObjectName("btnViewPassword");
|
||||
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
|
||||
|
||||
ui->editLogin->setValidator(new QRegExpValidator(QRegExp("[A-Za-z\\d]+"), this));
|
||||
}
|
||||
|
||||
DialogAuthorization::~DialogAuthorization()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
QString DialogAuthorization::getLogin()
|
||||
{
|
||||
return ui->editLogin->text();
|
||||
}
|
||||
|
||||
void DialogAuthorization::setLogin(QString login)
|
||||
{
|
||||
ui->editLogin->setText(login);
|
||||
}
|
||||
|
||||
QString DialogAuthorization::getPassword()
|
||||
{
|
||||
return ui->editPassword->text();
|
||||
}
|
||||
|
||||
void DialogAuthorization::setPassword(QString password)
|
||||
{
|
||||
ui->editPassword->setText(password);
|
||||
}
|
||||
|
||||
void DialogAuthorization::on_btnLogIn_clicked()
|
||||
{
|
||||
this->accept();
|
||||
}
|
||||
|
||||
void DialogAuthorization::on_btnViewPassword_pressed()
|
||||
{
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Normal);
|
||||
}
|
||||
|
||||
void DialogAuthorization::on_btnViewPassword_released()
|
||||
{
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
|
||||
}
|
||||
|
||||
void DialogAuthorization::on_editLogin_inputRejected()
|
||||
{
|
||||
QToolTip::showText(QCursor::pos(),tr("Only Latin letters and numbers"));
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef DIALOGAUTHORIZATION_H
|
||||
#define DIALOGAUTHORIZATION_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
//#include "ui_dialogauthorization.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogAuthorization;
|
||||
}
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT DialogAuthorization : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogAuthorization(QWidget *parent = nullptr);
|
||||
~DialogAuthorization();
|
||||
|
||||
public:
|
||||
QString getLogin();
|
||||
void setLogin(QString login);
|
||||
|
||||
QString getPassword();
|
||||
void setPassword(QString password);
|
||||
|
||||
private slots:
|
||||
void on_btnLogIn_clicked();
|
||||
void on_btnViewPassword_pressed();
|
||||
void on_btnViewPassword_released();
|
||||
|
||||
void on_editLogin_inputRejected();
|
||||
|
||||
private:
|
||||
Ui::DialogAuthorization *ui;
|
||||
};
|
||||
|
||||
#endif // DIALOGAUTHORIZATION_H
|
||||
142
LibInstructorsAndTrainees/authorization/dialogauthorization.ui
Normal file
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DialogAuthorization</class>
|
||||
<widget class="QDialog" name="DialogAuthorization">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>140</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Instructor authorization</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/lms.png</normaloff>:/resources/icons/lms.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Main">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_LP">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Labels">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Login">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Login</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Password">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Edites">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editLogin">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_Password">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editPassword">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnViewPassword">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/eye.png</normaloff>:/resources/icons/eye.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_Btn">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnLogIn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Log in</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../InstructorsAndTrainees.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
166
LibInstructorsAndTrainees/commonview.cpp
Normal file
@@ -0,0 +1,166 @@
|
||||
#include "commonview.h"
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
#include <QScrollBar>
|
||||
#include <QResizeEvent>
|
||||
|
||||
|
||||
CommonView::CommonView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
|
||||
QWidget(parent),
|
||||
connectorToServer(connectorToServer),
|
||||
treeWidget(nullptr),
|
||||
TypeUserDB(User::TypeUserDBInstructor),
|
||||
typeView(type),
|
||||
archiveVisible(false),
|
||||
notLoggedInVisible(true),
|
||||
adminMode(false),
|
||||
authComplited(false),
|
||||
lastCurrentID(0),
|
||||
typeObject(TypeObject::objInstructor),
|
||||
waitAnimationWidget(nullptr)
|
||||
{
|
||||
treeWidget = new QTreeWidget();
|
||||
treeWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||
|
||||
treeWidget->setEnabled(false);
|
||||
|
||||
treeWidget->setSortingEnabled(false);
|
||||
|
||||
waitAnimationWidget = new WaitAnimationWidget;
|
||||
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||
waitAnimationWidget->initialize(movie,this);
|
||||
}
|
||||
|
||||
CommonView::~CommonView()
|
||||
{
|
||||
waitAnimationWidget->hideWithStop();
|
||||
delete waitAnimationWidget;
|
||||
}
|
||||
|
||||
void CommonView::setItemColorArchive(QTreeWidgetItem *item)
|
||||
{
|
||||
setItemColor(item,QColor(240, 240, 240));
|
||||
}
|
||||
|
||||
void CommonView::setItemColorNoArchive(QTreeWidgetItem *item)
|
||||
{
|
||||
setItemColor(item,QColor(255, 255, 255));
|
||||
}
|
||||
|
||||
void CommonView::setItemColor(QTreeWidgetItem *item, QColor color)
|
||||
{
|
||||
for (int i = 0; i < item->columnCount(); i++)
|
||||
item->setBackground(i, color);
|
||||
}
|
||||
|
||||
int CommonView::calculateWidth_0Column()
|
||||
{
|
||||
int widthHeader = treeWidget->width() - 20;
|
||||
int width0Column = 0;
|
||||
int widthSB = 0;
|
||||
if(treeWidget->verticalScrollBar()->isVisible())
|
||||
widthSB = treeWidget->verticalScrollBar()->size().width();
|
||||
int cntColumns = treeWidget->columnCount();
|
||||
int widthRightColumns = 0;
|
||||
for (int i = 1; i < cntColumns; i++)
|
||||
{
|
||||
if(! treeWidget->isColumnHidden(i))
|
||||
{//Колонка не скрыта
|
||||
int w = listWidthColumn.at(i);
|
||||
widthRightColumns += w;
|
||||
}
|
||||
}
|
||||
width0Column = widthHeader - widthRightColumns - widthSB;
|
||||
|
||||
return width0Column;
|
||||
}
|
||||
|
||||
void CommonView::setWidthColumnsTree()
|
||||
{
|
||||
listWidthColumn.clear();
|
||||
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_Name, 100);
|
||||
listWidthColumn.append(100);
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_Login, 100);
|
||||
listWidthColumn.append(100);
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_Password, 100);
|
||||
listWidthColumn.append(100);
|
||||
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_Class, 100);
|
||||
listWidthColumn.append(100);
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_Computer, 100);
|
||||
listWidthColumn.append(100);
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_IP_address, 100);
|
||||
listWidthColumn.append(100);
|
||||
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_Administrator, 140);
|
||||
listWidthColumn.append(140);
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_Archived, 100);
|
||||
listWidthColumn.append(100);
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_Logged, 80);
|
||||
listWidthColumn.append(80);
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_ID, 40);
|
||||
listWidthColumn.append(40);
|
||||
|
||||
treeWidget->setColumnWidth(ColumnsTreeUsers::clmn_Name, calculateWidth_0Column());
|
||||
}
|
||||
|
||||
void CommonView::reSetHeadTreeWidget()
|
||||
{
|
||||
QStringList listHeaders = {tr("Name"), tr("Login"), tr("Password"), tr("Class"), tr("Computer"), tr("IP address"), tr("Administrator"), tr("Archived"), tr("Online"), tr("ID")};
|
||||
treeWidget->setHeaderLabels(listHeaders);
|
||||
}
|
||||
|
||||
void CommonView::preparationTreeWidget()
|
||||
{
|
||||
mtxTreeWidget.lock();
|
||||
|
||||
treeWidget->setColumnCount(clmn_count);
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
|
||||
if(typeView == TypeView::onlyView)
|
||||
{//onlyView
|
||||
archiveVisible = false;
|
||||
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_ID, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_Archived, true);
|
||||
}
|
||||
else
|
||||
{//control
|
||||
archiveVisible = true;
|
||||
|
||||
if(adminMode)
|
||||
{
|
||||
#ifdef PROJECT_TYPE_DEBUG
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_ID, false);
|
||||
#else
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_ID, true);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_ID, true);
|
||||
}
|
||||
}
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_Administrator, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_Password, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_Class, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_Computer, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_IP_address, true);
|
||||
if(TypeUserDB == User::TypeUserDBTrainee)
|
||||
treeWidget->setColumnHidden(ColumnsTreeUsers::clmn_Administrator, true);
|
||||
|
||||
//treeWidget->setSortingEnabled(true);
|
||||
treeWidget->sortItems(ColumnsTreeUsers::clmn_Name, Qt::SortOrder::AscendingOrder);
|
||||
|
||||
mtxTreeWidget.unlock();
|
||||
}
|
||||
|
||||
void CommonView::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
setWidthColumnsTree();
|
||||
|
||||
QSize size = event->size();
|
||||
waitAnimationWidget->resize(size);
|
||||
}
|
||||
119
LibInstructorsAndTrainees/commonview.h
Normal file
@@ -0,0 +1,119 @@
|
||||
#ifndef COMMONVIEW_H
|
||||
#define COMMONVIEW_H
|
||||
|
||||
#include <QTreeWidget>
|
||||
#include <QTranslator>
|
||||
#include <QMutex>
|
||||
#include <QMap>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "connectortoserver.h"
|
||||
#include "waitanimationwidget.h"
|
||||
|
||||
//Родительский класс представления БД Инструкторов/Обучаемых (самого верхнего уровня)
|
||||
|
||||
class CommonView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum TypeView
|
||||
{
|
||||
onlyView,
|
||||
control
|
||||
};
|
||||
|
||||
enum TypeObject
|
||||
{
|
||||
objInstructor,
|
||||
objTrainee,
|
||||
objGroup
|
||||
};
|
||||
|
||||
protected:
|
||||
enum ColumnsTreeUsers{
|
||||
clmn_Name = 0,
|
||||
clmn_Login,
|
||||
clmn_Password,
|
||||
clmn_Class,
|
||||
clmn_Computer,
|
||||
clmn_IP_address,
|
||||
clmn_Administrator,
|
||||
clmn_Archived,
|
||||
clmn_Logged,
|
||||
clmn_ID,
|
||||
clmn_count
|
||||
};
|
||||
|
||||
public:
|
||||
CommonView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent = nullptr);
|
||||
~CommonView();
|
||||
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
public:
|
||||
void setAdminMode(bool adminMode)
|
||||
{
|
||||
this->adminMode = adminMode;
|
||||
}
|
||||
void activate()
|
||||
{
|
||||
treeWidget->setEnabled(true);
|
||||
}
|
||||
void deactivate()
|
||||
{
|
||||
treeWidget->clear();
|
||||
treeWidget->setEnabled(false);
|
||||
lastCurrentID = 0;
|
||||
mapNewMsg.clear();
|
||||
}
|
||||
void clearSelection()
|
||||
{
|
||||
treeWidget->clearSelection();
|
||||
lastCurrentID = 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
void setArchiveVisible(bool archiveVisible)
|
||||
{
|
||||
this->archiveVisible = archiveVisible;
|
||||
}
|
||||
void setNotLoggedInVisible(bool notLoggedInVisible)
|
||||
{
|
||||
this->notLoggedInVisible = notLoggedInVisible;
|
||||
}
|
||||
|
||||
void setItemColorArchive(QTreeWidgetItem* item);
|
||||
void setItemColorNoArchive(QTreeWidgetItem* item);
|
||||
|
||||
void setItemColor(QTreeWidgetItem* item, QColor color);
|
||||
|
||||
void preparationTreeWidget();
|
||||
|
||||
private:
|
||||
int calculateWidth_0Column();
|
||||
void setWidthColumnsTree();
|
||||
|
||||
protected:
|
||||
void reSetHeadTreeWidget();
|
||||
|
||||
protected:
|
||||
ConnectorToServer* connectorToServer;
|
||||
QTreeWidget* treeWidget;
|
||||
QList<int> listWidthColumn;
|
||||
QString TypeUserDB;
|
||||
QMutex mtxTreeWidget;
|
||||
TypeView typeView;
|
||||
bool archiveVisible;
|
||||
bool notLoggedInVisible;
|
||||
bool adminMode;
|
||||
bool authComplited;
|
||||
int lastCurrentID;
|
||||
TypeObject typeObject;
|
||||
|
||||
QMutex mtxmapNewMsg;
|
||||
QMap<int, bool> mapNewMsg;
|
||||
|
||||
WaitAnimationWidget *waitAnimationWidget;
|
||||
};
|
||||
|
||||
#endif // COMMONVIEW_H
|
||||
32
LibInstructorsAndTrainees/connectorToServer/Core/FileData.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
#ifndef FILEDATA_H
|
||||
#define FILEDATA_H
|
||||
|
||||
struct FileData
|
||||
{
|
||||
QString path;
|
||||
QString hash;
|
||||
|
||||
bool operator==(const FileData& other)const{
|
||||
if(this->path==(other.path) && this->hash == other.hash) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}; //путь
|
||||
|
||||
struct SAttribute
|
||||
{
|
||||
QString name;
|
||||
QString value;
|
||||
|
||||
};
|
||||
|
||||
struct SXmlAnswerTag{
|
||||
QString elementName;
|
||||
QList<SAttribute> attr;
|
||||
};
|
||||
|
||||
#endif // FILEDATA_H
|
||||
|
||||
582
LibInstructorsAndTrainees/connectorToServer/Core/dataparser.cpp
Normal file
@@ -0,0 +1,582 @@
|
||||
#include "Core/dataparser.h"
|
||||
|
||||
#include "FileData.h"
|
||||
#include "tools.h"
|
||||
|
||||
#include "instructor.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
#include "tasksAmmFim.h"
|
||||
#include "streamingversiondata.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
DataParser::DataParser(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
if(!QDir(staticDataFolderName).exists()){
|
||||
QDir().mkdir(staticDataFolderName);
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray DataParser::slotGetXmlAnswer(QString answerCode)
|
||||
{
|
||||
if(answerCode == "END"){
|
||||
return xmlAnswer_notify(answerCode);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DataParser::createFileDataList(QList<FileData> fileDataList,QString filename)
|
||||
{
|
||||
|
||||
QFile file(filename);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("FileDataList");
|
||||
|
||||
foreach (FileData data,fileDataList)
|
||||
{
|
||||
xmlWriter.writeStartElement("FileData");
|
||||
|
||||
xmlWriter.writeAttribute("Path",data.path);
|
||||
xmlWriter.writeAttribute("Hash",data.hash);
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
QByteArray DataParser::createAuthMessage(ClientAutorization *auth)
|
||||
{
|
||||
authPassCache = auth; //кэширование даных авторизации, для сохранения при успешном заходе
|
||||
|
||||
QByteArray array;
|
||||
QXmlStreamWriter xmlWriter(&array);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("ClientAutorization");
|
||||
|
||||
xmlWriter.writeAttribute("Login", auth->Login);
|
||||
xmlWriter.writeAttribute("Password", auth->Password);
|
||||
xmlWriter.writeAttribute("TypeClient", QString::number(auth->TypeClient));
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
QByteArray DataParser::createMessage(ClientMessage clientMessage)
|
||||
{
|
||||
QByteArray array;
|
||||
QXmlStreamWriter xmlWriter(&array);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("ClientMessage");
|
||||
|
||||
xmlWriter.writeAttribute("From",clientMessage.fromId);
|
||||
xmlWriter.writeAttribute("To", clientMessage.toId);
|
||||
xmlWriter.writeAttribute("Text", clientMessage.Text);
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QByteArray DataParser::createQueryToDBMessage(ClientQueryToDB *queryToDB, int id, void* data)
|
||||
{
|
||||
QByteArray array;
|
||||
QXmlStreamWriter xmlWriter(&array);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("QueryToDB");
|
||||
|
||||
xmlWriter.writeAttribute("TypeQuery", QString::number(queryToDB->typeQuery));
|
||||
|
||||
if(id)
|
||||
xmlWriter.writeAttribute("id", QString::number(id));
|
||||
|
||||
if(data)
|
||||
{
|
||||
if(queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR ||
|
||||
queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_NEW_INSTRUCTOR)
|
||||
{
|
||||
Instructor* instructor = (Instructor*)data;
|
||||
if(instructor)
|
||||
{
|
||||
xmlWriter.writeAttribute("instructor_id", QString::number(instructor->getID()));
|
||||
xmlWriter.writeAttribute("name", instructor->getName());
|
||||
xmlWriter.writeAttribute("login", instructor->getLogin());
|
||||
xmlWriter.writeAttribute("password", instructor->getPassword());
|
||||
xmlWriter.writeAttribute("is_admin", QString::number(instructor->getIsAdmin()));
|
||||
xmlWriter.writeAttribute("archived", QString::number(instructor->getArchived()));
|
||||
xmlWriter.writeAttribute("logged_in", QString::number(instructor->getLoggedIn()));
|
||||
}
|
||||
}
|
||||
else if(queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_EDIT_TRAINEE)
|
||||
{
|
||||
Trainee* trainee = (Trainee*)data;
|
||||
if(trainee)
|
||||
{
|
||||
xmlWriter.writeAttribute("trainee_id", QString::number(trainee->getID()));
|
||||
xmlWriter.writeAttribute("name", trainee->getName());
|
||||
xmlWriter.writeAttribute("login", trainee->getLogin());
|
||||
xmlWriter.writeAttribute("password", trainee->getPassword());
|
||||
xmlWriter.writeAttribute("archived", QString::number(trainee->getArchived()));
|
||||
xmlWriter.writeAttribute("logged_in", QString::number(trainee->getLoggedIn()));
|
||||
xmlWriter.writeAttribute("group_trainee", QString::number(trainee->getGroup().getID()));
|
||||
xmlWriter.writeAttribute("computer_trainee", QString::number(trainee->getComputer().getID()));
|
||||
}
|
||||
}
|
||||
else if(queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_NEW_TRAINEE)
|
||||
{
|
||||
Trainee* trainee = (Trainee*)data;
|
||||
if(trainee)
|
||||
{
|
||||
xmlWriter.writeAttribute("trainee_id", QString::number(trainee->getID()));
|
||||
xmlWriter.writeAttribute("name", trainee->getName());
|
||||
xmlWriter.writeAttribute("login", trainee->getLogin());
|
||||
xmlWriter.writeAttribute("password", trainee->getPassword());
|
||||
xmlWriter.writeAttribute("archived", QString::number(trainee->getArchived()));
|
||||
xmlWriter.writeAttribute("logged_in", QString::number(trainee->getLoggedIn()));
|
||||
xmlWriter.writeAttribute("group_trainee", QString::number(id));
|
||||
xmlWriter.writeAttribute("computer_trainee", QString::number(trainee->getComputer().getID()));
|
||||
}
|
||||
}
|
||||
else if(queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_EDIT_GROUP ||
|
||||
queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_NEW_GROUP)
|
||||
{
|
||||
Group* group = (Group*)data;
|
||||
if(group)
|
||||
{
|
||||
xmlWriter.writeAttribute("group_id", QString::number(group->getID()));
|
||||
xmlWriter.writeAttribute("name", group->getName());
|
||||
}
|
||||
}
|
||||
else if(queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_ASSIGN_TASK_AMM_TO_TRAINEE)
|
||||
{
|
||||
TaskAmmFim* task = (TaskAmmFim*)data;
|
||||
if(task)
|
||||
{
|
||||
xmlWriter.writeAttribute("title", task->ammProcedure.title);
|
||||
xmlWriter.writeAttribute("dmCode", task->ammProcedure.dmCode);
|
||||
|
||||
for(SubProc subProc : task->listSubProc)
|
||||
{
|
||||
xmlWriter.writeStartElement("SubProc");
|
||||
|
||||
xmlWriter.writeAttribute("dmCode", subProc.getDmCode());
|
||||
xmlWriter.writeAttribute("title", subProc.getTitle());
|
||||
xmlWriter.writeAttribute("canplay", subProc.getModeListStr());
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE)
|
||||
{
|
||||
TaskAmmFim* task = (TaskAmmFim*)data;
|
||||
if(task)
|
||||
{
|
||||
xmlWriter.writeAttribute("title", task->title);
|
||||
|
||||
for(Malfunction malfunction : task->malfunctionList)
|
||||
{
|
||||
xmlWriter.writeStartElement("malfunction");
|
||||
xmlWriter.writeAttribute("dmCode", malfunction.dmCode);
|
||||
xmlWriter.writeAttribute("num", malfunction.num);
|
||||
xmlWriter.writeAttribute("description", malfunction.description);
|
||||
|
||||
for(MalfunctionSign sign : malfunction.malfunctionSigns)
|
||||
{
|
||||
xmlWriter.writeStartElement("malfunctionSign");
|
||||
xmlWriter.writeAttribute("type", QString::number(sign.type));
|
||||
xmlWriter.writeAttribute("description", sign.description);
|
||||
xmlWriter.writeEndElement();
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE ||
|
||||
queryToDB->typeQuery == TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE)
|
||||
{
|
||||
QString* status = (QString*)data;
|
||||
if(status)
|
||||
{
|
||||
xmlWriter.writeAttribute("status", *status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
QFile file("QueryToDB.xml");
|
||||
file.open(QIODevice::WriteOnly);
|
||||
file.write(array);
|
||||
file.close();
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
QByteArray DataParser::createQueryTasksXMLMessage(QString type)
|
||||
{
|
||||
QByteArray array;
|
||||
QXmlStreamWriter xmlWriter(&array);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("QueryTasksXML");
|
||||
|
||||
xmlWriter.writeAttribute("Type", type);
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
QByteArray DataParser::createQueryListSubProcMessage(QString dmCode)
|
||||
{
|
||||
QByteArray array;
|
||||
QXmlStreamWriter xmlWriter(&array);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("QueryListSubProc");
|
||||
|
||||
xmlWriter.writeAttribute("dmCode", dmCode);
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
QByteArray DataParser::createDeAuthMessage(ClientDeAutorization *deAuth)
|
||||
{
|
||||
QByteArray array;
|
||||
QXmlStreamWriter xmlWriter(&array);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("ClientDeAutorization");
|
||||
|
||||
xmlWriter.writeAttribute("Login",deAuth->Login);
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
QByteArray DataParser::createQueryBlockAuth(bool block)
|
||||
{
|
||||
QByteArray array;
|
||||
QXmlStreamWriter xmlWriter(&array);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("BlockAuth");
|
||||
|
||||
xmlWriter.writeAttribute("Block", block ? "1" : "0");
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DataParser::createServerSettings(QString address, QString port)
|
||||
{
|
||||
QFile file(settingsName);
|
||||
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
|
||||
xmlWriter.writeStartElement("ServerSettingsContainer");
|
||||
xmlWriter.writeStartElement("ServerSettings");
|
||||
|
||||
xmlWriter.writeAttribute("Address",address);
|
||||
xmlWriter.writeAttribute("Port",port);
|
||||
xmlWriter.writeAttribute("Language","RUS");
|
||||
xmlWriter.writeAttribute("AutoStart",QString::number(false));
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close();
|
||||
|
||||
}
|
||||
|
||||
void DataParser::createAuthData(ServerAuthorization *serverAuth)
|
||||
{
|
||||
QFile file(authTempName);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("AuthData");
|
||||
xmlWriter.writeAttribute("Login",authPassCache->Login);
|
||||
xmlWriter.writeAttribute("Password",authPassCache->Password);
|
||||
xmlWriter.writeAttribute("InstructorName",serverAuth->InstructorName);
|
||||
xmlWriter.writeAttribute("ClientName",serverAuth->ClientName);
|
||||
xmlWriter.writeAttribute("AccessType",serverAuth->AccessType);
|
||||
xmlWriter.writeAttribute("id_client",serverAuth->Id);
|
||||
xmlWriter.writeEndElement();
|
||||
file.close();
|
||||
|
||||
}
|
||||
|
||||
void DataParser::createAuthDataOffline(QString username, QString pass)
|
||||
{
|
||||
QFile file(authTempName);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("AuthData");
|
||||
xmlWriter.writeAttribute("Login",username);
|
||||
xmlWriter.writeAttribute("Password",pass);
|
||||
xmlWriter.writeAttribute("InstructorName","empty");
|
||||
xmlWriter.writeAttribute("ClientName","Offline");
|
||||
xmlWriter.writeAttribute("AccessType","Offline");
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
file.close();
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_notify(QString code)
|
||||
{
|
||||
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Code", code};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
SXmlAnswerTag tag = {"ClientNotify", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
void DataParser::addRunData(QList<int> displays)
|
||||
{
|
||||
QFile file(displayTemp);
|
||||
file.open(QIODevice::ReadWrite);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartElement("DisplayInfo");
|
||||
xmlWriter.writeAttribute("DisplayCount",QString::number(displays.length()));
|
||||
xmlWriter.writeEndElement();
|
||||
file.close();
|
||||
|
||||
}
|
||||
|
||||
ServerSettings *DataParser::getServerSettings()
|
||||
{
|
||||
ServerSettings *settings = new ServerSettings;
|
||||
QFile file(settingsName);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
QXmlStreamReader xmlReader(&file);
|
||||
|
||||
while (!xmlReader.atEnd()){
|
||||
|
||||
if(xmlReader.isStartElement()){
|
||||
|
||||
if(xmlReader.name() == "ServerSettings")
|
||||
{
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes()){
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "Address"){
|
||||
settings->Address = value;
|
||||
}
|
||||
|
||||
if(name == "Port"){
|
||||
settings->Port = value;
|
||||
}
|
||||
|
||||
if(name == "Language"){
|
||||
settings->Language = value;
|
||||
}
|
||||
|
||||
if(name == "AutoStart"){
|
||||
settings->isAutoStart = value.toInt();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xmlReader.readNext();
|
||||
}
|
||||
|
||||
file.close();
|
||||
return settings;
|
||||
}
|
||||
|
||||
void DataParser::saveClientSettrings(QString language, bool isAutoStart)
|
||||
{
|
||||
QFile file(settingsName);
|
||||
file.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||
|
||||
QString settings = file.readAll();
|
||||
|
||||
file.close();
|
||||
file.remove();
|
||||
|
||||
file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
|
||||
auto languagePos = settings.indexOf(XMLLanguageProperty) + XMLLanguageProperty.length();
|
||||
settings = settings.replace(languagePos,language.size(),language);
|
||||
|
||||
auto autoStartPos = settings.indexOf(XMLAutoStartProperty) + XMLAutoStartProperty.length();
|
||||
settings = settings.replace(autoStartPos,1,QString::number(isAutoStart));
|
||||
|
||||
file.write(settings.toUtf8());
|
||||
file.close();
|
||||
}
|
||||
|
||||
QList<FileData>* DataParser::xmlFileDataParse(QByteArray array, QString filter = "")
|
||||
{
|
||||
QXmlStreamReader xmlReader(array);
|
||||
QList<FileData> *datas = new QList<FileData>;
|
||||
xmlReader.readNext(); // Переходим к первому элементу в файле
|
||||
|
||||
//Крутимся в цикле до тех пор, пока не достигнем конца документа
|
||||
while(!xmlReader.atEnd())
|
||||
{
|
||||
//Проверяем, является ли элемент началом тега
|
||||
if(xmlReader.isStartElement())
|
||||
{
|
||||
if(xmlReader.name() == "FileData")
|
||||
{
|
||||
FileData data;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr,xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "Path")
|
||||
data.path = value;
|
||||
else if(name == "Hash")
|
||||
data.hash = value;
|
||||
}
|
||||
|
||||
if(data.path.contains(filter))
|
||||
|
||||
datas->append(data);
|
||||
}
|
||||
}
|
||||
|
||||
xmlReader.readNext();
|
||||
}
|
||||
|
||||
return datas;
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer(QList<SXmlAnswerTag> listTag, QString elemUp1, QString elemUp2)
|
||||
{
|
||||
/* Открываем файл для Записи*/
|
||||
QFile file(tempName);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
||||
/* Создаем объект, с помощью которого осуществляется запись в файл */
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
xmlWriter.setAutoFormatting(true); // Устанавливаем автоформатирование текста
|
||||
|
||||
xmlWriter.writeStartDocument(); // Запускаем запись в документ
|
||||
|
||||
if(elemUp1 != "")
|
||||
xmlWriter.writeStartElement(elemUp1); // Записываем тег
|
||||
|
||||
if(elemUp2 != "")
|
||||
xmlWriter.writeStartElement(elemUp2); // Записываем тег
|
||||
|
||||
//Записываем все элементы
|
||||
foreach(SXmlAnswerTag tag, listTag)
|
||||
{
|
||||
xmlWriter.writeStartElement(tag.elementName); // Записываем тег
|
||||
|
||||
// Записываем атрибуты
|
||||
foreach(SAttribute attr, tag.attr)
|
||||
xmlWriter.writeAttribute(attr.name, attr.value);
|
||||
|
||||
xmlWriter.writeEndElement(); // Закрываем тег
|
||||
}
|
||||
|
||||
if(elemUp1 != "")
|
||||
xmlWriter.writeEndElement(); // Закрываем тег
|
||||
|
||||
if(elemUp1 != "")
|
||||
xmlWriter.writeEndElement(); // Закрываем тег
|
||||
|
||||
/* Завершаем запись в документ*/
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close(); // Закрываем файл
|
||||
|
||||
QByteArray array;
|
||||
|
||||
/* Открываем файл для Чтения*/
|
||||
QFile fileR(tempName);
|
||||
if (!fileR.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
QString str = "Не удалось открыть файл";
|
||||
qDebug() << "xmlAnswer: " << str;
|
||||
}
|
||||
else
|
||||
{
|
||||
array = fileR.readAll();
|
||||
fileR.close(); // Закрываем файл
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
DataParser::~DataParser()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#ifndef DATAPARSER_H
|
||||
#define DATAPARSER_H
|
||||
|
||||
#include "FileData.h"
|
||||
#include "instructor.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <Datas.h>
|
||||
#include <QFile>
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
class DataParser : public QObject
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DataParser(QObject *parent = 0);
|
||||
~DataParser();
|
||||
ServerSettings* getServerSettings();
|
||||
void createServerSettings(QString server,QString port);
|
||||
void saveClientSettrings(QString language,bool isAutoStart);
|
||||
void createFileDataList(QList<FileData> fileDataList,QString filename);
|
||||
|
||||
QByteArray createAuthMessage(ClientAutorization *auth);
|
||||
QByteArray createMessage(ClientMessage toClientMessage);
|
||||
QByteArray createQueryToDBMessage(ClientQueryToDB *queryToDB, int id = 0, void* data = nullptr);
|
||||
QByteArray createQueryTasksXMLMessage(QString type);
|
||||
QByteArray createQueryListSubProcMessage(QString dmCode);
|
||||
QByteArray createDeAuthMessage(ClientDeAutorization *deAuth);
|
||||
|
||||
QByteArray createQueryBlockAuth(bool block);
|
||||
|
||||
void createAuthData(ServerAuthorization *serverAuth);
|
||||
void createAuthDataOffline(QString username,QString pass);
|
||||
void addRunData(QList<int> displays);
|
||||
QByteArray xmlAnswer_notify(QString code);
|
||||
QByteArray xmlAnswer(QList<SXmlAnswerTag> listTag, QString elemUp1 = "", QString elemUp2 = "");
|
||||
|
||||
QList<FileData>* xmlFileDataParse(QByteArray array,QString filter);
|
||||
public slots:
|
||||
QByteArray slotGetXmlAnswer(QString);
|
||||
|
||||
|
||||
private:
|
||||
const QString XMLLanguageProperty = "Language=\"";
|
||||
const QString XMLAutoStartProperty = "AutoStart=\"";
|
||||
ClientAutorization *authPassCache;
|
||||
|
||||
};
|
||||
|
||||
#endif // DATAPARSER_H
|
||||
@@ -0,0 +1,974 @@
|
||||
#include "Core/recognizesystem.h"
|
||||
#include <QThread>
|
||||
#include <QDir>
|
||||
#include <QDomDocument>
|
||||
#include <QMessageBox>
|
||||
#include "instructor.h"
|
||||
#include "tasksAmmFim.h"
|
||||
#include "module.h"
|
||||
#include "timingoftrainee.h"
|
||||
#include "specialmessagebox.h"
|
||||
|
||||
|
||||
RecognizeSystem::RecognizeSystem(QObject *parent):
|
||||
QObject(parent)
|
||||
{
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
filePath.clear();
|
||||
fileSize = 0;
|
||||
message.clear();
|
||||
sizeReceiveData = 0;
|
||||
tmpBlock.clear();
|
||||
countSend = 0;
|
||||
folderList = new QList<QString>;
|
||||
}
|
||||
|
||||
RecognizeSystem::~RecognizeSystem()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RecognizeSystem::initialize(DataParser *dataParser/*,MainWindow *mainWindow*/)
|
||||
{
|
||||
this->dataParser = dataParser;
|
||||
//this->mainWindow = mainWindow;
|
||||
connect(this,&RecognizeSystem::sigAuth,dataParser,&DataParser::createAuthData);
|
||||
}
|
||||
|
||||
void RecognizeSystem::recognize(QTcpSocket *socket)
|
||||
{
|
||||
qDebug() << "RecognizeThreadId " << QThread::currentThreadId();
|
||||
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
while(socket->bytesAvailable())
|
||||
{
|
||||
|
||||
if (socket->state() != QTcpSocket::ConnectedState) return;
|
||||
|
||||
if(packetType == PacketType::TYPE_NONE){ //определение первичного пакета
|
||||
|
||||
stream.startTransaction();
|
||||
stream >> packetType;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
emit sigSendDebugLog(Tools::getTime() + " CLIENT: packetType - FAIL commitTransaction");
|
||||
|
||||
if(socket->waitForReadyRead(TCP_READ_TIMEOUT)){
|
||||
emit sigSendDebugLog("ERROR: PACKET TYPE READ TIMEOUT");
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
//qDebug() << Tools::GetTime() << "CLIENT: type: " << packetType;
|
||||
}
|
||||
|
||||
if(packetType == PacketType::TYPE_FOLDER){ //создание папок
|
||||
stream.startTransaction();
|
||||
stream >> filePath;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
continue;
|
||||
}
|
||||
|
||||
filePath = Tools::createFullPath(filePath);
|
||||
|
||||
QDir dir(filePath);
|
||||
if(!dir.exists()){
|
||||
if(dir.mkpath(filePath)){
|
||||
qDebug() << "Dir Created";
|
||||
}
|
||||
}
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
emit sigUpdateBytesAvailable();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(packetType == PacketType::TYPE_FILE) //загрузка файлов
|
||||
{
|
||||
//ПОЛУЧЕНИЕ ПУТИ
|
||||
//ПОЛУЧЕНИЕ РАЗМЕРА ФАЙЛА
|
||||
forever
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> filePath;
|
||||
stream >> fileSize;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
emit sigSendDebugLog(Tools::getTime() + "CLIENT: filePath, fileSize - FAIL commitTransaction");
|
||||
|
||||
if (!socket->waitForReadyRead(TCP_READ_TIMEOUT)) {
|
||||
emit sigSendDebugLog(Tools::getTime() + "CLIENT: ERROR! readyRead timeout - filePath, fileSize!!!");
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
filePath = Tools::createFullPath(filePath);
|
||||
|
||||
emit sigSendDebugLog("CLIENT: filesize: " + QString::number(fileSize));
|
||||
emit sigSendDebugLog("CLIENT: filePath: " + filePath);
|
||||
|
||||
socket->waitForReadyRead(100);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//ПОЛУЧЕНИЕ САМОГО ФАЙЛА
|
||||
emit sigSendDebugLog(Tools::getTime() + "AfterRead size and path BytesAvailable: " + socket->bytesAvailable());
|
||||
|
||||
//УКАЗАНИЕ ПУТИ ФАЙЛА
|
||||
QFile file(filePath);
|
||||
|
||||
if (file.exists())
|
||||
{
|
||||
file.remove(); //удаление файла, если он уже есть, но необходимо обновить
|
||||
emit sigSendDebugLog(Tools::getTime() + "Delete exist file: " + filePath);
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
|
||||
|
||||
file.open(QFile::Append);
|
||||
|
||||
forever
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> tmpBlock;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
|
||||
if(socket->state() == QAbstractSocket::UnconnectedState){
|
||||
emit sigSocketDisabled();
|
||||
return;
|
||||
}
|
||||
if(socket->waitForReadyRead(TCP_READ_TIMEOUT)){
|
||||
continue;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
quint64 toFile = file.write(tmpBlock);
|
||||
emit sigSendDebugLog(Tools::getTime() + "CLIENT: toFile :" + toFile);
|
||||
|
||||
sizeReceiveData += toFile;
|
||||
countSend++;
|
||||
|
||||
tmpBlock.clear();
|
||||
|
||||
if(sizeReceiveData == fileSize){
|
||||
emit sigSendDebugLog(Tools::getTime() + "FINAL Count send: " + QString::number(countSend));
|
||||
emit sigSendDebugLog(Tools::getTime() + "FINAL Size received: " + QString::number(sizeReceiveData));
|
||||
emit sigSendDebugLog(Tools::getTime() + "FINAL File size" + QString::number(fileSize));
|
||||
emit sigUpdateBytesAvailable();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
emit sigSendDebugLog(Tools::getTime() + "File loaded");
|
||||
|
||||
//ОЧИСТКА ПОСЛЕ ПЕРЕДАЧИ
|
||||
|
||||
filePath.clear();
|
||||
fileSize = 0;
|
||||
tmpBlock.clear();
|
||||
sizeReceiveData = 0;
|
||||
countSend = 0;
|
||||
}
|
||||
|
||||
if(packetType == PacketType::TYPE_DELETE) //удаление лишних файлов (рекурсивно удаляет все содежимое)
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> filePath;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
continue;
|
||||
}
|
||||
|
||||
filePath = Tools::createFullPath(filePath);
|
||||
|
||||
QFileInfo fileInfo(filePath);
|
||||
|
||||
|
||||
if(fileInfo.exists())
|
||||
{
|
||||
if(fileInfo.isFile())
|
||||
{
|
||||
QFile file(filePath);
|
||||
file.remove();
|
||||
}
|
||||
|
||||
if(fileInfo.isDir()){
|
||||
QDir dir(filePath);
|
||||
dir.removeRecursively();
|
||||
}
|
||||
|
||||
qDebug() << Tools::getTime() << "Deleted: " << filePath;
|
||||
}
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
if(packetType ==PacketType::TYPE_FINISH){ //для повторного создания хэша после загрузки
|
||||
//updateController->calculateCommonHash();
|
||||
emit sigLoadComplete();
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
|
||||
if(packetType == PacketType::TYPE_NEEDUPDATE){ //нужно обновление
|
||||
|
||||
bool flag = false;
|
||||
quint64 size = 0;
|
||||
quint64 fileCount = 0;
|
||||
|
||||
stream.startTransaction();
|
||||
stream >> flag;
|
||||
stream >> size;
|
||||
stream >> fileCount;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
continue;
|
||||
}
|
||||
|
||||
emit sigNeedUpdate(flag,size,fileCount);
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
|
||||
if(packetType == PacketType::TYPE_XMLANSWER){ //ответы формата XML
|
||||
QByteArray array;
|
||||
stream.startTransaction();
|
||||
stream >> array;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
continue;
|
||||
}
|
||||
|
||||
xmlParser(array);
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
|
||||
|
||||
if(packetType == PacketType::BUSY)
|
||||
{
|
||||
emit sigAnimationActivated(true);
|
||||
}
|
||||
|
||||
if(packetType == PacketType::FREE)
|
||||
{
|
||||
emit sigAnimationActivated(false);
|
||||
}
|
||||
|
||||
if(packetType == PacketType::HASH_READY)
|
||||
{
|
||||
emit sigHashReady();
|
||||
}
|
||||
|
||||
if(packetType == PacketType::TYPE_XMLANSWER_DOCS_CHANGED)
|
||||
{
|
||||
emit signal_AnswerDocsChanged();
|
||||
}
|
||||
|
||||
//if(packetType == PacketType::TYPE_XMLANSWER_QUERY_LIST_SUB_PROC_AMM)
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
//А)xml-ответы на запросы к БД
|
||||
//B)перечни Подпроцедур
|
||||
switch(packetType)
|
||||
{
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_INSTRUCTORS:
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_GROUPS:
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES:
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_COMPUTERS:
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS:
|
||||
case TYPE_XMLANSWER_QUERY_TASKS_AMM_FOR_TRAINEE:
|
||||
case TYPE_XMLANSWER_QUERY_TASKS_FIM_FOR_TRAINEE:
|
||||
case TYPE_XMLANSWER_QUERY_LIST_SUB_PROC_AMM:
|
||||
{
|
||||
//ПОЛУЧЕНИЕ РАЗМЕРА ФАЙЛА
|
||||
forever
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> fileSize;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
emit sigSendDebugLog(Tools::getTime() + "CLIENT: fileSize - FAIL commitTransaction");
|
||||
|
||||
if (!socket->waitForReadyRead(TCP_READ_TIMEOUT)) {
|
||||
emit sigSendDebugLog(Tools::getTime() + "CLIENT: ERROR! readyRead timeout - fileSize!!!");
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
emit sigSendDebugLog("CLIENT: filesize: " + QString::number(fileSize));
|
||||
|
||||
socket->waitForReadyRead(100);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//ПОЛУЧЕНИЕ САМОГО ФАЙЛА
|
||||
emit sigSendDebugLog(Tools::getTime() + "AfterRead size and path BytesAvailable: " + socket->bytesAvailable());
|
||||
|
||||
QByteArray array;
|
||||
|
||||
forever
|
||||
{
|
||||
stream.startTransaction();
|
||||
stream >> tmpBlock;
|
||||
|
||||
if(!stream.commitTransaction()){
|
||||
|
||||
if(socket->state() == QAbstractSocket::UnconnectedState){
|
||||
emit sigSocketDisabled();
|
||||
return;
|
||||
}
|
||||
if(socket->waitForReadyRead(TCP_READ_TIMEOUT)){
|
||||
continue;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
array.append(tmpBlock);
|
||||
|
||||
emit sigSendDebugLog(Tools::getTime() + "CLIENT: toFile :" + array.size());
|
||||
|
||||
sizeReceiveData += array.size();
|
||||
countSend++;
|
||||
|
||||
tmpBlock.clear();
|
||||
|
||||
if(sizeReceiveData == fileSize){
|
||||
emit sigSendDebugLog(Tools::getTime() + "FINAL Count send: " + QString::number(countSend));
|
||||
emit sigSendDebugLog(Tools::getTime() + "FINAL Size received: " + QString::number(sizeReceiveData));
|
||||
emit sigSendDebugLog(Tools::getTime() + "FINAL File size" + QString::number(fileSize));
|
||||
emit sigUpdateBytesAvailable();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
emit sigSendDebugLog(Tools::getTime() + "File loaded");
|
||||
|
||||
//ОЧИСТКА ПОСЛЕ ПЕРЕДАЧИ
|
||||
fileSize = 0;
|
||||
tmpBlock.clear();
|
||||
sizeReceiveData = 0;
|
||||
countSend = 0;
|
||||
|
||||
if(packetType != TYPE_XMLANSWER_QUERY_LIST_SUB_PROC_AMM)
|
||||
{//xml-ответы на запросы к БД
|
||||
xmlParserQueryToDB(packetType, array);
|
||||
}
|
||||
else
|
||||
{//перечни Подпроцедур
|
||||
xmlParserQuerySubProc(packetType, array);
|
||||
}
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
QByteArray array;
|
||||
stream.startTransaction();
|
||||
stream >> array;
|
||||
|
||||
if(!stream.commitTransaction())
|
||||
continue;
|
||||
|
||||
xmlParserQueryToDB(packetType, array);
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
*/
|
||||
}
|
||||
break;
|
||||
};
|
||||
|
||||
//xml-ответы на запросы AdditionalFiles (сигнал о чтении ранее принятого)
|
||||
if(packetType == PacketType::TYPE_XMLANSWER_QUERY_TASKS_XML_FIM ||
|
||||
packetType == PacketType::TYPE_XMLANSWER_QUERY_TASKS_XML_AMM)
|
||||
{
|
||||
QByteArray array;
|
||||
QString xmlFileName = "";
|
||||
|
||||
if(packetType == PacketType::TYPE_XMLANSWER_QUERY_TASKS_XML_FIM)
|
||||
xmlFileName = "./" + additionalFilesFolderName + "/tasksFIM.xml";
|
||||
else
|
||||
xmlFileName = "./" + additionalFilesFolderName + "/docs.xml"; //"/tasksAMM.xml";
|
||||
|
||||
QFile xmlInFile(xmlFileName);
|
||||
if (!xmlInFile.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
SpecMsgBox::CriticalClose(nullptr, tr("The file could not be opened ") + xmlFileName);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
array = xmlInFile.readAll();
|
||||
xmlInFile.close();
|
||||
}
|
||||
|
||||
xmlParserQueryTasksXML(packetType, array);
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void RecognizeSystem::xmlParser(QByteArray array)
|
||||
{
|
||||
QXmlStreamReader xmlReader(array);
|
||||
|
||||
xmlReader.readNext();
|
||||
QString name = xmlReader.name().toString();
|
||||
|
||||
while(!xmlReader.atEnd())
|
||||
{
|
||||
name = xmlReader.name().toString();
|
||||
|
||||
if(!xmlReader.isStartElement()) {
|
||||
xmlReader.readNext();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "ServerNotify")
|
||||
{
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "Code")
|
||||
{
|
||||
if (value == NOTIFY_SERVER_END)
|
||||
{
|
||||
emit sigSocketDisabled();
|
||||
}
|
||||
|
||||
if(value == NOTIFY_SERVER_BLOCKED)
|
||||
{
|
||||
emit sigServerBlocked();
|
||||
}
|
||||
|
||||
if(value == NOTIFY_ERROR_AUTH_DB)
|
||||
{
|
||||
emit sigErrorAuth(value);
|
||||
}
|
||||
if(value == NOTIFY_ERROR_AUTH_LOGINORPASSWORD)
|
||||
{
|
||||
emit sigErrorAuth(value);
|
||||
}
|
||||
if(value == NOTIFY_ERROR_AUTH_ARCHIVED)
|
||||
{
|
||||
emit sigErrorAuth(value);
|
||||
}
|
||||
if(value == NOTIFY_ERROR_AUTH_ALREADYLOGIN)
|
||||
{
|
||||
emit sigErrorAuth(value);
|
||||
}
|
||||
|
||||
if(value == "HASHSENDCOMPLETE")
|
||||
{
|
||||
emit sigStartCompare();
|
||||
}
|
||||
|
||||
if (value == "BASEDELETETRY")
|
||||
{
|
||||
emit sigNotifyVersionControl(tr("You cannot delete the basic version!"));
|
||||
}
|
||||
|
||||
if (value == "TRYACTIVEDELETE")
|
||||
{
|
||||
emit sigNotifyVersionControl(tr("You cannot delete the active version"));
|
||||
}
|
||||
|
||||
if (value == "DUPLICATEVERNAME")
|
||||
{
|
||||
emit sigNotifyVersionControl(tr("This name already exists"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "ServerAuthorization"){
|
||||
|
||||
ServerAuthorization *serverAuth = new ServerAuthorization;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if (name == "Result"){
|
||||
serverAuth->Result = value == "true" ? true : false;
|
||||
}
|
||||
|
||||
if (name == "InstructorName"){
|
||||
serverAuth->InstructorName = value;
|
||||
}
|
||||
|
||||
if (name == "ClientName"){
|
||||
serverAuth->ClientName = value;
|
||||
}
|
||||
|
||||
if (name == "AccessType"){
|
||||
serverAuth->AccessType = value;
|
||||
checkAccessType(value);
|
||||
}
|
||||
|
||||
if (name == "Login"){
|
||||
serverAuth->Login = value;
|
||||
}
|
||||
|
||||
if (name == "id_client")
|
||||
{
|
||||
serverAuth->Id = value;
|
||||
}
|
||||
}
|
||||
|
||||
emit sigAuth(serverAuth);
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "ClientMessage"){
|
||||
|
||||
ClientMessage *clientMessage = new ClientMessage;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if (name == "From"){
|
||||
clientMessage->fromId = value;
|
||||
}
|
||||
|
||||
if (name == "To"){
|
||||
clientMessage->toId = value;
|
||||
}
|
||||
|
||||
if (name == "Text"){
|
||||
clientMessage->Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
emit signal_ReceiveMessage(*clientMessage);
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "ServerDeAuthorization"){
|
||||
|
||||
ServerDeAuthorization *serverDeAuth = new ServerDeAuthorization;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if (name == "Result"){
|
||||
serverDeAuth->Result = value == "true" ? true : false;
|
||||
}
|
||||
|
||||
if (name == "Login"){
|
||||
serverDeAuth->Login = value;
|
||||
}
|
||||
}
|
||||
|
||||
emit sigDeAuth(serverDeAuth);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(xmlReader.name() == "VersionList")
|
||||
{
|
||||
QList<StreamingVersionData*> *serverStreamingVersionDataList = new QList<StreamingVersionData*>;
|
||||
xmlReader.readNext();
|
||||
|
||||
while (!xmlReader.atEnd())
|
||||
{
|
||||
if(xmlReader.isStartElement())
|
||||
{
|
||||
if(xmlReader.name() == "VersionData")
|
||||
{
|
||||
StreamingVersionData *data = new StreamingVersionData;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr,xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "Version")
|
||||
data->setName(value);
|
||||
else if(name == "Created")
|
||||
data->setCreateData(QDateTime::fromString(value));
|
||||
else if(name == "isChangeable")
|
||||
data->setIsChangeable(value.toInt());
|
||||
else if(name == "author")
|
||||
data->setAuthor(value);
|
||||
|
||||
}
|
||||
|
||||
serverStreamingVersionDataList->append(data);
|
||||
}
|
||||
}
|
||||
|
||||
xmlReader.readNext();
|
||||
}
|
||||
|
||||
emit sigShowServerDataList(serverStreamingVersionDataList);
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "VersionData")
|
||||
{
|
||||
StreamingVersionData *serverVersion = new StreamingVersionData;
|
||||
foreach(const QXmlStreamAttribute &attr,xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if (name == "Version")
|
||||
{
|
||||
serverVersion->setName(value);
|
||||
}
|
||||
|
||||
if (name == "Created")
|
||||
{
|
||||
serverVersion->setCreateData(QDateTime::fromString(value));
|
||||
}
|
||||
|
||||
if (name == "isChangeable")
|
||||
{
|
||||
serverVersion->setIsChangeable(value.toInt());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
emit sigSetVersion(serverVersion);
|
||||
}
|
||||
|
||||
xmlReader.readNext();
|
||||
}
|
||||
}
|
||||
|
||||
void RecognizeSystem::xmlParserQueryToDB(PacketType packetType, QByteArray array)
|
||||
{
|
||||
QDomDocument commonDOM;
|
||||
commonDOM.setContent(array);
|
||||
|
||||
switch(packetType)
|
||||
{
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_INSTRUCTORS:
|
||||
{
|
||||
QList<Instructor> listInstructors;
|
||||
QDomNode listNode = commonDOM.namedItem("ListInstructors");
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode instructorNode = listNode.childNodes().at(i);
|
||||
if(instructorNode.nodeName() == "Instructor")
|
||||
{//Инструктор
|
||||
Instructor instructor;
|
||||
instructor.setID(instructorNode.toElement().attribute("instructor_id").toInt());
|
||||
instructor.setName(instructorNode.toElement().attribute("name"));
|
||||
instructor.setLogin(instructorNode.toElement().attribute("login"));
|
||||
instructor.setPassword(instructorNode.toElement().attribute("password"));
|
||||
instructor.setIsAdmin(instructorNode.toElement().attribute("is_admin").toInt());
|
||||
instructor.setArchived(instructorNode.toElement().attribute("archived").toInt());
|
||||
instructor.setLoggedIn(instructorNode.toElement().attribute("logged_in").toInt());
|
||||
|
||||
listInstructors.append(instructor);
|
||||
}
|
||||
}
|
||||
emit sigAnswerQueryToDB_ListInstructors(listInstructors);
|
||||
}
|
||||
break;
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_GROUPS:
|
||||
{
|
||||
QList<Group> listGroups;
|
||||
QDomNode listNode = commonDOM.namedItem("ListGroups");
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode groupNode = listNode.childNodes().at(i);
|
||||
if(groupNode.nodeName() == "Group")
|
||||
{//Группа
|
||||
Group group;
|
||||
group.setID(groupNode.toElement().attribute("group_id").toInt());
|
||||
group.setName(groupNode.toElement().attribute("name"));
|
||||
|
||||
listGroups.append(group);
|
||||
}
|
||||
}
|
||||
emit sigAnswerQueryToDB_ListGroups(listGroups);
|
||||
}
|
||||
break;
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES:
|
||||
{
|
||||
QList<Trainee> listTrainees;
|
||||
QDomNode listNode = commonDOM.namedItem("ListTrainees");
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode traineeNode = listNode.childNodes().at(i);
|
||||
if(traineeNode.nodeName() == "Trainee")
|
||||
{//Обучаемый
|
||||
Trainee trainee;
|
||||
trainee.setID(traineeNode.toElement().attribute("trainee_id").toInt());
|
||||
trainee.setName(traineeNode.toElement().attribute("name"));
|
||||
trainee.setLogin(traineeNode.toElement().attribute("login"));
|
||||
trainee.setPassword(traineeNode.toElement().attribute("password"));
|
||||
trainee.setArchived(traineeNode.toElement().attribute("archived").toInt());
|
||||
trainee.setLoggedIn(traineeNode.toElement().attribute("logged_in").toInt());
|
||||
Group group(traineeNode.toElement().attribute("group_trainee").toInt(), "");
|
||||
trainee.setGroup(group);
|
||||
//trainee.setComputer()
|
||||
//trainee.setTasks()
|
||||
|
||||
|
||||
//Тайминг
|
||||
QDomNode timingNode = traineeNode.firstChildElement("timing");
|
||||
|
||||
TimingOfTrainee timing(trainee.getID());
|
||||
timing.setEntryTimeS(timingNode.toElement().attribute("entryTime"));
|
||||
timing.setExitTimeS(timingNode.toElement().attribute("exitTime"));
|
||||
timing.setOperatingTimeS(timingNode.toElement().attribute("operatingTime"));
|
||||
|
||||
trainee.setTiming(timing);
|
||||
|
||||
|
||||
listTrainees.append(trainee);
|
||||
}
|
||||
}
|
||||
emit sigAnswerQueryToDB_ListTrainees(listTrainees);
|
||||
}
|
||||
break;
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_COMPUTERS:
|
||||
{
|
||||
QList<Computer> listComputers;
|
||||
QDomNode listNode = commonDOM.namedItem("ListComputers");
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode computerNode = listNode.childNodes().at(i);
|
||||
if(computerNode.nodeName() == "Computer")
|
||||
{//Компьютер
|
||||
Computer computer;
|
||||
computer.setID(computerNode.toElement().attribute("computer_id").toInt());
|
||||
computer.setName(computerNode.toElement().attribute("name"));
|
||||
computer.setIpAddress(computerNode.toElement().attribute("ip_address"));
|
||||
//computer.setClassroom
|
||||
|
||||
listComputers.append(computer);
|
||||
}
|
||||
}
|
||||
emit sigAnswerQueryToDB_ListComputers(listComputers);
|
||||
}
|
||||
break;
|
||||
case TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS:
|
||||
{
|
||||
QList<Classroom> listClassrooms;
|
||||
QDomNode listNode = commonDOM.namedItem("ListClassrooms");
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode classroomNode = listNode.childNodes().at(i);
|
||||
if(classroomNode.nodeName() == "Classroom")
|
||||
{//Класс
|
||||
Classroom classroom;
|
||||
classroom.setID(classroomNode.toElement().attribute("classroom_id").toInt());
|
||||
classroom.setName(classroomNode.toElement().attribute("name"));
|
||||
|
||||
listClassrooms.append(classroom);
|
||||
}
|
||||
}
|
||||
emit sigAnswerQueryToDB_ListClassrooms(listClassrooms);
|
||||
}
|
||||
break;
|
||||
case TYPE_XMLANSWER_QUERY_TASKS_AMM_FOR_TRAINEE:
|
||||
{
|
||||
QList<TaskAmmFim> listTasks;
|
||||
int trainee_id = 0;
|
||||
QDomNode listNode = commonDOM.namedItem("ListTasksAMM");
|
||||
trainee_id = listNode.toElement().attribute("trainee_id").toInt();
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode taskNode = listNode.childNodes().at(i);
|
||||
if(taskNode.nodeName() == "taskAMM")
|
||||
{//Задача
|
||||
TaskAmmFim task;
|
||||
task.setID(taskNode.toElement().attribute("task_id").toInt());
|
||||
task.ammProcedure.title = taskNode.toElement().attribute("title");
|
||||
task.ammProcedure.dmCode = taskNode.toElement().attribute("dmCode");
|
||||
task.status = taskNode.toElement().attribute("status");
|
||||
|
||||
for(int j = 0; j < taskNode.childNodes().count(); j++)
|
||||
{
|
||||
QDomNode subProcNode = taskNode.childNodes().at(j);
|
||||
if(subProcNode.nodeName() == "SubProc")
|
||||
{//Подпроцедура
|
||||
SubProc subProc;
|
||||
subProc.setDmCode(subProcNode.toElement().attribute("dmCode"));
|
||||
subProc.setTitle(subProcNode.toElement().attribute("title"));
|
||||
subProc.setModeListStr(subProcNode.toElement().attribute("canplay"));
|
||||
|
||||
task.listSubProc.append(subProc);
|
||||
}
|
||||
}
|
||||
|
||||
listTasks.append(task);
|
||||
}
|
||||
}
|
||||
emit sigAnswerQueryToDB_ListTasksAMMforTrainee(listTasks, trainee_id);
|
||||
}
|
||||
break;
|
||||
case TYPE_XMLANSWER_QUERY_TASKS_FIM_FOR_TRAINEE:
|
||||
{
|
||||
QList<TaskAmmFim> listTasks;
|
||||
int trainee_id = 0;
|
||||
QDomNode listNode = commonDOM.namedItem("ListTasksFIM");
|
||||
trainee_id = listNode.toElement().attribute("trainee_id").toInt();
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{//Задачи
|
||||
QDomNode taskNode = listNode.childNodes().at(i);
|
||||
if(taskNode.nodeName() == "taskFIM")
|
||||
{
|
||||
TaskAmmFim task;
|
||||
task.setID(taskNode.toElement().attribute("task_id").toInt());
|
||||
task.title = taskNode.toElement().attribute("title");
|
||||
task.status = taskNode.toElement().attribute("status");
|
||||
|
||||
for(int j = 0; j < taskNode.childNodes().count(); j++)
|
||||
{
|
||||
QDomNode malfOrReportNode = taskNode.childNodes().at(j);
|
||||
if(malfOrReportNode.nodeName() == "malfunction")
|
||||
{//Неисправность
|
||||
Malfunction malfunction;
|
||||
malfunction.num = malfOrReportNode.toElement().attribute("num");
|
||||
malfunction.dmCode = malfOrReportNode.toElement().attribute("dmCode");
|
||||
malfunction.description = malfOrReportNode.toElement().attribute("description");
|
||||
|
||||
for(int s = 0; s < malfOrReportNode.childNodes().count(); s++)
|
||||
{
|
||||
QDomNode signNode = malfOrReportNode.childNodes().at(s);
|
||||
if(signNode.nodeName() == "malfunctionSign")
|
||||
{
|
||||
MalfunctionSign sign;
|
||||
sign.type = signNode.toElement().attribute("type").toInt();
|
||||
sign.description = signNode.toElement().attribute("description");
|
||||
|
||||
malfunction.malfunctionSigns.append(sign);
|
||||
}
|
||||
}
|
||||
|
||||
task.malfunctionList.append(malfunction);
|
||||
}
|
||||
else
|
||||
if(malfOrReportNode.nodeName() == "report")
|
||||
{//Отчет
|
||||
FIMReport report;
|
||||
report.id = malfOrReportNode.toElement().attribute("report_id").toInt();
|
||||
|
||||
for(int k = 0; k < malfOrReportNode.childNodes().count(); k++)
|
||||
{
|
||||
QDomNode reportItemNode = malfOrReportNode.childNodes().at(k);
|
||||
if(reportItemNode.nodeName() == "reportItem")
|
||||
{
|
||||
FIMReportItem reportItem;
|
||||
reportItem.id = reportItemNode.toElement().attribute("item_id").toInt();
|
||||
reportItem.text = reportItemNode.toElement().attribute("text");
|
||||
|
||||
if(reportItemNode.childNodes().count())
|
||||
{
|
||||
QDomNode procedureIDNode = reportItemNode.childNodes().at(0);
|
||||
reportItem.procedure.doc = procedureIDNode.toElement().attribute("doc");
|
||||
reportItem.procedure.title = procedureIDNode.toElement().attribute("title");
|
||||
reportItem.procedure.dmCode = procedureIDNode.toElement().attribute("dmCode");
|
||||
reportItem.procedure.result = procedureIDNode.toElement().attribute("result");
|
||||
}
|
||||
|
||||
report.itemList.append(reportItem);
|
||||
}
|
||||
}
|
||||
|
||||
task.report = report;
|
||||
}
|
||||
}
|
||||
|
||||
listTasks.append(task);
|
||||
}
|
||||
}
|
||||
emit sigAnswerQueryToDB_ListTasksFIMforTrainee(listTasks, trainee_id);
|
||||
}
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
void RecognizeSystem::xmlParserQuerySubProc(PacketType packetType, QByteArray array)
|
||||
{
|
||||
QDomDocument commonDOM;
|
||||
commonDOM.setContent(array);
|
||||
|
||||
switch(packetType)
|
||||
{
|
||||
case TYPE_XMLANSWER_QUERY_LIST_SUB_PROC_AMM:
|
||||
{
|
||||
QList<SubProc> listSubProc;
|
||||
QString parentTask_dmCode = "";
|
||||
QDomNode listNode = commonDOM.namedItem("ListSubProc");
|
||||
parentTask_dmCode = listNode.toElement().attribute("dmCode");
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode taskNode = listNode.childNodes().at(i);
|
||||
if(taskNode.nodeName() == "SubProc")
|
||||
{//Подпроцедура
|
||||
SubProc subProc;
|
||||
subProc.setTitle(taskNode.toElement().attribute("title"));
|
||||
subProc.setDmCode(taskNode.toElement().attribute("dmCode"));
|
||||
subProc.setModeListStr(taskNode.toElement().attribute("canplay"));
|
||||
|
||||
listSubProc.append(subProc);
|
||||
}
|
||||
}
|
||||
emit sigAnswerQuerySubProc(listSubProc, parentTask_dmCode);
|
||||
}
|
||||
break;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
void RecognizeSystem::xmlParserQueryTasksXML(PacketType packetType, QByteArray array)
|
||||
{
|
||||
if(packetType == TYPE_XMLANSWER_QUERY_TASKS_XML_FIM)
|
||||
{
|
||||
emit sigAnswerQueryTasksXML_FIM(array);
|
||||
}
|
||||
else if(packetType == TYPE_XMLANSWER_QUERY_TASKS_XML_AMM)
|
||||
{
|
||||
emit sigAnswerQueryTasksXML_AMM(array);
|
||||
}
|
||||
}
|
||||
|
||||
void RecognizeSystem::checkAccessType(QString type)
|
||||
{
|
||||
if(type == "instructor")
|
||||
{
|
||||
//mainWindow->callUpdateList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
#ifndef RECOGNIZESYSTEM_H
|
||||
#define RECOGNIZESYSTEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QDataStream>
|
||||
#include <QTcpSocket>
|
||||
#include <streamingVersionData.h>
|
||||
//#include <mainwindow.h>
|
||||
#include <Core\tools.h>
|
||||
#include "dataparser.h"
|
||||
#include "instructor.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
#include "Datas.h"
|
||||
#include "tasksAmmFim.h"
|
||||
#include "module.h"
|
||||
|
||||
|
||||
class RecognizeSystem : public QObject
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RecognizeSystem(QObject *parent = 0);
|
||||
~RecognizeSystem();
|
||||
void initialize(DataParser *dataParser/*,MainWindow *mainWindow*/);
|
||||
void recognize(QTcpSocket *socket);
|
||||
|
||||
signals:
|
||||
void sigUpdateBytesAvailable();
|
||||
void sigLoadComplete();
|
||||
void sigNeedUpdate(bool flag,qint64 size,quint64 fileCount);
|
||||
void sigSendDebugLog(QString message);
|
||||
void sigSocketDisabled();
|
||||
void sigServerBlocked();
|
||||
void sigErrorAuth(QString error);
|
||||
void sigAuth(ServerAuthorization *serverAuth);
|
||||
void sigDeAuth(ServerDeAuthorization *serverDeAuth);
|
||||
void sigAnswerQueryToDB(QList<Instructor>* listInstructors,
|
||||
QList<Trainee>* listTrainees,
|
||||
QList<Group>* listGroups);
|
||||
void sigSocketWaitForReadyRead(int waitTime);
|
||||
void sigStartCompare();
|
||||
|
||||
void signal_ReceiveMessage(ClientMessage clientMessage);
|
||||
|
||||
void sigAnswerQueryToDB_ListInstructors(QList<Instructor> listInstructors);
|
||||
void sigAnswerQueryToDB_ListGroups(QList<Group> listGroups);
|
||||
void sigAnswerQueryToDB_ListTrainees(QList<Trainee> listTrainees);
|
||||
void sigAnswerQueryToDB_ListComputers(QList<Computer> listComputers);
|
||||
void sigAnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms);
|
||||
void sigAnswerQueryToDB_ListTasksAMMforTrainee(QList<TaskAmmFim>listTasks, int trainee_id);
|
||||
void sigAnswerQueryToDB_ListTasksFIMforTrainee(QList<TaskAmmFim>listTasks, int trainee_id);
|
||||
void sigAnswerQueryTasksXML_FIM(QByteArray array);
|
||||
void sigAnswerQueryTasksXML_AMM(QByteArray array);
|
||||
void sigShowServerDataList(QList<StreamingVersionData*> *versions);
|
||||
void sigSetVersion(StreamingVersionData* serverVersion);
|
||||
void sigNotifyVersionControl(QString text);
|
||||
void sigAnimationActivated(bool flag);
|
||||
void sigHashReady();
|
||||
void sigAnswerQuerySubProc(QList<SubProc> listSubProc, QString parentTask_dmCode);
|
||||
|
||||
void signal_AnswerDocsChanged();
|
||||
|
||||
private:
|
||||
QList<QString> *folderList;
|
||||
//MainWindow *mainWindow;
|
||||
DataParser *dataParser;
|
||||
PacketType packetType;
|
||||
QString message;
|
||||
QString filePath;
|
||||
QByteArray tmpBlock;
|
||||
|
||||
qint64 sizeReceiveData;
|
||||
qint64 fileSize;
|
||||
int countSend;
|
||||
|
||||
void xmlParser(QByteArray array);
|
||||
void xmlParserQueryToDB(PacketType packetType, QByteArray array);
|
||||
void xmlParserQuerySubProc(PacketType packetType, QByteArray array);
|
||||
void xmlParserQueryTasksXML(PacketType packetType, QByteArray array);
|
||||
|
||||
void checkAccessType(QString type);
|
||||
};
|
||||
|
||||
#endif // RECOGNIZESYSTEM_H
|
||||
179
LibInstructorsAndTrainees/connectorToServer/Core/sendsystem.cpp
Normal file
@@ -0,0 +1,179 @@
|
||||
#include "sendsystem.h"
|
||||
#include "tools.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QThread>
|
||||
|
||||
|
||||
|
||||
SendSystem::SendSystem(QObject *)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SendSystem::setSocket(QTcpSocket *socket)
|
||||
{
|
||||
this->socket = socket;
|
||||
}
|
||||
|
||||
|
||||
void SendSystem::sendDisable()
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
QByteArray data;
|
||||
data = emit sigGetXmlAnswer("DISABLE");
|
||||
|
||||
stream << PacketType::TYPE_XMLANSWER;
|
||||
stream << data;
|
||||
socket->waitForBytesWritten();
|
||||
}
|
||||
|
||||
//void SendSystem::sendXMLmsgGUItoServer(QByteArray array)
|
||||
//{
|
||||
// qDebug() << "SendSystem" << QThread::currentThreadId();
|
||||
// QDataStream stream(socket);
|
||||
// stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
// stream << PacketType::TYPE_XMLANSWER;
|
||||
// stream << array;
|
||||
// socket->waitForBytesWritten(6000);
|
||||
//}
|
||||
|
||||
void SendSystem::sendFileBlock(QString path)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
QString fullPath = Tools::createFullPath(path);
|
||||
quint64 fileSize = 0;
|
||||
int countSend = 0;
|
||||
|
||||
|
||||
QFile file(fullPath); //Открываем файл для чтения
|
||||
QFileInfo fileInfo(file);
|
||||
|
||||
fileSize = fileInfo.size();
|
||||
|
||||
stream << PacketType::TYPE_FILE; //Отправляем тип блока
|
||||
stream << path << fileSize;
|
||||
|
||||
socket->waitForReadyRead(20);
|
||||
//socket->waitForBytesWritten();
|
||||
|
||||
if(file.open(QFile::ReadOnly)){
|
||||
while(!file.atEnd()){
|
||||
QByteArray data = file.read(1025*250);
|
||||
stream << data;
|
||||
socket->waitForBytesWritten();
|
||||
countSend++;
|
||||
}
|
||||
|
||||
qDebug() << Tools::getTime() << "count end Final: " << countSend;
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
emit sigSend();
|
||||
//qDebug() << "Transaction after send file: " << socket->isTransactionStarted();
|
||||
countSend = 0;
|
||||
//socket->waitForBytesWritten();
|
||||
socket->waitForReadyRead(20);
|
||||
}
|
||||
|
||||
void SendSystem::sendFolderBlock(QString path)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
stream << PacketType::TYPE_FOLDER;
|
||||
stream << path;
|
||||
emit sigSend();
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
|
||||
void SendSystem::sendQTConnect()
|
||||
{
|
||||
QByteArray container;
|
||||
int numPackage = (int)PacketType::TYPE_QT;
|
||||
container.append(numPackage & 0x000000ff);
|
||||
container.append((numPackage >> 8) & 0x000000ff);
|
||||
container.append((numPackage >> 16) & 0x000000ff);
|
||||
container.append((numPackage >> 24) & 0x000000ff);
|
||||
|
||||
socket->write(container);
|
||||
socket->waitForBytesWritten();
|
||||
}
|
||||
|
||||
void SendSystem::sendXMLAnswer(QByteArray array)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
stream << PacketType::TYPE_XMLANSWER;
|
||||
stream << array;
|
||||
|
||||
socket->waitForBytesWritten();
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendFinish()
|
||||
{
|
||||
socket->waitForReadyRead(100);
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
stream << PacketType::TYPE_FINISH;
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendChangeVersion(StreamingVersionData *streamingVersion)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::CHANGE_DATA_VERSION;
|
||||
stream << streamingVersion->getViewName();
|
||||
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendDeleteVersion(StreamingVersionData *streamingVersion)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::DELETE_DATA_VERSION;
|
||||
stream << streamingVersion->getViewName();
|
||||
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendCopyVersion(QString versionName)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::COPY_VERSION;
|
||||
|
||||
stream << versionName;
|
||||
}
|
||||
|
||||
void SendSystem::sendGetVersion()
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::GET_VERSION;
|
||||
}
|
||||
|
||||
void SendSystem::sendPacketType(PacketType packetType)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
QByteArray data;
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
stream << packetType;
|
||||
}
|
||||
SendSystem::~SendSystem()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef SENDSYSTEM_H
|
||||
#define SENDSYSTEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTcpSocket>
|
||||
#include <QDataStream>
|
||||
|
||||
#include <streamingVersionData.h>
|
||||
#include "Core/tools.h"
|
||||
|
||||
class SendSystem :public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SendSystem(QObject* parent = nullptr);
|
||||
void setSocket(QTcpSocket *socket);
|
||||
//void sendXMLmsgGUItoServer(QByteArray array);
|
||||
void sendDisable();
|
||||
void sendFileBlock(QString path);
|
||||
void sendFolderBlock(QString path);
|
||||
void sendQTConnect();
|
||||
void sendXMLAnswer(QByteArray array);
|
||||
~SendSystem();
|
||||
void sendFinish();
|
||||
|
||||
public slots:
|
||||
void sendPacketType(PacketType packetType);
|
||||
void sendChangeVersion(StreamingVersionData *streamingVersion);
|
||||
void sendDeleteVersion(StreamingVersionData *streamingVersion);
|
||||
void sendCopyVersion(QString versionName);
|
||||
void sendGetVersion();
|
||||
signals:
|
||||
void sigSend();
|
||||
QByteArray sigGetXmlAnswer(QString);
|
||||
|
||||
private:
|
||||
QTcpSocket *socket;
|
||||
};
|
||||
|
||||
#endif // SENDSYSTEM_H
|
||||
152
LibInstructorsAndTrainees/connectorToServer/Core/tcpclient.cpp
Normal file
@@ -0,0 +1,152 @@
|
||||
#include "tcpclient.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QThread>
|
||||
|
||||
TCPClient::TCPClient(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void TCPClient::initialize(RecognizeSystem *recognize,SendSystem *sendSystem)
|
||||
{
|
||||
this->recognizeSystem = recognize;
|
||||
this->sendSystem = sendSystem;
|
||||
isConnected = false;
|
||||
|
||||
emit sigSendDebugLog(Tools::getTime() + " Client started");
|
||||
}
|
||||
|
||||
void TCPClient::setConnect(ServerSettings *serverSettings)
|
||||
{
|
||||
socket = new QTcpSocket();
|
||||
qDebug() << "TCPCLient thread: " << QThread::currentThreadId();
|
||||
if (socket != NULL && socket->state() == QTcpSocket::ConnectedState)
|
||||
{
|
||||
emit sigSendDebugLog("already connected");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
socket->connectToHost(serverSettings->Address,serverSettings->Port.toShort());
|
||||
emit sigSendDebugLog("Try connect...");
|
||||
isConnected = true;
|
||||
|
||||
if (socket->waitForConnected(5))
|
||||
{
|
||||
connect(socket,&QTcpSocket::readyRead,this,&TCPClient::slotReadyRead,Qt::DirectConnection);
|
||||
connect(socket,&QTcpSocket::disconnected,this,&TCPClient::setDisconnect);
|
||||
//connect(socket,&QTcpSocket::connected,this,&TCPClient::slotConnectNotify);
|
||||
|
||||
connect(this,&TCPClient::sigRecognize,recognizeSystem,&RecognizeSystem::recognize,Qt::DirectConnection);
|
||||
connect(this,&TCPClient::sigSetSocket,sendSystem,&SendSystem::setSocket);
|
||||
|
||||
emit sigSetSocket(socket);
|
||||
slotConnectNotify();
|
||||
|
||||
emit signal_ConnectedToServer(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isConnected = false;
|
||||
emit signal_ConnectedToServer(false);
|
||||
emit sigServerDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void TCPClient::setDisconnect()
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::TYPE_DISABLE;
|
||||
|
||||
socket->disconnect();
|
||||
|
||||
isConnected = false;
|
||||
emit sigServerDisconnect();
|
||||
emit sigSendDebugLog("Server disabled");
|
||||
|
||||
emit signal_ConnectedToServer(false);
|
||||
}
|
||||
|
||||
|
||||
void TCPClient:: waitRead(int time)
|
||||
{
|
||||
socket->waitForReadyRead(time);
|
||||
}
|
||||
|
||||
QTcpSocket *TCPClient::getSocket()
|
||||
{
|
||||
return socket;
|
||||
}
|
||||
|
||||
void TCPClient::slotSendCommand(QString command)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
QByteArray data;
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
if(!command.isEmpty() && socket->state() == QTcpSocket::ConnectedState){
|
||||
|
||||
if(command == "check")
|
||||
{
|
||||
stream << PacketType::TYPE_COMMAND;
|
||||
stream << command;
|
||||
socket->waitForBytesWritten();
|
||||
|
||||
sendSystem->sendFileBlock("/" + hashFilename);
|
||||
emit sigSendDebugLog(Tools::getTime() + " Local checkFile sended");
|
||||
|
||||
socket->waitForReadyRead(1000);
|
||||
}
|
||||
else if(command == "update"){
|
||||
emit sigSendDebugLog("Update started");
|
||||
stream << PacketType::TYPE_COMMAND;
|
||||
stream << command;
|
||||
socket->waitForReadyRead(1000);
|
||||
}
|
||||
else if(command == "run"){
|
||||
//externalExecuter->callApp();
|
||||
}
|
||||
}else{
|
||||
emit sigSendDebugLog("WRONG SOCKET AFTER ENTERED");
|
||||
}
|
||||
}
|
||||
|
||||
void TCPClient::slotConnectNotify()
|
||||
{
|
||||
if(socket->state() != QTcpSocket::ConnectedState)
|
||||
{
|
||||
isConnected = false;
|
||||
emit sigSendDebugLog("Connect invalid");
|
||||
emit sigConnectionState(false);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
isConnected = true;
|
||||
emit sigSendDebugLog("Connect complete");
|
||||
emit sigConnectionState(true);
|
||||
sendSystem->sendQTConnect();
|
||||
}
|
||||
}
|
||||
|
||||
void TCPClient::slotReadyRead()
|
||||
{
|
||||
if(!socket){
|
||||
emit sigSendDebugLog("WRONG SOCKET");
|
||||
return;
|
||||
}
|
||||
|
||||
emit sigRecognize(socket);
|
||||
}
|
||||
|
||||
bool TCPClient::getIsConnected() const
|
||||
{
|
||||
return isConnected;
|
||||
}
|
||||
|
||||
TCPClient::~TCPClient()
|
||||
{
|
||||
|
||||
}
|
||||
61
LibInstructorsAndTrainees/connectorToServer/Core/tcpclient.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#ifndef TCPCLIENT_H
|
||||
#define TCPCLIENT_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTcpSocket>
|
||||
#include <QHostAddress>
|
||||
#include <QDataStream>
|
||||
#include <QTcpServer>
|
||||
#include <QFile>
|
||||
#include <QCoreApplication>
|
||||
#include "Core\recognizesystem.h"
|
||||
#include "Core\tools.h"
|
||||
#include "sendsystem.h"
|
||||
#include "Datas.h"
|
||||
|
||||
|
||||
class RecognizeSystem;
|
||||
class SendSystem;
|
||||
|
||||
class TCPClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
explicit TCPClient(QObject *parent = 0);
|
||||
void initialize(RecognizeSystem *recognize,SendSystem *sendSystem);
|
||||
void setConnect(ServerSettings *serverSettings);
|
||||
void setDisconnect();
|
||||
|
||||
void waitRead(int time);
|
||||
QTcpSocket* getSocket();
|
||||
~TCPClient();
|
||||
|
||||
bool getIsConnected() const;
|
||||
|
||||
signals:
|
||||
void sigSendDebugLog(QString message);
|
||||
void sigRecognize(QTcpSocket *socket);
|
||||
void sigServerDisconnect();
|
||||
void sigConnectionState(bool flag);
|
||||
void sigSetSocket(QTcpSocket *socket);
|
||||
|
||||
void signal_ConnectedToServer(bool state);
|
||||
|
||||
public slots:
|
||||
void slotSendCommand(QString message);
|
||||
void slotConnectNotify();
|
||||
|
||||
private slots:
|
||||
void slotReadyRead();
|
||||
|
||||
|
||||
private:
|
||||
SendSystem *sendSystem;
|
||||
QTcpSocket *socket;
|
||||
RecognizeSystem *recognizeSystem;
|
||||
bool isConnected;
|
||||
};
|
||||
|
||||
#endif // TCPCLIENT_H
|
||||
58
LibInstructorsAndTrainees/connectorToServer/Core/tools.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#include "tools.h"
|
||||
|
||||
#include <qdir.h>
|
||||
|
||||
|
||||
void Tools::printTime()
|
||||
{
|
||||
qDebug() << QTime::currentTime().toString("hh:mm:ss");
|
||||
}
|
||||
|
||||
QString Tools::getTime()
|
||||
{
|
||||
return QTime::currentTime().toString(("hh:mm:ss"));
|
||||
}
|
||||
|
||||
QString Tools::createLocalPath(QString path)
|
||||
{
|
||||
qDebug() << "Full path: " << path;
|
||||
qint8 pos = path.indexOf("Application");
|
||||
|
||||
QString localPath = path.remove(0,--pos);
|
||||
|
||||
qDebug() << "Local path: " << localPath;
|
||||
return localPath;
|
||||
}
|
||||
|
||||
QString Tools::createFullPath(QString path)
|
||||
{
|
||||
QString fullPath;
|
||||
qint8 pos = path.indexOf(additionalFilesFolderName);
|
||||
|
||||
QString localPath = path.remove(0,--pos);
|
||||
|
||||
qDebug() << "CLIENT: localPath" << localPath;
|
||||
fullPath = QDir::currentPath() + localPath;
|
||||
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
QString Tools::convertFileSize(quint64 fileSize)
|
||||
{
|
||||
quint64 megaByte = fileSize / (1024 * 1024);
|
||||
QString resultSize;
|
||||
|
||||
if (megaByte == 0)
|
||||
{
|
||||
auto kiloByte = fileSize / 1024;
|
||||
resultSize = QString::number(kiloByte) + "кб. ";
|
||||
}
|
||||
else
|
||||
{
|
||||
resultSize = QString::number(megaByte) + "мб. ";
|
||||
}
|
||||
|
||||
|
||||
QString result = resultSize;
|
||||
return result;
|
||||
}
|
||||
94
LibInstructorsAndTrainees/connectorToServer/Core/tools.h
Normal file
@@ -0,0 +1,94 @@
|
||||
#ifndef GLOBAL_H
|
||||
#define GLOBAL_H
|
||||
|
||||
#include <QString>
|
||||
#include <QTime>
|
||||
#include <QDebug>
|
||||
|
||||
#define TCP_READ_TIMEOUT 2000
|
||||
|
||||
static QString applicationEXEName = "RRJ.exe";
|
||||
static QString applicationFolderName = "/Application";
|
||||
static QString staticDataFolderName = "StaticData";
|
||||
static QString additionalFilesFolderName = "RRJ-95NEW-100";
|
||||
static QString streamingAssetsPath = "/Application/RRJLoader/RRJ_Data/StreamingAssets";
|
||||
static QString hashFilename = staticDataFolderName + "/clientHash.xml";
|
||||
|
||||
static QString configFolderName = "config";
|
||||
static QString settingsName = configFolderName + "/settings.xml";
|
||||
|
||||
static QString tempName = staticDataFolderName + "/temp.xml";
|
||||
static QString authTempName = staticDataFolderName + "/authData.xml";
|
||||
static QString displayTemp = staticDataFolderName + "/displayData.xml";
|
||||
static QString streamingHashFilename = staticDataFolderName + "/streamingHash.xml";
|
||||
static QString serverHash = staticDataFolderName + "/serverHash.xml";
|
||||
|
||||
static QString cmd_CheckVersionList = "CHECKVERSIONLIST";
|
||||
static QString cmd_GetOfflineMessages = "GETOFFLINEMESSAGE";
|
||||
|
||||
enum PacketType{
|
||||
TYPE_NONE = 0,
|
||||
TYPE_UNITY = 1,
|
||||
TYPE_FILE = 2,
|
||||
TYPE_COMMAND = 3,
|
||||
TYPE_FOLDER = 4,
|
||||
TYPE_DELETE = 5,
|
||||
TYPE_FINISH = 6,
|
||||
TYPE_NEEDUPDATE = 7,
|
||||
TYPE_XMLANSWER = 8,
|
||||
TYPE_QT = 9,
|
||||
TYPE_DISABLE = 11,
|
||||
TYPE_CHECKVERSION = 13,
|
||||
TYPE_GET_OLD_MESSAGES = 22,
|
||||
|
||||
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
|
||||
|
||||
//xml-ответы на запросы к БД
|
||||
TYPE_XMLANSWER_QUERY_DB__LIST_INSTRUCTORS = 100,
|
||||
TYPE_XMLANSWER_QUERY_DB__LIST_GROUPS = 101,
|
||||
TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES = 102,
|
||||
TYPE_XMLANSWER_QUERY_DB__LIST_COMPUTERS = 103,
|
||||
TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS = 104,
|
||||
|
||||
TYPE_XMLANSWER_QUERY_TASKS_AMM_FOR_TRAINEE = 106,
|
||||
TYPE_XMLANSWER_QUERY_TASKS_FIM_FOR_TRAINEE = 107,
|
||||
|
||||
//xml-ответы на запросы AdditionalFiles
|
||||
TYPE_XMLANSWER_QUERY_TASKS_XML_FIM = 130,
|
||||
TYPE_XMLANSWER_QUERY_TASKS_XML_AMM = 131,
|
||||
|
||||
//оповещение об изменении docs.xml
|
||||
TYPE_XMLANSWER_DOCS_CHANGED = 132,
|
||||
|
||||
TYPE_XMLANSWER_QUERY_LIST_SUB_PROC_AMM = 133,
|
||||
|
||||
GET_VERSION = 149,
|
||||
HASH_READY = 150,
|
||||
CHANGE_DATA_VERSION = 151,
|
||||
COPY_VERSION = 152,
|
||||
DELETE_DATA_VERSION = 153,
|
||||
BUSY = 154,
|
||||
FREE = 155
|
||||
};
|
||||
|
||||
#define NOTIFY_ERROR_AUTH_DB "ERROR_AUTH_DB"
|
||||
#define NOTIFY_ERROR_AUTH_LOGINORPASSWORD "ERROR_AUTH_LOGINORPASSWORD"
|
||||
#define NOTIFY_ERROR_AUTH_ARCHIVED "ERROR_AUTH_ARCHIVED"
|
||||
#define NOTIFY_ERROR_AUTH_ALREADYLOGIN "ERROR_AUTH_ALREADYLOGIN"
|
||||
#define NOTIFY_SERVER_END "END"
|
||||
#define NOTIFY_SERVER_BLOCKED "BLOCKED"
|
||||
#define SERVER_HELLO "NewConnection. I am server LMS!"
|
||||
|
||||
//Q_DECLARE_METATYPE(PacketType)
|
||||
|
||||
class Tools {
|
||||
public:
|
||||
|
||||
static void printTime();
|
||||
static QString getTime();
|
||||
static QString createLocalPath(QString path);
|
||||
static QString createFullPath(QString path);
|
||||
static QString convertFileSize(quint64 fileSize);
|
||||
};
|
||||
|
||||
#endif // GLOBAL_H
|
||||
@@ -0,0 +1,42 @@
|
||||
#include "versioncontainer.h"
|
||||
|
||||
VersionContainer::VersionContainer(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VersionContainer::~VersionContainer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString VersionContainer::getServerVersion() const
|
||||
{
|
||||
return serverVersionData->getViewName();
|
||||
}
|
||||
|
||||
QString VersionContainer::getLocalVersion() const
|
||||
{
|
||||
return localVersionData->getViewName();
|
||||
}
|
||||
|
||||
StreamingVersionData *VersionContainer::getLocalVersionData() const
|
||||
{
|
||||
return localVersionData;
|
||||
}
|
||||
|
||||
void VersionContainer::setLocalVersionData(StreamingVersionData *value)
|
||||
{
|
||||
localVersionData = value;
|
||||
}
|
||||
|
||||
StreamingVersionData *VersionContainer::getServerVersionData() const
|
||||
{
|
||||
return serverVersionData;
|
||||
}
|
||||
|
||||
void VersionContainer::setServerVersionData(StreamingVersionData *value)
|
||||
{
|
||||
serverVersionData = value;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef VERSIONCONTAINER_H
|
||||
#define VERSIONCONTAINER_H
|
||||
|
||||
#include <QObject>
|
||||
#include "connectorToServer/streamingversiondata.h"
|
||||
|
||||
class VersionContainer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit VersionContainer(QObject *parent = nullptr);
|
||||
~VersionContainer();
|
||||
|
||||
QString getServerVersion() const;
|
||||
QString getLocalVersion() const;
|
||||
|
||||
|
||||
StreamingVersionData *getLocalVersionData() const;
|
||||
void setLocalVersionData(StreamingVersionData *value);
|
||||
|
||||
StreamingVersionData *getServerVersionData() const;
|
||||
void setServerVersionData(StreamingVersionData *value);
|
||||
|
||||
private:
|
||||
StreamingVersionData *localVersionData;
|
||||
StreamingVersionData *serverVersionData;
|
||||
|
||||
};
|
||||
|
||||
#endif // VERSIONCONTAINER_H
|
||||
112
LibInstructorsAndTrainees/connectorToServer/Datas.h
Normal file
@@ -0,0 +1,112 @@
|
||||
#ifndef DATAS_H
|
||||
#define DATAS_H
|
||||
|
||||
#include <QString>
|
||||
#include "typeQueryToDB.h"
|
||||
|
||||
class ServerSettings{
|
||||
public:
|
||||
QString Address;
|
||||
QString Port;
|
||||
QString Language;
|
||||
bool isAutoStart;
|
||||
};
|
||||
|
||||
class ServerAuthorization{
|
||||
public:
|
||||
QString InstructorName;
|
||||
QString ClientName;
|
||||
bool Result;
|
||||
QString AccessType;
|
||||
QString Login;
|
||||
QString Id;
|
||||
};
|
||||
class ServerDeAuthorization{
|
||||
public:
|
||||
bool Result;
|
||||
QString Login;
|
||||
};
|
||||
|
||||
enum TypeClientAutorization{
|
||||
TYPE_SIMPLE = 0,
|
||||
TYPE_GUI = 10
|
||||
};
|
||||
|
||||
class ClientAutorization{
|
||||
public:
|
||||
QString Login;
|
||||
QString Password;
|
||||
TypeClientAutorization TypeClient;
|
||||
};
|
||||
|
||||
class ClientDeAutorization{
|
||||
public:
|
||||
QString Login;
|
||||
};
|
||||
/*
|
||||
enum TypeQueryToDB{
|
||||
TYPE_QUERY_GET_ALL_LISTS,
|
||||
TYPE_QUERY_NEW_INSTRUCTOR,
|
||||
TYPE_QUERY_DEL_INSTRUCTOR,
|
||||
TYPE_QUERY_EDIT_INSTRUCTOR,
|
||||
TYPE_QUERY_NEW_GROUP,
|
||||
TYPE_QUERY_DEL_GROUP,
|
||||
TYPE_QUERY_EDIT_GROUP,
|
||||
TYPE_QUERY_NEW_TRAINEE,
|
||||
TYPE_QUERY_DEL_TRAINEE,
|
||||
TYPE_QUERY_EDIT_TRAINEE,
|
||||
TYPE_QUERY_ASSIGN_TASK_AMM_TO_TRAINEE,
|
||||
TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE
|
||||
};
|
||||
*/
|
||||
|
||||
class ClientQueryToDB{
|
||||
public:
|
||||
TypeQueryToDB typeQuery;
|
||||
};
|
||||
|
||||
class ServerMessage
|
||||
{
|
||||
public:
|
||||
QString Text;
|
||||
};
|
||||
|
||||
class ClientMessage
|
||||
{
|
||||
public:
|
||||
QString fromId;//формат id-typeId
|
||||
QString toId;//формат id-typeId
|
||||
QString Text;
|
||||
QString timeStr;
|
||||
|
||||
//TypeId
|
||||
//0 - инструктор, 1 - обучаемый
|
||||
ClientMessage(){}
|
||||
ClientMessage(QString fromId, QString toId, QString text, QString timeStr = "")
|
||||
{
|
||||
this->fromId = fromId;
|
||||
this->toId = toId;
|
||||
this->Text = text;
|
||||
this->timeStr = timeStr;
|
||||
}
|
||||
};
|
||||
|
||||
class ServerTask
|
||||
{
|
||||
public:
|
||||
QString Text;
|
||||
};
|
||||
|
||||
class ServerNotify
|
||||
{
|
||||
public:
|
||||
QString Code;
|
||||
};
|
||||
|
||||
class ClientNotify
|
||||
{
|
||||
public:
|
||||
QString Code;
|
||||
};
|
||||
|
||||
#endif // DATAS_H
|
||||
@@ -0,0 +1,202 @@
|
||||
#include "connectortoserver.h"
|
||||
#include <QThread>
|
||||
|
||||
ConnectorToServer::ConnectorToServer(QObject *parent) :
|
||||
QObject(parent),
|
||||
connectionThread(nullptr),
|
||||
client(nullptr),
|
||||
dataParser(nullptr),
|
||||
sendSystem(nullptr),
|
||||
recognizeSystem(nullptr),
|
||||
fl_GetedOfflineMessages(false),
|
||||
nameInstructorLoggedInLocal("")
|
||||
{
|
||||
initialize();
|
||||
}
|
||||
|
||||
ConnectorToServer::~ConnectorToServer()
|
||||
{
|
||||
delete client;
|
||||
delete recognizeSystem;
|
||||
delete sendSystem;
|
||||
delete dataParser;
|
||||
|
||||
connectionThread->quit();
|
||||
connectionThread->wait();
|
||||
delete connectionThread;
|
||||
}
|
||||
|
||||
ServerSettings ConnectorToServer::getServerSettings()
|
||||
{
|
||||
return serverSettings;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::getIsConnected()
|
||||
{
|
||||
return client->getIsConnected();
|
||||
}
|
||||
|
||||
void ConnectorToServer::SetConnectToServer()
|
||||
{
|
||||
qDebug() << "connectorToServer::SetConnectToServer() thread ID " << QThread::currentThreadId();
|
||||
serverSettings = *dataParser->getServerSettings();
|
||||
emit sigSetConnect(dataParser->getServerSettings(),connectionThread);
|
||||
}
|
||||
|
||||
void ConnectorToServer::StopConnectToServer()
|
||||
{
|
||||
emit sigStopConnect();
|
||||
clearListModelDB();
|
||||
}
|
||||
|
||||
void ConnectorToServer::setLoginName(QString name)
|
||||
{
|
||||
//versionSelectWidget->setAuthor(name);
|
||||
nameInstructorLoggedInLocal = name;
|
||||
}
|
||||
|
||||
QString ConnectorToServer::getLoginName()
|
||||
{
|
||||
return nameInstructorLoggedInLocal;
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_sendMessage(ClientMessage clientMessage)
|
||||
{
|
||||
sendMessage(clientMessage);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_showServerList(QList<StreamingVersionData *> *serverList)
|
||||
{
|
||||
//versionSelectWidget->fillView(serverList);
|
||||
emit signal_showServerList(serverList);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_HashReady()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_Auth(ServerAuthorization *serverAuth)
|
||||
{
|
||||
this->serverAuth = *serverAuth;
|
||||
emit sigLoginResult(serverAuth);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_ServerBlocked()
|
||||
{
|
||||
emit sigServerBlocked();
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_ErrorAuth(QString error)
|
||||
{
|
||||
emit sigErrorAuth(error);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_SendDeleteVersion(StreamingVersionData *streaming)
|
||||
{
|
||||
emit signal_SendDeleteVersion(streaming);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_SendSwitchVersion(StreamingVersionData *selectVersion)
|
||||
{
|
||||
emit signal_SendSwitchVersion(selectVersion);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_SendCopyVersion(QString versionPair)
|
||||
{
|
||||
emit signal_SendCopyVersion(versionPair);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_getVersion()
|
||||
{
|
||||
emit signal_SendGetVersion();
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_NotifyVersionControl(QString text)
|
||||
{
|
||||
emit signal_NotifyVersionControl(text);
|
||||
}
|
||||
|
||||
void ConnectorToServer::initialize()
|
||||
{
|
||||
createObjects();
|
||||
|
||||
bindConnection();
|
||||
|
||||
emit sigInitializeClient(recognizeSystem,sendSystem,connectionThread);
|
||||
|
||||
//SetConnectToServer();
|
||||
}
|
||||
|
||||
void ConnectorToServer::bindConnection()
|
||||
{
|
||||
connect(this,&ConnectorToServer::sigInitializeClient,client,&TCPClient::initialize,Qt::AutoConnection);
|
||||
connect(this,&ConnectorToServer::sigSetConnect,client,&TCPClient::setConnect,Qt::AutoConnection);
|
||||
connect(this,&ConnectorToServer::sigStopConnect,client,&TCPClient::setDisconnect,Qt::AutoConnection);
|
||||
|
||||
connect(this,&ConnectorToServer::sigSendAnswerToServer,sendSystem,&SendSystem::sendXMLAnswer,Qt::AutoConnection);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::slot_Auth);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigServerBlocked,this,&ConnectorToServer::slot_ServerBlocked);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigErrorAuth,this,&ConnectorToServer::slot_ErrorAuth);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::signal_ReceiveMessage,this,&ConnectorToServer::signal_receiveMessage,Qt::AutoConnection);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigShowServerDataList,this,&ConnectorToServer::slot_showServerList);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListInstructors,this,&ConnectorToServer::slot_AnswerQueryToDB_ListInstructors);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListGroups,this,&ConnectorToServer::slot_AnswerQueryToDB_ListGroups);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListTrainees,this,&ConnectorToServer::slot_AnswerQueryToDB_ListTrainees);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListComputers,this,&ConnectorToServer::slot_AnswerQueryToDB_ListComputers);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListClassrooms,this,&ConnectorToServer::slot_AnswerQueryToDB_ListClassrooms);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListTasksAMMforTrainee,this,&ConnectorToServer::slot_AnswerQueryToDB_ListTasksAMMforTrainee);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListTasksFIMforTrainee,this,&ConnectorToServer::slot_AnswerQueryToDB_ListTasksFIMforTrainee);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_FIM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_FIM);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_AMM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_AMM);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQuerySubProc,this,&ConnectorToServer::slot_AnswerQuerySubProc);
|
||||
|
||||
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer,Qt::AutoConnection);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigNotifyVersionControl,this,&ConnectorToServer::slot_NotifyVersionControl,Qt::AutoConnection);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigHashReady,this,&ConnectorToServer::slot_HashReady);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::signal_AnswerDocsChanged,this,&ConnectorToServer::slot_AnswerDocsChanged);
|
||||
|
||||
connect(recognizeSystem, &RecognizeSystem::sigSetVersion, this, &ConnectorToServer::signal_SetVersion);
|
||||
connect(recognizeSystem, &RecognizeSystem::sigAnimationActivated, this, &ConnectorToServer::signal_AnimationActivated);
|
||||
|
||||
connect(this, &ConnectorToServer::signal_SendCopyVersion, sendSystem, &SendSystem::sendCopyVersion);
|
||||
connect(this, &ConnectorToServer::signal_SendDeleteVersion, sendSystem, &SendSystem::sendDeleteVersion);
|
||||
connect(this, &ConnectorToServer::signal_SendSwitchVersion, sendSystem, &SendSystem::sendChangeVersion);
|
||||
|
||||
connect(this, &ConnectorToServer::signal_SendGetVersion, sendSystem, &SendSystem::sendGetVersion);
|
||||
}
|
||||
|
||||
void ConnectorToServer::createObjects()
|
||||
{
|
||||
connectionThread = new QThread;
|
||||
|
||||
client = new TCPClient;
|
||||
client->moveToThread(connectionThread);
|
||||
|
||||
dataParser = new DataParser;
|
||||
|
||||
sendSystem = new SendSystem;
|
||||
sendSystem->moveToThread(connectionThread);
|
||||
|
||||
recognizeSystem = new RecognizeSystem;
|
||||
recognizeSystem->moveToThread(connectionThread);
|
||||
|
||||
connectionThread->start();
|
||||
connectionThread->setPriority(QThread::HighestPriority);
|
||||
}
|
||||
|
||||
SendSystem *ConnectorToServer::getSendSystem() const
|
||||
{
|
||||
return sendSystem;
|
||||
}
|
||||
197
LibInstructorsAndTrainees/connectorToServer/connectortoserver.h
Normal file
@@ -0,0 +1,197 @@
|
||||
#ifndef CONNECTORTOSERVER_H
|
||||
#define CONNECTORTOSERVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QMap>
|
||||
#include <QMutex>
|
||||
#include "Core\tcpclient.h"
|
||||
#include "Core\dataparser.h"
|
||||
#include "Core\sendsystem.h"
|
||||
#include "Core\recognizesystem.h"
|
||||
#include "instructor.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
#include "computer.h"
|
||||
#include "classroom.h"
|
||||
#include "Datas.h"
|
||||
#include "streamingversiondata.h"
|
||||
|
||||
class ConnectorToServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConnectorToServer(QObject *parent = nullptr);
|
||||
~ConnectorToServer();
|
||||
|
||||
public:
|
||||
ServerSettings getServerSettings();
|
||||
bool getIsConnected();
|
||||
|
||||
SendSystem *getSendSystem() const;
|
||||
ServerAuthorization getServerAuth(){return serverAuth;}
|
||||
|
||||
void SetConnectToServer();
|
||||
void StopConnectToServer();
|
||||
|
||||
void setLoginName(QString name);
|
||||
QString getLoginName();
|
||||
|
||||
public:
|
||||
//Send
|
||||
bool sendAuthorizationInstructorLocal(QString login, QString password);
|
||||
bool sendDeAuthorizationInstructorLocal(QString login);
|
||||
|
||||
bool sendQueryToDB(TypeQueryToDB typeQuery, int id = 0, void* data = nullptr);
|
||||
bool sendMessage(ClientMessage clientMessage);
|
||||
|
||||
bool sendQueryTasksXML(QString type);
|
||||
bool sendQueryListSubProc(QString dmCode);
|
||||
bool sendQueryBlockAuth(bool block);
|
||||
|
||||
void sendShowVersionSelect();
|
||||
bool sendClientNotify(QString command);
|
||||
|
||||
public:
|
||||
//LocalModelDB
|
||||
QByteArray getListTaskFimArray();
|
||||
QByteArray getListTaskAmmArray();
|
||||
|
||||
QList<Instructor> getListInstructors();
|
||||
QList<Trainee> getListTrainees();
|
||||
QList<Group> getListGroups();
|
||||
QList<Computer> getListComputers();
|
||||
QList<Classroom> getListClassrooms();
|
||||
QList<TaskAmmFim> getListTasksAMMforTrainee(int trainee_id);
|
||||
QList<TaskAmmFim> getListTasksFIMforTrainee(int trainee_id);
|
||||
QList<SubProc> getListSubProcForDMCode(QString dmCode);
|
||||
int getCountTasksAMMforTrainee(int trainee_id);
|
||||
int getCountTasksFIMforTrainee(int trainee_id);
|
||||
|
||||
bool isArchivedInstructor(int id);
|
||||
bool isAdminInstructor(int id);
|
||||
bool isLoggedInInstructor(int id);
|
||||
Instructor getInstructor(int id);
|
||||
|
||||
QList<Trainee> getListTraineesInGroup(int id);
|
||||
bool isArchivedTrainee(int id);
|
||||
bool isLoggedInTrainee(int id);
|
||||
Trainee getTrainee(int id);
|
||||
Group getGroup(int id);
|
||||
|
||||
int getIdTraineeByLogin(QString login);
|
||||
int getIdInstructorByLogin(QString login);
|
||||
|
||||
private:
|
||||
//Очистка списочной модели БД СУО
|
||||
void clearListModelDB();
|
||||
|
||||
public slots:
|
||||
//AnswerQueryToDB
|
||||
void slot_AnswerQueryToDB_ListInstructors(QList<Instructor> listInstructors);
|
||||
void slot_AnswerQueryToDB_ListGroups(QList<Group> listGroups);
|
||||
void slot_AnswerQueryToDB_ListTrainees(QList<Trainee> listTrainees);
|
||||
void slot_AnswerQueryToDB_ListComputers(QList<Computer> listComputers);
|
||||
void slot_AnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms);
|
||||
void slot_AnswerQueryToDB_ListTasksAMMforTrainee(QList<TaskAmmFim> listTasks, int trainee_id);
|
||||
void slot_AnswerQueryToDB_ListTasksFIMforTrainee(QList<TaskAmmFim> listTasks, int trainee_id);
|
||||
void slot_AnswerQueryTasksXML_FIM(QByteArray array);
|
||||
void slot_AnswerQueryTasksXML_AMM(QByteArray array);
|
||||
void slot_AnswerQuerySubProc(QList<SubProc> listSubProc, QString parentTask_dmCode);
|
||||
|
||||
void slot_AnswerDocsChanged();
|
||||
|
||||
public slots:
|
||||
void slot_sendMessage(ClientMessage clientMessage);
|
||||
void slot_showServerList(QList<StreamingVersionData*> *serverList);
|
||||
void slot_HashReady();
|
||||
void slot_Auth(ServerAuthorization * serverAuth);
|
||||
void slot_ServerBlocked();
|
||||
void slot_ErrorAuth(QString error);
|
||||
|
||||
void slot_SendDeleteVersion(StreamingVersionData *streaming);
|
||||
void slot_SendSwitchVersion(StreamingVersionData *selectVersion);
|
||||
void slot_SendCopyVersion(QString versionPair);
|
||||
|
||||
void slot_getVersion();
|
||||
|
||||
void slot_NotifyVersionControl(QString text);
|
||||
|
||||
signals:
|
||||
void sigSetConnect(ServerSettings* serverSettings,QThread *thread);
|
||||
void sigStopConnect();
|
||||
void sigInitializeClient(RecognizeSystem *recognizeSystem,
|
||||
SendSystem *sendSystem,
|
||||
QThread *thread);
|
||||
|
||||
void sigLoginResult(ServerAuthorization * serverAuth);
|
||||
void sigDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||
void sigServerBlocked();
|
||||
void sigErrorAuth(QString error);
|
||||
|
||||
void signal_UpdateDB(bool treeInstructor, bool treeTrainee);
|
||||
|
||||
void signal_UpdateTasksFIM(); //Общий список
|
||||
void signal_UpdateTasksAMM(); //Общий список
|
||||
|
||||
void signal_UpdateTasksFIMforTrainee(int trainee_id);
|
||||
void signal_UpdateTasksAMMforTrainee(int trainee_id);
|
||||
|
||||
void signal_UpdateSubProcForDMCode(QString dmCode);
|
||||
|
||||
void signal_ConnectedToServer(bool state);
|
||||
|
||||
void signal_reInitMessangerByUsers(QList<User> listUsers);
|
||||
|
||||
void signal_receiveMessage(ClientMessage clientMessage);
|
||||
void sigSendAnswerToServer(QByteArray array);
|
||||
|
||||
void signal_AnswerDocsChanged();
|
||||
|
||||
void signal_SetVersion(StreamingVersionData* serverVersion);
|
||||
void signal_AnimationActivated(bool flag);
|
||||
|
||||
void signal_SendDeleteVersion(StreamingVersionData *streaming);
|
||||
void signal_SendSwitchVersion(StreamingVersionData *selectVersion);
|
||||
void signal_SendCopyVersion(QString versionPair);
|
||||
|
||||
void signal_showServerList(QList<StreamingVersionData*> *serverList);
|
||||
void signal_SendGetVersion();
|
||||
|
||||
void signal_NotifyVersionControl(QString text);
|
||||
|
||||
private:
|
||||
void initialize();
|
||||
void bindConnection();
|
||||
void createObjects();
|
||||
|
||||
private:
|
||||
QThread *connectionThread;
|
||||
TCPClient *client;
|
||||
DataParser *dataParser;
|
||||
SendSystem *sendSystem;
|
||||
RecognizeSystem *recognizeSystem;
|
||||
|
||||
//Списочная модель БД СУО
|
||||
QMutex mtxAccess;
|
||||
QList<Instructor> listInstructors;
|
||||
QList<Group> listGroups;
|
||||
QList<Trainee> listTrainees;
|
||||
QList<Computer> listComputers;
|
||||
QList<Classroom> listClassrooms;
|
||||
QMap<int, QList<TaskAmmFim>> mapTasksAMM;
|
||||
QMap<int, QList<TaskAmmFim>> mapTasksFIM;
|
||||
QByteArray listTaskFimArray;
|
||||
QByteArray listTaskAmmArray;
|
||||
|
||||
QMap<QString, QList<SubProc>> mapSubProc;
|
||||
|
||||
ServerSettings serverSettings;
|
||||
ServerAuthorization serverAuth;
|
||||
|
||||
bool fl_GetedOfflineMessages;
|
||||
|
||||
QString nameInstructorLoggedInLocal;
|
||||
};
|
||||
|
||||
#endif // CONNECTORTOSERVER_H
|
||||
@@ -0,0 +1,140 @@
|
||||
#include "connectortoserver.h"
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListInstructors(QList<Instructor> listInstructors)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
|
||||
this->listInstructors = listInstructors;
|
||||
|
||||
QList<User> listUsers;
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
listUsers.append(instructor);
|
||||
}
|
||||
|
||||
mtxAccess.unlock();
|
||||
|
||||
emit signal_UpdateDB(true, false);
|
||||
emit signal_reInitMessangerByUsers(listUsers);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListGroups(QList<Group> listGroups)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
this->listGroups = listGroups;
|
||||
mtxAccess.unlock();
|
||||
|
||||
emit signal_UpdateDB(false, true);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListTrainees(QList<Trainee> listTrainees)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
|
||||
this->listTrainees = listTrainees;
|
||||
|
||||
QList<User> listUsers;
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
listUsers.append(trainee);
|
||||
}
|
||||
|
||||
mtxAccess.unlock();
|
||||
|
||||
emit signal_UpdateDB(false, true);
|
||||
emit signal_reInitMessangerByUsers(listUsers);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListComputers(QList<Computer> listComputers)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
this->listComputers = listComputers;
|
||||
mtxAccess.unlock();
|
||||
|
||||
//emit signal_UpdateDB(false, true); //TODO
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
this->listClassrooms = listClassrooms;
|
||||
mtxAccess.unlock();
|
||||
|
||||
//emit signal_UpdateDB(false, true); //TODO
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListTasksAMMforTrainee(QList<TaskAmmFim> listTasks, int trainee_id)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
|
||||
//Удаляем старые задачи этого обучаемого
|
||||
mapTasksAMM.remove(trainee_id);
|
||||
|
||||
//Добавляем новые
|
||||
mapTasksAMM.insert(trainee_id, listTasks);
|
||||
|
||||
mtxAccess.unlock();
|
||||
|
||||
emit signal_UpdateTasksAMMforTrainee(trainee_id);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListTasksFIMforTrainee(QList<TaskAmmFim> listTasks, int trainee_id)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
|
||||
//Удаляем старые задачи этого обучаемого
|
||||
mapTasksFIM.remove(trainee_id);
|
||||
|
||||
//Добавляем новые
|
||||
mapTasksFIM.insert(trainee_id, listTasks);
|
||||
|
||||
mtxAccess.unlock();
|
||||
|
||||
emit signal_UpdateTasksFIMforTrainee(trainee_id);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryTasksXML_FIM(QByteArray array)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
this->listTaskFimArray = array;
|
||||
mtxAccess.unlock();
|
||||
|
||||
emit signal_UpdateTasksFIM();
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryTasksXML_AMM(QByteArray array)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
this->listTaskAmmArray = array;
|
||||
mapSubProc.clear();//Очищаем подпроцедуры (уже не актуальны)
|
||||
mtxAccess.unlock();
|
||||
|
||||
emit signal_UpdateTasksAMM();
|
||||
|
||||
//Запрос старых оффлайн-сообщений
|
||||
if(!fl_GetedOfflineMessages)
|
||||
{
|
||||
sendClientNotify(cmd_GetOfflineMessages);
|
||||
fl_GetedOfflineMessages = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQuerySubProc(QList<SubProc> listSubProc, QString parentTask_dmCode)
|
||||
{
|
||||
mtxAccess.lock();
|
||||
|
||||
//Удаляем старые Подпроцедуры этого dmCode
|
||||
mapSubProc.remove(parentTask_dmCode);
|
||||
|
||||
//Добавляем новые
|
||||
mapSubProc.insert(parentTask_dmCode, listSubProc);
|
||||
|
||||
mtxAccess.unlock();
|
||||
|
||||
emit signal_UpdateSubProcForDMCode(parentTask_dmCode);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerDocsChanged()
|
||||
{
|
||||
emit signal_AnswerDocsChanged();
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
#include "connectortoserver.h"
|
||||
|
||||
QByteArray ConnectorToServer::getListTaskFimArray()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listTaskFimArray;
|
||||
}
|
||||
|
||||
QByteArray ConnectorToServer::getListTaskAmmArray()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listTaskAmmArray;
|
||||
}
|
||||
|
||||
QList<Instructor> ConnectorToServer::getListInstructors()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listInstructors;
|
||||
}
|
||||
|
||||
QList<Trainee> ConnectorToServer::getListTrainees()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listTrainees;
|
||||
}
|
||||
|
||||
QList<Group> ConnectorToServer::getListGroups()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listGroups;
|
||||
}
|
||||
|
||||
QList<Computer> ConnectorToServer::getListComputers()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listComputers;
|
||||
}
|
||||
|
||||
QList<Classroom> ConnectorToServer::getListClassrooms()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
return listClassrooms;
|
||||
}
|
||||
|
||||
QList<TaskAmmFim> ConnectorToServer::getListTasksAMMforTrainee(int trainee_id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
if(mapTasksAMM.contains(trainee_id))
|
||||
return mapTasksAMM.value(trainee_id);
|
||||
else
|
||||
return QList<TaskAmmFim>();
|
||||
}
|
||||
|
||||
QList<TaskAmmFim> ConnectorToServer::getListTasksFIMforTrainee(int trainee_id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
if(mapTasksFIM.contains(trainee_id))
|
||||
return mapTasksFIM.value(trainee_id);
|
||||
else
|
||||
return QList<TaskAmmFim>();
|
||||
}
|
||||
|
||||
QList<SubProc> ConnectorToServer::getListSubProcForDMCode(QString dmCode)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
if(mapSubProc.contains(dmCode))
|
||||
return mapSubProc.value(dmCode);
|
||||
else
|
||||
return QList<SubProc>();
|
||||
}
|
||||
|
||||
int ConnectorToServer::getCountTasksAMMforTrainee(int trainee_id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
if(mapTasksAMM.contains(trainee_id))
|
||||
return mapTasksAMM.value(trainee_id).count();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ConnectorToServer::getCountTasksFIMforTrainee(int trainee_id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
if(mapTasksFIM.contains(trainee_id))
|
||||
return mapTasksFIM.value(trainee_id).count();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isArchivedInstructor(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
{
|
||||
if(instructor.getArchived()) return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isAdminInstructor(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
{
|
||||
if(instructor.getIsAdmin()) return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isLoggedInInstructor(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
{
|
||||
if(instructor.getLoggedIn()) return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Instructor ConnectorToServer::getInstructor(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
return instructor;
|
||||
}
|
||||
return Instructor();
|
||||
}
|
||||
|
||||
QList<Trainee> ConnectorToServer::getListTraineesInGroup(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
QList<Trainee> list;
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getGroup().getID() == id)
|
||||
list.append(trainee);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isArchivedTrainee(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getID() == id)
|
||||
{
|
||||
if(trainee.getArchived()) return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isLoggedInTrainee(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getID() == id)
|
||||
{
|
||||
if(trainee.getLoggedIn()) return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Trainee ConnectorToServer::getTrainee(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getID() == id)
|
||||
return trainee;
|
||||
}
|
||||
return Trainee();
|
||||
}
|
||||
|
||||
Group ConnectorToServer::getGroup(int id)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Group group : listGroups)
|
||||
{
|
||||
if(group.getID() == id)
|
||||
return group;
|
||||
}
|
||||
return Group();
|
||||
}
|
||||
|
||||
int ConnectorToServer::getIdTraineeByLogin(QString login)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getLogin() == login)
|
||||
return trainee.getID();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ConnectorToServer::getIdInstructorByLogin(QString login)
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getLogin() == login)
|
||||
return instructor.getID();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ConnectorToServer::clearListModelDB()
|
||||
{
|
||||
QMutexLocker locker(&mtxAccess);
|
||||
|
||||
listInstructors.clear();
|
||||
listGroups.clear();
|
||||
listTrainees.clear();
|
||||
listComputers.clear();
|
||||
listClassrooms.clear();
|
||||
mapTasksAMM.clear();
|
||||
mapTasksFIM.clear();
|
||||
|
||||
mapSubProc.clear();
|
||||
|
||||
listTaskFimArray.clear();
|
||||
listTaskAmmArray.clear();
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
#include "connectortoserver.h"
|
||||
|
||||
bool ConnectorToServer::sendAuthorizationInstructorLocal(QString login, QString password)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ClientAutorization *autorization = new ClientAutorization;
|
||||
autorization->Login = login;
|
||||
autorization->Password = password;
|
||||
autorization->TypeClient = TypeClientAutorization::TYPE_GUI;
|
||||
|
||||
QByteArray array = dataParser->createAuthMessage(autorization);
|
||||
emit sigSendAnswerToServer(array);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::sendDeAuthorizationInstructorLocal(QString login)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ClientDeAutorization *deAutorization = new ClientDeAutorization;
|
||||
deAutorization->Login = login;
|
||||
|
||||
QByteArray array = dataParser->createDeAuthMessage(deAutorization);
|
||||
emit sigSendAnswerToServer(array);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::sendQueryToDB(TypeQueryToDB typeQuery, int id, void* data)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ClientQueryToDB *queryToDB = new ClientQueryToDB;
|
||||
queryToDB->typeQuery = typeQuery;
|
||||
|
||||
QByteArray array = dataParser->createQueryToDBMessage(queryToDB, id, data);
|
||||
emit sigSendAnswerToServer(array);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::sendMessage(ClientMessage clientMessage)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
QByteArray array = dataParser->createMessage(clientMessage);
|
||||
emit sigSendAnswerToServer(array);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::sendClientNotify(QString command)
|
||||
{
|
||||
QByteArray answer = dataParser->xmlAnswer_notify(command);
|
||||
emit sigSendAnswerToServer(answer);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::sendQueryTasksXML(QString type)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QByteArray array = dataParser->createQueryTasksXMLMessage(type);
|
||||
emit sigSendAnswerToServer(array);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::sendQueryListSubProc(QString dmCode)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QByteArray array = dataParser->createQueryListSubProcMessage(dmCode);
|
||||
emit sigSendAnswerToServer(array);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::sendQueryBlockAuth(bool block)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QByteArray array = dataParser->createQueryBlockAuth(block);
|
||||
emit sigSendAnswerToServer(array);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ConnectorToServer::sendShowVersionSelect()
|
||||
{
|
||||
QByteArray answer = dataParser->xmlAnswer_notify(cmd_CheckVersionList);
|
||||
emit sigSendAnswerToServer(answer);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
#ifndef STREAMINGVERSIONDATA_H
|
||||
#define STREAMINGVERSIONDATA_H
|
||||
|
||||
#include <QObject>
|
||||
#include <qdatetime.h>
|
||||
|
||||
class StreamingVersionData
|
||||
{
|
||||
public:
|
||||
|
||||
StreamingVersionData(){}
|
||||
|
||||
StreamingVersionData(QString absoltePath,QString viewName,QDateTime data,qint32 size)
|
||||
{
|
||||
this->absolutePath = absoltePath;
|
||||
this->viewName = viewName;
|
||||
this->createData = data;
|
||||
this->size = size;
|
||||
this->author = "";
|
||||
}
|
||||
|
||||
void setName(QString viewName)
|
||||
{
|
||||
this->viewName = viewName;
|
||||
}
|
||||
|
||||
void setCreateData(QDateTime data)
|
||||
{
|
||||
this->createData = data;
|
||||
}
|
||||
|
||||
~StreamingVersionData();
|
||||
|
||||
QString getAbsolutPath() const
|
||||
{
|
||||
return absolutePath;
|
||||
}
|
||||
|
||||
QString getViewName() const
|
||||
{
|
||||
return viewName;
|
||||
}
|
||||
|
||||
QDateTime getCreateData() const
|
||||
{
|
||||
return createData;
|
||||
}
|
||||
|
||||
qint32 getSize() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
|
||||
bool getIsChangeable() const
|
||||
{
|
||||
return isChangeable;
|
||||
}
|
||||
|
||||
void setIsChangeable(bool value)
|
||||
{
|
||||
isChangeable = value;
|
||||
}
|
||||
|
||||
QString getAuthor() const
|
||||
{
|
||||
return author;
|
||||
}
|
||||
|
||||
void setAuthor(const QString &value)
|
||||
{
|
||||
author = value;
|
||||
}
|
||||
|
||||
private:
|
||||
QString absolutePath;
|
||||
QString viewName;
|
||||
QString author;
|
||||
QDateTime createData;
|
||||
bool isChangeable;
|
||||
qint32 size;
|
||||
};
|
||||
|
||||
#endif // STREAMINGVERSIONDATA_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
14
LibInstructorsAndTrainees/dialognewpassword.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "dialognewpassword.h"
|
||||
#include "ui_dialognewpassword.h"
|
||||
|
||||
DialogNewPassword::DialogNewPassword(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogNewPassword)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DialogNewPassword::~DialogNewPassword()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
22
LibInstructorsAndTrainees/dialognewpassword.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef DIALOGNEWPASSWORD_H
|
||||
#define DIALOGNEWPASSWORD_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class DialogNewPassword;
|
||||
}
|
||||
|
||||
class DialogNewPassword : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogNewPassword(QWidget *parent = nullptr);
|
||||
~DialogNewPassword();
|
||||
|
||||
private:
|
||||
Ui::DialogNewPassword *ui;
|
||||
};
|
||||
|
||||
#endif // DIALOGNEWPASSWORD_H
|
||||
38
LibInstructorsAndTrainees/dialognewpassword.ui
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DialogNewPassword</class>
|
||||
<widget class="QDialog" name="DialogNewPassword">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>277</width>
|
||||
<height>95</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editPassword1"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editPassword2"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnOK">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
158
LibInstructorsAndTrainees/instructors/dialogeditinstructor.cpp
Normal file
@@ -0,0 +1,158 @@
|
||||
#include "dialogeditinstructor.h"
|
||||
#include "ui_dialogeditinstructor.h"
|
||||
#include "hashtools.h"
|
||||
#include <QPushButton>
|
||||
#include <QRegExpValidator>
|
||||
#include <QToolTip>
|
||||
|
||||
DialogEditInstructor::DialogEditInstructor(bool adminMode, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogEditInstructor),
|
||||
instructorInput(),
|
||||
flNeedHashPassword(false),
|
||||
adminMode(adminMode)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
verify();
|
||||
|
||||
ui->editName->setProperty("mandatoryField", true);
|
||||
ui->editLogin->setProperty("mandatoryField", true);
|
||||
ui->editPassword->setProperty("mandatoryField", true);
|
||||
|
||||
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);
|
||||
//#ifndef PROJECT_TYPE_DEBUG
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
|
||||
//#endif
|
||||
|
||||
ui->btnViewPassword->setEnabled(false);
|
||||
ui->btnChangePassword->setEnabled(false);
|
||||
|
||||
ui->btnOK->setEnabled(false);
|
||||
}
|
||||
|
||||
DialogEditInstructor::~DialogEditInstructor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DialogEditInstructor::setInstructor(Instructor instructor)
|
||||
{
|
||||
instructorInput = instructor;
|
||||
|
||||
ui->editName ->setText(instructor.getName());
|
||||
ui->editLogin->setText(instructor.getLogin());
|
||||
ui->editPassword->setText(instructor.getPassword());
|
||||
|
||||
ui->checkIsAdmin->setChecked(instructor.getIsAdmin());
|
||||
ui->checkArchived->setChecked(instructor.getArchived());
|
||||
ui->checkLoggedIn->setChecked(instructor.getLoggedIn());
|
||||
|
||||
if(instructor.getIsAdmin())
|
||||
{
|
||||
ui->editName->setEnabled(false);
|
||||
ui->editLogin->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->editName->setEnabled(true);
|
||||
ui->editLogin->setEnabled(true);
|
||||
}
|
||||
|
||||
if(instructor.getNeedSetPassword())
|
||||
{
|
||||
ui->editPassword->setEnabled(true);
|
||||
ui->btnViewPassword->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(adminMode)
|
||||
ui->btnChangePassword->setEnabled(true);
|
||||
}
|
||||
|
||||
ui->btnOK->setEnabled(false);
|
||||
}
|
||||
|
||||
Instructor DialogEditInstructor::getInstructor()
|
||||
{
|
||||
Instructor instructor = instructorInput;
|
||||
|
||||
instructor.setName(ui->editName->text());
|
||||
instructor.setLogin(ui->editLogin->text());
|
||||
|
||||
if(flNeedHashPassword)
|
||||
{
|
||||
QString psw = ui->editPassword->text();
|
||||
psw = HashTools::hashingMD5string(psw);
|
||||
instructor.setPassword(psw);
|
||||
}
|
||||
else
|
||||
instructor.setPassword(ui->editPassword->text());
|
||||
|
||||
instructor.setIsAdmin(ui->checkIsAdmin->isChecked());
|
||||
instructor.setArchived(ui->checkArchived->isChecked());
|
||||
instructor.setLoggedIn(ui->checkLoggedIn->isChecked());
|
||||
|
||||
return instructor;
|
||||
}
|
||||
|
||||
void DialogEditInstructor::on_editName_textChanged(const QString &arg1)
|
||||
{
|
||||
verify();
|
||||
}
|
||||
|
||||
void DialogEditInstructor::on_editLogin_textChanged(const QString &arg1)
|
||||
{
|
||||
verify();
|
||||
}
|
||||
|
||||
void DialogEditInstructor::on_editPassword_textChanged(const QString &arg1)
|
||||
{
|
||||
verify();
|
||||
}
|
||||
|
||||
void DialogEditInstructor::verify()
|
||||
{
|
||||
if(ui->editName->text().trimmed() == QStringLiteral("") ||
|
||||
ui->editLogin->text().trimmed() == QStringLiteral("") ||
|
||||
ui->editPassword->text().trimmed() == QStringLiteral(""))
|
||||
ui->btnOK->setEnabled(false);
|
||||
else
|
||||
ui->btnOK->setEnabled(true);
|
||||
}
|
||||
|
||||
void DialogEditInstructor::on_btnOK_clicked()
|
||||
{
|
||||
this->accept();
|
||||
}
|
||||
|
||||
void DialogEditInstructor::on_btnViewPassword_pressed()
|
||||
{
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Normal);
|
||||
}
|
||||
|
||||
void DialogEditInstructor::on_btnViewPassword_released()
|
||||
{
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
|
||||
}
|
||||
|
||||
void DialogEditInstructor::on_btnChangePassword_clicked()
|
||||
{
|
||||
ui->editPassword->setEnabled(true);
|
||||
ui->btnViewPassword->setEnabled(true);
|
||||
|
||||
ui->editPassword->setText("");
|
||||
flNeedHashPassword = true;
|
||||
|
||||
ui->editPassword->setFocus();
|
||||
}
|
||||
|
||||
void DialogEditInstructor::on_editLogin_inputRejected()
|
||||
{
|
||||
QToolTip::showText(QCursor::pos(),tr("Only Latin letters and numbers"));
|
||||
}
|
||||
53
LibInstructorsAndTrainees/instructors/dialogeditinstructor.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef DIALOGEDITINSTRUCTOR_H
|
||||
#define DIALOGEDITINSTRUCTOR_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "instructor.h"
|
||||
//#include "ui_dialogeditinstructor.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogEditInstructor;
|
||||
}
|
||||
|
||||
class DialogEditInstructor : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogEditInstructor(bool adminMode, QWidget *parent = nullptr);
|
||||
~DialogEditInstructor();
|
||||
|
||||
void setInstructor(Instructor instructor);
|
||||
Instructor getInstructor();
|
||||
|
||||
private slots:
|
||||
void on_editName_textChanged(const QString &arg1);
|
||||
|
||||
void on_editLogin_textChanged(const QString &arg1);
|
||||
|
||||
void on_editPassword_textChanged(const QString &arg1);
|
||||
|
||||
void on_btnOK_clicked();
|
||||
|
||||
void on_btnViewPassword_pressed();
|
||||
|
||||
void on_btnViewPassword_released();
|
||||
|
||||
void on_btnChangePassword_clicked();
|
||||
|
||||
void on_editLogin_inputRejected();
|
||||
|
||||
private:
|
||||
void verify();
|
||||
|
||||
private:
|
||||
Ui::DialogEditInstructor *ui;
|
||||
|
||||
Instructor instructorInput;
|
||||
|
||||
bool flNeedHashPassword;
|
||||
|
||||
bool adminMode;
|
||||
};
|
||||
|
||||
#endif // DIALOGEDITINSTRUCTOR_H
|
||||
247
LibInstructorsAndTrainees/instructors/dialogeditinstructor.ui
Normal file
@@ -0,0 +1,247 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DialogEditInstructor</class>
|
||||
<widget class="QDialog" name="DialogEditInstructor">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>470</width>
|
||||
<height>286</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Instructor</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Login</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editLogin"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_Password">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editPassword"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnViewPassword">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/eye.png</normaloff>:/resources/icons/eye.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnChangePassword">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/exchange.png</normaloff>:/resources/icons/exchange.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="lineWidth">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkIsAdmin">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Administrator</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/admin.png</normaloff>
|
||||
<disabledoff>:/resources/icons/admin.png</disabledoff>:/resources/icons/admin.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkArchived">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Archived</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/archive.png</normaloff>
|
||||
<disabledoff>:/resources/icons/archive.png</disabledoff>:/resources/icons/archive.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkLoggedIn">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Online</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/circleGreen.png</normaloff>
|
||||
<disabledoff>:/resources/icons/circleGreen.png</disabledoff>:/resources/icons/circleGreen.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnOK">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../InstructorsAndTrainees.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,33 @@
|
||||
#include <QHBoxLayout>
|
||||
#include "dialogredactorinstructors.h"
|
||||
|
||||
DialogRedactorInstructors::DialogRedactorInstructors(ConnectorToServer* connectorToServer,
|
||||
bool adminMode, QWidget *parent) :
|
||||
QDialog(parent,
|
||||
Qt::WindowSystemMenuHint
|
||||
| Qt::WindowMaximizeButtonHint
|
||||
| Qt::WindowMinimizeButtonHint
|
||||
| Qt::WindowCloseButtonHint),
|
||||
editorInstructors(nullptr)
|
||||
{
|
||||
editorInstructors = new EditorInstructors(connectorToServer, adminMode, this);
|
||||
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, editorInstructors, &EditorInstructors::slot_NeedUpdateUI);
|
||||
editorInstructors->activate();
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
||||
layout->addWidget(editorInstructors);
|
||||
this->setWindowTitle(tr("Editor of instructors"));
|
||||
this->setMinimumSize(1400, 700);
|
||||
//this->setWindowState(Qt::WindowMaximized);
|
||||
this->setModal(true);
|
||||
}
|
||||
|
||||
DialogRedactorInstructors::~DialogRedactorInstructors()
|
||||
{
|
||||
delete editorInstructors;
|
||||
}
|
||||
|
||||
void DialogRedactorInstructors::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
editorInstructors->close();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef DIALOGREDACTORINSTRUCTORS_H
|
||||
#define DIALOGREDACTORINSTRUCTORS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QObject>
|
||||
#include "connectortoserver.h"
|
||||
#include "editorinstructors.h"
|
||||
|
||||
class DialogRedactorInstructors : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DialogRedactorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
|
||||
~DialogRedactorInstructors();
|
||||
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
private:
|
||||
EditorInstructors* editorInstructors;
|
||||
};
|
||||
|
||||
#endif // DIALOGREDACTORINSTRUCTORS_H
|
||||
371
LibInstructorsAndTrainees/instructors/editorinstructors.cpp
Normal file
@@ -0,0 +1,371 @@
|
||||
#include <QMessageBox>
|
||||
#include "editorinstructors.h"
|
||||
#include "specialmessagebox.h"
|
||||
#include "ui_editorinstructors.h"
|
||||
|
||||
EditorInstructors::EditorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent) :
|
||||
InstructorsView(connectorToServer, CommonView::TypeView::control, parent),
|
||||
ui(new Ui::EditorInstructors),
|
||||
dlgEditInstructor(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->btnDeleteInstructor->setEnabled(false);
|
||||
ui->btnToOrFromArchive->setEnabled(false);
|
||||
ui->btnEdit->setEnabled(false);
|
||||
|
||||
connect(treeWidget, &QTreeWidget::currentItemChanged, this, &EditorInstructors::on_treeWidgetCurrentItemChanged);
|
||||
|
||||
ui->verticalLayout_1->addWidget(treeWidget);
|
||||
|
||||
this->adminMode = adminMode;
|
||||
|
||||
preparationTreeWidget();
|
||||
//setNotLoggedInVisible(true);
|
||||
loadInstructorsFromDB();
|
||||
|
||||
if(adminMode)
|
||||
ui->btnArchive->click();
|
||||
|
||||
waitAnimationWidget->setParent(this);
|
||||
|
||||
authComplited = true;
|
||||
}
|
||||
|
||||
EditorInstructors::~EditorInstructors()
|
||||
{
|
||||
if(dlgEditInstructor)
|
||||
{
|
||||
dlgEditInstructor->close();
|
||||
delete dlgEditInstructor;
|
||||
dlgEditInstructor = nullptr;
|
||||
}
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void EditorInstructors::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if(dlgEditInstructor)
|
||||
dlgEditInstructor->close();
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnNewInstructor_clicked()
|
||||
{
|
||||
Instructor instructor;
|
||||
Instructor instructor_edit;
|
||||
|
||||
instructor.setNeedSetPassword(true);
|
||||
|
||||
if(editInstructor(instructor, &instructor_edit))
|
||||
{
|
||||
waitAnimationWidget->showWithPlay();
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_INSTRUCTOR, 0, &instructor_edit);
|
||||
}
|
||||
|
||||
lastCurrentID = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnDeleteInstructor_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран Инструктор
|
||||
|
||||
int id = treeItemCurrent->text(ColumnsTreeUsers::clmn_ID).toInt();
|
||||
|
||||
if(connectorToServer->isAdminInstructor(id))
|
||||
{//Это Админ!
|
||||
SpecMsgBox::CriticalClose(this, tr("You cannot delete the Administrator."));
|
||||
return;
|
||||
}
|
||||
|
||||
if(connectorToServer->isLoggedInInstructor(id))
|
||||
{//Инструктор залогирован!
|
||||
SpecMsgBox::CriticalClose(this, tr("You cannot delete a logged-in instructor."));
|
||||
return;
|
||||
}
|
||||
|
||||
if(SpecMsgBox::WarningYesNo(this, tr("The deletion will be irrevocable.\nDelete it anyway?")) == QDialog::Accepted)
|
||||
{
|
||||
waitAnimationWidget->showWithPlay();
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_INSTRUCTOR, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnToOrFromArchive_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран Инструктор
|
||||
|
||||
int id = treeItemCurrent->text(ColumnsTreeUsers::clmn_ID).toInt();
|
||||
|
||||
Instructor instructor = connectorToServer->getInstructor(id);
|
||||
if(instructor.getID() == 0)
|
||||
return;
|
||||
|
||||
if(connectorToServer->isArchivedInstructor(id))
|
||||
{//Архивный
|
||||
instructor.setArchived(false);
|
||||
waitAnimationWidget->showWithPlay();
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor);
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
if(connectorToServer->isLoggedInInstructor(id))
|
||||
{//Инструктор залогирован!
|
||||
SpecMsgBox::CriticalClose(this, tr("You cannot archive a logged-in instructor."));
|
||||
return;
|
||||
}
|
||||
|
||||
instructor.setArchived(true);
|
||||
waitAnimationWidget->showWithPlay();
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor);
|
||||
if(!archiveVisible)
|
||||
ui->btnArchive->click();
|
||||
/*if(int id_edit = dbLMS->editInstructor(instructor))
|
||||
{
|
||||
if(!archiveVisible)
|
||||
ui->btnArchive->click();
|
||||
|
||||
loadInstructorsFromDB();
|
||||
setCurrentInstructor(id_edit);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnEdit_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent == nullptr)
|
||||
return;
|
||||
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран Инструктор
|
||||
|
||||
int id = treeItemCurrent->text(ColumnsTreeUsers::clmn_ID).toInt();
|
||||
|
||||
if(connectorToServer->isLoggedInInstructor(id) && !adminMode)
|
||||
{//Инструктор залогирован!
|
||||
SpecMsgBox::CriticalClose(this, tr("You cannot edit a logged-in instructor."));
|
||||
return;
|
||||
}
|
||||
|
||||
Instructor instructor = connectorToServer->getInstructor(id);
|
||||
if(instructor.getID() == 0)
|
||||
return;
|
||||
|
||||
Instructor instructor_edit;
|
||||
|
||||
if(editInstructor(instructor, &instructor_edit))
|
||||
{
|
||||
waitAnimationWidget->showWithPlay();
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor_edit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnArchive_clicked()
|
||||
{
|
||||
bool state = ui->btnArchive->isChecked();
|
||||
setArchiveVisible(state);
|
||||
if(!state)
|
||||
{
|
||||
Instructor instructor = connectorToServer->getInstructor(lastCurrentID);
|
||||
if(instructor.getID())
|
||||
{
|
||||
if(instructor.getArchived())
|
||||
lastCurrentID = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastCurrentID = 0;
|
||||
}
|
||||
}
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
|
||||
void EditorInstructors::on_treeWidgetCurrentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
||||
{
|
||||
//Определяем доступность и функционал кнопок для выбранного элемента
|
||||
|
||||
if(current == nullptr)
|
||||
{
|
||||
ui->btnDeleteInstructor->setEnabled(false);
|
||||
ui->btnToOrFromArchive->setEnabled(false);
|
||||
ui->btnEdit->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
QTreeWidgetItem *treeItemParent = current->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран инструктор
|
||||
|
||||
int id = current->text(ColumnsTreeUsers::clmn_ID).toInt();
|
||||
|
||||
lastCurrentID = id;
|
||||
|
||||
if(connectorToServer->isArchivedInstructor(id))
|
||||
{//Архивный
|
||||
ui->btnToOrFromArchive->setText(tr("From archive"));
|
||||
ui->btnToOrFromArchive->setIcon(QIcon(QStringLiteral(":/resources/icons/instructorFromArchive.png")));
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
ui->btnToOrFromArchive->setText(tr("To archive"));
|
||||
ui->btnToOrFromArchive->setIcon(QIcon(QStringLiteral(":/resources/icons/instructorArchive.png")));
|
||||
}
|
||||
|
||||
ui->btnNewInstructor->setEnabled(true);
|
||||
|
||||
if(connectorToServer->isAdminInstructor(id))
|
||||
{//Это Админ! Удалять/Архивировать/Редактировать нельзя! (Только сменить пароль, если это он сам)
|
||||
if(adminMode)
|
||||
{
|
||||
ui->btnDeleteInstructor->setEnabled(false);
|
||||
ui->btnToOrFromArchive->setEnabled(false);
|
||||
ui->btnEdit->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnDeleteInstructor->setEnabled(false);
|
||||
ui->btnToOrFromArchive->setEnabled(false);
|
||||
ui->btnEdit->setEnabled(false);
|
||||
}
|
||||
}
|
||||
else if(connectorToServer->isLoggedInInstructor(id))
|
||||
{//Это Админ или залогированный! Удалять/Архивировать/Редактировать нельзя!
|
||||
ui->btnDeleteInstructor->setEnabled(false);
|
||||
ui->btnToOrFromArchive->setEnabled(false);
|
||||
ui->btnEdit->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnToOrFromArchive->setEnabled(true);
|
||||
|
||||
if(connectorToServer->isArchivedInstructor(id))
|
||||
ui->btnDeleteInstructor->setEnabled(true);
|
||||
else
|
||||
ui->btnDeleteInstructor->setEnabled(false);
|
||||
|
||||
ui->btnEdit->setEnabled(true);
|
||||
}
|
||||
|
||||
//ui->btnEdit->setEnabled(true);
|
||||
ui->btnArchive->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnDeleteInstructor->setEnabled(false);
|
||||
ui->btnToOrFromArchive->setEnabled(false);
|
||||
ui->btnEdit->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
bool EditorInstructors::verifyInstructor(Instructor instructor)
|
||||
{
|
||||
//Проверка корректности логина, имени, пароля
|
||||
|
||||
if(instructor.getName() == QStringLiteral("<name>"))
|
||||
{//Имя не корректно!
|
||||
SpecMsgBox::CriticalClose(this, tr("Unacceptable instructor name has been entered.\nThe changes will not be accepted."));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(instructor.getLogin() == QStringLiteral("<login>"))
|
||||
{//Логин не корректен!
|
||||
SpecMsgBox::CriticalClose(this, tr("Unacceptable instructor login has been entered.\nThe changes will not be accepted."));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(instructor.getPassword() == QStringLiteral("<password>"))
|
||||
{//Пароль не корректный!
|
||||
SpecMsgBox::CriticalClose(this, tr("Unacceptable instructor password has been entered.\nThe changes will not be accepted."));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int user_I = connectorToServer->getIdInstructorByLogin(instructor.getLogin());
|
||||
int user_T = connectorToServer->getIdTraineeByLogin(instructor.getLogin());
|
||||
if((user_I && (user_I != instructor.getID())) || (user_T && (user_T != instructor.getID())))
|
||||
{//Логин уже существует!
|
||||
SpecMsgBox::CriticalClose(this, tr("An existing instructor or trainee login has been entered.\nThe changes will not be accepted."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorInstructors::editInstructor(Instructor instructor, Instructor* instructor_edit)
|
||||
{
|
||||
dlgEditInstructor = new DialogEditInstructor(adminMode, this);
|
||||
dlgEditInstructor->setWindowFlags(dlgEditInstructor->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
dlgEditInstructor->setInstructor(instructor);
|
||||
|
||||
bool flStop = false;
|
||||
bool res = false;
|
||||
|
||||
while (!flStop)
|
||||
{
|
||||
switch( dlgEditInstructor->exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
*instructor_edit = dlgEditInstructor->getInstructor();
|
||||
|
||||
if(! verifyInstructor(*instructor_edit))
|
||||
{
|
||||
dlgEditInstructor->setInstructor(*instructor_edit);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(instructor_edit->getNeedSetPassword())
|
||||
{
|
||||
//Хэшируем пароль
|
||||
instructor_edit->hashingPassword();
|
||||
instructor_edit->setNeedSetPassword(false);
|
||||
}
|
||||
|
||||
flStop = true;
|
||||
res = true;
|
||||
break;
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
flStop = true;
|
||||
res = false;
|
||||
break;
|
||||
default:
|
||||
flStop = true;
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(dlgEditInstructor)
|
||||
{
|
||||
delete dlgEditInstructor;
|
||||
dlgEditInstructor = nullptr;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
48
LibInstructorsAndTrainees/instructors/editorinstructors.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef DIALOGINSTRUCTORS_H
|
||||
#define DIALOGINSTRUCTORS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QTreeWidget>
|
||||
#include "instructorsview.h"
|
||||
#include "dialogeditinstructor.h"
|
||||
#include "specialmessagebox.h"
|
||||
|
||||
class DialogEditInstructor;
|
||||
|
||||
namespace Ui {
|
||||
class EditorInstructors;
|
||||
}
|
||||
|
||||
//Виджет для редактирования БД Инструкторов
|
||||
|
||||
class EditorInstructors : public InstructorsView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EditorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
|
||||
~EditorInstructors();
|
||||
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_btnNewInstructor_clicked();
|
||||
void on_btnDeleteInstructor_clicked();
|
||||
void on_btnToOrFromArchive_clicked();
|
||||
void on_btnEdit_clicked();
|
||||
void on_btnArchive_clicked();
|
||||
void on_treeWidgetCurrentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
|
||||
private:
|
||||
//void setCurrentInstructor(int id);
|
||||
bool verifyInstructor(Instructor instructor);
|
||||
|
||||
bool editInstructor(Instructor instructor, Instructor* instructor_edit);
|
||||
|
||||
private:
|
||||
Ui::EditorInstructors *ui;
|
||||
|
||||
DialogEditInstructor* dlgEditInstructor;
|
||||
};
|
||||
|
||||
#endif // DIALOGINSTRUCTORS_H
|
||||
246
LibInstructorsAndTrainees/instructors/editorinstructors.ui
Normal file
@@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EditorInstructors</class>
|
||||
<widget class="QWidget" name="EditorInstructors">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1300</width>
|
||||
<height>800</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>List instructors</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_1"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnNewInstructor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>160</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New instructor</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/addInstructor.png</normaloff>:/resources/icons/addInstructor.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnDeleteInstructor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>160</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete instructor</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/deleteInstructor.png</normaloff>:/resources/icons/deleteInstructor.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnToOrFromArchive">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>160</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>To archive</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/instructorArchive.png</normaloff>:/resources/icons/instructorArchive.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>160</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/edit.png</normaloff>:/resources/icons/edit.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnArchive">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>160</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show archive</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/archive.png</normaloff>:/resources/icons/archive.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../InstructorsAndTrainees.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
150
LibInstructorsAndTrainees/instructors/instructorsview.cpp
Normal file
@@ -0,0 +1,150 @@
|
||||
#include <QHeaderView>
|
||||
#include <QTranslator>
|
||||
#include <QResizeEvent>
|
||||
#include <QScrollBar>
|
||||
#include "instructorsview.h"
|
||||
|
||||
InstructorsView::InstructorsView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
|
||||
CommonView(connectorToServer, type, parent)
|
||||
{
|
||||
typeObject = TypeObject::objInstructor;
|
||||
TypeUserDB = User::TypeUserDBInstructor;
|
||||
}
|
||||
|
||||
void InstructorsView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
||||
{
|
||||
updateButtons();
|
||||
|
||||
if(authComplited)
|
||||
{
|
||||
if(treeInstructor)
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsView::loadInstructorsFromDB()
|
||||
{
|
||||
mtxTreeWidget.lock();
|
||||
|
||||
//Обновление дерева
|
||||
treeWidget->clear();
|
||||
|
||||
//Инструкторы
|
||||
QList<Instructor> listInstructors;
|
||||
|
||||
listInstructors = connectorToServer->getListInstructors();
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
QTreeWidgetItem *ItemInstructor = new QTreeWidgetItem(treeWidget);
|
||||
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_ID, QString::number(instructor.getID()));
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_Name, instructor.getName());
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_Login, instructor.getLogin());
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_Password, instructor.getPassword());
|
||||
|
||||
//Сокрытие пароля
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_Password, QStringLiteral("******"));
|
||||
|
||||
if(instructor.getArchived())
|
||||
{//Архивный
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_Archived, tr("yes"));
|
||||
ItemInstructor->setIcon(ColumnsTreeUsers::clmn_Name, QIcon(QStringLiteral(":/resources/icons/archive.png")));
|
||||
setItemColorArchive(ItemInstructor);
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_Archived, tr("no"));
|
||||
ItemInstructor->setIcon(ColumnsTreeUsers::clmn_Name, QIcon(QStringLiteral(":/resources/icons/instructor.png")));
|
||||
setItemColorNoArchive(ItemInstructor);
|
||||
}
|
||||
|
||||
if(instructor.getIsAdmin())
|
||||
{//Админ
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_Administrator, tr("yes"));
|
||||
ItemInstructor->setIcon(ColumnsTreeUsers::clmn_Name, QIcon(QStringLiteral(":/resources/icons/admin.png")));
|
||||
}
|
||||
else
|
||||
{//Не Админ
|
||||
ItemInstructor->setText(ColumnsTreeUsers::clmn_Administrator, tr("no"));
|
||||
}
|
||||
|
||||
if(instructor.getLoggedIn())
|
||||
{//Залогинен
|
||||
//ItemInstructor->setText(ColumnsTreeUsers::clmn_Logged, tr("yes"));
|
||||
ItemInstructor->setIcon(ColumnsTreeUsers::clmn_Logged, QIcon(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||
}
|
||||
else
|
||||
{//Не Залогинен
|
||||
//ItemInstructor->setText(ColumnsTreeUsers::clmn_Logged, tr("no"));
|
||||
ItemInstructor->setIcon(ColumnsTreeUsers::clmn_Logged, QIcon(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
}
|
||||
|
||||
//Скрываем архивных (при необходимости)
|
||||
if(instructor.getArchived())
|
||||
if(! archiveVisible)
|
||||
ItemInstructor->setHidden(true);
|
||||
|
||||
//Скрываем незалогиненых (при необходимости)
|
||||
if(! instructor.getLoggedIn())
|
||||
if(! notLoggedInVisible)
|
||||
ItemInstructor->setHidden(true);
|
||||
|
||||
mtxmapNewMsg.lock();
|
||||
if(mapNewMsg.contains(instructor.getID()))
|
||||
{//Есть непрочитанные сообщения от него
|
||||
if(mapNewMsg.value(instructor.getID()))
|
||||
{
|
||||
if(lastCurrentID == instructor.getID())
|
||||
mapNewMsg.take(lastCurrentID);
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < ColumnsTreeUsers::clmn_count; i++)
|
||||
{
|
||||
ItemInstructor->setBackground(i, QBrush(QColor(250, 210, 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mtxmapNewMsg.unlock();
|
||||
}
|
||||
|
||||
treeWidget->expandAll();
|
||||
|
||||
/*
|
||||
//if(typeView == TypeView::control)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
|
||||
if(item != nullptr)
|
||||
treeWidget->setCurrentItem(item);
|
||||
}*/
|
||||
|
||||
setCurrentInstructor(lastCurrentID);
|
||||
|
||||
treeWidget->sortItems(ColumnsTreeUsers::clmn_Name, Qt::SortOrder::AscendingOrder);
|
||||
|
||||
mtxTreeWidget.unlock();
|
||||
|
||||
waitAnimationWidget->hideWithStop();
|
||||
}
|
||||
|
||||
void InstructorsView::setCurrentInstructor(int id)
|
||||
{
|
||||
for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
|
||||
if(item != nullptr)
|
||||
if(item->text(ColumnsTreeUsers::clmn_ID).toInt() == id)
|
||||
{
|
||||
treeWidget->setCurrentItem(item);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
|
||||
if(item != nullptr)
|
||||
treeWidget->setCurrentItem(item);
|
||||
*/
|
||||
}
|
||||
|
||||
26
LibInstructorsAndTrainees/instructors/instructorsview.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef INSTRUCTORSVIEW_H
|
||||
#define INSTRUCTORSVIEW_H
|
||||
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "commonview.h"
|
||||
|
||||
//Родительский класс представления БД Инструкторов (для просмотра и управления)
|
||||
|
||||
class InstructorsView: public CommonView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
InstructorsView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent = nullptr);
|
||||
|
||||
public Q_SLOTS:
|
||||
//Слот обработки сигнала необходимости обновления интерфейса
|
||||
void slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee);
|
||||
|
||||
protected:
|
||||
virtual void updateButtons(){};
|
||||
void loadInstructorsFromDB();
|
||||
void setCurrentInstructor(int id);
|
||||
};
|
||||
|
||||
#endif // INSTRUCTORSVIEW_H
|
||||
143
LibInstructorsAndTrainees/instructors/viewerinstructors.cpp
Normal file
@@ -0,0 +1,143 @@
|
||||
#include <QMessageBox>
|
||||
#include "editorinstructors.h"
|
||||
#include "viewerinstructors.h"
|
||||
#include "ui_viewerinstructors.h"
|
||||
|
||||
ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent) :
|
||||
InstructorsView(connectorToServer, CommonView::TypeView::onlyView, parent),
|
||||
dlgRedactor(nullptr),
|
||||
ui(new Ui::ViewerInstructors)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(treeWidget, &QTreeWidget::itemClicked, this, &ViewerInstructors::on_treeWidgetItemClicked);
|
||||
|
||||
ui->horizontalLayout_1->addWidget(treeWidget);
|
||||
|
||||
//treeWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
|
||||
preparationTreeWidget();
|
||||
setNotLoggedInVisible(true);
|
||||
|
||||
ui->btnEditorInstructors->setVisible(false);
|
||||
}
|
||||
|
||||
ViewerInstructors::~ViewerInstructors()
|
||||
{
|
||||
if(dlgRedactor)
|
||||
{
|
||||
dlgRedactor->close();
|
||||
delete dlgRedactor;
|
||||
dlgRedactor = nullptr;
|
||||
}
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ViewerInstructors::setAuthComplited(bool authComplited)
|
||||
{
|
||||
this->authComplited = authComplited;
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
void ViewerInstructors::deactivate()
|
||||
{
|
||||
if(dlgRedactor)
|
||||
{
|
||||
dlgRedactor->close();
|
||||
delete dlgRedactor;
|
||||
dlgRedactor = nullptr;
|
||||
}
|
||||
|
||||
CommonView::deactivate();
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
void ViewerInstructors::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{// переведём окно заново
|
||||
ui->retranslateUi(this);
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
slot_NeedUpdateUI(true, false);
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerInstructors::slot_receiveMessage(ClientMessage clientMessage)
|
||||
{
|
||||
int id_instructor = clientMessage.fromId.toInt();
|
||||
|
||||
mtxmapNewMsg.lock();
|
||||
mapNewMsg.insert(id_instructor, true);
|
||||
mtxmapNewMsg.unlock();
|
||||
|
||||
slot_NeedUpdateUI(true, false);
|
||||
}
|
||||
|
||||
void ViewerInstructors::on_btnEditorInstructors_clicked()
|
||||
{
|
||||
connectorToServer->sendQueryBlockAuth(true);
|
||||
|
||||
dlgRedactor = new DialogRedactorInstructors(connectorToServer, adminMode, this);
|
||||
dlgRedactor->exec();
|
||||
|
||||
if(dlgRedactor)
|
||||
{
|
||||
delete dlgRedactor;
|
||||
dlgRedactor = nullptr;
|
||||
}
|
||||
|
||||
if(authComplited)
|
||||
loadInstructorsFromDB();
|
||||
|
||||
connectorToServer->sendQueryBlockAuth(false);
|
||||
}
|
||||
|
||||
void ViewerInstructors::on_treeWidgetItemClicked(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
if(item == nullptr)
|
||||
return;
|
||||
|
||||
//if(current->childCount() == 0)
|
||||
{//Выбран обучаемый
|
||||
QString login = item->text(ColumnsTreeUsers::clmn_Login);
|
||||
//if(login != "")
|
||||
{
|
||||
int newCurrentID = connectorToServer->getIdInstructorByLogin(login);
|
||||
|
||||
//if(newCurrentID == lastCurrentID)
|
||||
//return;
|
||||
|
||||
lastCurrentID = newCurrentID;
|
||||
|
||||
mtxmapNewMsg.lock();
|
||||
if(mapNewMsg.contains(newCurrentID))
|
||||
{//Есть непрочитанные сообщения от него
|
||||
if(mapNewMsg.value(newCurrentID))
|
||||
{
|
||||
for (int i = 0; i < ColumnsTreeUsers::clmn_count; i++)
|
||||
{
|
||||
item->setBackground(i, QBrush(Qt::GlobalColor::white));
|
||||
}
|
||||
mapNewMsg.take(newCurrentID);
|
||||
}
|
||||
}
|
||||
mtxmapNewMsg.unlock();
|
||||
|
||||
Q_EMIT signal_instructorSelected(newCurrentID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerInstructors::updateButtons()
|
||||
{
|
||||
if(adminMode && authComplited)
|
||||
{
|
||||
ui->btnEditorInstructors->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnEditorInstructors->setEnabled(false);
|
||||
}
|
||||
}
|
||||
51
LibInstructorsAndTrainees/instructors/viewerinstructors.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef INSTRUCTORSWIDGET_H
|
||||
#define INSTRUCTORSWIDGET_H
|
||||
|
||||
#include "instructorsview.h"
|
||||
#include "dialogredactorinstructors.h"
|
||||
|
||||
namespace Ui {
|
||||
class ViewerInstructors;
|
||||
}
|
||||
|
||||
//Виджет только для просмотра БД Инструкторов
|
||||
|
||||
class ViewerInstructors : public InstructorsView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent = nullptr);
|
||||
~ViewerInstructors();
|
||||
|
||||
public:
|
||||
void setAuthComplited(bool authComplited);
|
||||
|
||||
void deactivate();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
public slots:
|
||||
void slot_receiveMessage(ClientMessage clientMessage);
|
||||
|
||||
public Q_SLOTS:
|
||||
void on_btnEditorInstructors_clicked();
|
||||
|
||||
void on_treeWidgetItemClicked(QTreeWidgetItem *item, int column);
|
||||
|
||||
Q_SIGNALS:
|
||||
//сигнал о выборе инструктора
|
||||
void signal_instructorSelected(int id_instructor);
|
||||
|
||||
private:
|
||||
void updateButtons() override;
|
||||
|
||||
private:
|
||||
DialogRedactorInstructors* dlgRedactor;
|
||||
|
||||
private:
|
||||
Ui::ViewerInstructors *ui;
|
||||
};
|
||||
|
||||
#endif // INSTRUCTORSWIDGET_H
|
||||
73
LibInstructorsAndTrainees/instructors/viewerinstructors.ui
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ViewerInstructors</class>
|
||||
<widget class="QWidget" name="ViewerInstructors">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Instructors</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_0">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnEditorInstructors">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Editor of Instructors</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/DB-instructors.png</normaloff>:/resources/icons/DB-instructors.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../InstructorsAndTrainees.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
12
LibInstructorsAndTrainees/instructorsAndTrainees_global.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef INSTRUCTORSANDTRAINEES_GLOBAL_H
|
||||
#define INSTRUCTORSANDTRAINEES_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(INSTRUCTORSANDTRAINEES_LIBRARY)
|
||||
# define INSTRUCTORSANDTRAINEES_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define INSTRUCTORSANDTRAINEES_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // INSTRUCTORSANDTRAINEES_GLOBAL_H
|
||||
727
LibInstructorsAndTrainees/instructorsandtraineeswidget.cpp
Normal file
@@ -0,0 +1,727 @@
|
||||
#include <QMessageBox>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include "instructorsandtraineeswidget.h"
|
||||
#include "ui_instructorsandtraineeswidget.h"
|
||||
#include "dialogauthorization.h"
|
||||
#include "dialogsettings.h"
|
||||
#include "specialmessagebox.h"
|
||||
#include "hashtools.h"
|
||||
#include "widgettools.h"
|
||||
|
||||
|
||||
const QString InstructorsAndTraineesWidget::languageENG = "en_EN";
|
||||
const QString InstructorsAndTraineesWidget::languageRUS = "ru_RU";
|
||||
|
||||
|
||||
InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
connectorToServer(nullptr),
|
||||
viewerTrainees(nullptr),
|
||||
viewerInstructors(nullptr),
|
||||
messangerWidget(nullptr),
|
||||
messangerController(nullptr),
|
||||
dlgTasksCommon(nullptr),
|
||||
dlgSettings(nullptr),
|
||||
dlgAuthorization(nullptr),
|
||||
waitAnimationWidget(nullptr),
|
||||
flSettingsServerIsChanged(false),
|
||||
flTryConnectToServer(false),
|
||||
cntTryConnectToServer(0),
|
||||
flTryLogin(false),
|
||||
language(languageENG),
|
||||
ui(new Ui::InstructorsAndTraineesWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
//Пока не нужно
|
||||
ui->btnTasksCommon->setVisible(false);
|
||||
|
||||
qDebug() << "InstructorsAndTraineesWidget init thread ID " << QThread::currentThreadId();
|
||||
|
||||
ui->widget_Control->setObjectName("widgetControl");
|
||||
|
||||
registerMetaType();
|
||||
|
||||
updateMyStyleSheet();
|
||||
|
||||
setLanguageInterfase();
|
||||
|
||||
connectorToServer = new ConnectorToServer();
|
||||
connect(connectorToServer, &ConnectorToServer::sigLoginResult, this, &InstructorsAndTraineesWidget::slot_checkLoginResult);
|
||||
connect(connectorToServer, &ConnectorToServer::sigDeLoginResult, this, &InstructorsAndTraineesWidget::slot_checkDeLoginResult);
|
||||
connect(connectorToServer, &ConnectorToServer::sigServerBlocked, this, &InstructorsAndTraineesWidget::slot_ServerBlocked);
|
||||
connect(connectorToServer, &ConnectorToServer::sigErrorAuth, this, &InstructorsAndTraineesWidget::slot_ErrorAuth);
|
||||
connect(connectorToServer, &ConnectorToServer::signal_SetVersion, this, &InstructorsAndTraineesWidget::slot_SetVersion);
|
||||
connect(connectorToServer, &ConnectorToServer::signal_AnswerDocsChanged,this, &InstructorsAndTraineesWidget::slot_AnswerDocsChanged);
|
||||
|
||||
messangerController = new MessangerController(connectorToServer, this);
|
||||
|
||||
viewerTrainees = new ViewerTrainees(connectorToServer, messangerController, this);
|
||||
viewerInstructors = new ViewerInstructors(connectorToServer, this);
|
||||
connect(this, &InstructorsAndTraineesWidget::signal_NeedUpdateUI, viewerTrainees, &ViewerTrainees::slot_NeedUpdateUI);
|
||||
connect(this, &InstructorsAndTraineesWidget::signal_NeedUpdateUI, viewerInstructors, &ViewerInstructors::slot_NeedUpdateUI);
|
||||
|
||||
connect(connectorToServer, &ConnectorToServer::signal_ConnectedToServer, this, &InstructorsAndTraineesWidget::slot_ConnectedToServer);
|
||||
|
||||
connect(viewerTrainees, &ViewerTrainees::signal_traineeSelected, this, &InstructorsAndTraineesWidget::slot_traineeSelected);
|
||||
connect(viewerInstructors, &ViewerInstructors::signal_instructorSelected, this, &InstructorsAndTraineesWidget::slot_instructorSelected);
|
||||
|
||||
connect(messangerController, &MessangerController::signal_receiveMessage_fromInstructor, viewerInstructors, &ViewerInstructors::slot_receiveMessage);
|
||||
connect(messangerController, &MessangerController::signal_receiveMessage_fromTrainee, viewerTrainees, &ViewerTrainees::slot_receiveMessage);
|
||||
|
||||
viewerTrainees->clearSelection();
|
||||
viewerInstructors->clearSelection();
|
||||
|
||||
//Размещение
|
||||
ui->verticalLayout_Trainees->addWidget(viewerTrainees);
|
||||
ui->verticalLayout_Instructors->addWidget(viewerInstructors);
|
||||
|
||||
ui->groupBox_Messenger->setMinimumHeight(600);
|
||||
|
||||
ui->groupBox_Messenger->setMaximumWidth(500);
|
||||
ui->groupBox_Messenger->setMinimumWidth(500);
|
||||
|
||||
ui->groupBox_Instructors->setMinimumHeight(200);
|
||||
ui->groupBox_Instructors->setMaximumHeight(300);
|
||||
|
||||
ui->groupBox_Trainees->setMinimumHeight(400);
|
||||
|
||||
ui->groupBox_Trainees->setMinimumWidth(600);
|
||||
ui->groupBox_Instructors->setMinimumWidth(600);
|
||||
|
||||
|
||||
//Доступность кнопок
|
||||
ui->btnAuthorizationInstructor->setEnabled(false);
|
||||
ui->btnEditorTrainees->setEnabled(false);
|
||||
ui->btnEditorInstructors->setEnabled(false);
|
||||
ui->btnPersonalCard->setEnabled(false);
|
||||
|
||||
waitAnimationWidget = new WaitAnimationWidget;
|
||||
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||
waitAnimationWidget->setParent(this);
|
||||
waitAnimationWidget->initialize(movie,this);
|
||||
|
||||
ui->btnConnectionToServer->click();
|
||||
}
|
||||
|
||||
InstructorsAndTraineesWidget::~InstructorsAndTraineesWidget()
|
||||
{
|
||||
if(authorizationIsCompleted())
|
||||
deAuthorizationInstructor(instructorLoggedInLocal.getLogin());
|
||||
|
||||
if(dlgTasksCommon)
|
||||
{
|
||||
dlgTasksCommon->close();
|
||||
delete dlgTasksCommon;
|
||||
dlgTasksCommon = nullptr;
|
||||
}
|
||||
|
||||
if(dlgSettings)
|
||||
{
|
||||
dlgSettings->close();
|
||||
delete dlgSettings;
|
||||
dlgSettings = nullptr;
|
||||
}
|
||||
|
||||
if(dlgAuthorization)
|
||||
{
|
||||
dlgAuthorization->close();
|
||||
delete dlgAuthorization;
|
||||
dlgAuthorization = nullptr;
|
||||
}
|
||||
|
||||
delete messangerController;
|
||||
delete viewerInstructors;
|
||||
delete viewerTrainees;
|
||||
delete connectorToServer;
|
||||
|
||||
waitAnimationWidget->hideWithStop();
|
||||
delete waitAnimationWidget;
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
QString InstructorsAndTraineesWidget::getLanguage()
|
||||
{
|
||||
return language;
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{// переведём окно заново
|
||||
ui->retranslateUi(this);
|
||||
|
||||
updateLabelLoggedInInstructor(instructorLoggedInLocal);
|
||||
updateLabelServer();
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QSize size = event->size();
|
||||
waitAnimationWidget->resize(size);
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::updateMyStyleSheet()
|
||||
{
|
||||
QString styleSheet = loadStyleSheet();
|
||||
styleSheet = styleSheet.replace("\n", "");
|
||||
|
||||
this->setStyleSheet(styleSheet);
|
||||
}
|
||||
|
||||
QString InstructorsAndTraineesWidget::loadStyleSheet()
|
||||
{
|
||||
QString fileName = "./resources/css/styleSheetMain.css";
|
||||
QFile styleSheetFile(fileName);
|
||||
if (!styleSheetFile.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
SpecMsgBox::CriticalClose(this, tr("The file could not be opened ") + fileName);
|
||||
return QStringLiteral("");
|
||||
}
|
||||
else
|
||||
{
|
||||
QByteArray byteArray = styleSheetFile.readAll();
|
||||
styleSheetFile.close();
|
||||
|
||||
QString style = byteArray;
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_LanguageChanged(QString language)
|
||||
{
|
||||
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTraineesWidget_")) + language, QStringLiteral("."));
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
|
||||
emit signal_LanguageChanged(language);
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_UpdateStyleSheet()
|
||||
{
|
||||
updateMyStyleSheet();
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *serverAuth)
|
||||
{
|
||||
if (serverAuth->Result)
|
||||
{
|
||||
instructorLoggedInLocal.setLogin(serverAuth->Login);
|
||||
instructorLoggedInLocal.setName(serverAuth->ClientName);
|
||||
instructorLoggedInLocal.setID(serverAuth->Id.toInt());
|
||||
|
||||
if(serverAuth->Login == QStringLiteral("admin"))
|
||||
instructorLoggedInLocal.setIsAdmin(true);
|
||||
else
|
||||
instructorLoggedInLocal.setIsAdmin(false);
|
||||
|
||||
viewerInstructors->setAdminMode(instructorLoggedInLocal.getIsAdmin());
|
||||
viewerTrainees->setAdminMode(instructorLoggedInLocal.getIsAdmin());
|
||||
viewerInstructors->setAuthComplited(true);
|
||||
viewerTrainees->setAuthComplited(true);
|
||||
|
||||
ui->btnEditorTrainees->setEnabled(true);
|
||||
if(instructorLoggedInLocal.getIsAdmin())
|
||||
ui->btnEditorInstructors->setEnabled(true);
|
||||
|
||||
emit signal_NeedUpdateUI(true, true);
|
||||
|
||||
updateLabelLoggedInInstructor(instructorLoggedInLocal);
|
||||
connectorToServer->setLoginName(instructorLoggedInLocal.getName());
|
||||
|
||||
messangerController->setUserLocalGUI_ID(serverAuth->Id.toInt());
|
||||
|
||||
connectorToServer->sendQueryTasksXML("fim");
|
||||
connectorToServer->sendQueryTasksXML("amm");
|
||||
|
||||
viewerTrainees->activate();
|
||||
viewerInstructors->activate();
|
||||
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
flTryLogin = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//waitAnimationWidget->hideWithStop();
|
||||
//ui->btnAuthorizationInstructor->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization *serverDeAuth)
|
||||
{
|
||||
if (serverDeAuth->Result)
|
||||
{
|
||||
instructorLoggedInLocal.setLogin(QStringLiteral(""));
|
||||
instructorLoggedInLocal.setName(QStringLiteral(""));
|
||||
instructorLoggedInLocal.setIsAdmin(false);
|
||||
instructorLoggedInLocal.setID(0);
|
||||
|
||||
viewerInstructors->setAdminMode(instructorLoggedInLocal.getIsAdmin());
|
||||
viewerTrainees->setAdminMode(instructorLoggedInLocal.getIsAdmin());
|
||||
viewerInstructors->setAuthComplited(false);
|
||||
viewerTrainees->setAuthComplited(false);
|
||||
|
||||
ui->btnEditorTrainees->setEnabled(false);
|
||||
ui->btnEditorInstructors->setEnabled(false);
|
||||
ui->btnPersonalCard->setEnabled(false);
|
||||
|
||||
updateLabelLoggedInInstructor(instructorLoggedInLocal);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnAuthorizationInstructor->setChecked(true);
|
||||
SpecMsgBox::CriticalClose(this, tr("Instructor deauthorization") + "\n" + tr("Error!"));
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_ServerBlocked()
|
||||
{
|
||||
if(flTryLogin)
|
||||
{
|
||||
flTryLogin = false;
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
SpecMsgBox::WarningClose(this, tr("Instructor authorization.") + "\n" + tr("Server blocked!"));
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_ErrorAuth(QString error)
|
||||
{
|
||||
if(flTryLogin)
|
||||
{
|
||||
flTryLogin = false;
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
|
||||
QString errorTextMsg = "";
|
||||
|
||||
if(error == NOTIFY_ERROR_AUTH_DB)
|
||||
{
|
||||
errorTextMsg = tr("Database error!");
|
||||
}
|
||||
else if(error == NOTIFY_ERROR_AUTH_ARCHIVED)
|
||||
{
|
||||
errorTextMsg = tr("The user is archived!");
|
||||
}
|
||||
else if(error == NOTIFY_ERROR_AUTH_ALREADYLOGIN)
|
||||
{
|
||||
errorTextMsg = tr("The user is already logged in!");
|
||||
}
|
||||
else if(error == NOTIFY_ERROR_AUTH_LOGINORPASSWORD)
|
||||
{
|
||||
errorTextMsg = tr("Login or password error!");
|
||||
}
|
||||
|
||||
SpecMsgBox::WarningClose(this, tr("Instructor authorization.") + "\n" + errorTextMsg);
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_SetVersion(StreamingVersionData *serverVersion)
|
||||
{
|
||||
QString viewName = serverVersion->getViewName();
|
||||
ui->lblVersionText->setText(viewName);
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
||||
{
|
||||
if(state)
|
||||
{//Сервер подключен
|
||||
ui->btnConnectionToServer->setEnabled(false);
|
||||
ui->btnAuthorizationInstructor->setEnabled(true);
|
||||
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||
|
||||
updateLabelLoggedInInstructor(instructorLoggedInLocal);
|
||||
|
||||
flTryConnectToServer = false;
|
||||
cntTryConnectToServer = 0;
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
updateLabelServer();
|
||||
|
||||
ui->btnAuthorizationInstructor->click();
|
||||
}
|
||||
else
|
||||
{//Сервер отключен
|
||||
//ui->btnConnectionToServer->setEnabled(true);
|
||||
ui->btnAuthorizationInstructor->setEnabled(false);
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
|
||||
viewerInstructors->setAuthComplited(false);
|
||||
viewerTrainees->setAuthComplited(false);
|
||||
|
||||
ui->btnEditorTrainees->setEnabled(false);
|
||||
ui->btnEditorInstructors->setEnabled(false);
|
||||
ui->btnPersonalCard->setEnabled(false);
|
||||
|
||||
viewerTrainees->deactivate();
|
||||
viewerInstructors->deactivate();
|
||||
|
||||
if(dlgSettings)
|
||||
{
|
||||
//dlgSettings->deactivate();
|
||||
dlgSettings->close();
|
||||
delete dlgSettings;
|
||||
dlgSettings = nullptr;
|
||||
}
|
||||
|
||||
if(dlgAuthorization)
|
||||
{
|
||||
dlgAuthorization->close();
|
||||
delete dlgAuthorization;
|
||||
dlgAuthorization = nullptr;
|
||||
}
|
||||
|
||||
messangerController->deleteAllWidgets();
|
||||
|
||||
instructorLoggedInLocal.setLogin(QStringLiteral(""));
|
||||
instructorLoggedInLocal.setName(QStringLiteral(""));
|
||||
instructorLoggedInLocal.setIsAdmin(false);
|
||||
instructorLoggedInLocal.setID(0);
|
||||
|
||||
updateLabelLoggedInInstructor(instructorLoggedInLocal);
|
||||
|
||||
|
||||
if(flTryConnectToServer)
|
||||
{
|
||||
if(cntTryConnectToServer < 10)
|
||||
{
|
||||
cntTryConnectToServer++;
|
||||
QTimer::singleShot(1000, this, SLOT(slot_TryConnectToServer()));
|
||||
}
|
||||
else
|
||||
{
|
||||
flTryConnectToServer = false;
|
||||
cntTryConnectToServer = 0;
|
||||
ui->btnConnectionToServer->setEnabled(true);
|
||||
waitAnimationWidget->hideWithStop();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flTryConnectToServer = false;
|
||||
cntTryConnectToServer = 0;
|
||||
ui->btnConnectionToServer->setEnabled(true);
|
||||
}
|
||||
|
||||
if(!flSettingsServerIsChanged)
|
||||
{
|
||||
if(!flTryConnectToServer)
|
||||
{
|
||||
WidgetTools::closeAllChildWidgets(this, "SpecMsgBox");
|
||||
SpecMsgBox::WarningClose(this, tr("The server is not available!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
flSettingsServerIsChanged = false;
|
||||
|
||||
|
||||
updateLabelServer();
|
||||
|
||||
flTryLogin = false;
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_traineeSelected(int id_trainee)
|
||||
{
|
||||
ui->btnPersonalCard->setEnabled(false);
|
||||
viewerInstructors->clearSelection();
|
||||
|
||||
/*Messanger*/
|
||||
messangerController->deleteWidget(messangerWidget);
|
||||
if(id_trainee)
|
||||
{
|
||||
Trainee trainee = connectorToServer->getTrainee(id_trainee);
|
||||
if(trainee.getID())
|
||||
{
|
||||
messangerWidget = messangerController->newWidget(this, &trainee, ui->verticalLayout_Messenger);
|
||||
ui->btnPersonalCard->setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_instructorSelected(int id_instructor)
|
||||
{
|
||||
ui->btnPersonalCard->setEnabled(false);
|
||||
viewerTrainees->clearSelection();
|
||||
|
||||
/*Messanger*/
|
||||
messangerController->deleteWidget(messangerWidget);
|
||||
if(id_instructor && id_instructor != instructorLoggedInLocal.getID())
|
||||
{
|
||||
Instructor instructor = connectorToServer->getInstructor(id_instructor);
|
||||
if(instructor.getID())
|
||||
messangerWidget = messangerController->newWidget(this, &instructor, ui->verticalLayout_Messenger);
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_AnswerDocsChanged()
|
||||
{
|
||||
viewerTrainees->getAmmTasksWidgetCommon()->setDocsActualed(false);
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_TryConnectToServer()
|
||||
{
|
||||
updateLabelServer();
|
||||
connectorToServer->SetConnectToServer();
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::authorizationInstructorDialog(QWidget* parent)
|
||||
{
|
||||
dlgAuthorization = new DialogAuthorization(parent);
|
||||
|
||||
dlgAuthorization->setWindowTitle(tr("Instructor authorization"));
|
||||
dlgAuthorization->setWindowFlags(dlgAuthorization->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
dlgAuthorization->setStyleSheet(this->styleSheet());
|
||||
#ifdef PROJECT_TYPE_DEBUG
|
||||
dlgAuthorization->setLogin("admin");
|
||||
dlgAuthorization->setPassword("admin");
|
||||
#endif
|
||||
|
||||
do
|
||||
{
|
||||
switch( dlgAuthorization->exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
QString login = dlgAuthorization->getLogin();
|
||||
QString password = dlgAuthorization->getPassword();
|
||||
|
||||
// Вычисление MD5 хэша
|
||||
password = HashTools::hashingMD5string(password);
|
||||
|
||||
waitAnimationWidget->showWithPlay();
|
||||
|
||||
flTryLogin = true;
|
||||
|
||||
connectorToServer->sendAuthorizationInstructorLocal(login, password);
|
||||
|
||||
return true;
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
while(true);
|
||||
|
||||
if(dlgAuthorization)
|
||||
{
|
||||
delete dlgAuthorization;
|
||||
dlgAuthorization = nullptr;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::deAuthorizationInstructor(QString login)
|
||||
{
|
||||
connectorToServer->sendDeAuthorizationInstructorLocal(login);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::authorizationIsCompleted()
|
||||
{
|
||||
if(instructorLoggedInLocal.getLogin() == QStringLiteral(""))
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnConnectionToServer_clicked()
|
||||
{
|
||||
waitAnimationWidget->showWithPlay();
|
||||
|
||||
ui->btnConnectionToServer->setEnabled(false);
|
||||
|
||||
flTryConnectToServer = true;
|
||||
cntTryConnectToServer = 1;
|
||||
|
||||
updateLabelServer();
|
||||
|
||||
QTimer::singleShot(1000, this, SLOT(slot_TryConnectToServer()));
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnAuthorizationInstructor_clicked()
|
||||
{
|
||||
bool stateIsChecked = ui->btnAuthorizationInstructor->isChecked();
|
||||
|
||||
if(stateIsChecked)
|
||||
{//Авторизация Инструктора локальная (Администратора)
|
||||
if(authorizationInstructorDialog(this))
|
||||
{
|
||||
connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerInstructors,&ViewerInstructors::slot_NeedUpdateUI);
|
||||
connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerTrainees,&ViewerTrainees::slot_NeedUpdateUI);
|
||||
connect(connectorToServer,&ConnectorToServer::signal_reInitMessangerByUsers,messangerController,&MessangerController::slot_reinitMessangers);
|
||||
}
|
||||
else
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
}
|
||||
else
|
||||
{//ДеАвторизация Инструктора локальная (Администратора)
|
||||
if(authorizationIsCompleted())
|
||||
{
|
||||
if(deAuthorizationInstructor(instructorLoggedInLocal.getLogin()))
|
||||
{
|
||||
disconnect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerInstructors,&ViewerInstructors::slot_NeedUpdateUI);
|
||||
disconnect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerTrainees,&ViewerTrainees::slot_NeedUpdateUI);
|
||||
disconnect(connectorToServer,&ConnectorToServer::signal_reInitMessangerByUsers,messangerController,&MessangerController::slot_reinitMessangers);
|
||||
|
||||
viewerTrainees->deactivate();
|
||||
viewerInstructors->deactivate();
|
||||
|
||||
if(dlgSettings)
|
||||
dlgSettings->deactivate();
|
||||
|
||||
messangerController->deleteAllWidgets();
|
||||
}
|
||||
else
|
||||
ui->btnAuthorizationInstructor->setChecked(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::updateLabelLoggedInInstructor(Instructor& instructor)
|
||||
{
|
||||
if(authorizationIsCompleted())
|
||||
{
|
||||
QString nameLoggedInInstructor = QString("%1 (%2)").arg(instructor.getName(), instructor.getLogin());
|
||||
ui->lblLoggedInInstructor->setText(nameLoggedInInstructor);
|
||||
if(instructor.getIsAdmin())
|
||||
ui->lblLoggedIn->setPixmap(QPixmap(QStringLiteral(":/resources/icons/admin.png")));
|
||||
else
|
||||
ui->lblLoggedIn->setPixmap(QPixmap(QStringLiteral(":/resources/icons/instructor.png")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->lblLoggedInInstructor->setText(tr("none"));
|
||||
ui->lblLoggedIn->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::updateLabelServer()
|
||||
{
|
||||
if(!connectorToServer)
|
||||
return;
|
||||
|
||||
if(flTryConnectToServer)
|
||||
{
|
||||
ui->lblServer->setText(tr("Connection attempt") + QString(" %1 ").arg(cntTryConnectToServer) + "...");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(connectorToServer->getIsConnected())
|
||||
{
|
||||
ServerSettings serverSettings = connectorToServer->getServerSettings();
|
||||
ui->lblServer->setText(tr("connected") + " " + serverSettings.Address + " : " +serverSettings.Port);
|
||||
}
|
||||
else
|
||||
ui->lblServer->setText(tr("not connected"));
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::setLanguageInterfase()
|
||||
{
|
||||
ServerSettings settings;
|
||||
DialogSettings::loadSettings(&settings);
|
||||
|
||||
if(settings.Language == "ENG")
|
||||
{
|
||||
qtLanguageTranslator.load(QString("translations/InstructorsAndTraineesWidget_") + languageENG, ".");
|
||||
language = languageENG;
|
||||
}
|
||||
else
|
||||
{
|
||||
qtLanguageTranslator.load(QString("translations/InstructorsAndTraineesWidget_") + languageRUS, ".");
|
||||
language = languageRUS;
|
||||
}
|
||||
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
|
||||
emit signal_LanguageChanged(language);
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnSettings_clicked()
|
||||
{
|
||||
dlgSettings = new DialogSettings(connectorToServer, authorizationIsCompleted(), this);
|
||||
dlgSettings->setWindowFlags(dlgSettings->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
connect(dlgSettings, &DialogSettings::signal_LanguageChanged, this, &InstructorsAndTraineesWidget::slot_LanguageChanged);
|
||||
connect(dlgSettings, &DialogSettings::signal_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet);
|
||||
|
||||
switch( dlgSettings->exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
language = dlgSettings->getSettings().Language;
|
||||
|
||||
if(dlgSettings->settingsServerIsChanged())
|
||||
{
|
||||
SpecMsgBox::WarningClose(this, tr("Server settings have been changed.\nPlease reconnect to the server."));
|
||||
|
||||
flSettingsServerIsChanged = true;
|
||||
|
||||
if(authorizationIsCompleted())
|
||||
deAuthorizationInstructor(instructorLoggedInLocal.getLogin());
|
||||
|
||||
connectorToServer->StopConnectToServer();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(dlgSettings)
|
||||
{
|
||||
delete dlgSettings;
|
||||
dlgSettings = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnEditorTrainees_clicked()
|
||||
{
|
||||
this->viewerTrainees->on_btnEditorTrainees_clicked();
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnEditorInstructors_clicked()
|
||||
{
|
||||
this->viewerInstructors->on_btnEditorInstructors_clicked();
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnPersonalCard_clicked()
|
||||
{
|
||||
this->viewerTrainees->on_btnPersonalCard_clicked();
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnTasksCommon_clicked()
|
||||
{
|
||||
AMMtasksWidget* ammTasksWidgetCommon = viewerTrainees->getAmmTasksWidgetCommon();
|
||||
FIMtasksWidget* fimTasksWidgetCommon = viewerTrainees->getFimTasksWidgetCommon();
|
||||
|
||||
if(!ammTasksWidgetCommon || !fimTasksWidgetCommon)
|
||||
return;
|
||||
|
||||
dlgTasksCommon = new DialogTasksCommon(connectorToServer, ammTasksWidgetCommon, fimTasksWidgetCommon, this);
|
||||
dlgTasksCommon->exec();
|
||||
|
||||
ammTasksWidgetCommon->setParent(this);
|
||||
fimTasksWidgetCommon->setParent(this);
|
||||
|
||||
if(dlgTasksCommon)
|
||||
{
|
||||
delete dlgTasksCommon;
|
||||
dlgTasksCommon = nullptr;
|
||||
}
|
||||
}
|
||||
123
LibInstructorsAndTrainees/instructorsandtraineeswidget.h
Normal file
@@ -0,0 +1,123 @@
|
||||
#ifndef INSTRUCTORSANDTRAINEESWIDGET_H
|
||||
#define INSTRUCTORSANDTRAINEESWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTranslator>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "viewertrainees.h"
|
||||
#include "viewerinstructors.h"
|
||||
#include "messangerwidget.h"
|
||||
#include "messangercontroller.h"
|
||||
#include "connectortoserver.h"
|
||||
#include "metatypes.h"
|
||||
#include "dialogtaskscommon.h"
|
||||
#include "dialogsettings.h"
|
||||
#include "dialogauthorization.h"
|
||||
#include "instructor.h"
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class InstructorsAndTraineesWidget;
|
||||
}
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT InstructorsAndTraineesWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InstructorsAndTraineesWidget(QWidget *parent = nullptr);
|
||||
~InstructorsAndTraineesWidget();
|
||||
|
||||
public:
|
||||
static const QString languageENG;
|
||||
static const QString languageRUS;
|
||||
|
||||
public:
|
||||
QString getLanguage();
|
||||
|
||||
private:
|
||||
void changeEvent(QEvent * event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
void updateMyStyleSheet();
|
||||
QString loadStyleSheet();
|
||||
|
||||
public Q_SLOTS:
|
||||
//Слот обработки смены языка
|
||||
void slot_LanguageChanged(QString language);
|
||||
//Слот обработки смены стиля
|
||||
void slot_UpdateStyleSheet();
|
||||
|
||||
//Слот обработки результата авторизации
|
||||
void slot_checkLoginResult(ServerAuthorization * serverAuth);
|
||||
//Слот обработки результата деавторизации
|
||||
void slot_checkDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||
|
||||
void slot_ServerBlocked();
|
||||
void slot_ErrorAuth(QString error);
|
||||
void slot_SetVersion(StreamingVersionData* serverVersion);
|
||||
|
||||
//Слот обработки результата подключения к серверу
|
||||
void slot_ConnectedToServer(bool state);
|
||||
|
||||
void slot_traineeSelected(int id_trainee);
|
||||
void slot_instructorSelected(int id_instructor);
|
||||
|
||||
void slot_AnswerDocsChanged();
|
||||
|
||||
void slot_TryConnectToServer();
|
||||
|
||||
Q_SIGNALS:
|
||||
//сигнал смены языка
|
||||
void signal_LanguageChanged(QString language);
|
||||
//сигнал о необходимости обновления интерфейса
|
||||
void signal_NeedUpdateUI(bool treeInstructor, bool treeTrainee);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_btnConnectionToServer_clicked();
|
||||
void on_btnAuthorizationInstructor_clicked();
|
||||
void on_btnSettings_clicked();
|
||||
void on_btnEditorTrainees_clicked();
|
||||
void on_btnEditorInstructors_clicked();
|
||||
void on_btnPersonalCard_clicked();
|
||||
void on_btnTasksCommon_clicked();
|
||||
|
||||
private:
|
||||
bool authorizationInstructorDialog(QWidget* parent = nullptr);
|
||||
bool deAuthorizationInstructor(QString login);
|
||||
bool authorizationIsCompleted();
|
||||
void updateLabelLoggedInInstructor(Instructor& instructor);
|
||||
void updateLabelServer();
|
||||
void setLanguageInterfase();
|
||||
|
||||
private:
|
||||
ConnectorToServer* connectorToServer;
|
||||
|
||||
ViewerTrainees* viewerTrainees;
|
||||
ViewerInstructors* viewerInstructors;
|
||||
MessangerWidget* messangerWidget;
|
||||
MessangerController* messangerController;
|
||||
|
||||
DialogTasksCommon* dlgTasksCommon;
|
||||
DialogSettings* dlgSettings;
|
||||
DialogAuthorization* dlgAuthorization;
|
||||
|
||||
WaitAnimationWidget *waitAnimationWidget;
|
||||
|
||||
Instructor instructorLoggedInLocal;
|
||||
|
||||
bool flSettingsServerIsChanged;
|
||||
|
||||
bool flTryConnectToServer;
|
||||
int cntTryConnectToServer;
|
||||
|
||||
bool flTryLogin;
|
||||
|
||||
QTranslator qtLanguageTranslator;
|
||||
QString language;
|
||||
|
||||
Ui::InstructorsAndTraineesWidget *ui;
|
||||
};
|
||||
|
||||
#endif // INSTRUCTORSANDTRAINEESWIDGET_H
|
||||
483
LibInstructorsAndTrainees/instructorsandtraineeswidget.ui
Normal file
@@ -0,0 +1,483 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>InstructorsAndTraineesWidget</class>
|
||||
<widget class="QWidget" name="InstructorsAndTraineesWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1300</width>
|
||||
<height>900</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Main">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_Main">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_Control" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Control">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnConnectionToServer">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Connection</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/connectDB.png</normaloff>:/resources/icons/connectDB.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnAuthorizationInstructor">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Authorization</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/login-user.png</normaloff>:/resources/icons/login-user.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnEditorTrainees">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Trainee editor</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/DB-trainees.png</normaloff>:/resources/icons/DB-trainees.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnEditorInstructors">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Instructor editor</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/DB-instructors.png</normaloff>:/resources/icons/DB-instructors.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnTasksCommon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Tasks</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/procedure.png</normaloff>:/resources/icons/procedure.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnPersonalCard">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Personal card</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/personalCard.png</normaloff>:/resources/icons/personalCard.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnSettings">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="InstructorsAndTrainees.qrc">
|
||||
<normaloff>:/resources/icons/settings.png</normaloff>:/resources/icons/settings.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Work">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_Work">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_L">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_L">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_TI">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_Trainees">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Trainees</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Trainees"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_Instructors">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Instructors</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Instructors"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_R">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_Messenger">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Chat</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Messenger"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_FootNote">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_ConnectedServer">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblDBisConnected">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="InstructorsAndTrainees.qrc">:/resources/icons/circleGray.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblServerPrefix">
|
||||
<property name="text">
|
||||
<string>Server: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblServer">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>none</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_Version">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Version">
|
||||
<property name="text">
|
||||
<string>Version of materials: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblVersionText">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_LoggedInInstructor">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblLoggedIn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="InstructorsAndTrainees.qrc">:/resources/icons/circleGray.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblLoggedInPrefix">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string> Instructor: </string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::AutoText</enum>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblLoggedInInstructor">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>none</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="InstructorsAndTrainees.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
168
LibInstructorsAndTrainees/messanger/messangercontroller.cpp
Normal file
@@ -0,0 +1,168 @@
|
||||
#include "messangercontroller.h"
|
||||
|
||||
MessangerController::MessangerController(ConnectorToServer* connectorToServer, QObject *parent) :
|
||||
QObject(parent),
|
||||
connectorToServer(connectorToServer),
|
||||
userLocalGUI_ID(0)
|
||||
{
|
||||
connect(connectorToServer, &ConnectorToServer::signal_receiveMessage, this, &MessangerController::slot_receiveMessage);
|
||||
}
|
||||
|
||||
MessangerController::~MessangerController()
|
||||
{
|
||||
deleteAllWidgets();
|
||||
}
|
||||
|
||||
MessangerWidget *MessangerController::newWidget(QWidget *parent, User* user, QVBoxLayout* boxLayout)
|
||||
{
|
||||
MessangerWidget *msgWdgt = new MessangerWidget(parent);
|
||||
|
||||
if(boxLayout)
|
||||
boxLayout->addWidget(msgWdgt);
|
||||
|
||||
connect(msgWdgt, &MessangerWidget::signal_sendMessage, this, &MessangerController::slot_sendMessage);
|
||||
|
||||
msgWdgt->initUserLocalGUI(connectorToServer->getInstructor(userLocalGUI_ID));
|
||||
|
||||
if(user)
|
||||
{
|
||||
msgWdgt->initUserRemote(*user);
|
||||
|
||||
//Заполнение предыстории
|
||||
int id_user = user->getID();
|
||||
QList<MessageOfMessanger>* list = nullptr;
|
||||
if(mapAlldialogsWithClients.contains(id_user))
|
||||
{//Уже есть
|
||||
list = mapAlldialogsWithClients.value(id_user);
|
||||
|
||||
for(MessageOfMessanger msg : *list)
|
||||
{
|
||||
if(msg.flLocal)
|
||||
msgWdgt->showSendedMessage(ClientMessage(QString::number(userLocalGUI_ID), QString::number(id_user), msg.text, msg.time.toString("hh:mm")));
|
||||
else
|
||||
msgWdgt->showReceivedMessage(ClientMessage(QString::number(id_user), QString::number(userLocalGUI_ID), msg.text, msg.time.toString("hh:mm")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
listWidgets.append(msgWdgt);
|
||||
|
||||
return msgWdgt;
|
||||
}
|
||||
|
||||
void MessangerController::deleteWidget(MessangerWidget *msgWdgt)
|
||||
{
|
||||
for(int i = 0; i < listWidgets.count(); i++)
|
||||
{
|
||||
if(listWidgets.at(i) == msgWdgt)
|
||||
{
|
||||
delete msgWdgt;
|
||||
listWidgets.removeAt(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerController::deleteAllWidgets()
|
||||
{
|
||||
for(MessangerWidget* widget : listWidgets)
|
||||
delete widget;
|
||||
listWidgets.clear();
|
||||
|
||||
mapAlldialogsWithClients.clear();
|
||||
}
|
||||
|
||||
void MessangerController::setUserLocalGUI_ID(int id)
|
||||
{
|
||||
userLocalGUI_ID = id;
|
||||
|
||||
for(MessangerWidget* widget : listWidgets)
|
||||
{
|
||||
widget->initUserLocalGUI(connectorToServer->getInstructor(userLocalGUI_ID));
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerController::slot_sendMessage(ClientMessage clientMessage)
|
||||
{
|
||||
connectorToServer->slot_sendMessage(clientMessage);
|
||||
|
||||
showMessageInAllWidgets(clientMessage);
|
||||
}
|
||||
|
||||
void MessangerController::slot_receiveMessage(ClientMessage clientMessage)
|
||||
{
|
||||
int id_user = clientMessage.fromId.toInt();
|
||||
|
||||
Instructor instructor = connectorToServer->getInstructor(id_user);
|
||||
if(instructor.getID())
|
||||
emit signal_receiveMessage_fromInstructor(clientMessage);
|
||||
else
|
||||
{
|
||||
Trainee trainee = connectorToServer->getTrainee(id_user);
|
||||
if(trainee.getID())
|
||||
emit signal_receiveMessage_fromTrainee(clientMessage);
|
||||
}
|
||||
|
||||
showMessageInAllWidgets(clientMessage);
|
||||
}
|
||||
|
||||
void MessangerController::slot_reinitMessangers(QList<User> listUsers)
|
||||
{
|
||||
for(MessangerWidget* widget : listWidgets)
|
||||
{
|
||||
for(User user : listUsers)
|
||||
{
|
||||
if(user.getID() == widget->getIDuserRemote())
|
||||
{
|
||||
widget->reinitMessangerWidget(user);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerController::showMessageInAllWidgets(ClientMessage clientMessage)
|
||||
{
|
||||
int id_user = 0;
|
||||
MessageOfMessanger msg;
|
||||
|
||||
if(clientMessage.fromId == QString::number(userLocalGUI_ID))
|
||||
{//Send
|
||||
id_user = clientMessage.toId.toInt();
|
||||
msg.flLocal = true;
|
||||
}
|
||||
else
|
||||
{//Receive
|
||||
id_user = clientMessage.fromId.toInt();
|
||||
msg.flLocal = false;
|
||||
}
|
||||
|
||||
|
||||
QList<MessageOfMessanger>* list = nullptr;
|
||||
if(mapAlldialogsWithClients.contains(id_user))
|
||||
{//Уже есть
|
||||
list = mapAlldialogsWithClients.value(id_user);
|
||||
}
|
||||
else
|
||||
{//Новый
|
||||
list = new QList<MessageOfMessanger>();
|
||||
mapAlldialogsWithClients.insert(id_user, list);
|
||||
}
|
||||
|
||||
msg.text = clientMessage.Text;
|
||||
msg.time = QTime::currentTime();
|
||||
list->append(msg);
|
||||
|
||||
clientMessage.timeStr = msg.time.toString("hh:mm");
|
||||
|
||||
for(MessangerWidget* widget : listWidgets)
|
||||
{
|
||||
if(widget->getIDuserRemote() == id_user)
|
||||
{
|
||||
if(msg.flLocal)
|
||||
widget->showSendedMessage(clientMessage);
|
||||
else
|
||||
widget->showReceivedMessage(clientMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
52
LibInstructorsAndTrainees/messanger/messangercontroller.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef MESSANGERCONTROLLER_H
|
||||
#define MESSANGERCONTROLLER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QVBoxLayout>
|
||||
#include "messangerwidget.h"
|
||||
#include "connectortoserver.h"
|
||||
|
||||
struct MessageOfMessanger
|
||||
{
|
||||
QString text;
|
||||
bool flLocal;
|
||||
QTime time;
|
||||
};
|
||||
|
||||
class MessangerController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MessangerController(ConnectorToServer* connectorToServer, QObject *parent = nullptr);
|
||||
~MessangerController();
|
||||
|
||||
public:
|
||||
MessangerWidget* newWidget(QWidget *parent, User* user, QVBoxLayout* boxLayout);
|
||||
void deleteWidget(MessangerWidget* msgWdgt);
|
||||
void deleteAllWidgets();
|
||||
|
||||
void setUserLocalGUI_ID(int id);
|
||||
|
||||
public slots:
|
||||
void slot_sendMessage(ClientMessage clientMessage);
|
||||
void slot_receiveMessage(ClientMessage clientMessage);
|
||||
|
||||
void slot_reinitMessangers(QList<User> listUsers);
|
||||
|
||||
signals:
|
||||
void signal_receiveMessage_fromInstructor(ClientMessage clientMessage);
|
||||
void signal_receiveMessage_fromTrainee(ClientMessage clientMessage);
|
||||
|
||||
private:
|
||||
void showMessageInAllWidgets(ClientMessage clientMessage);
|
||||
|
||||
private:
|
||||
ConnectorToServer* connectorToServer;
|
||||
QList <MessangerWidget*> listWidgets;
|
||||
|
||||
int userLocalGUI_ID;
|
||||
|
||||
QMap <int, QList<MessageOfMessanger>*> mapAlldialogsWithClients;
|
||||
};
|
||||
|
||||
#endif // MESSANGERCONTROLLER_H
|
||||
172
LibInstructorsAndTrainees/messanger/messangerwidget.cpp
Normal file
@@ -0,0 +1,172 @@
|
||||
#include <QListWidget>
|
||||
#include <QKeyEvent>
|
||||
#include <QAbstractScrollArea>
|
||||
#include <QMessageBox>
|
||||
#include <QLabel>
|
||||
#include "instructor.h"
|
||||
#include "messangerwidget.h"
|
||||
#include "ui_messangerwidget.h"
|
||||
|
||||
|
||||
MessangerWidget::MessangerWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
oneDialogMessenger(nullptr),
|
||||
ui(new Ui::MessangerWidget),
|
||||
myTextEdit(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->btnSend->setObjectName("btnSend");
|
||||
|
||||
ui->lblUser->setObjectName("MessangerWidgetLblUser");
|
||||
ui->lblAvatar->setObjectName("MessangerWidgetLblAvatar");
|
||||
ui->lblLoggedIn->setObjectName("MessangerWidgetLblLoggedIn");
|
||||
|
||||
myTextEdit = new MyTextEdit();
|
||||
connect(myTextEdit, &MyTextEdit::signal_pressEnter, this, &MessangerWidget::on_btnSend_clicked);
|
||||
|
||||
myTextEdit->setObjectName("editMsg");
|
||||
myTextEdit->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
|
||||
myTextEdit->setFixedHeight(65);
|
||||
|
||||
ui->horizontalLayout_EditMsg->addWidget(myTextEdit);
|
||||
}
|
||||
|
||||
MessangerWidget::~MessangerWidget()
|
||||
{
|
||||
delete oneDialogMessenger;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MessangerWidget::initUserRemote(User user)
|
||||
{
|
||||
userRemote = user;
|
||||
|
||||
addTabDialogMessenger(userRemote);
|
||||
}
|
||||
|
||||
void MessangerWidget::reinitMessangerWidget(User user)
|
||||
{
|
||||
if(userRemote.getID() == user.getID())
|
||||
{
|
||||
userRemote = user;
|
||||
|
||||
//Обновляем заголовок
|
||||
updateHeader(userRemote);
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::initUserLocalGUI(User user)
|
||||
{
|
||||
userLocalGUI = user;
|
||||
}
|
||||
|
||||
int MessangerWidget::getIDuserRemote()
|
||||
{
|
||||
return userRemote.getID();
|
||||
}
|
||||
|
||||
void MessangerWidget::showSendedMessage(ClientMessage clientMessage)
|
||||
{
|
||||
if(userLocalGUI.getID() == clientMessage.fromId.toInt())
|
||||
oneDialogMessenger->addMsgWidgetLocal(clientMessage.Text, clientMessage.timeStr, userLocalGUI.getName());
|
||||
}
|
||||
|
||||
void MessangerWidget::showReceivedMessage(ClientMessage clientMessage)
|
||||
{
|
||||
if(userRemote.getID() == clientMessage.fromId.toInt())
|
||||
oneDialogMessenger->addMsgWidgetRemote(clientMessage.Text, clientMessage.timeStr, userRemote.getName());
|
||||
}
|
||||
|
||||
void MessangerWidget::addTabDialogMessenger(User user)
|
||||
{
|
||||
if(!oneDialogMessenger)
|
||||
{//Диалога еще не существует
|
||||
|
||||
oneDialogMessenger = new OneDialogMessenger(userLocalGUI, userRemote, this);
|
||||
|
||||
ui->verticalLayout_ListMsg->addWidget(oneDialogMessenger);
|
||||
|
||||
//Обновляем заголовок
|
||||
updateHeader(user);
|
||||
}
|
||||
else
|
||||
{//Диалог уже существует
|
||||
|
||||
//Проверяем наличие диалога именно с этим клиентом
|
||||
if(oneDialogMessenger->getUserRemoteId() == user.getID())
|
||||
{
|
||||
//Обновляем заголовок
|
||||
updateHeader(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::updateHeader(User user)
|
||||
{
|
||||
//Обновляем статус залогинивания
|
||||
if(user.getLoggedIn())
|
||||
ui->lblLoggedIn->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||
else
|
||||
ui->lblLoggedIn->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
|
||||
|
||||
QString typeUserStr = "";
|
||||
|
||||
if(user.getTypeUserDB() == User::TypeUserDBTrainee)
|
||||
{
|
||||
ui->lblAvatar->setPixmap(QPixmap(QStringLiteral(":/resources/icons/trainee.png")));
|
||||
|
||||
typeUserStr = tr("Trainee");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(static_cast<Instructor*>(&user)->getIsAdmin())
|
||||
ui->lblAvatar->setPixmap(QPixmap(QStringLiteral(":/resources/icons/admin.png")));
|
||||
else
|
||||
ui->lblAvatar->setPixmap(QPixmap(QStringLiteral(":/resources/icons/instructor.png")));
|
||||
|
||||
typeUserStr = tr("Instructor");
|
||||
}
|
||||
|
||||
QString fullName = typeUserStr + ": " + user.getName() + " (" + user.getLogin() + ")";
|
||||
ui->lblUser->setText(fullName);
|
||||
}
|
||||
|
||||
void MessangerWidget::on_btnSend_clicked()
|
||||
{
|
||||
QString text = myTextEdit->toPlainText();
|
||||
QString from = QString::number(userLocalGUI.getID());
|
||||
QString to = QString::number(userRemote.getID());
|
||||
|
||||
ClientMessage message = ClientMessage(from, to, text);
|
||||
emit signal_sendMessage(message);
|
||||
|
||||
myTextEdit->clear();
|
||||
}
|
||||
|
||||
void MessangerWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this); // переведём окно заново
|
||||
}
|
||||
}
|
||||
|
||||
void MyTextEdit::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)
|
||||
{
|
||||
if(QApplication::keyboardModifiers().testFlag(Qt::ControlModifier))
|
||||
{
|
||||
this->insertPlainText("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
emit signal_pressEnter();
|
||||
return;
|
||||
}
|
||||
}
|
||||
QTextEdit::keyPressEvent(event);
|
||||
}
|
||||
73
LibInstructorsAndTrainees/messanger/messangerwidget.h
Normal file
@@ -0,0 +1,73 @@
|
||||
#ifndef MESSANGERWIDGET_H
|
||||
#define MESSANGERWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTranslator>
|
||||
#include <user.h>
|
||||
#include "Datas.h"
|
||||
#include "tabdialogmessenger.h"
|
||||
#include <QTextEdit>
|
||||
|
||||
class MyTextEdit : public QTextEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MyTextEdit(){};
|
||||
|
||||
signals:
|
||||
void signal_pressEnter();
|
||||
|
||||
private:
|
||||
virtual void keyPressEvent(QKeyEvent *event) override;
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class MessangerWidget;
|
||||
}
|
||||
|
||||
class MessangerWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MessangerWidget(QWidget *parent = nullptr);
|
||||
~MessangerWidget();
|
||||
|
||||
public:
|
||||
void initUserRemote(User user);
|
||||
void reinitMessangerWidget(User user);
|
||||
void initUserLocalGUI(User user);
|
||||
int getIDuserRemote();
|
||||
|
||||
void showSendedMessage(ClientMessage clientMessage);
|
||||
void showReceivedMessage(ClientMessage clientMessage);
|
||||
|
||||
private:
|
||||
void addTabDialogMessenger(User user);
|
||||
void updateHeader(User user);
|
||||
|
||||
private slots:
|
||||
void on_btnSend_clicked();
|
||||
|
||||
signals:
|
||||
//сигнал о готовности нового сообщения на отправку клиенту
|
||||
void signal_sendMessage(ClientMessage clientMessage);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
private:
|
||||
OneDialogMessenger* oneDialogMessenger;
|
||||
User userLocalGUI;
|
||||
User userRemote;
|
||||
|
||||
QTranslator qtLanguageTranslator;
|
||||
|
||||
private:
|
||||
Ui::MessangerWidget *ui;
|
||||
|
||||
MyTextEdit* myTextEdit;
|
||||
};
|
||||
|
||||
#endif // MESSANGERWIDGET_H
|
||||
155
LibInstructorsAndTrainees/messanger/messangerwidget.ui
Normal file
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MessangerWidget</class>
|
||||
<widget class="QWidget" name="MessangerWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>344</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Main">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Dialog" stretch="0,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_User">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblAvatar">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblUser">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblLoggedIn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../../ServerLMS/ServerLMS.qrc">:/resources/icons/circleGray.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_ListMsg"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_Input">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_EditMsg"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnSend">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>65</width>
|
||||
<height>54</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>1000</width>
|
||||
<height>1000</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/resources/icons/sendMsg.png</normaloff>:/resources/icons/sendMsg.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../ServerLMS/ServerLMS.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
143
LibInstructorsAndTrainees/messanger/msgwidget.cpp
Normal file
@@ -0,0 +1,143 @@
|
||||
#include "msgwidget.h"
|
||||
#include "ui_msgwidget.h"
|
||||
|
||||
MsgWidget::MsgWidget(QString avatar, AligneAvatar aligneAvatar, int width, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::MsgWidget),
|
||||
widthEdit(100)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
setAvatar(avatar);
|
||||
|
||||
if(aligneAvatar == AligneAvatar::Left)
|
||||
setAligneAvatarLeft();
|
||||
else
|
||||
setAligneAvatarRight();
|
||||
|
||||
setWidth(width);
|
||||
|
||||
ui->lblAvatar->setObjectName("MsgWidgetLblAvatar");
|
||||
}
|
||||
|
||||
MsgWidget::~MsgWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MsgWidget::setAligneAvatarLeft()
|
||||
{
|
||||
ui->horizontalLayout_Main->removeItem(ui->verticalLayout_Avatar);
|
||||
ui->horizontalLayout_Main->removeItem(ui->verticalLayout_Text);
|
||||
ui->horizontalLayout_Main->removeItem(ui->horizontalLayout_Add);
|
||||
ui->horizontalLayout_EditText->removeItem(ui->horizontalSpacer_EditText);
|
||||
ui->horizontalLayout_EditText->removeWidget(ui->editText);
|
||||
|
||||
ui->horizontalLayout_Main->addLayout(ui->verticalLayout_Avatar);
|
||||
ui->horizontalLayout_Main->addLayout(ui->verticalLayout_Text);
|
||||
ui->horizontalLayout_Main->addLayout(ui->horizontalLayout_Add);
|
||||
|
||||
ui->horizontalLayout_EditText->addWidget(ui->editText);
|
||||
ui->horizontalLayout_EditText->addItem(ui->horizontalSpacer_EditText);
|
||||
|
||||
ui->editText->setObjectName("MsgWidgetEditTextRemote");
|
||||
ui->lblTime->setObjectName("MsgWidgetLblTimeRemote");
|
||||
ui->lblName->setObjectName("MsgWidgetLblNameRemote");
|
||||
|
||||
ui->lblTime->setAlignment(Qt::AlignLeft);
|
||||
ui->lblName->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
|
||||
//ui->editText->setAlignment(Qt::AlignLeft);
|
||||
}
|
||||
|
||||
void MsgWidget::setAligneAvatarRight()
|
||||
{
|
||||
ui->horizontalLayout_Main->removeItem(ui->verticalLayout_Avatar);
|
||||
ui->horizontalLayout_Main->removeItem(ui->verticalLayout_Text);
|
||||
ui->horizontalLayout_Main->removeItem(ui->horizontalLayout_Add);
|
||||
ui->horizontalLayout_EditText->removeItem(ui->horizontalSpacer_EditText);
|
||||
ui->horizontalLayout_EditText->removeWidget(ui->editText);
|
||||
|
||||
ui->horizontalLayout_Main->addLayout(ui->horizontalLayout_Add);
|
||||
ui->horizontalLayout_Main->addLayout(ui->verticalLayout_Text);
|
||||
ui->horizontalLayout_Main->addLayout(ui->verticalLayout_Avatar);
|
||||
|
||||
ui->horizontalLayout_EditText->addItem(ui->horizontalSpacer_EditText);
|
||||
ui->horizontalLayout_EditText->addWidget(ui->editText);
|
||||
|
||||
ui->editText->setObjectName("MsgWidgetEditTextLocal");
|
||||
ui->lblTime->setObjectName("MsgWidgetLblTimeLocal");
|
||||
ui->lblName->setObjectName("MsgWidgetLblNameLocal");
|
||||
|
||||
ui->lblTime->setAlignment(Qt::AlignRight);
|
||||
ui->lblName->setAlignment(Qt::AlignRight | Qt::AlignBottom);
|
||||
//ui->editText->setAlignment(Qt::AlignRight);
|
||||
}
|
||||
|
||||
|
||||
void MsgWidget::setAvatar(QString avatar)
|
||||
{
|
||||
QPixmap pix(avatar);
|
||||
ui->lblAvatar->setPixmap( pix.scaled(32,32) );
|
||||
}
|
||||
|
||||
void MsgWidget::setWidth(int width)
|
||||
{
|
||||
this->setFixedWidth(width);
|
||||
widthEdit = width - 200;
|
||||
}
|
||||
|
||||
void MsgWidget::setText(QString text)
|
||||
{
|
||||
ui->editText->setText(text);
|
||||
}
|
||||
|
||||
void MsgWidget::setTime(QString timeStr)
|
||||
{
|
||||
ui->lblTime->setText(timeStr);
|
||||
}
|
||||
|
||||
void MsgWidget::setName(QString name)
|
||||
{
|
||||
ui->lblName->setText(name);
|
||||
}
|
||||
|
||||
void MsgWidget::on_editText_textChanged()
|
||||
{
|
||||
QString text = ui->editText->toPlainText();
|
||||
QFontMetrics metricsFont(ui->editText->font()); //метрики шрифта
|
||||
|
||||
//геометрические параметры текста (высота/ширина в пикселях). В одну строку
|
||||
QRect textRect = metricsFont.boundingRect(QRect(0, 0, 0, 0), 0, text);
|
||||
|
||||
int X = 10; // отступы
|
||||
|
||||
if(textRect.width() > widthEdit)
|
||||
{//Не помещается в одну строку
|
||||
|
||||
textRect = metricsFont.boundingRect(QRect(0, 0, widthEdit, 1000), Qt::TextWordWrap, text);
|
||||
|
||||
if(textRect.width() > widthEdit)
|
||||
{
|
||||
QRect textRect1str = metricsFont.boundingRect(QRect(0, 0, widthEdit, 1000), 0, "string");
|
||||
int ost = textRect.width() % widthEdit;
|
||||
int cnt = textRect.width() / widthEdit;
|
||||
//if(ost > 0)
|
||||
cnt += 1;
|
||||
|
||||
this->setFixedHeight(textRect1str.height() * cnt + (ost? textRect1str.height() : 0) + X + 20 + 30 + 30);
|
||||
ui->editText->setFixedHeight(textRect1str.height() * cnt + (ost? textRect1str.height() : 0) + X);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setFixedHeight(textRect.height() + X + 20 + 30 + 30);
|
||||
ui->editText->setFixedHeight(textRect.height() + X);
|
||||
}
|
||||
}
|
||||
else
|
||||
{//В одну строку
|
||||
this->setFixedHeight(textRect.height() + X + 20 + 30 + 30);
|
||||
ui->editText->setFixedWidth(textRect.width() + X);
|
||||
ui->editText->setFixedHeight(textRect.height() + X);
|
||||
}
|
||||
}
|
||||
50
LibInstructorsAndTrainees/messanger/msgwidget.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef MSGWIDGET_H
|
||||
#define MSGWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class MsgWidget;
|
||||
}
|
||||
|
||||
//Виджет одного сообщения для/от клиента
|
||||
|
||||
class MsgWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum DirectionMsg
|
||||
{
|
||||
Incoming, //Входящее
|
||||
Outgoing //Исходящее
|
||||
};
|
||||
enum AligneAvatar
|
||||
{
|
||||
Left,
|
||||
Right
|
||||
};
|
||||
|
||||
public:
|
||||
explicit MsgWidget(QString avatar, AligneAvatar aligneAvatar, int width, QWidget *parent = nullptr);
|
||||
~MsgWidget();
|
||||
|
||||
void setText(QString text);
|
||||
void setTime(QString timeStr);
|
||||
void setName(QString name);
|
||||
|
||||
private:
|
||||
void setAligneAvatarLeft();
|
||||
void setAligneAvatarRight();
|
||||
void setAvatar(QString avatar);
|
||||
void setWidth(int width);
|
||||
|
||||
private slots:
|
||||
void on_editText_textChanged();
|
||||
|
||||
private:
|
||||
Ui::MsgWidget *ui;
|
||||
|
||||
int widthEdit;
|
||||
};
|
||||
|
||||
#endif // MSGWIDGET_H
|
||||
187
LibInstructorsAndTrainees/messanger/msgwidget.ui
Normal file
@@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MsgWidget</class>
|
||||
<widget class="QWidget" name="MsgWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>257</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_Main">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Avatar">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblAvatar">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_Avatar">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Text">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblName">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_EditText">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_EditText">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="editText">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblTime">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>--:--</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_Add">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_Add">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
85
LibInstructorsAndTrainees/messanger/tabdialogmessenger.cpp
Normal file
@@ -0,0 +1,85 @@
|
||||
#include <QScrollBar>
|
||||
#include "tabdialogmessenger.h"
|
||||
#include "msgwidget.h"
|
||||
#include "user.h"
|
||||
#include "instructor.h"
|
||||
|
||||
|
||||
OneDialogMessenger::OneDialogMessenger(User userLocalGUI, User userRemote, QWidget *parent):
|
||||
QListWidget(parent)
|
||||
{
|
||||
this->setObjectName("oneDialogMessenger");
|
||||
|
||||
this->userLocalGUI = userLocalGUI;
|
||||
this->userRemote = userRemote;
|
||||
|
||||
setWordWrap(true);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOn);
|
||||
}
|
||||
|
||||
OneDialogMessenger::~OneDialogMessenger()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OneDialogMessenger::addMsgWidgetLocal(QString text, QString timeStr, QString name)
|
||||
{
|
||||
addMsgWidget(text, timeStr, MsgWidget::DirectionMsg::Outgoing, name);
|
||||
}
|
||||
|
||||
void OneDialogMessenger::addMsgWidgetRemote(QString text, QString timeStr, QString name)
|
||||
{
|
||||
addMsgWidget(text, timeStr, MsgWidget::DirectionMsg::Incoming, name);
|
||||
}
|
||||
|
||||
void OneDialogMessenger::addMsgWidget(QString text, QString timeStr, MsgWidget::DirectionMsg direction, QString name)
|
||||
{
|
||||
QListWidgetItem *listWidgetItem = new QListWidgetItem();
|
||||
|
||||
QString avatar = "";
|
||||
MsgWidget::AligneAvatar aligneAvatar = MsgWidget::AligneAvatar::Left;
|
||||
|
||||
if(direction == MsgWidget::DirectionMsg::Outgoing)
|
||||
{//Исходящее
|
||||
if(static_cast<Instructor*>(&userLocalGUI)->getIsAdmin())
|
||||
avatar = ":/resources/icons/admin.png";
|
||||
else
|
||||
avatar = ":/resources/icons/instructor.png";
|
||||
|
||||
aligneAvatar = MsgWidget::AligneAvatar::Right;
|
||||
}
|
||||
else
|
||||
{//Входящее
|
||||
if(userRemote.getTypeUserDB() == User::TypeUserDBTrainee)
|
||||
avatar = ":/resources/icons/trainee.png";
|
||||
else
|
||||
{
|
||||
if(static_cast<Instructor*>(&userRemote)->getIsAdmin())
|
||||
avatar = ":/resources/icons/admin.png";
|
||||
else
|
||||
avatar = ":/resources/icons/instructor.png";
|
||||
}
|
||||
|
||||
aligneAvatar = MsgWidget::AligneAvatar::Left;
|
||||
}
|
||||
|
||||
int widthW = width();
|
||||
int widthSB = verticalScrollBar()->size().width();
|
||||
//TODO Времянка
|
||||
widthW = 450;
|
||||
widthSB = 17;
|
||||
|
||||
MsgWidget *msgWidget = new MsgWidget(avatar, aligneAvatar, widthW - widthSB);
|
||||
|
||||
addItem(listWidgetItem);
|
||||
setItemWidget(listWidgetItem, msgWidget);
|
||||
|
||||
msgWidget->setText(text);
|
||||
msgWidget->setTime(timeStr);
|
||||
msgWidget->setName(name);
|
||||
|
||||
//Корректировка высоты item
|
||||
listWidgetItem->setSizeHint (QSize(10, msgWidget->height()));
|
||||
|
||||
scrollToItem(listWidgetItem);
|
||||
}
|
||||
29
LibInstructorsAndTrainees/messanger/tabdialogmessenger.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef TABDIALOGMESSENGER_H
|
||||
#define TABDIALOGMESSENGER_H
|
||||
|
||||
#include <QListWidget>
|
||||
#include "msgwidget.h"
|
||||
#include "user.h"
|
||||
|
||||
class OneDialogMessenger : public QListWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
OneDialogMessenger(User userLocalGUI, User userRemote, QWidget *parent = nullptr);
|
||||
~OneDialogMessenger();
|
||||
|
||||
int getUserRemoteId() {return userRemote.getID();}
|
||||
|
||||
void addMsgWidgetLocal(QString text, QString timeStr = "", QString name = "");
|
||||
void addMsgWidgetRemote(QString text, QString timeStr = "", QString name = "");
|
||||
|
||||
private:
|
||||
void addMsgWidget(QString text, QString timeStr, MsgWidget::DirectionMsg direction, QString name = "");
|
||||
|
||||
private:
|
||||
User userLocalGUI;
|
||||
User userRemote;
|
||||
};
|
||||
|
||||
#endif // TABDIALOGMESSENGER_H
|
||||
17
LibInstructorsAndTrainees/metatypes.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "metatypes.h"
|
||||
|
||||
void registerMetaType()
|
||||
{
|
||||
qRegisterMetaType<QList<Instructor>>("QList<Instructor>");
|
||||
qRegisterMetaType<QList<Trainee>>("QList<Trainee>");
|
||||
qRegisterMetaType<QList<Group>>("QList<Group>");
|
||||
qRegisterMetaType<QList<Computer>>("QList<Computer>");
|
||||
qRegisterMetaType<QList<Classroom>>("QList<Classroom>");
|
||||
qRegisterMetaType<QList<Module*>>("QList<Module*>");
|
||||
qRegisterMetaType<QList<TaskAmmFim>>("QList<TaskAmmFim>");
|
||||
qRegisterMetaType<PacketType>("PacketType");
|
||||
qRegisterMetaType<ClientMessage>("ClientMessage");
|
||||
qRegisterMetaType<QList<QTreeWidgetItem*>>("QList<QTreeWidgetItem*>");
|
||||
|
||||
qRegisterMetaType<QList<SubProc>>("QList<SubProc>");
|
||||
}
|
||||
31
LibInstructorsAndTrainees/metatypes.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef METATYPES_H
|
||||
#define METATYPES_H
|
||||
|
||||
#include <QTreeWidgetItem>
|
||||
|
||||
#include "instructor.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
#include "computer.h"
|
||||
#include "classroom.h"
|
||||
#include "module.h"
|
||||
#include "tasksAmmFim.h"
|
||||
#include "tools.h"
|
||||
#include "Datas.h"
|
||||
|
||||
void registerMetaType();
|
||||
|
||||
Q_DECLARE_METATYPE(QList<Instructor>)
|
||||
Q_DECLARE_METATYPE(QList<Trainee>)
|
||||
Q_DECLARE_METATYPE(QList<Group>)
|
||||
Q_DECLARE_METATYPE(QList<Computer>)
|
||||
Q_DECLARE_METATYPE(QList<Classroom>)
|
||||
Q_DECLARE_METATYPE(QList<Module*>)
|
||||
Q_DECLARE_METATYPE(QList<TaskAmmFim>)
|
||||
Q_DECLARE_METATYPE(PacketType)
|
||||
Q_DECLARE_METATYPE(ClientMessage)
|
||||
Q_DECLARE_METATYPE(QList<QTreeWidgetItem*>)
|
||||
|
||||
Q_DECLARE_METATYPE(QList<SubProc>)
|
||||
|
||||
#endif // METATYPES_H
|
||||
BIN
LibInstructorsAndTrainees/resources/icons/762.gif
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/DB-instructors.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/DB-trainees.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/DB-instructors.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/DB-trainees.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/addInstructor.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/addTrainee.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/admin.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/archive.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/assignTask.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/check.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/chekNo.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/chekYes.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/circleGray.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/circleGreen.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/circleRed.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/circleYellow.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/connectDB.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/delete.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/deleteGroup.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/deleteTrainee.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/docTasks.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/edit.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/editorDB.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/filter.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/group.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/instructor.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/lms.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/login-user.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/malfunction.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/newGroup.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/rectGray.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/rectGreen.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
LibInstructorsAndTrainees/resources/icons/PNG/sendMsg.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |