Переделано под один мега-проект LMS с общим CMakeLists.txt
145
InstructorsAndTrainees/CMakeLists.txt
Normal file
@@ -0,0 +1,145 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(InstructorsAndTrainees LANGUAGES CXX)
|
||||
|
||||
get_filename_component(REPO_PATH ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(PROJECT_TYPE_DEBUG TRUE)
|
||||
endif()
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_definitions(-DPROJECT_TYPE_DEBUG)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Sql REQUIRED)
|
||||
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Xml REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Network REQUIRED)
|
||||
|
||||
add_library(InstructorsAndTrainees SHARED
|
||||
instructorsAndTrainees_global.h
|
||||
instructorsandtraineeswidget.cpp
|
||||
instructorsandtraineeswidget.h
|
||||
instructorsandtraineeswidget.ui
|
||||
commonview.cpp
|
||||
commonview.h
|
||||
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
|
||||
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/dialogauthorizationinstructor.cpp
|
||||
instructors/dialogauthorizationinstructor.h
|
||||
instructors/dialogauthorizationinstructor.ui
|
||||
instructors/instructorsview.cpp
|
||||
instructors/instructorsview.h
|
||||
tasks/taskswidget.cpp
|
||||
tasks/taskswidget.h
|
||||
tasks/taskswidget.ui
|
||||
docTasks/doctaskswidget.cpp
|
||||
docTasks/doctaskswidget.h
|
||||
docTasks/doctaskswidget.ui
|
||||
docTasks/module.cpp
|
||||
docTasks/module.h
|
||||
connectorToServer/connectortoserver.cpp
|
||||
connectorToServer/connectortoserver.h
|
||||
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/Datas.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
|
||||
docTasks/fimtaskswidget.cpp
|
||||
docTasks/fimtaskswidget.h
|
||||
docTasks/fimtaskswidget.ui
|
||||
docTasks/tasksAmmFim.cpp
|
||||
docTasks/tasksAmmFim.h
|
||||
resources.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}/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}/docTasks)
|
||||
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_compile_definitions(InstructorsAndTrainees PRIVATE INSTRUCTORSANDTRAINEES_LIBRARY)
|
||||
|
||||
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../DataBaseLMS)
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
target_link_directories(InstructorsAndTrainees PUBLIC ${REPO_PATH}/BUILDS/Debug64/DataBaseLMS)
|
||||
elseif()
|
||||
target_link_directories(InstructorsAndTrainees PUBLIC ${REPO_PATH}/BUILDS/Release64/DataBaseLMS)
|
||||
endif()
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE libDataBaseLMS.dll)
|
||||
|
||||
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
add_custom_command(TARGET InstructorsAndTrainees
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
|
||||
${REPO_PATH}/BUILDS/Debug64/GUIdataBaseLMS)
|
||||
elseif()
|
||||
add_custom_command(TARGET InstructorsAndTrainees
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${REPO_PATH}/BUILDS/Release64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
|
||||
${REPO_PATH}/BUILDS/Release64/GUIdataBaseLMS)
|
||||
endif()
|
||||
|
||||
|
||||
#Только для TSMP!
|
||||
#install(TARGETS InstructorsAndTrainees DESTINATION ${VEYON_LIB_DIR})
|
||||
618
InstructorsAndTrainees/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
InstructorsAndTrainees/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
InstructorsAndTrainees/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>
|
||||
40
InstructorsAndTrainees/commonview.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "commonview.h"
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
CommonView::CommonView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
|
||||
QWidget(parent),
|
||||
connectorToServer(connectorToServer),
|
||||
treeWidget(nullptr),
|
||||
typeView(type),
|
||||
archiveVisible(false),
|
||||
notLoggedInVisible(false),
|
||||
adminMode(false),
|
||||
authComplited(false),
|
||||
lastCurrentID(0),
|
||||
typeObject(TypeObject::objInstructor)
|
||||
{
|
||||
treeWidget = new QTreeWidget();
|
||||
|
||||
//treeWidget->setIconSize(QSize(20, 20));
|
||||
treeWidget->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||
|
||||
//updateMyStyleSheet();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
71
InstructorsAndTrainees/commonview.h
Normal file
@@ -0,0 +1,71 @@
|
||||
#ifndef COMMONVIEW_H
|
||||
#define COMMONVIEW_H
|
||||
|
||||
#include <QTreeWidget>
|
||||
#include <QTranslator>
|
||||
#include <QMutex>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "connectortoserver.h"
|
||||
|
||||
//Родительский класс представления БД Инструкторов/Обучаемых (самого верхнего уровня)
|
||||
|
||||
class CommonView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum TypeView
|
||||
{
|
||||
onlyView,
|
||||
control
|
||||
};
|
||||
|
||||
enum TypeObject
|
||||
{
|
||||
objInstructor,
|
||||
objTrainee,
|
||||
objGroup
|
||||
};
|
||||
|
||||
public:
|
||||
CommonView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent = nullptr);
|
||||
|
||||
public:
|
||||
void setAdminMode(bool adminMode)
|
||||
{
|
||||
this->adminMode = adminMode;
|
||||
}
|
||||
void setAuthComplited(bool authComplited)
|
||||
{
|
||||
this->authComplited = authComplited;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
protected:
|
||||
ConnectorToServer* connectorToServer;
|
||||
QTreeWidget* treeWidget;
|
||||
QMutex mtxTreeWidget;
|
||||
TypeView typeView;
|
||||
bool archiveVisible;
|
||||
bool notLoggedInVisible;
|
||||
bool adminMode;
|
||||
bool authComplited;
|
||||
int lastCurrentID;
|
||||
TypeObject typeObject;
|
||||
};
|
||||
|
||||
#endif // COMMONVIEW_H
|
||||
32
InstructorsAndTrainees/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)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}; //путь
|
||||
|
||||
struct SAttribute
|
||||
{
|
||||
QString name;
|
||||
QString value;
|
||||
|
||||
};
|
||||
|
||||
struct SXmlAnswerTag{
|
||||
QString elementName;
|
||||
QList<SAttribute> attr;
|
||||
};
|
||||
|
||||
#endif // FILEDATA_H
|
||||
|
||||
469
InstructorsAndTrainees/connectorToServer/Core/dataparser.cpp
Normal file
@@ -0,0 +1,469 @@
|
||||
#include "Core/dataparser.h"
|
||||
|
||||
#include "FileData.h"
|
||||
#include "tools.h"
|
||||
|
||||
#include "instructor.h"
|
||||
#include "trainee.h"
|
||||
#include "group.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();
|
||||
}
|
||||
|
||||
void DataParser::createAuthMessage(ClientAutorization *auth)
|
||||
{
|
||||
authPassCache = auth; //кэширование даных авторизации, для сохранения при успешном заходе
|
||||
|
||||
QFile file(tempName);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
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();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
void DataParser::createToClientMessage(ToClientMessage *toClientMessage)
|
||||
{
|
||||
QFile file(tempName);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("ToClientMessage");
|
||||
|
||||
xmlWriter.writeAttribute("id", QString::number(toClientMessage->id));
|
||||
xmlWriter.writeAttribute("Login", toClientMessage->Login);
|
||||
xmlWriter.writeAttribute("Text", toClientMessage->Text);
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DataParser::createQueryToDBMessage(ClientQueryToDB *queryToDB, int id, void* data)
|
||||
{
|
||||
QFile file(tempName);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
void DataParser::createDeAuthMessage(ClientDeAutorization *deAuth)
|
||||
{
|
||||
QFile file(tempName);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("ClientDeAutorization");
|
||||
|
||||
xmlWriter.writeAttribute("Login",deAuth->Login);
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
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.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()
|
||||
{
|
||||
|
||||
}
|
||||
46
InstructorsAndTrainees/connectorToServer/Core/dataparser.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#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);
|
||||
void createAuthMessage(ClientAutorization *auth);
|
||||
void createToClientMessage(ToClientMessage *toClientMessage);
|
||||
void createQueryToDBMessage(ClientQueryToDB *queryToDB, int id = 0, void* data = nullptr);
|
||||
void createDeAuthMessage(ClientDeAutorization *deAuth);
|
||||
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,556 @@
|
||||
#include "Core/recognizesystem.h"
|
||||
#include <QThread>
|
||||
#include <QDir>
|
||||
#include <QDomDocument>
|
||||
#include "instructor.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;
|
||||
}
|
||||
|
||||
//xml-ответы на запросы к БД
|
||||
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_DB__LIST_TASKS:
|
||||
{
|
||||
QByteArray array;
|
||||
stream.startTransaction();
|
||||
stream >> array;
|
||||
|
||||
if(!stream.commitTransaction())
|
||||
continue;
|
||||
|
||||
xmlParserQueryToDB(packetType, array);
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
break;
|
||||
};
|
||||
|
||||
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 == "END")
|
||||
{
|
||||
emit sigSocketDisabled();
|
||||
}
|
||||
|
||||
if(value == "BLOCKED")
|
||||
{
|
||||
emit sigServerBlocked();
|
||||
}
|
||||
|
||||
if(value == "HASHSENDCOMPLETE")
|
||||
{
|
||||
emit sigStartCompare();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
emit sigAuth(serverAuth);
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "ServerMessage"){
|
||||
|
||||
ClientMessage *clientMessage = new ClientMessage;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if (name == "Login"){
|
||||
clientMessage->Login = value;
|
||||
}
|
||||
if (name == "Text"){
|
||||
clientMessage->Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
emit signal_MessageForGUI(clientMessage->Login, clientMessage->Text);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
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_DB__LIST_TASKS:
|
||||
{
|
||||
QList<Task> listTasks;
|
||||
QDomNode listNode = commonDOM.namedItem("ListTasks");
|
||||
|
||||
for(int i = 0; i < listNode.childNodes().count(); i++)
|
||||
{
|
||||
QDomNode taskNode = listNode.childNodes().at(i);
|
||||
if(taskNode.nodeName() == "Task")
|
||||
{//Задача
|
||||
Task task;
|
||||
task.setID(taskNode.toElement().attribute("task_id").toInt());
|
||||
task.setName(taskNode.toElement().attribute("name"));
|
||||
|
||||
listTasks.append(task);
|
||||
}
|
||||
}
|
||||
emit sigAnswerQueryToDB_ListTasks(listTasks);
|
||||
}
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
void RecognizeSystem::checkAccessType(QString type)
|
||||
{
|
||||
if(type == "instructor")
|
||||
{
|
||||
//mainWindow->callUpdateList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
#ifndef RECOGNIZESYSTEM_H
|
||||
#define RECOGNIZESYSTEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QDataStream>
|
||||
#include <QTcpSocket>
|
||||
//#include <mainwindow.h>
|
||||
#include <Core\tools.h>
|
||||
#include "dataparser.h"
|
||||
#include "instructor.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
#include "Datas.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 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_MessageForGUI(QString login, QString text);
|
||||
|
||||
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_ListTasks(QList<Task> listTasks);
|
||||
|
||||
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 checkAccessType(QString type);
|
||||
};
|
||||
|
||||
#endif // RECOGNIZESYSTEM_H
|
||||
135
InstructorsAndTrainees/connectorToServer/Core/sendsystem.cpp
Normal file
@@ -0,0 +1,135 @@
|
||||
#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()
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
QFile file(tempName);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
|
||||
QByteArray array = file.readAll();
|
||||
|
||||
stream << PacketType::TYPE_XMLANSWER;
|
||||
stream << array;
|
||||
socket->waitForBytesWritten();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
QString value = QString::number(PacketType::TYPE_QT);
|
||||
socket->write(value.toUtf8());
|
||||
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);
|
||||
}
|
||||
|
||||
SendSystem::~SendSystem()
|
||||
{
|
||||
|
||||
}
|
||||
31
InstructorsAndTrainees/connectorToServer/Core/sendsystem.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef SENDSYSTEM_H
|
||||
#define SENDSYSTEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTcpSocket>
|
||||
#include <QDataStream>
|
||||
|
||||
class SendSystem :public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SendSystem(QObject* parent = nullptr);
|
||||
void setSocket(QTcpSocket *socket);
|
||||
void sendXMLmsgGUItoServer();
|
||||
void sendDisable();
|
||||
void sendFileBlock(QString path);
|
||||
void sendFolderBlock(QString path);
|
||||
void sendQTConnect();
|
||||
void sendXMLAnswer(QByteArray array);
|
||||
~SendSystem();
|
||||
void sendFinish();
|
||||
|
||||
signals:
|
||||
void sigSend();
|
||||
QByteArray sigGetXmlAnswer(QString);
|
||||
|
||||
private:
|
||||
QTcpSocket *socket;
|
||||
};
|
||||
|
||||
#endif // SENDSYSTEM_H
|
||||
145
InstructorsAndTrainees/connectorToServer/Core/tcpclient.cpp
Normal file
@@ -0,0 +1,145 @@
|
||||
#include "tcpclient.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
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: " << thread();
|
||||
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 sigServerDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void TCPClient::setDisconnect()
|
||||
{
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
62
InstructorsAndTrainees/connectorToServer/Core/tcpclient.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#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 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;
|
||||
|
||||
void setDisconnect();
|
||||
};
|
||||
|
||||
#endif // TCPCLIENT_H
|
||||
58
InstructorsAndTrainees/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("Application");
|
||||
|
||||
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;
|
||||
}
|
||||
58
InstructorsAndTrainees/connectorToServer/Core/tools.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#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 streamingAssetsPath = "/Application/RRJLoader/RRJ_Data/StreamingAssets";
|
||||
static QString hashFilename = staticDataFolderName + "/clientHash.xml";
|
||||
static QString settingsName = staticDataFolderName + "/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";
|
||||
|
||||
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_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_DB__LIST_TASKS = 105
|
||||
};
|
||||
|
||||
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
|
||||
102
InstructorsAndTrainees/connectorToServer/Datas.h
Normal file
@@ -0,0 +1,102 @@
|
||||
#ifndef DATAS_H
|
||||
#define DATAS_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class ServerSettings{
|
||||
public:
|
||||
QString Address;
|
||||
QString Port;
|
||||
QString Language;
|
||||
bool isAutoStart;
|
||||
};
|
||||
|
||||
class ServerAuthorization{
|
||||
public:
|
||||
QString InstructorName;
|
||||
QString ClientName;
|
||||
bool Result;
|
||||
QString AccessType;
|
||||
QString Login;
|
||||
};
|
||||
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
|
||||
};
|
||||
|
||||
class ClientQueryToDB{
|
||||
public:
|
||||
TypeQueryToDB typeQuery;
|
||||
};
|
||||
|
||||
class ServerMessage
|
||||
{
|
||||
public:
|
||||
QString Text;
|
||||
};
|
||||
|
||||
class ClientMessage
|
||||
{
|
||||
public:
|
||||
QString Login;
|
||||
QString Text;
|
||||
};
|
||||
|
||||
class ToClientMessage
|
||||
{
|
||||
public:
|
||||
int id;
|
||||
QString Login;
|
||||
QString Text;
|
||||
};
|
||||
|
||||
class ServerTask
|
||||
{
|
||||
public:
|
||||
QString Text;
|
||||
};
|
||||
|
||||
class ServerNotify
|
||||
{
|
||||
public:
|
||||
QString Code;
|
||||
};
|
||||
|
||||
class ClientNotify
|
||||
{
|
||||
public:
|
||||
QString Code;
|
||||
};
|
||||
|
||||
#endif // DATAS_H
|
||||
333
InstructorsAndTrainees/connectorToServer/connectortoserver.cpp
Normal file
@@ -0,0 +1,333 @@
|
||||
#include "connectortoserver.h"
|
||||
#include <QThread>
|
||||
|
||||
ConnectorToServer::ConnectorToServer(QObject *parent) :
|
||||
QObject(parent),
|
||||
connectionThread(nullptr),
|
||||
client(nullptr),
|
||||
dataParser(nullptr),
|
||||
sendSystem(nullptr),
|
||||
recognizeSystem(nullptr)
|
||||
{
|
||||
initialize();
|
||||
}
|
||||
|
||||
bool ConnectorToServer::authorizationInstructorLocal(QString login, QString password)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ClientAutorization *autorization = new ClientAutorization;
|
||||
autorization->Login = login;
|
||||
autorization->Password = password;
|
||||
autorization->TypeClient = TypeClientAutorization::TYPE_GUI;
|
||||
|
||||
dataParser->createAuthMessage(autorization);
|
||||
emit signal_sendXMLmsgGUItoServer();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::deAuthorizationInstructorLocal(QString login)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ClientDeAutorization *deAutorization = new ClientDeAutorization;
|
||||
deAutorization->Login = login;
|
||||
|
||||
dataParser->createDeAuthMessage(deAutorization);
|
||||
emit signal_sendXMLmsgGUItoServer();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::sendQueryToDB(TypeQueryToDB typeQuery, int id, void* data)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ClientQueryToDB *queryToDB = new ClientQueryToDB;
|
||||
queryToDB->typeQuery = typeQuery;
|
||||
|
||||
dataParser->createQueryToDBMessage(queryToDB, id, data);
|
||||
emit signal_sendXMLmsgGUItoServer();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::sendMessageForClient(int id, QString login, QString text)
|
||||
{
|
||||
if (!client->getIsConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ToClientMessage *toClientMessage = new ToClientMessage;
|
||||
toClientMessage->id = id;
|
||||
toClientMessage->Login = login;
|
||||
toClientMessage->Text = text;
|
||||
|
||||
dataParser->createToClientMessage(toClientMessage);
|
||||
emit signal_sendXMLmsgGUItoServer();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ConnectorToServer::SetConnectToServer()
|
||||
{
|
||||
emit sigSetConnect(dataParser->getServerSettings(),connectionThread);
|
||||
}
|
||||
|
||||
QList<Instructor> ConnectorToServer::getListInstructors()
|
||||
{
|
||||
return listInstructors;
|
||||
}
|
||||
|
||||
QList<Trainee> ConnectorToServer::getListTrainees()
|
||||
{
|
||||
return listTrainees;
|
||||
}
|
||||
|
||||
QList<Group> ConnectorToServer::getListGroups()
|
||||
{
|
||||
return listGroups;
|
||||
}
|
||||
|
||||
QList<Computer> ConnectorToServer::getListComputers()
|
||||
{
|
||||
return listComputers;
|
||||
}
|
||||
|
||||
QList<Classroom> ConnectorToServer::getListClassrooms()
|
||||
{
|
||||
return listClassrooms;
|
||||
}
|
||||
|
||||
QList<Task> ConnectorToServer::getListTasks()
|
||||
{
|
||||
return listTasks;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isArchivedInstructor(int id)
|
||||
{
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
{
|
||||
if(instructor.getArchived()) return true; else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isAdminInstructor(int id)
|
||||
{
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
{
|
||||
if(instructor.getIsAdmin()) return true; else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isLoggedInInstructor(int id)
|
||||
{
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
{
|
||||
if(instructor.getLoggedIn()) return true; else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Instructor ConnectorToServer::getInstructor(int id)
|
||||
{
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getID() == id)
|
||||
return instructor;
|
||||
}
|
||||
return Instructor();
|
||||
}
|
||||
|
||||
QList<Trainee> ConnectorToServer::getListTraineesInGroup(int id)
|
||||
{
|
||||
QList<Trainee> list;
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getGroup().getID() == id)
|
||||
list.append(trainee);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isArchivedTrainee(int id)
|
||||
{
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getID() == id)
|
||||
{
|
||||
if(trainee.getArchived()) return true; else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ConnectorToServer::isLoggedInTrainee(int id)
|
||||
{
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getID() == id)
|
||||
{
|
||||
if(trainee.getLoggedIn()) return true; else return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Trainee ConnectorToServer::getTrainee(int id)
|
||||
{
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getID() == id)
|
||||
return trainee;
|
||||
}
|
||||
return Trainee();
|
||||
}
|
||||
|
||||
Group ConnectorToServer::getGroup(int id)
|
||||
{
|
||||
for(Group group : listGroups)
|
||||
{
|
||||
if(group.getID() == id)
|
||||
return group;
|
||||
}
|
||||
return Group();
|
||||
}
|
||||
|
||||
int ConnectorToServer::getIdTraineeByLogin(QString login)
|
||||
{
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getLogin() == login)
|
||||
return trainee.getID();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
void ConnectorToServer::slot_AnswerQueryToDB(QList<Instructor>* listInstructors,
|
||||
QList<Trainee>* listTrainees,
|
||||
QList<Group>* listGroups)
|
||||
{
|
||||
this->listInstructors = *listInstructors;
|
||||
this->listTrainees = *listTrainees;
|
||||
this->listGroups = *listGroups;
|
||||
emit signal_UpdateDB(true, true);
|
||||
}*/
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListInstructors(QList<Instructor> listInstructors)
|
||||
{
|
||||
this->listInstructors = listInstructors;
|
||||
emit signal_UpdateDB(true, false);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListGroups(QList<Group> listGroups)
|
||||
{
|
||||
this->listGroups = listGroups;
|
||||
emit signal_UpdateDB(false, true);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListTrainees(QList<Trainee> listTrainees)
|
||||
{
|
||||
this->listTrainees = listTrainees;
|
||||
emit signal_UpdateDB(false, true);
|
||||
emit signal_InitMessanger(listTrainees);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListComputers(QList<Computer> listComputers)
|
||||
{
|
||||
this->listComputers = listComputers;
|
||||
//emit signal_UpdateDB(false, true);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms)
|
||||
{
|
||||
this->listClassrooms = listClassrooms;
|
||||
//emit signal_UpdateDB(false, true);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_AnswerQueryToDB_ListTasks(QList<Task> listTasks)
|
||||
{
|
||||
this->listTasks = listTasks;
|
||||
//emit signal_UpdateDB(false, true);
|
||||
}
|
||||
|
||||
void ConnectorToServer::slot_msgToClientReady(QString login, QString text)
|
||||
{
|
||||
int id = getIdTraineeByLogin(login);
|
||||
if(id)
|
||||
sendMessageForClient(id, login, text);
|
||||
}
|
||||
|
||||
void ConnectorToServer::initialize()
|
||||
{
|
||||
createObjects();
|
||||
|
||||
bindConnection();
|
||||
|
||||
emit sigInitializeClient(recognizeSystem,sendSystem,connectionThread);
|
||||
|
||||
emit sigSetConnect(dataParser->getServerSettings(),connectionThread);
|
||||
}
|
||||
|
||||
void ConnectorToServer::bindConnection()
|
||||
{
|
||||
connect(this,&ConnectorToServer::sigInitializeClient,client,&TCPClient::initialize,Qt::AutoConnection);
|
||||
connect(this,&ConnectorToServer::sigSetConnect,client,&TCPClient::setConnect,Qt::AutoConnection);
|
||||
connect(this,&ConnectorToServer::signal_sendXMLmsgGUItoServer,sendSystem,&SendSystem::sendXMLmsgGUItoServer);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::sigLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::signal_MessageForGUI,this,&ConnectorToServer::signal_msgFromClientReady);
|
||||
//connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB,this,&ConnectorToServer::slot_AnswerQueryToDB);
|
||||
|
||||
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_ListTasks,this,&ConnectorToServer::slot_AnswerQueryToDB_ListTasks);
|
||||
|
||||
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
107
InstructorsAndTrainees/connectorToServer/connectortoserver.h
Normal file
@@ -0,0 +1,107 @@
|
||||
#ifndef CONNECTORTOSERVER_H
|
||||
#define CONNECTORTOSERVER_H
|
||||
|
||||
#include <QObject>
|
||||
#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 "task.h"
|
||||
|
||||
class ConnectorToServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ConnectorToServer(QObject *parent = nullptr);
|
||||
|
||||
bool authorizationInstructorLocal(QString login, QString password);
|
||||
bool deAuthorizationInstructorLocal(QString login);
|
||||
|
||||
bool sendQueryToDB(TypeQueryToDB typeQuery, int id = 0, void* data = nullptr);
|
||||
bool sendMessageForClient(int id, QString login, QString text);
|
||||
|
||||
void SetConnectToServer();
|
||||
|
||||
public:
|
||||
//Запросы к БД (локальной)
|
||||
QList<Instructor> getListInstructors();
|
||||
QList<Trainee> getListTrainees();
|
||||
QList<Group> getListGroups();
|
||||
QList<Computer> getListComputers();
|
||||
QList<Classroom> getListClassrooms();
|
||||
QList<Task> getListTasks();
|
||||
|
||||
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);
|
||||
|
||||
public slots:
|
||||
/*void slot_AnswerQueryToDB(QList<Instructor>* listInstructors,
|
||||
QList<Trainee>* listTrainees,
|
||||
QList<Group>* listGroups);*/
|
||||
|
||||
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_ListTasks(QList<Task> listTasks);
|
||||
|
||||
void slot_msgToClientReady(QString login, QString text);
|
||||
|
||||
signals:
|
||||
void sigSetConnect(ServerSettings* serverSettings,QThread *thread);
|
||||
void sigInitializeClient(RecognizeSystem *recognizeSystem,
|
||||
SendSystem *sendSystem,
|
||||
QThread *thread);
|
||||
|
||||
void signal_sendXMLmsgGUItoServer();
|
||||
|
||||
void sigLoginResult(ServerAuthorization * serverAuth);
|
||||
void sigDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||
|
||||
void signal_UpdateDB(bool treeInstructor, bool treeTrainee);
|
||||
|
||||
void signal_ConnectedToServer(bool state);
|
||||
|
||||
void signal_InitMessanger(QList<Trainee> listTrainees);
|
||||
|
||||
void signal_msgFromClientReady(QString login, QString text);
|
||||
|
||||
|
||||
private:
|
||||
void initialize();
|
||||
void bindConnection();
|
||||
void createObjects();
|
||||
|
||||
private:
|
||||
QThread *connectionThread;
|
||||
TCPClient *client;
|
||||
DataParser *dataParser;
|
||||
SendSystem *sendSystem;
|
||||
RecognizeSystem *recognizeSystem;
|
||||
|
||||
//Списочная модель БД СУО
|
||||
QList<Instructor> listInstructors;
|
||||
QList<Group> listGroups;
|
||||
QList<Trainee> listTrainees;
|
||||
QList<Computer> listComputers;
|
||||
QList<Classroom> listClassrooms;
|
||||
QList<Task> listTasks;
|
||||
};
|
||||
|
||||
#endif // CONNECTORTOSERVER_H
|
||||
286
InstructorsAndTrainees/docTasks/doctaskswidget.cpp
Normal file
@@ -0,0 +1,286 @@
|
||||
#include <QFile>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QDomDocument>
|
||||
#include <QMessageBox>
|
||||
#include "doctaskswidget.h"
|
||||
#include "ui_doctaskswidget.h"
|
||||
|
||||
DocTasksWidget::DocTasksWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::DocTasksWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
treeWidget = new QTreeWidget();
|
||||
|
||||
connect(treeWidget, &QTreeWidget::currentItemChanged, this, &DocTasksWidget::on_treeWidget_currentItemChanged);
|
||||
|
||||
ui->horizontalLayout_2->addWidget(treeWidget);
|
||||
|
||||
preparationTreeWidget();
|
||||
|
||||
loadDocTasksFromXML();
|
||||
|
||||
updateTreeWidget();
|
||||
}
|
||||
|
||||
DocTasksWidget::~DocTasksWidget()
|
||||
{
|
||||
deleteAllModuls();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DocTasksWidget::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
||||
{
|
||||
if(current == nullptr)
|
||||
return;
|
||||
|
||||
int id = current->text(ColumnsTree::clmn_ID).toInt();
|
||||
|
||||
Module* module = searchModuleByID(id);
|
||||
|
||||
if(module)
|
||||
{
|
||||
QString type = "Code";
|
||||
QString code = "";
|
||||
|
||||
if(module->getType() == ModuleType::TYPE_PM)
|
||||
{
|
||||
PM* PMmodul = static_cast<PM*>(module);
|
||||
type = "PM";
|
||||
code = PMmodul->pmCode();
|
||||
}
|
||||
else
|
||||
{
|
||||
DM* DMmodul = static_cast<DM*>(module);
|
||||
type = "DM";
|
||||
code = DMmodul->dmCode();
|
||||
}
|
||||
|
||||
ui->label->setText(type + " Code");
|
||||
ui->editCode->setText(code);
|
||||
}
|
||||
}
|
||||
|
||||
void DocTasksWidget::domElementParser(QDomElement element, Module* moduleParent)
|
||||
{
|
||||
QString name;
|
||||
|
||||
QDomElement childElement = element.firstChildElement();
|
||||
if(childElement.isNull())
|
||||
return;
|
||||
|
||||
Module* module = nullptr;
|
||||
|
||||
do
|
||||
{
|
||||
name = childElement.nodeName();
|
||||
|
||||
QDomNamedNodeMap nodeMap = childElement.attributes();
|
||||
|
||||
if(name == "pm")
|
||||
{
|
||||
module = new PM();
|
||||
PM* PMmodul = static_cast<PM*>(module);
|
||||
|
||||
PMmodul->initialize(nodeMap.namedItem("modelIdentCode").nodeValue(),
|
||||
nodeMap.namedItem("pmIssuer").nodeValue(),
|
||||
nodeMap.namedItem("pmNumber").nodeValue(),
|
||||
nodeMap.namedItem("pmVolume").nodeValue());
|
||||
|
||||
if(moduleParent)
|
||||
{
|
||||
PMmodul->setParentModule(moduleParent);
|
||||
|
||||
PM* PMmodulParent = static_cast<PM*>(moduleParent);
|
||||
PMmodulParent->addChildModule(module);
|
||||
}
|
||||
}
|
||||
else if(name == "dm")
|
||||
{
|
||||
module = new DM();
|
||||
DM* DMmodul = static_cast<DM*>(module);
|
||||
|
||||
DMmodul->initialize(nodeMap.namedItem("modelIdentCode").nodeValue(),
|
||||
nodeMap.namedItem("systemDiffCode").nodeValue(),
|
||||
nodeMap.namedItem("systemCode").nodeValue(),
|
||||
nodeMap.namedItem("subSystemCode").nodeValue(),
|
||||
nodeMap.namedItem("subSubSystemCode").nodeValue(),
|
||||
nodeMap.namedItem("assyCode").nodeValue(),
|
||||
nodeMap.namedItem("disassyCode").nodeValue(),
|
||||
nodeMap.namedItem("disassyCodeVariant").nodeValue(),
|
||||
nodeMap.namedItem("infoCode").nodeValue(),
|
||||
nodeMap.namedItem("infoCodeVariant").nodeValue(),
|
||||
nodeMap.namedItem("itemLocationCode").nodeValue());
|
||||
|
||||
if(moduleParent)
|
||||
{
|
||||
DMmodul->setParentModule(moduleParent);
|
||||
|
||||
PM* PMmodulParent = static_cast<PM*>(moduleParent);
|
||||
PMmodulParent->addChildModule(module);
|
||||
}
|
||||
}
|
||||
else if(name == "rus" || name == "eng")
|
||||
{
|
||||
if(moduleParent)
|
||||
{
|
||||
if(moduleParent->getType() == ModuleType::TYPE_PM)
|
||||
{//PM
|
||||
PM* PMmodulParent = static_cast<PM*>(moduleParent);
|
||||
|
||||
if(name == "rus")
|
||||
PMmodulParent->setLangStructRus(nodeMap.namedItem("title").nodeValue());
|
||||
else
|
||||
PMmodulParent->setLangStructEng(nodeMap.namedItem("title").nodeValue());
|
||||
}
|
||||
else
|
||||
{//DM
|
||||
DM* DMmodulParent = static_cast<DM*>(moduleParent);
|
||||
|
||||
if(name == "rus")
|
||||
DMmodulParent->setLangStructRus(nodeMap.namedItem("techName").nodeValue(),
|
||||
nodeMap.namedItem("infoName").nodeValue(),
|
||||
nodeMap.namedItem("pdf").nodeValue(),
|
||||
nodeMap.namedItem("bookmark").nodeValue(),
|
||||
nodeMap.namedItem("xml").nodeValue());
|
||||
else
|
||||
DMmodulParent->setLangStructEng(nodeMap.namedItem("techName").nodeValue(),
|
||||
nodeMap.namedItem("infoName").nodeValue(),
|
||||
nodeMap.namedItem("pdf").nodeValue(),
|
||||
nodeMap.namedItem("bookmark").nodeValue(),
|
||||
nodeMap.namedItem("xml").nodeValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
domElementParser(childElement, module);
|
||||
|
||||
if(moduleParent == nullptr)
|
||||
listAllModules.append(module);
|
||||
|
||||
}while (! (childElement = childElement.nextSiblingElement()).isNull());
|
||||
}
|
||||
|
||||
void DocTasksWidget::loadDocTasksFromXML()
|
||||
{
|
||||
QDomDocument docTasksDOM;
|
||||
QString xmlFileName = "./docs.xml";
|
||||
QFile xmlInFile(xmlFileName);
|
||||
if (!xmlInFile.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
QMessageBox::critical(nullptr, tr("Attention!"), tr("The file could not be opened ") + xmlFileName);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
docTasksDOM.setContent(xmlInFile.readAll());
|
||||
xmlInFile.close();
|
||||
|
||||
QDomElement manifestElement = docTasksDOM.firstChildElement("manifest");
|
||||
if(manifestElement.isNull())
|
||||
return;
|
||||
|
||||
//deleteAllModuls();
|
||||
|
||||
domElementParser(manifestElement, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void DocTasksWidget::deleteAllModuls()
|
||||
{
|
||||
for(Module* module: listAllModules)
|
||||
{
|
||||
if(module->getType() == ModuleType::TYPE_PM)
|
||||
delete static_cast<PM*>(module);
|
||||
else
|
||||
delete static_cast<DM*>(module);
|
||||
}
|
||||
listAllModules.clear();
|
||||
}
|
||||
|
||||
Module *DocTasksWidget::searchModuleByID(int id)
|
||||
{
|
||||
Module* ptrModule = nullptr;
|
||||
|
||||
for(Module* module: listAllModules)
|
||||
{
|
||||
ptrModule = module->getModuleByID(id);
|
||||
if(ptrModule)
|
||||
return ptrModule;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DocTasksWidget::preparationTreeWidget()
|
||||
{
|
||||
treeWidget->setColumnCount(2);
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
|
||||
treeWidget->setColumnWidth(ColumnsTree::clmn_ID, 80);
|
||||
treeWidget->setColumnWidth(ColumnsTree::clmn_PMorDM, 900);
|
||||
|
||||
//treeWidget->setColumnHidden(ColumnsTree::clmn_ID, true);
|
||||
}
|
||||
|
||||
void DocTasksWidget::reSetHeadTreeWidget()
|
||||
{
|
||||
QStringList listHeaders = {tr("PM/DM"), tr("ID")};
|
||||
treeWidget->setHeaderLabels(listHeaders);
|
||||
}
|
||||
|
||||
void DocTasksWidget::updateTreeWidget()
|
||||
{
|
||||
//Обновление дерева
|
||||
treeWidget->clear();
|
||||
|
||||
for(Module* module : listAllModules)
|
||||
{
|
||||
addModuleToTreeWidget(module);
|
||||
}
|
||||
}
|
||||
|
||||
void DocTasksWidget::addModuleToTreeWidget(Module *module, QTreeWidgetItem* parentItem)
|
||||
{
|
||||
QTreeWidgetItem* itemModule = nullptr;
|
||||
|
||||
QString text;
|
||||
QString ID = QString::number(module->getID());
|
||||
|
||||
if(parentItem)
|
||||
{
|
||||
itemModule = new QTreeWidgetItem();
|
||||
parentItem->addChild(itemModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
itemModule = new QTreeWidgetItem(treeWidget);
|
||||
}
|
||||
|
||||
if(module->getType() == ModuleType::TYPE_PM)
|
||||
{
|
||||
PM* PMmodul = static_cast<PM*>(module);
|
||||
text = PMmodul->getLangStructRus().title;
|
||||
|
||||
for(Module* module : PMmodul->getListChildModules())
|
||||
{
|
||||
addModuleToTreeWidget(module, itemModule);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DM* DMmodul = static_cast<DM*>(module);
|
||||
text = DMmodul->getLangStructRus().techName;
|
||||
|
||||
itemModule->setFlags(itemModule->flags() | Qt::ItemIsUserCheckable);
|
||||
itemModule->setCheckState(0, Qt::Checked);
|
||||
itemModule->setIcon(0, QIcon(":/resources/icons/procedure.png"));
|
||||
}
|
||||
|
||||
itemModule->setText(ColumnsTree::clmn_PMorDM, text);
|
||||
itemModule->setText(ColumnsTree::clmn_ID, ID);
|
||||
}
|
||||
|
||||
48
InstructorsAndTrainees/docTasks/doctaskswidget.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef DOCTASKSWIDGET_H
|
||||
#define DOCTASKSWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTreeWidget>
|
||||
#include <QDomNode>
|
||||
#include "module.h"
|
||||
|
||||
namespace Ui {
|
||||
class DocTasksWidget;
|
||||
}
|
||||
|
||||
class DocTasksWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
enum ColumnsTree{
|
||||
clmn_PMorDM = 0,
|
||||
clmn_ID
|
||||
};
|
||||
|
||||
public:
|
||||
explicit DocTasksWidget(QWidget *parent = nullptr);
|
||||
~DocTasksWidget();
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
|
||||
private:
|
||||
void domElementParser(QDomElement element, Module* moduleParent);
|
||||
void loadDocTasksFromXML();
|
||||
void deleteAllModuls();
|
||||
Module* searchModuleByID(int id);
|
||||
|
||||
void preparationTreeWidget();
|
||||
void reSetHeadTreeWidget();
|
||||
void updateTreeWidget();
|
||||
void addModuleToTreeWidget(Module* module, QTreeWidgetItem* parentItem = nullptr);
|
||||
|
||||
private:
|
||||
Ui::DocTasksWidget *ui;
|
||||
QTreeWidget* treeWidget;
|
||||
|
||||
QList<Module*> listAllModules;
|
||||
};
|
||||
|
||||
#endif // DOCTASKSWIDGET_H
|
||||
61
InstructorsAndTrainees/docTasks/doctaskswidget.ui
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DocTasksWidget</class>
|
||||
<widget class="QWidget" name="DocTasksWidget">
|
||||
<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>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>AMM</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editCode">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
174
InstructorsAndTrainees/docTasks/fimtaskswidget.cpp
Normal file
@@ -0,0 +1,174 @@
|
||||
#include <QDomDocument>
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
#include <QTreeWidget>
|
||||
#include "fimtaskswidget.h"
|
||||
#include "ui_fimtaskswidget.h"
|
||||
#include "tasksAmmFim.h"
|
||||
|
||||
FIMtasksWidget::FIMtasksWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::FIMtasksWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
loadTasksAmmFimFromXML();
|
||||
|
||||
preparationTreeWidget();
|
||||
|
||||
fillTree();
|
||||
}
|
||||
|
||||
FIMtasksWidget::~FIMtasksWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void FIMtasksWidget::loadTasksAmmFimFromXML()
|
||||
{
|
||||
QDomDocument docTasksDOM;
|
||||
QString xmlFileName = "./tasksFIM.xml";
|
||||
QFile xmlInFile(xmlFileName);
|
||||
if (!xmlInFile.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
QMessageBox::critical(nullptr, tr("Attention!"), tr("The file could not be opened ") + xmlFileName);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
docTasksDOM.setContent(xmlInFile.readAll());
|
||||
xmlInFile.close();
|
||||
|
||||
QDomElement RRJTasksElement = docTasksDOM.firstChildElement("RRJTasks");
|
||||
if(RRJTasksElement.isNull())
|
||||
return;
|
||||
|
||||
QDomElement taskElement = RRJTasksElement.firstChildElement();
|
||||
if(taskElement.isNull())
|
||||
return;
|
||||
|
||||
do
|
||||
{/*task*/
|
||||
QString name = taskElement.nodeName();
|
||||
QDomNamedNodeMap nodeMap = taskElement.attributes();
|
||||
|
||||
if(name == "task")
|
||||
{
|
||||
TaskAmmFim task;
|
||||
|
||||
task.initialize(nodeMap.namedItem("id").nodeValue().toInt(),
|
||||
nodeMap.namedItem("type").nodeValue(),
|
||||
nodeMap.namedItem("title").nodeValue(),
|
||||
nodeMap.namedItem("status").nodeValue(),
|
||||
nodeMap.namedItem("created").nodeValue(),
|
||||
nodeMap.namedItem("changed").nodeValue());
|
||||
|
||||
QDomElement malfunctionElement = taskElement.firstChildElement();
|
||||
if(!malfunctionElement.isNull())
|
||||
{
|
||||
do
|
||||
{/*malfunction*/
|
||||
QString name = malfunctionElement.nodeName();
|
||||
QDomNamedNodeMap nodeMap = malfunctionElement.attributes();
|
||||
|
||||
if(name == "malfunction")
|
||||
{
|
||||
Malfunction malfunction;
|
||||
|
||||
malfunction.initialize(nodeMap.namedItem("dmCode").nodeValue(),
|
||||
nodeMap.namedItem("num").nodeValue(),
|
||||
nodeMap.namedItem("description").nodeValue());
|
||||
|
||||
QDomElement signElement = malfunctionElement.firstChildElement();
|
||||
if(!signElement.isNull())
|
||||
{
|
||||
do
|
||||
{/*malfunctionSign*/
|
||||
QString name = signElement.nodeName();
|
||||
QDomNamedNodeMap nodeMap = signElement.attributes();
|
||||
|
||||
if(name == "malfunctionSign")
|
||||
{
|
||||
MalfunctionSign sign;
|
||||
|
||||
sign.initialize(nodeMap.namedItem("type").nodeValue().toInt(),
|
||||
nodeMap.namedItem("description").nodeValue());
|
||||
|
||||
malfunction.addMalfunctionSign(sign);
|
||||
}
|
||||
|
||||
}while(! (signElement = signElement.nextSiblingElement()).isNull());
|
||||
}
|
||||
task.addMalfunction(malfunction);
|
||||
}
|
||||
}while(! (malfunctionElement = malfunctionElement.nextSiblingElement()).isNull());
|
||||
}
|
||||
listTaskAmmFim.append(task);
|
||||
}
|
||||
}while (! (taskElement = taskElement.nextSiblingElement()).isNull());
|
||||
}
|
||||
}
|
||||
|
||||
void FIMtasksWidget::fillTree()
|
||||
{
|
||||
for(int i = 0; i < listTaskAmmFim.count(); i++)
|
||||
{/*Задачи*/
|
||||
TaskAmmFim task = listTaskAmmFim.at(i);
|
||||
|
||||
QTreeWidgetItem* itemTask = new QTreeWidgetItem();
|
||||
|
||||
itemTask->setText(0, task.title);
|
||||
itemTask->setText(1, QString::number(task.id));
|
||||
itemTask->setFlags(itemTask->flags() | Qt::ItemIsUserCheckable);
|
||||
itemTask->setCheckState(0, Qt::Checked);
|
||||
itemTask->setIcon(0, QIcon(":/resources/icons/procedure.png"));
|
||||
|
||||
ui->treeWidget->addTopLevelItem(itemTask);
|
||||
|
||||
for (int j = 0; j < task.malfunctionList.count(); j++)
|
||||
{/*Неисправности*/
|
||||
Malfunction malfunction = task.malfunctionList.at(j);
|
||||
|
||||
QTreeWidgetItem* itemMalfunction = new QTreeWidgetItem();
|
||||
|
||||
itemMalfunction->setText(0, malfunction.description);
|
||||
itemMalfunction->setFlags(itemMalfunction->flags() | Qt::ItemIsUserCheckable);
|
||||
itemMalfunction->setCheckState(0, Qt::Checked);
|
||||
itemMalfunction->setIcon(0, QIcon(":/resources/icons/malfunction.png"));
|
||||
|
||||
itemTask->addChild(itemMalfunction);
|
||||
|
||||
for (int k = 0; k < malfunction.malfunctionSigns.count(); k++)
|
||||
{/*Сигнализация*/
|
||||
MalfunctionSign sign = malfunction.malfunctionSigns.at(k);
|
||||
|
||||
QTreeWidgetItem* itemSign = new QTreeWidgetItem();
|
||||
|
||||
itemSign->setText(0, sign.description);
|
||||
//itemSign->setFlags(itemSign->flags() | Qt::ItemIsUserCheckable);
|
||||
//itemSign->setCheckState(0, Qt::Checked);
|
||||
itemSign->setIcon(0, QIcon(":/resources/icons/sign.png"));
|
||||
|
||||
itemMalfunction->addChild(itemSign);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FIMtasksWidget::preparationTreeWidget()
|
||||
{
|
||||
ui->treeWidget->setColumnCount(2);
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
|
||||
ui->treeWidget->setColumnWidth(ColumnsTree::clmn_ID, 20);
|
||||
ui->treeWidget->setColumnWidth(ColumnsTree::clmn_Title, 500);
|
||||
|
||||
//ui->treeWidget->setColumnHidden(ColumnsTree::clmn_ID, true);
|
||||
}
|
||||
|
||||
void FIMtasksWidget::reSetHeadTreeWidget()
|
||||
{
|
||||
QStringList listHeaders = {tr("Title"), tr("ID")};
|
||||
ui->treeWidget->setHeaderLabels(listHeaders);
|
||||
}
|
||||
40
InstructorsAndTrainees/docTasks/fimtaskswidget.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef FIMTASKSWIDGET_H
|
||||
#define FIMTASKSWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "tasksAmmFim.h"
|
||||
|
||||
namespace Ui {
|
||||
class FIMtasksWidget;
|
||||
}
|
||||
|
||||
class FIMtasksWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
enum ColumnsTree{
|
||||
clmn_Title = 0,
|
||||
clmn_ID
|
||||
};
|
||||
|
||||
public:
|
||||
explicit FIMtasksWidget(QWidget *parent = nullptr);
|
||||
~FIMtasksWidget();
|
||||
|
||||
private:
|
||||
void loadTasksAmmFimFromXML();
|
||||
void fillTree();
|
||||
void preparationTreeWidget();
|
||||
void reSetHeadTreeWidget();
|
||||
|
||||
|
||||
public:
|
||||
QString userName;
|
||||
QList<TaskAmmFim> listTaskAmmFim;
|
||||
|
||||
private:
|
||||
Ui::FIMtasksWidget *ui;
|
||||
};
|
||||
|
||||
#endif // FIMTASKSWIDGET_H
|
||||
50
InstructorsAndTrainees/docTasks/fimtaskswidget.ui
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FIMtasksWidget</class>
|
||||
<widget class="QWidget" name="FIMtasksWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>472</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>FIM</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="4" column="0">
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>List of tasks</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
178
InstructorsAndTrainees/docTasks/module.cpp
Normal file
@@ -0,0 +1,178 @@
|
||||
#include "module.h"
|
||||
|
||||
int Module::lastID = 0;
|
||||
|
||||
Module::Module():
|
||||
type (ModuleType::TYPE_PM),
|
||||
parentModule(nullptr),
|
||||
ID(0)
|
||||
{
|
||||
ID = ++lastID;
|
||||
}
|
||||
|
||||
Module::~Module()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Module *Module::getModuleByID(int id)
|
||||
{
|
||||
if(getID() == id)
|
||||
return this;
|
||||
|
||||
if(this->getType() == ModuleType::TYPE_PM)
|
||||
{
|
||||
PM* PMmodul = static_cast<PM*>(this);
|
||||
|
||||
Module* ptrModule = nullptr;
|
||||
|
||||
for(Module* module: PMmodul->getListChildModules())
|
||||
{
|
||||
ptrModule = module->getModuleByID(id);
|
||||
|
||||
if(ptrModule)
|
||||
return ptrModule;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PM::PM():
|
||||
modelIdentCode (),
|
||||
pmIssuer (),
|
||||
pmNumber (),
|
||||
pmVolume ()
|
||||
{
|
||||
type = ModuleType::TYPE_PM;
|
||||
|
||||
langRus.title = "";
|
||||
langEng.title = "";
|
||||
}
|
||||
|
||||
PM::~PM()
|
||||
{
|
||||
for(Module* module: listChildModules)
|
||||
{
|
||||
if(module->getType() == ModuleType::TYPE_PM)
|
||||
delete static_cast<PM*>(module);
|
||||
else
|
||||
delete static_cast<DM*>(module);
|
||||
}
|
||||
listChildModules.clear();
|
||||
}
|
||||
|
||||
void PM::initialize(QString modelIdentCode, QString pmIssuer, QString pmNumber, QString pmVolume)
|
||||
{
|
||||
this->modelIdentCode = modelIdentCode;
|
||||
this->pmIssuer = pmIssuer;
|
||||
this->pmNumber = pmNumber;
|
||||
this->pmVolume = pmVolume;
|
||||
}
|
||||
|
||||
void PM::setLangStructRus(QString title)
|
||||
{
|
||||
langRus.title = title;
|
||||
}
|
||||
|
||||
PM::pmLangStruct PM::getLangStructRus()
|
||||
{
|
||||
return langRus;
|
||||
}
|
||||
|
||||
void PM::setLangStructEng(QString title)
|
||||
{
|
||||
langEng.title = title;
|
||||
}
|
||||
|
||||
void PM::addChildModule(Module *childModule)
|
||||
{
|
||||
listChildModules.append(childModule);
|
||||
}
|
||||
|
||||
QList<Module *> PM::getListChildModules()
|
||||
{
|
||||
return listChildModules;
|
||||
}
|
||||
|
||||
QString PM::pmCode()
|
||||
{
|
||||
return (modelIdentCode + "-" + pmIssuer + "-" + pmNumber + "-" + pmVolume).toUpper();
|
||||
}
|
||||
|
||||
|
||||
|
||||
DM::DM():
|
||||
modelIdentCode (),
|
||||
systemDiffCode (),
|
||||
systemCode (),
|
||||
subSystemCode (),
|
||||
subSubSystemCode (),
|
||||
assyCode (),
|
||||
disassyCode (),
|
||||
disassyCodeVariant (),
|
||||
infoCode (),
|
||||
infoCodeVariant (),
|
||||
itemLocationCode ()
|
||||
{
|
||||
type = ModuleType::TYPE_DM;
|
||||
|
||||
setLangStructRus("", "", "", "", "");
|
||||
setLangStructEng("", "", "", "", "");
|
||||
}
|
||||
|
||||
DM::~DM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DM::initialize(QString modelIdentCode, QString systemDiffCode, QString systemCode,
|
||||
QString subSystemCode, QString subSubSystemCode, QString assyCode,
|
||||
QString disassyCode, QString disassyCodeVariant, QString infoCode,
|
||||
QString infoCodeVariant, QString itemLocationCode)
|
||||
{
|
||||
this->modelIdentCode = modelIdentCode;
|
||||
this->systemDiffCode = systemDiffCode;
|
||||
this->systemCode = systemCode;
|
||||
this->subSystemCode = subSystemCode;
|
||||
this->subSubSystemCode = subSubSystemCode;
|
||||
this->assyCode = assyCode;
|
||||
this->disassyCode = disassyCode;
|
||||
this->disassyCodeVariant = disassyCodeVariant;
|
||||
this->infoCode = infoCode;
|
||||
this->infoCodeVariant = infoCodeVariant;
|
||||
this->itemLocationCode = itemLocationCode;
|
||||
}
|
||||
|
||||
void DM::setLangStructRus(QString techName, QString infoName, QString pdf, QString bookmark, QString xml)
|
||||
{
|
||||
langRus.techName = techName;
|
||||
langRus.infoName = infoName;
|
||||
langRus.pdf = pdf;
|
||||
langRus.bookmark = bookmark;
|
||||
langRus.xml = xml;
|
||||
}
|
||||
|
||||
DM::dmLangStruct DM::getLangStructRus()
|
||||
{
|
||||
return langRus;
|
||||
}
|
||||
|
||||
void DM::setLangStructEng(QString techName, QString infoName, QString pdf, QString bookmark, QString xml)
|
||||
{
|
||||
langEng.techName = techName;
|
||||
langEng.infoName = infoName;
|
||||
langEng.pdf = pdf;
|
||||
langEng.bookmark = bookmark;
|
||||
langEng.xml = xml;
|
||||
}
|
||||
|
||||
QString DM::dmCode()
|
||||
{
|
||||
return (modelIdentCode + "-" + systemDiffCode + "-" + systemCode + "-" +
|
||||
subSystemCode + subSubSystemCode + "-" + assyCode + "-" +
|
||||
disassyCode + disassyCodeVariant + "-" + infoCode +
|
||||
infoCodeVariant + "-" + itemLocationCode).toUpper();
|
||||
}
|
||||
115
InstructorsAndTrainees/docTasks/module.h
Normal file
@@ -0,0 +1,115 @@
|
||||
#ifndef MODULE_H
|
||||
#define MODULE_H
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
|
||||
enum ModuleType
|
||||
{
|
||||
TYPE_PM = 0,
|
||||
TYPE_DM = 1
|
||||
};
|
||||
|
||||
class Module
|
||||
{
|
||||
public:
|
||||
Module();
|
||||
~Module();
|
||||
|
||||
int getID(){ return ID; };
|
||||
ModuleType getType(){ return type; };
|
||||
void setParentModule(Module* parentModule){ this->parentModule = parentModule; };
|
||||
Module* getModuleByID(int id);
|
||||
|
||||
protected:
|
||||
ModuleType type;
|
||||
Module* parentModule;
|
||||
int ID;
|
||||
static int lastID;
|
||||
};
|
||||
|
||||
|
||||
class PM : public Module
|
||||
{
|
||||
public:
|
||||
struct pmLangStruct
|
||||
{
|
||||
QString title;
|
||||
};
|
||||
|
||||
public:
|
||||
PM();
|
||||
~PM();
|
||||
|
||||
public:
|
||||
void initialize(QString modelIdentCode, QString pmIssuer, QString pmNumber, QString pmVolume);
|
||||
void setLangStructRus(QString title);
|
||||
pmLangStruct getLangStructRus();
|
||||
void setLangStructEng(QString title);
|
||||
void addChildModule(Module* childModule);
|
||||
QList<Module*> getListChildModules();
|
||||
QString pmCode();
|
||||
|
||||
private:
|
||||
QString modelIdentCode;
|
||||
QString pmIssuer;
|
||||
QString pmNumber;
|
||||
QString pmVolume;
|
||||
|
||||
pmLangStruct langRus;
|
||||
pmLangStruct langEng;
|
||||
|
||||
QList<Module*> listChildModules;
|
||||
};
|
||||
|
||||
|
||||
class DM : public Module
|
||||
{
|
||||
public:
|
||||
struct dmLangStruct
|
||||
{
|
||||
QString techName;
|
||||
QString infoName;
|
||||
QString pdf;
|
||||
QString bookmark;
|
||||
QString xml;
|
||||
};
|
||||
|
||||
public:
|
||||
DM();
|
||||
~DM();
|
||||
|
||||
public:
|
||||
void initialize(QString modelIdentCode,
|
||||
QString systemDiffCode,
|
||||
QString systemCode,
|
||||
QString subSystemCode,
|
||||
QString subSubSystemCode,
|
||||
QString assyCode,
|
||||
QString disassyCode,
|
||||
QString disassyCodeVariant,
|
||||
QString infoCode,
|
||||
QString infoCodeVariant,
|
||||
QString itemLocationCode);
|
||||
void setLangStructRus(QString techName, QString infoName, QString pdf, QString bookmark, QString xml);
|
||||
dmLangStruct getLangStructRus();
|
||||
void setLangStructEng(QString techName, QString infoName, QString pdf, QString bookmark, QString xml);
|
||||
QString dmCode();
|
||||
|
||||
private:
|
||||
QString modelIdentCode;
|
||||
QString systemDiffCode;
|
||||
QString systemCode;
|
||||
QString subSystemCode;
|
||||
QString subSubSystemCode;
|
||||
QString assyCode;
|
||||
QString disassyCode;
|
||||
QString disassyCodeVariant;
|
||||
QString infoCode;
|
||||
QString infoCodeVariant;
|
||||
QString itemLocationCode;
|
||||
|
||||
dmLangStruct langRus;
|
||||
dmLangStruct langEng;
|
||||
};
|
||||
|
||||
#endif // MODULE_H
|
||||
38
InstructorsAndTrainees/docTasks/tasksAmmFim.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "tasksAmmFim.h"
|
||||
#include <QDomDocument>
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
void TaskAmmFim::initialize(int id, QString type, QString title, QString status, QString created_date, QString changed_date)
|
||||
{
|
||||
this->id = id;
|
||||
this->type = type;
|
||||
this->title = title;
|
||||
this->status = status;
|
||||
this->created_date = created_date;
|
||||
this->changed_date = changed_date;
|
||||
}
|
||||
|
||||
void TaskAmmFim::addMalfunction(Malfunction malfunction)
|
||||
{
|
||||
malfunctionList.append(malfunction);
|
||||
}
|
||||
|
||||
void Malfunction::initialize(QString dmCode, QString num, QString description)
|
||||
{
|
||||
this->dmCode = dmCode;
|
||||
this->num = num;
|
||||
this->description = description;
|
||||
}
|
||||
|
||||
void Malfunction::addMalfunctionSign(MalfunctionSign sign)
|
||||
{
|
||||
malfunctionSigns.append(sign);
|
||||
}
|
||||
|
||||
void MalfunctionSign::initialize(int type, QString description)
|
||||
{
|
||||
this->type = type;
|
||||
this->description = description;
|
||||
}
|
||||
102
InstructorsAndTrainees/docTasks/tasksAmmFim.h
Normal file
@@ -0,0 +1,102 @@
|
||||
#ifndef TASKSAMMFIM_H
|
||||
#define TASKSAMMFIM_H
|
||||
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
|
||||
class ProcedureID
|
||||
{
|
||||
public:
|
||||
ProcedureID(){};
|
||||
~ProcedureID(){};
|
||||
public:
|
||||
QString doc; // "amm", "fim"
|
||||
QString dmCode;
|
||||
QString title;
|
||||
QString result; // "" - нет результата, "viewed" - процедура изучена (просмотрена при отсутствующем сценарии), "completed" - выполнена (в т.ч. режим "контроль" сценария)
|
||||
};
|
||||
|
||||
class MalfunctionSign // признак неисправности
|
||||
{
|
||||
public:
|
||||
MalfunctionSign(){};
|
||||
~MalfunctionSign(){};
|
||||
public:
|
||||
void initialize(int type, QString description);
|
||||
public:
|
||||
int type; // "1" - аварийно-сигнальные сообщения, "2" - сообщения БСТО,
|
||||
// "3" - сигнализация СЭИ, "4" - локальная сигнализация, "5" - наблюдаемая неисправность
|
||||
QString description; // описание (напр. "ЭРРД, 25, DOOR_FAIL_TO_CLOSE" - для БСТО)
|
||||
};
|
||||
|
||||
class Malfunction // неисправность
|
||||
{
|
||||
public:
|
||||
Malfunction(){};
|
||||
~Malfunction(){};
|
||||
public:
|
||||
void initialize(QString dmCode, QString num, QString description);
|
||||
void addMalfunctionSign(MalfunctionSign sign);
|
||||
public:
|
||||
QString dmCode; // dmCode процедуры
|
||||
QString num; // номер по-порядку в пункте "2. Возможные причины" процедуры
|
||||
QString description; // описание
|
||||
QList<MalfunctionSign> malfunctionSigns;// список соответствующих неисправности признаков
|
||||
};
|
||||
|
||||
class FIMReportItem
|
||||
{
|
||||
public:
|
||||
FIMReportItem(){};
|
||||
~FIMReportItem(){};
|
||||
public:
|
||||
QString title; // текст, вводимый обучаемым
|
||||
ProcedureID procedure; // ссылка на процедуру, при необходимости
|
||||
};
|
||||
|
||||
class FIMReport
|
||||
{
|
||||
public:
|
||||
FIMReport(){};
|
||||
~FIMReport(){};
|
||||
public:
|
||||
QList<FIMReportItem> itemList;
|
||||
};
|
||||
|
||||
class TaskAmmFim
|
||||
{
|
||||
public:
|
||||
TaskAmmFim(){};
|
||||
~TaskAmmFim(){};
|
||||
public:
|
||||
void initialize(int id, QString type, QString title, QString status, QString created_date, QString changed_date);
|
||||
void addMalfunction(Malfunction malfunction);
|
||||
public:
|
||||
|
||||
int id; // для идентификации в БД
|
||||
|
||||
QString type; // "amm" - процедура из Руководства по технической эксплуатации
|
||||
// "fim" - поиск и устранение неисправностей
|
||||
|
||||
QString title; // название задания:
|
||||
// для "amm" - берётся из титула процедуры
|
||||
// для "fim" - вводится вручную
|
||||
|
||||
QString status; // "new" - задание не выполнено
|
||||
// "checkup" - выполнено, на проверке у инструктора (только для "fim")
|
||||
// "failed" - инструктором проверено, выполнено неверно (только для "fim")
|
||||
// "completed" - выполнено корректно
|
||||
|
||||
QString created_date; // дата создания задания инструктором ("new")
|
||||
// (при записи в базу, даты ставить по времени сервера, а не те, что присланы от клиента)
|
||||
QString changed_date; // дата крайнего изменения статуса ("checkup", "failed", "completed")
|
||||
|
||||
// amm:
|
||||
ProcedureID ammProcedure; // ссылка на процедуру в AMM
|
||||
|
||||
// fim:
|
||||
QList<Malfunction> malfunctionList; // список неисправностей
|
||||
FIMReport report; // отчет по выполнению "fim"
|
||||
};
|
||||
|
||||
#endif // TASKSAMMFIM_H
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "dialogauthorizationinstructor.h"
|
||||
#include "ui_dialogauthorizationinstructor.h"
|
||||
|
||||
DialogAuthorizationInstructor::DialogAuthorizationInstructor(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogAuthorizationInstructor)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->editLogin->setProperty("mandatoryField", true);
|
||||
ui->editPassword->setProperty("mandatoryField", true);
|
||||
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
|
||||
}
|
||||
|
||||
DialogAuthorizationInstructor::~DialogAuthorizationInstructor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef DIALOGAUTHORIZATIONINSTRUCTOR_H
|
||||
#define DIALOGAUTHORIZATIONINSTRUCTOR_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "ui_dialogauthorizationinstructor.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogAuthorizationInstructor;
|
||||
}
|
||||
|
||||
class DialogAuthorizationInstructor : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogAuthorizationInstructor(QWidget *parent = nullptr);
|
||||
~DialogAuthorizationInstructor();
|
||||
|
||||
QString getLogin()
|
||||
{
|
||||
return ui->editLogin->text();
|
||||
}
|
||||
|
||||
QString getPassword()
|
||||
{
|
||||
return ui->editPassword->text();
|
||||
}
|
||||
|
||||
private:
|
||||
Ui::DialogAuthorizationInstructor *ui;
|
||||
};
|
||||
|
||||
#endif // DIALOGAUTHORIZATIONINSTRUCTOR_H
|
||||
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DialogAuthorizationInstructor</class>
|
||||
<widget class="QDialog" name="DialogAuthorizationInstructor">
|
||||
<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="../resources.qrc">
|
||||
<normaloff>:/icons/login-user.png</normaloff>:/icons/login-user.png</iconset>
|
||||
</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_1">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Login</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<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="editLogin">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>admin</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editPassword">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>admin</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="locale">
|
||||
<locale language="English" country="UnitedStates"/>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>DialogAuthorizationInstructor</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>DialogAuthorizationInstructor</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
79
InstructorsAndTrainees/instructors/dialogeditinstructor.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
#include "dialogeditinstructor.h"
|
||||
#include "ui_dialogeditinstructor.h"
|
||||
#include <QPushButton>
|
||||
|
||||
DialogEditInstructor::DialogEditInstructor(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogEditInstructor),
|
||||
instructorInput()
|
||||
{
|
||||
ui->setupUi(this);
|
||||
verify();
|
||||
|
||||
ui->editName->setProperty("mandatoryField", true);
|
||||
ui->editLogin->setProperty("mandatoryField", true);
|
||||
ui->editPassword->setProperty("mandatoryField", true);
|
||||
}
|
||||
|
||||
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);
|
||||
else
|
||||
ui->editName->setEnabled(true);
|
||||
}
|
||||
|
||||
Instructor DialogEditInstructor::getInstructor()
|
||||
{
|
||||
Instructor instructor = instructorInput;
|
||||
|
||||
instructor.setName(ui->editName->text());
|
||||
instructor.setLogin(ui->editLogin->text());
|
||||
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->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||
else
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||
}
|
||||
39
InstructorsAndTrainees/instructors/dialogeditinstructor.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#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(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);
|
||||
|
||||
private:
|
||||
void verify();
|
||||
|
||||
private:
|
||||
Ui::DialogEditInstructor *ui;
|
||||
|
||||
Instructor instructorInput;
|
||||
};
|
||||
|
||||
#endif // DIALOGEDITINSTRUCTOR_H
|
||||
226
InstructorsAndTrainees/instructors/dialogeditinstructor.ui
Normal file
@@ -0,0 +1,226 @@
|
||||
<?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>300</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>
|
||||
<widget class="QLineEdit" name="editPassword"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</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="../resources.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="../resources.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>Logged</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.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>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="locale">
|
||||
<locale language="English" country="UnitedStates"/>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>DialogEditInstructor</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>DialogEditInstructor</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
336
InstructorsAndTrainees/instructors/editorinstructors.cpp
Normal file
@@ -0,0 +1,336 @@
|
||||
#include <QMessageBox>
|
||||
#include "editorinstructors.h"
|
||||
#include "dialogeditinstructor.h"
|
||||
#include "ui_editorinstructors.h"
|
||||
|
||||
EditorInstructors::EditorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent) :
|
||||
InstructorsView(connectorToServer, CommonView::TypeView::control, parent),
|
||||
ui(new Ui::EditorInstructors)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(treeWidget, &QTreeWidget::currentItemChanged, this, &EditorInstructors::on_treeWidget_currentItemChanged);
|
||||
|
||||
ui->verticalLayout_1->addWidget(treeWidget);
|
||||
|
||||
this->adminMode = adminMode;
|
||||
|
||||
preparationTreeWidget();
|
||||
//setNotLoggedInVisible(true);
|
||||
loadInstructorsFromDB();
|
||||
|
||||
if(adminMode)
|
||||
ui->btnArchive->click();
|
||||
}
|
||||
|
||||
EditorInstructors::~EditorInstructors()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnNewInstructor_clicked()
|
||||
{
|
||||
Instructor instructor;
|
||||
Instructor instructor_edit;
|
||||
|
||||
if(editInstructor(instructor, &instructor_edit))
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_INSTRUCTOR, 0, &instructor_edit);
|
||||
|
||||
return;
|
||||
/*
|
||||
if(int id_instructor = dbLMS->newInstructor())
|
||||
{
|
||||
loadInstructorsFromDB();
|
||||
setCurrentInstructor(id_instructor);
|
||||
|
||||
DialogEditInstructor dlg(this);
|
||||
|
||||
Instructor instructor = dbLMS->getInstructor(id_instructor);
|
||||
if(instructor.getID() == 0)
|
||||
return;
|
||||
|
||||
dlg.setInstructor(instructor);
|
||||
|
||||
while (true)
|
||||
{
|
||||
switch( dlg.exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
Instructor instructor_edit = dlg.getInstructor();
|
||||
|
||||
if(int id_edit = dbLMS->editInstructor(instructor_edit))
|
||||
{//Отредактировано
|
||||
loadInstructorsFromDB();
|
||||
setCurrentInstructor(id_edit);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
dlg.setInstructor(instructor_edit);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
dbLMS->delInstructor(id_instructor);
|
||||
loadInstructorsFromDB();
|
||||
return;
|
||||
default:
|
||||
dbLMS->delInstructor(id_instructor);
|
||||
loadInstructorsFromDB();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnDeleteInstructor_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран Инструктор
|
||||
|
||||
int id = treeItemCurrent->text(ColumnsTreeInsructors::clmn_ID).toInt();
|
||||
|
||||
if(connectorToServer->isAdminInstructor(id))
|
||||
{//Это Админ!
|
||||
QMessageBox::critical(this, tr("Error!"), tr("You cannot delete the Administrator."));
|
||||
return;
|
||||
}
|
||||
|
||||
if(connectorToServer->isLoggedInInstructor(id))
|
||||
{//Инструктор залогирован!
|
||||
QMessageBox::critical(this, tr("Error!"), tr("You cannot delete a logged-in instructor."));
|
||||
return;
|
||||
}
|
||||
|
||||
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||
{
|
||||
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(ColumnsTreeInsructors::clmn_ID).toInt();
|
||||
|
||||
Instructor instructor = connectorToServer->getInstructor(id);
|
||||
if(instructor.getID() == 0)
|
||||
return;
|
||||
|
||||
if(connectorToServer->isArchivedInstructor(id))
|
||||
{//Архивный
|
||||
instructor.setArchived(false);
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor);
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
if(connectorToServer->isLoggedInInstructor(id))
|
||||
{//Инструктор залогирован!
|
||||
QMessageBox::critical(this, tr("Error!"), tr("You cannot archive a logged-in instructor."));
|
||||
return;
|
||||
}
|
||||
|
||||
instructor.setArchived(true);
|
||||
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(ColumnsTreeInsructors::clmn_ID).toInt();
|
||||
|
||||
if(connectorToServer->isLoggedInInstructor(id))
|
||||
{//Инструктор залогирован!
|
||||
QMessageBox::critical(this, tr("Error!"), 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))
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_EDIT_INSTRUCTOR, id, &instructor_edit);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnArchive_clicked()
|
||||
{
|
||||
bool state = ui->btnArchive->isChecked();
|
||||
setArchiveVisible(state);
|
||||
if(!state)
|
||||
{
|
||||
lastCurrentID = 0;
|
||||
}
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
|
||||
void EditorInstructors::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
||||
{
|
||||
//Определяем доступность и функционал кнопок для выбранного элемента
|
||||
|
||||
if(current == nullptr)
|
||||
return;
|
||||
|
||||
QTreeWidgetItem *treeItemParent = current->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран инструктор
|
||||
|
||||
int id = current->text(ColumnsTreeInsructors::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) || 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);
|
||||
}
|
||||
}
|
||||
|
||||
bool EditorInstructors::verifyInstructor(Instructor instructor)
|
||||
{
|
||||
//Проверка корректности логина, имени, пароля
|
||||
|
||||
if(instructor.getName() == QStringLiteral("<instructor>"))
|
||||
{//Имя не корректно!
|
||||
QMessageBox::critical(this, tr("Editing error!"),
|
||||
tr("Unacceptable instructor name has been entered.\nThe changes will not be accepted."));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(instructor.getLogin() == QStringLiteral("<login>"))
|
||||
{//Логин не корректен!
|
||||
QMessageBox::critical(this, tr("Editing error!"),
|
||||
tr("Unacceptable instructor login has been entered.\nThe changes will not be accepted."));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(instructor.getPassword() == QStringLiteral("<password>"))
|
||||
{//Пароль не корректный!
|
||||
QMessageBox::critical(this, tr("Editing error!"),
|
||||
tr("Unacceptable instructor password has been entered.\nThe changes will not be accepted."));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QList<Instructor> listInstructors = connectorToServer->getListInstructors();
|
||||
|
||||
for(Instructor exist_instructor : listInstructors)
|
||||
{
|
||||
if(instructor.getName() == exist_instructor.getName() && instructor.getID() != exist_instructor.getID())
|
||||
{//Имя уже существует
|
||||
QMessageBox::critical(this, tr("Editing error!"),
|
||||
tr("An existing instructor name has been entered."));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(instructor.getLogin() == exist_instructor.getLogin() && instructor.getID() != exist_instructor.getID())
|
||||
{//Логин уже существует!
|
||||
QMessageBox::critical(this, tr("Editing error!"),
|
||||
tr("An existing instructor login has been entered.\nThe changes will not be accepted."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorInstructors::editInstructor(Instructor instructor, Instructor* instructor_edit)
|
||||
{
|
||||
DialogEditInstructor dlg(this);
|
||||
|
||||
dlg.setInstructor(instructor);
|
||||
|
||||
while (true)
|
||||
{
|
||||
switch( dlg.exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
*instructor_edit = dlg.getInstructor();
|
||||
|
||||
if(! verifyInstructor(*instructor_edit))
|
||||
{
|
||||
dlg.setInstructor(*instructor_edit);
|
||||
continue;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
40
InstructorsAndTrainees/instructors/editorinstructors.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef DIALOGINSTRUCTORS_H
|
||||
#define DIALOGINSTRUCTORS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QTreeWidget>
|
||||
#include "instructorsview.h"
|
||||
|
||||
namespace Ui {
|
||||
class EditorInstructors;
|
||||
}
|
||||
|
||||
//Виджет для редактирования БД Инструкторов
|
||||
|
||||
class EditorInstructors : public InstructorsView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EditorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent = nullptr);
|
||||
~EditorInstructors();
|
||||
|
||||
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_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
|
||||
private:
|
||||
//void setCurrentInstructor(int id);
|
||||
bool verifyInstructor(Instructor instructor);
|
||||
|
||||
bool editInstructor(Instructor instructor, Instructor* instructor_edit);
|
||||
|
||||
private:
|
||||
Ui::EditorInstructors *ui;
|
||||
};
|
||||
|
||||
#endif // DIALOGINSTRUCTORS_H
|
||||
240
InstructorsAndTrainees/instructors/editorinstructors.ui
Normal file
@@ -0,0 +1,240 @@
|
||||
<?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="Fixed" 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="../resources.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="Fixed" 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="../resources.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="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="../resources.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="Fixed" 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="../resources.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="Fixed" 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="../resources.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="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
203
InstructorsAndTrainees/instructors/instructorsview.cpp
Normal file
@@ -0,0 +1,203 @@
|
||||
#include <QHeaderView>
|
||||
#include <QTranslator>
|
||||
#include "instructorsview.h"
|
||||
|
||||
InstructorsView::InstructorsView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent):
|
||||
CommonView(connectorToServer, type, parent)
|
||||
{
|
||||
typeObject = TypeObject::objInstructor;
|
||||
}
|
||||
|
||||
void InstructorsView::slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee)
|
||||
{
|
||||
if(typeView == TypeView::onlyView)
|
||||
{
|
||||
if(adminMode)
|
||||
archiveVisible = false;
|
||||
else
|
||||
archiveVisible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
archiveVisible = true;
|
||||
}
|
||||
|
||||
if(adminMode)
|
||||
{
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_ID, false);
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Archived, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_ID, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Archived, true);
|
||||
}
|
||||
|
||||
updateButtons();
|
||||
|
||||
if(treeInstructor)
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
|
||||
void InstructorsView::preparationTreeWidget()
|
||||
{
|
||||
mtxTreeWidget.lock();
|
||||
|
||||
treeWidget->setColumnCount(7);
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
|
||||
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_ID, 50);
|
||||
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Instructor, 250);
|
||||
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Login, 100);
|
||||
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Password, 100);
|
||||
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Administrator, 100);
|
||||
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Archived, 100);
|
||||
treeWidget->setColumnWidth(ColumnsTreeInsructors::clmn_Logged, 100);
|
||||
|
||||
if(typeView == TypeView::onlyView)
|
||||
{//onlyView
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_ID, true);
|
||||
//treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Login, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Password, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Archived, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Administrator, true);
|
||||
|
||||
if(adminMode)
|
||||
archiveVisible = false;
|
||||
else
|
||||
archiveVisible = false;
|
||||
|
||||
notLoggedInVisible = true;
|
||||
}
|
||||
else
|
||||
{//control
|
||||
archiveVisible = true;
|
||||
notLoggedInVisible = true;
|
||||
|
||||
if(adminMode)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_ID, true);
|
||||
treeWidget->setColumnHidden(ColumnsTreeInsructors::clmn_Archived, true);
|
||||
}
|
||||
}
|
||||
|
||||
treeWidget->setSortingEnabled(true);
|
||||
treeWidget->sortItems(ColumnsTreeInsructors::clmn_Instructor, Qt::SortOrder::AscendingOrder);
|
||||
|
||||
mtxTreeWidget.unlock();
|
||||
}
|
||||
|
||||
void InstructorsView::loadInstructorsFromDB()
|
||||
{
|
||||
mtxTreeWidget.lock();
|
||||
|
||||
//Обновление дерева
|
||||
treeWidget->clear();
|
||||
|
||||
//Инструкторы
|
||||
QList<Instructor> listInstructors;
|
||||
|
||||
listInstructors = connectorToServer->getListInstructors();
|
||||
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
QTreeWidgetItem *ItemInstructor = new QTreeWidgetItem(treeWidget);
|
||||
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_ID, QString::number(instructor.getID()));
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Instructor, instructor.getName());
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Login, instructor.getLogin());
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Password, instructor.getPassword());
|
||||
|
||||
//Сокрытие пароля
|
||||
if(!adminMode)
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Password, QStringLiteral("******"));
|
||||
|
||||
if(instructor.getArchived())
|
||||
{//Архивный
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Archived, tr("yes"));
|
||||
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Instructor, QIcon(QStringLiteral(":/resources/icons/archive.png")));
|
||||
setItemColorArchive(ItemInstructor);
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Archived, tr("no"));
|
||||
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Instructor, QIcon(QStringLiteral(":/resources/icons/instructor.png")));
|
||||
setItemColorNoArchive(ItemInstructor);
|
||||
}
|
||||
|
||||
if(instructor.getIsAdmin())
|
||||
{//Админ
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Administrator, tr("yes"));
|
||||
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Instructor, QIcon(QStringLiteral(":/resources/icons/admin.png")));
|
||||
}
|
||||
else
|
||||
{//Не Админ
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Administrator, tr("no"));
|
||||
}
|
||||
|
||||
if(instructor.getLoggedIn())
|
||||
{//Залогинен
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Logged, tr("yes"));
|
||||
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Logged, QIcon(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||
}
|
||||
else
|
||||
{//Не Залогинен
|
||||
ItemInstructor->setText(ColumnsTreeInsructors::clmn_Logged, tr("no"));
|
||||
ItemInstructor->setIcon(ColumnsTreeInsructors::clmn_Logged, QIcon(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
}
|
||||
|
||||
//Скрываем архивных (при необходимости)
|
||||
if(instructor.getArchived())
|
||||
if(! archiveVisible)
|
||||
ItemInstructor->setHidden(true);
|
||||
|
||||
//Скрываем незалогиненых (при необходимости)
|
||||
if(! instructor.getLoggedIn())
|
||||
if(! notLoggedInVisible)
|
||||
ItemInstructor->setHidden(true);
|
||||
}
|
||||
|
||||
treeWidget->expandAll();
|
||||
|
||||
/*
|
||||
//if(typeView == TypeView::control)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
|
||||
if(item != nullptr)
|
||||
treeWidget->setCurrentItem(item);
|
||||
}*/
|
||||
|
||||
setCurrentInstructor(lastCurrentID);
|
||||
|
||||
mtxTreeWidget.unlock();
|
||||
}
|
||||
|
||||
void InstructorsView::reSetHeadTreeWidget()
|
||||
{
|
||||
QStringList listHeaders = {tr("Instructor"), tr("Login"), tr("Password"), tr("Administrator"), tr("Archived"), tr("Logged"), tr("ID")};
|
||||
treeWidget->setHeaderLabels(listHeaders);
|
||||
}
|
||||
|
||||
void InstructorsView::setCurrentInstructor(int id)
|
||||
{
|
||||
for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
|
||||
if(item != nullptr)
|
||||
if(item->text(ColumnsTreeInsructors::clmn_ID).toInt() == id)
|
||||
{
|
||||
treeWidget->setCurrentItem(item);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
|
||||
if(item != nullptr)
|
||||
treeWidget->setCurrentItem(item);
|
||||
}
|
||||
|
||||
41
InstructorsAndTrainees/instructors/instructorsview.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#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);
|
||||
|
||||
protected:
|
||||
enum ColumnsTreeInsructors{
|
||||
clmn_Instructor = 0,
|
||||
clmn_Login,
|
||||
clmn_Password,
|
||||
clmn_Administrator,
|
||||
clmn_Archived,
|
||||
clmn_Logged,
|
||||
clmn_ID
|
||||
};
|
||||
|
||||
public Q_SLOTS:
|
||||
//Слот обработки сигнала необходимости обновления интерфейса
|
||||
void slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee);
|
||||
|
||||
protected:
|
||||
virtual void updateButtons(){};
|
||||
void preparationTreeWidget();
|
||||
void loadInstructorsFromDB();
|
||||
|
||||
void reSetHeadTreeWidget();
|
||||
|
||||
void setCurrentInstructor(int id);
|
||||
};
|
||||
|
||||
#endif // INSTRUCTORSVIEW_H
|
||||
68
InstructorsAndTrainees/instructors/viewerinstructors.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
#include <QMessageBox>
|
||||
#include "editorinstructors.h"
|
||||
#include "viewerinstructors.h"
|
||||
#include "ui_viewerinstructors.h"
|
||||
|
||||
ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent) :
|
||||
InstructorsView(connectorToServer, CommonView::TypeView::onlyView, parent),
|
||||
ui(new Ui::ViewerInstructors)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->horizontalLayout_1->addWidget(treeWidget);
|
||||
|
||||
treeWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
|
||||
preparationTreeWidget();
|
||||
setNotLoggedInVisible(true);
|
||||
}
|
||||
|
||||
ViewerInstructors::~ViewerInstructors()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ViewerInstructors::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{// переведём окно заново
|
||||
ui->retranslateUi(this);
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
//loadInstructorsFromDB();
|
||||
slot_NeedUpdateUI(true, false);
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerInstructors::on_btnEditorInstructors_clicked()
|
||||
{
|
||||
Q_EMIT signal_BlockAutorization(true);
|
||||
|
||||
EditorInstructors editorInstructors(connectorToServer, adminMode);
|
||||
connect(connectorToServer, &ConnectorToServer::signal_UpdateDB, &editorInstructors, &EditorInstructors::slot_NeedUpdateUI);
|
||||
|
||||
QDialog* dialog = new QDialog(this);
|
||||
QHBoxLayout *layout = new QHBoxLayout(dialog);
|
||||
layout->addWidget(&editorInstructors);
|
||||
dialog->setWindowTitle(tr("Editor of instructors"));
|
||||
dialog->setMinimumSize(1600, 800);
|
||||
dialog->setStyleSheet(this->styleSheet());
|
||||
dialog->exec();
|
||||
|
||||
loadInstructorsFromDB();
|
||||
|
||||
Q_EMIT signal_BlockAutorization(false);
|
||||
}
|
||||
|
||||
void ViewerInstructors::updateButtons()
|
||||
{
|
||||
if(adminMode && authComplited)
|
||||
{
|
||||
ui->btnEditorInstructors->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnEditorInstructors->setEnabled(false);
|
||||
}
|
||||
}
|
||||
37
InstructorsAndTrainees/instructors/viewerinstructors.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef INSTRUCTORSWIDGET_H
|
||||
#define INSTRUCTORSWIDGET_H
|
||||
|
||||
#include "instructorsview.h"
|
||||
|
||||
namespace Ui {
|
||||
class ViewerInstructors;
|
||||
}
|
||||
|
||||
//Виджет только для просмотра БД Инструкторов
|
||||
|
||||
class ViewerInstructors : public InstructorsView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ViewerInstructors(ConnectorToServer* connectorToServer, QWidget *parent = nullptr);
|
||||
~ViewerInstructors();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
Q_SIGNALS:
|
||||
//сигнал о блокировке авторизации
|
||||
void signal_BlockAutorization(bool block);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_btnEditorInstructors_clicked();
|
||||
|
||||
private:
|
||||
void updateButtons() override;
|
||||
|
||||
private:
|
||||
Ui::ViewerInstructors *ui;
|
||||
};
|
||||
|
||||
#endif // INSTRUCTORSWIDGET_H
|
||||
100
InstructorsAndTrainees/instructors/viewerinstructors.ui
Normal file
@@ -0,0 +1,100 @@
|
||||
<?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>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Instructors</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<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>
|
||||
<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="../resources.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>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
12
InstructorsAndTrainees/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
|
||||
377
InstructorsAndTrainees/instructorsandtraineeswidget.cpp
Normal file
@@ -0,0 +1,377 @@
|
||||
#include <QMessageBox>
|
||||
#include "instructorsandtraineeswidget.h"
|
||||
#include "ui_instructorsandtraineeswidget.h"
|
||||
#include "dialogauthorizationinstructor.h"
|
||||
#include "doctaskswidget.h"
|
||||
|
||||
InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::InstructorsAndTraineesWidget),
|
||||
connectorToServer(nullptr),
|
||||
viewerTrainees(nullptr),
|
||||
viewerInstructors(nullptr),
|
||||
messangerWidget(nullptr),
|
||||
docTasksWidget(nullptr),
|
||||
fIMtasksWidget(nullptr),
|
||||
adminMode(false),
|
||||
loginInstructorLoggedInLocal(QStringLiteral("")),
|
||||
nameInstructorLoggedInLocal(QStringLiteral(""))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->btnUpdateStyleSheet->setObjectName("btnUpdateStyleSheet");
|
||||
|
||||
qRegisterMetaType<PacketType>("PacketType");
|
||||
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<Task>>("QList<Task>");
|
||||
|
||||
connectorToServer = new ConnectorToServer(this);
|
||||
connect(connectorToServer,&ConnectorToServer::sigLoginResult,this,&InstructorsAndTraineesWidget::checkLoginResult);
|
||||
connect(connectorToServer,&ConnectorToServer::sigDeLoginResult,this,&InstructorsAndTraineesWidget::checkDeLoginResult);
|
||||
|
||||
viewerTrainees = new ViewerTrainees(connectorToServer, 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(viewerInstructors, &ViewerInstructors::signal_BlockAutorization, this, &InstructorsAndTraineesWidget::signal_BlockAutorization);
|
||||
connect(viewerTrainees, &ViewerTrainees::signal_BlockAutorization, this, &InstructorsAndTraineesWidget::signal_BlockAutorization);
|
||||
|
||||
connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerInstructors,&ViewerInstructors::slot_NeedUpdateUI);
|
||||
connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerTrainees,&ViewerTrainees::slot_NeedUpdateUI);
|
||||
|
||||
connect(connectorToServer,&ConnectorToServer::signal_ConnectedToServer,this,&InstructorsAndTraineesWidget::slot_ConnectedToServer);
|
||||
|
||||
|
||||
messangerWidget = new MessangerWidget(this);
|
||||
connect(connectorToServer,&ConnectorToServer::signal_InitMessanger,messangerWidget,&MessangerWidget::slot_InitMessanger);
|
||||
connect(viewerTrainees, &ViewerTrainees::signal_traineeSelected, messangerWidget, &MessangerWidget::slot_traineeSelected);
|
||||
connect(messangerWidget, &MessangerWidget::signal_tabMessengerChanged, viewerTrainees, &ViewerTrainees::slot_tabMessengerChanged);
|
||||
connect(messangerWidget, &MessangerWidget::signal_msgToClientReady, connectorToServer, &ConnectorToServer::slot_msgToClientReady);
|
||||
connect(connectorToServer,&ConnectorToServer::signal_msgFromClientReady,messangerWidget,&MessangerWidget::slot_msgFromClientReady);
|
||||
|
||||
|
||||
docTasksWidget = new DocTasksWidget(this);
|
||||
fIMtasksWidget = new FIMtasksWidget(this);
|
||||
|
||||
ui->horizontalLayout_3->addWidget(viewerTrainees);
|
||||
ui->horizontalLayout_3->addWidget(messangerWidget);
|
||||
|
||||
ui->verticalLayout_1->addWidget(viewerInstructors);
|
||||
ui->verticalLayout_2->addWidget(docTasksWidget);
|
||||
ui->verticalLayout_2->addWidget(fIMtasksWidget);
|
||||
|
||||
viewerTrainees->setMinimumHeight(800);
|
||||
viewerInstructors->setMinimumSize(1800, 300);
|
||||
messangerWidget->setMinimumSize(500, 600);
|
||||
messangerWidget->setMaximumWidth(500);
|
||||
|
||||
//ui->btnAuthorizationInstructor->setEnabled(false);
|
||||
|
||||
updateMyStyleSheet();
|
||||
}
|
||||
|
||||
InstructorsAndTraineesWidget::~InstructorsAndTraineesWidget()
|
||||
{
|
||||
if(authorizationIsCompleted())
|
||||
deAuthorizationInstructor(loginInstructorLoggedInLocal);
|
||||
|
||||
delete docTasksWidget;
|
||||
delete fIMtasksWidget;
|
||||
delete messangerWidget;
|
||||
delete viewerInstructors;
|
||||
delete viewerTrainees;
|
||||
delete connectorToServer;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{// переведём окно заново
|
||||
ui->retranslateUi(this);
|
||||
|
||||
if(ui->btnAuthorizationInstructor->isChecked())
|
||||
ui->btnAuthorizationInstructor->setText(tr("Deauthorization Instructor"));
|
||||
else
|
||||
ui->btnAuthorizationInstructor->setText(tr("Authorization Instructor"));
|
||||
|
||||
/*
|
||||
if(ui->btnConnectionToDB->isChecked())
|
||||
ui->btnConnectionToDB->setText(tr("Disconnection DB"));
|
||||
else
|
||||
ui->btnConnectionToDB->setText(tr("Connection DB"));
|
||||
*/
|
||||
|
||||
updateLabelLoggedInInstructor(loginInstructorLoggedInLocal, nameInstructorLoggedInLocal);
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::updateMyStyleSheet()
|
||||
{
|
||||
QString styleSheet = loadStyleSheet();
|
||||
styleSheet = styleSheet.replace("\n", "");
|
||||
|
||||
this->setStyleSheet(styleSheet);
|
||||
}
|
||||
|
||||
QString InstructorsAndTraineesWidget::loadStyleSheet()
|
||||
{
|
||||
//QString fileName = ":/resources/css/styleSheetMain.css";
|
||||
QString fileName = "./resources/css/styleSheetMain.css";
|
||||
QFile styleSheetFile(fileName);
|
||||
if (!styleSheetFile.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Attention!"), 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);
|
||||
|
||||
Q_EMIT signal_LanguageChanged(language);
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::checkLoginResult(ServerAuthorization *serverAuth)
|
||||
{
|
||||
if (serverAuth->Result)
|
||||
{
|
||||
loginInstructorLoggedInLocal = serverAuth->Login;
|
||||
nameInstructorLoggedInLocal = serverAuth->ClientName;
|
||||
|
||||
if(loginInstructorLoggedInLocal == QStringLiteral("admin"))
|
||||
adminMode = true;
|
||||
else
|
||||
adminMode = false;
|
||||
|
||||
viewerInstructors->setAdminMode(adminMode);
|
||||
viewerTrainees->setAdminMode(adminMode);
|
||||
viewerInstructors->setAuthComplited(true);
|
||||
viewerTrainees->setAuthComplited(true);
|
||||
|
||||
Q_EMIT signal_NeedUpdateUI(true, true);
|
||||
|
||||
ui->btnAuthorizationInstructor->setText(tr("Deauthorization Instructor"));
|
||||
|
||||
updateLabelLoggedInInstructor(serverAuth->Login, serverAuth->ClientName);
|
||||
|
||||
QMessageBox::information(this, tr("Instructor authorization"), tr("Successfully!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
QMessageBox::warning(this, tr("Instructor authorization"), tr("Invalid login or password!"));
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::checkDeLoginResult(ServerDeAuthorization *serverDeAuth)
|
||||
{
|
||||
if (serverDeAuth->Result)
|
||||
{
|
||||
loginInstructorLoggedInLocal = QStringLiteral("");
|
||||
nameInstructorLoggedInLocal = QStringLiteral("");
|
||||
adminMode = false;
|
||||
|
||||
viewerInstructors->setAdminMode(adminMode);
|
||||
viewerTrainees->setAdminMode(adminMode);
|
||||
viewerInstructors->setAuthComplited(false);
|
||||
viewerTrainees->setAuthComplited(false);
|
||||
|
||||
Q_EMIT signal_NeedUpdateUI(true, false);
|
||||
|
||||
ui->btnAuthorizationInstructor->setText(tr("Authorization Instructor"));
|
||||
|
||||
updateLabelLoggedInInstructor("","");
|
||||
|
||||
QMessageBox::information(this, tr("Instructor deauthorization"), tr("Successfully!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnAuthorizationInstructor->setChecked(true);
|
||||
QMessageBox::warning(this, tr("Instructor deauthorization"), tr("Error!"));
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
||||
{
|
||||
if(state)
|
||||
{//Сервер подключен
|
||||
|
||||
//ui->btnConnectionToDB->setText(tr("Disconnection DB"));
|
||||
ui->btnConnectionToServer->setEnabled(false);
|
||||
ui->btnAuthorizationInstructor->setEnabled(true);
|
||||
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||
}
|
||||
else
|
||||
{//Сервер отключен
|
||||
|
||||
//ui->btnConnectionToDB->setText(tr("Connection DB"));
|
||||
ui->btnConnectionToServer->setEnabled(true);
|
||||
ui->btnAuthorizationInstructor->setEnabled(false);
|
||||
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
}
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::authorizationInstructorDialog(QWidget* parent)
|
||||
{
|
||||
DialogAuthorizationInstructor dlg(parent);
|
||||
dlg.setWindowTitle(tr("Instructor authorization"));
|
||||
|
||||
do
|
||||
{
|
||||
switch( dlg.exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
QString login = dlg.getLogin();
|
||||
QString password = dlg.getPassword();
|
||||
|
||||
connectorToServer->authorizationInstructorLocal(login, password);
|
||||
|
||||
return true;
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
while(true);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::deAuthorizationInstructor(QString login)
|
||||
{
|
||||
connectorToServer->deAuthorizationInstructorLocal(login);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::authorizationIsCompleted()
|
||||
{
|
||||
if(loginInstructorLoggedInLocal == QStringLiteral(""))
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnConnectionToServer_clicked()
|
||||
{
|
||||
connectorToServer->SetConnectToServer();
|
||||
|
||||
if(true)
|
||||
{//Подключение к БД
|
||||
/*
|
||||
connectorToServer->SetConnectToServer();
|
||||
|
||||
|
||||
if(! dbLMS->DBisConnected())
|
||||
{
|
||||
if(dbLMS->ConnectionToDB())
|
||||
{
|
||||
ui->btnConnectionToDB->setText(tr("Disconnection DB"));
|
||||
ui->btnAuthorizationInstructor->setEnabled(true);
|
||||
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/icons/circleGreen.png")));
|
||||
|
||||
Q_EMIT signal_NeedUpdateUI(true, true);
|
||||
|
||||
Q_EMIT signal_BlockAutorization(false);
|
||||
|
||||
Q_EMIT signal_InitMessanger(dbLMS->getListTrainees());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{//Отключение от БД
|
||||
/*
|
||||
bool stateIsCheckedAuthorization = ui->btnAuthorizationInstructor->isChecked();
|
||||
if(stateIsCheckedAuthorization)
|
||||
ui->btnAuthorizationInstructor->click();
|
||||
|
||||
if(dbLMS->DBisConnected())
|
||||
{
|
||||
Q_EMIT signal_BlockAutorization(true);
|
||||
|
||||
dbLMS->DisConnectionFromDB();
|
||||
|
||||
ui->btnConnectionToDB->setText(tr("Connection DB"));
|
||||
ui->btnAuthorizationInstructor->setEnabled(false);
|
||||
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/icons/circleGray.png")));
|
||||
|
||||
Q_EMIT signal_NeedUpdateUI(true, true);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnAuthorizationInstructor_clicked()
|
||||
{
|
||||
bool stateIsChecked = ui->btnAuthorizationInstructor->isChecked();
|
||||
|
||||
if(stateIsChecked)
|
||||
{//Авторизация Инструктора локальная (Администратора)
|
||||
if(authorizationInstructorDialog(this))
|
||||
{
|
||||
}
|
||||
else
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
}
|
||||
else
|
||||
{//ДеАвторизация Инструктора локальная (Администратора)
|
||||
if(authorizationIsCompleted())
|
||||
{
|
||||
if(deAuthorizationInstructor(loginInstructorLoggedInLocal))
|
||||
{
|
||||
}
|
||||
else
|
||||
ui->btnAuthorizationInstructor->setChecked(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::updateLabelLoggedInInstructor(QString login, QString name)
|
||||
{
|
||||
if(authorizationIsCompleted())
|
||||
{
|
||||
QString nameLoggedInInstructor = QString("%1 (%2)").arg(name, login);
|
||||
ui->lblLoggedInInstructor->setText(nameLoggedInInstructor);
|
||||
if(loginInstructorLoggedInLocal == QStringLiteral("admin"))
|
||||
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::on_btnUpdateStyleSheet_clicked()
|
||||
{
|
||||
/*
|
||||
viewerTrainees->updateMyStyleSheet();
|
||||
viewerInstructors->updateMyStyleSheet();
|
||||
messangerWidget->updateMyStyleSheet();
|
||||
*/
|
||||
|
||||
updateMyStyleSheet();
|
||||
}
|
||||
89
InstructorsAndTrainees/instructorsandtraineeswidget.h
Normal file
@@ -0,0 +1,89 @@
|
||||
#ifndef INSTRUCTORSANDTRAINEESWIDGET_H
|
||||
#define INSTRUCTORSANDTRAINEESWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTranslator>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "viewertrainees.h"
|
||||
#include "viewerinstructors.h"
|
||||
#include "messangerwidget.h"
|
||||
#include "doctaskswidget.h"
|
||||
#include "fimtaskswidget.h"
|
||||
#include "connectortoserver.h"
|
||||
|
||||
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<Task>)
|
||||
|
||||
namespace Ui {
|
||||
class InstructorsAndTraineesWidget;
|
||||
}
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT InstructorsAndTraineesWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InstructorsAndTraineesWidget(QWidget *parent = nullptr);
|
||||
~InstructorsAndTraineesWidget();
|
||||
|
||||
private:
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
public:
|
||||
void updateMyStyleSheet();
|
||||
private:
|
||||
QString loadStyleSheet();
|
||||
|
||||
public Q_SLOTS:
|
||||
//Слот обработки смены языка
|
||||
void slot_LanguageChanged(QString language);
|
||||
//Слот обработки результата авторизации
|
||||
void checkLoginResult(ServerAuthorization * serverAuth);
|
||||
//Слот обработки результата деавторизации
|
||||
void checkDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||
|
||||
void slot_ConnectedToServer(bool state);
|
||||
|
||||
Q_SIGNALS:
|
||||
//сигнал об изменении языка интерфейса
|
||||
void signal_LanguageChanged(QString language);
|
||||
//сигнал о необходимости обновления интерфейса
|
||||
void signal_NeedUpdateUI(bool treeInstructor, bool treeTrainee);
|
||||
//сигнал о блокировке авторизации
|
||||
void signal_BlockAutorization(bool block);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_btnConnectionToServer_clicked();
|
||||
void on_btnAuthorizationInstructor_clicked();
|
||||
void on_btnUpdateStyleSheet_clicked();
|
||||
|
||||
private:
|
||||
//Авторизация инструктора локальная
|
||||
bool authorizationInstructorDialog(QWidget* parent = nullptr);
|
||||
bool deAuthorizationInstructor(QString login);
|
||||
bool authorizationIsCompleted();
|
||||
void updateLabelLoggedInInstructor(QString login, QString name);
|
||||
|
||||
private:
|
||||
Ui::InstructorsAndTraineesWidget *ui;
|
||||
|
||||
ConnectorToServer* connectorToServer;
|
||||
|
||||
ViewerTrainees* viewerTrainees;
|
||||
ViewerInstructors* viewerInstructors;
|
||||
MessangerWidget* messangerWidget;
|
||||
DocTasksWidget* docTasksWidget;
|
||||
FIMtasksWidget* fIMtasksWidget;
|
||||
|
||||
bool adminMode;
|
||||
QString loginInstructorLoggedInLocal;
|
||||
QString nameInstructorLoggedInLocal;
|
||||
|
||||
QTranslator qtLanguageTranslator;
|
||||
};
|
||||
|
||||
#endif // INSTRUCTORSANDTRAINEESWIDGET_H
|
||||
232
InstructorsAndTrainees/instructorsandtraineeswidget.ui
Normal file
@@ -0,0 +1,232 @@
|
||||
<?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>1000</width>
|
||||
<height>800</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">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_0">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Database LMS</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_1">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnConnectionToServer">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Connection to Server</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources.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="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="resources.qrc">:/resources/icons/circleGray.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnAuthorizationInstructor">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Authorization Instructor</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources.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="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="resources.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>Logged in 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>
|
||||
<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>
|
||||
<widget class="QToolButton" name="btnUpdateStyleSheet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>58</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Update StyleSheet</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
227
InstructorsAndTrainees/messanger/messangerwidget.cpp
Normal file
@@ -0,0 +1,227 @@
|
||||
#include <QListWidget>
|
||||
#include <QBrush>
|
||||
#include <QKeyEvent>
|
||||
#include <QAbstractScrollArea>
|
||||
#include <QMessageBox>
|
||||
#include <QLabel>
|
||||
#include "messangerwidget.h"
|
||||
#include "ui_messangerwidget.h"
|
||||
|
||||
|
||||
MessangerWidget::MessangerWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::MessangerWidget),
|
||||
currLogin("")
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->tabWidget->removeTab(1);
|
||||
ui->tabWidget->removeTab(0);
|
||||
|
||||
ui->btnSend->setObjectName("btnSend");
|
||||
}
|
||||
|
||||
MessangerWidget::~MessangerWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MessangerWidget::addMsgFromClient(Trainee trainee, QString text)
|
||||
{
|
||||
//Пробуем добавить вкладку диалога с клиентом (если вдруг еще нет)
|
||||
addTabDialogMessenger(trainee);
|
||||
|
||||
//Ищем нужный диалог
|
||||
QString login = trainee.getLogin();
|
||||
foreach(TabDialogMessenger* tabDialog, listTabDialogMessenger)
|
||||
{//Есть такой
|
||||
if(tabDialog->getLogin() == login)
|
||||
{
|
||||
//Добавляем в существующую вкладку
|
||||
ui->tabWidget->setCurrentIndex(getIndexTab(login));
|
||||
tabDialog->addMsgWidgetRemote(text);
|
||||
//Делаем ее текущей
|
||||
ui->tabWidget->setCurrentIndex(getIndexTab(login));
|
||||
|
||||
currLogin = login;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::addTabDialogMessenger(Trainee trainee)
|
||||
{
|
||||
if(listTabDialogMessenger.count() == 0)
|
||||
{//Самая первая вкладка, делаем ее активной
|
||||
currLogin = trainee.getLogin();
|
||||
emit signal_tabMessengerChanged(currLogin);
|
||||
}
|
||||
|
||||
//Проверяем наличие диалога с этим клиентом
|
||||
foreach(TabDialogMessenger* dialogMsg, listTabDialogMessenger)
|
||||
{
|
||||
if(dialogMsg->getLogin() == trainee.getLogin())
|
||||
{//Диалог для этого клиента уже существует
|
||||
//Обновляем статус залогинивания
|
||||
if(trainee.getLoggedIn())
|
||||
ui->tabWidget->setTabIcon(getIndexTab(trainee.getLogin()), QIcon(":/resources/icons/circleGreen.png"));
|
||||
else
|
||||
ui->tabWidget->setTabIcon(getIndexTab(trainee.getLogin()), QIcon(":/resources/icons/circleGray.png"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Диалога для этого клиента еще не существует
|
||||
|
||||
//Помещаем новый диалог в список диалогов
|
||||
TabDialogMessenger* tabDialog = new TabDialogMessenger(0 /*TODO доделать передачу реального ID*/, trainee.getLogin(), this);
|
||||
listTabDialogMessenger.append(tabDialog);
|
||||
|
||||
//Добавляем новую вкладку диалога
|
||||
int index = ui->tabWidget->addTab(tabDialog, /*login + ": " +*/ trainee.getName());
|
||||
|
||||
//Обновляем статус залогинивания
|
||||
if(trainee.getLoggedIn())
|
||||
ui->tabWidget->setTabIcon(index, QIcon(":/resources/icons/circleGreen.png"));
|
||||
else
|
||||
ui->tabWidget->setTabIcon(index, QIcon(":/resources/icons/circleGray.png"));
|
||||
}
|
||||
|
||||
void MessangerWidget::actualizationTabsDialogMessenger()
|
||||
{
|
||||
foreach(TabDialogMessenger* tabDialog, listTabDialogMessenger)
|
||||
{
|
||||
QString login = tabDialog->getLogin();
|
||||
bool exist = false;
|
||||
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
if(trainee.getLogin() == login)
|
||||
{
|
||||
if(trainee.getArchived())
|
||||
{//Стал архивным
|
||||
//Удаляем диалог с клиентом
|
||||
ui->tabWidget->removeTab(getIndexTab(login));
|
||||
listTabDialogMessenger.removeOne(tabDialog);
|
||||
}
|
||||
else
|
||||
exist = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!exist)
|
||||
{//Нет такого логина
|
||||
//Удаляем диалог с клиентом
|
||||
ui->tabWidget->removeTab(getIndexTab(login));
|
||||
listTabDialogMessenger.removeOne(tabDialog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int MessangerWidget::getIndexTab(QString login)
|
||||
{
|
||||
for(int index = 0; index < ui->tabWidget->count(); index++)
|
||||
{
|
||||
TabDialogMessenger* tabDialogMessenger = static_cast<TabDialogMessenger*>(ui->tabWidget->widget(index));
|
||||
if(tabDialogMessenger->getLogin() == login)
|
||||
return index;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void MessangerWidget::on_btnSend_clicked()
|
||||
{
|
||||
QString text = ui->editMsg->toPlainText();
|
||||
|
||||
emit signal_msgToClientReady(currLogin, text);
|
||||
|
||||
ui->editMsg->clear();
|
||||
|
||||
//Ищем нужный диалог
|
||||
foreach(TabDialogMessenger* tabDialog, listTabDialogMessenger)
|
||||
{
|
||||
if(tabDialog->getLogin() == currLogin)
|
||||
{
|
||||
//Добавляем в существующую вкладку
|
||||
tabDialog->addMsgWidgetLocal(text);
|
||||
//Делаем ее активной
|
||||
ui->tabWidget->setCurrentIndex(getIndexTab(currLogin));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::on_tabWidget_currentChanged(int index)
|
||||
{
|
||||
//Ищем нужный диалог
|
||||
foreach(TabDialogMessenger* tabDialog, listTabDialogMessenger)
|
||||
{
|
||||
if(getIndexTab(tabDialog->getLogin()) == index)
|
||||
{
|
||||
currLogin = tabDialog->getLogin();
|
||||
emit signal_tabMessengerChanged(currLogin);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::slot_traineeSelected(QString login)
|
||||
{
|
||||
//Ищем нужный диалог
|
||||
foreach(TabDialogMessenger* tabDialog, listTabDialogMessenger)
|
||||
{
|
||||
if(tabDialog->getLogin() == login)
|
||||
{
|
||||
//Активируем нужную вкладку
|
||||
ui->tabWidget->setCurrentIndex(getIndexTab(login));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::slot_LanguageChanged(QString language)
|
||||
{
|
||||
qtLanguageTranslator.load(QString("translationsMy/ServerLMS_") + language, ".");
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
}
|
||||
|
||||
void MessangerWidget::slot_InitMessanger(QList<Trainee> listTrainees)
|
||||
{
|
||||
this->listTrainees = listTrainees;
|
||||
|
||||
actualizationTabsDialogMessenger();
|
||||
|
||||
for(Trainee trainee: listTrainees)
|
||||
{
|
||||
if(! trainee.getArchived())
|
||||
addTabDialogMessenger(trainee);
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::slot_msgFromClientReady(QString login, QString text)
|
||||
{
|
||||
for(Trainee trainee: listTrainees)
|
||||
{
|
||||
if(trainee.getLogin() == login)
|
||||
addMsgFromClient(trainee, text);
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)
|
||||
{
|
||||
ui->btnSend->click();
|
||||
}
|
||||
}
|
||||
|
||||
void MessangerWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this); // переведём окно заново
|
||||
}
|
||||
}
|
||||
71
InstructorsAndTrainees/messanger/messangerwidget.h
Normal file
@@ -0,0 +1,71 @@
|
||||
#ifndef MESSANGERWIDGET_H
|
||||
#define MESSANGERWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTranslator>
|
||||
#include <trainee.h>
|
||||
#include "Datas.h"
|
||||
#include "tabdialogmessenger.h"
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class MessangerWidget;
|
||||
}
|
||||
|
||||
//Главный виджет мессенджера
|
||||
|
||||
class MessangerWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MessangerWidget(QWidget *parent = nullptr);
|
||||
~MessangerWidget();
|
||||
|
||||
protected:
|
||||
// Метод получения событий
|
||||
// В нём будет производиться проверка события смены перевода приложения
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
public:
|
||||
enum ETypeMsg{fromClient, toClient};
|
||||
|
||||
void addMsgFromClient(Trainee trainee, QString text);
|
||||
|
||||
void addTabDialogMessenger(Trainee trainee);
|
||||
void actualizationTabsDialogMessenger();
|
||||
|
||||
int getIndexTab(QString login);
|
||||
|
||||
private slots:
|
||||
void on_btnSend_clicked();
|
||||
void on_tabWidget_currentChanged(int index);
|
||||
|
||||
signals:
|
||||
//сигнал о готовности нового сообщения на отправку клиенту
|
||||
void signal_msgToClientReady(QString login, QString text);
|
||||
//сигнал об изменении вкладки диалога с клиентом (TabDialogMessenger)
|
||||
void signal_tabMessengerChanged(QString login);
|
||||
|
||||
public slots:
|
||||
//слот обработки сигнала о смене языка
|
||||
void slot_LanguageChanged(QString language);
|
||||
//слот обработки сигнала об инициализации мессенджера
|
||||
void slot_InitMessanger(QList<Trainee> listTrainees);
|
||||
//слот обработки сигнала о выборе обучаемого
|
||||
void slot_traineeSelected(QString login);
|
||||
//слот о приходе нового сообщения от клиента
|
||||
void slot_msgFromClientReady(QString login, QString text);
|
||||
|
||||
private:
|
||||
virtual void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
Ui::MessangerWidget *ui;
|
||||
QList <TabDialogMessenger*> listTabDialogMessenger;
|
||||
QList<Trainee> listTrainees;
|
||||
QString currLogin; //Логин клиента текущего диалога
|
||||
QTranslator qtLanguageTranslator;
|
||||
};
|
||||
|
||||
#endif // MESSANGERWIDGET_H
|
||||
153
InstructorsAndTrainees/messanger/messangerwidget.ui
Normal file
@@ -0,0 +1,153 @@
|
||||
<?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>500</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="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Messenger</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="editMsg">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Ignored">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1000</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnSend">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>65</width>
|
||||
<height>58</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 resource="../resources.qrc">
|
||||
<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>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
<widget class="QListWidget" name="listWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>30</y>
|
||||
<width>256</width>
|
||||
<height>192</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Tab 2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
92
InstructorsAndTrainees/messanger/msgwidget.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
#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);
|
||||
}
|
||||
|
||||
MsgWidget::~MsgWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MsgWidget::setAligneAvatarLeft()
|
||||
{
|
||||
ui->horizontalLayout->removeWidget(ui->textEdit);
|
||||
ui->horizontalLayout->removeItem(ui->verticalLayout);
|
||||
ui->horizontalLayout->removeItem(ui->horizontalLayout_2);
|
||||
|
||||
ui->horizontalLayout->addLayout(ui->verticalLayout);
|
||||
ui->horizontalLayout->addWidget(ui->textEdit);
|
||||
ui->horizontalLayout->addLayout(ui->horizontalLayout_2);
|
||||
|
||||
ui->textEdit->setObjectName("MsgWidgetLocal");
|
||||
}
|
||||
|
||||
void MsgWidget::setAligneAvatarRight()
|
||||
{
|
||||
ui->horizontalLayout->removeWidget(ui->textEdit);
|
||||
ui->horizontalLayout->removeItem(ui->verticalLayout);
|
||||
ui->horizontalLayout->removeItem(ui->horizontalLayout_2);
|
||||
|
||||
ui->horizontalLayout->addLayout(ui->horizontalLayout_2);
|
||||
ui->horizontalLayout->addWidget(ui->textEdit);
|
||||
ui->horizontalLayout->addLayout(ui->verticalLayout);
|
||||
|
||||
ui->textEdit->setObjectName("MsgWidgetRemote");
|
||||
}
|
||||
|
||||
|
||||
void MsgWidget::setAvatar(QString avatar)
|
||||
{
|
||||
QPixmap pix(avatar);
|
||||
ui->label->setPixmap( pix.scaled(32,32) );
|
||||
}
|
||||
|
||||
void MsgWidget::setWidth(int width)
|
||||
{
|
||||
this->setFixedWidth(width);
|
||||
widthEdit = width - 200;
|
||||
}
|
||||
|
||||
void MsgWidget::setText(QString text)
|
||||
{
|
||||
ui->textEdit->setText(text);
|
||||
}
|
||||
|
||||
void MsgWidget::on_textEdit_textChanged()
|
||||
{
|
||||
QString text = ui->textEdit->toPlainText();
|
||||
QFontMetrics metricsFont(ui->textEdit->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, 10), Qt::TextWordWrap, text);
|
||||
ui->textEdit->setFixedHeight(textRect.height() + X);
|
||||
this->setFixedHeight(textRect.height() + X + 20);
|
||||
}
|
||||
else
|
||||
{//В одну строку
|
||||
ui->textEdit->setFixedWidth(textRect.width() + X);
|
||||
ui->textEdit->setFixedHeight(textRect.height() + X);
|
||||
this->setFixedHeight(textRect.height() + X + 20);
|
||||
}
|
||||
}
|
||||
42
InstructorsAndTrainees/messanger/msgwidget.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef MSGWIDGET_H
|
||||
#define MSGWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class MsgWidget;
|
||||
}
|
||||
|
||||
//Виджет одного сообщения для/от клиента
|
||||
|
||||
class MsgWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum AligneAvatar
|
||||
{
|
||||
Left,
|
||||
Right
|
||||
};
|
||||
|
||||
public:
|
||||
explicit MsgWidget(QString avatar, AligneAvatar aligneAvatar, int width, QWidget *parent = nullptr);
|
||||
~MsgWidget();
|
||||
|
||||
void setAligneAvatarLeft();
|
||||
void setAligneAvatarRight();
|
||||
void setAvatar(QString avatar);
|
||||
void setWidth(int width);
|
||||
|
||||
void setText(QString text);
|
||||
|
||||
private slots:
|
||||
void on_textEdit_textChanged();
|
||||
|
||||
private:
|
||||
Ui::MsgWidget *ui;
|
||||
|
||||
int widthEdit;
|
||||
};
|
||||
|
||||
#endif // MSGWIDGET_H
|
||||
106
InstructorsAndTrainees/messanger/msgwidget.ui
Normal file
@@ -0,0 +1,106 @@
|
||||
<?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>91</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">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<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>
|
||||
<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>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</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>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<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>
|
||||
57
InstructorsAndTrainees/messanger/tabdialogmessenger.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
#include <QScrollBar>
|
||||
#include "tabdialogmessenger.h"
|
||||
#include "msgwidget.h"
|
||||
|
||||
|
||||
TabDialogMessenger::TabDialogMessenger(int id, QString login, QWidget *parent):
|
||||
QListWidget(parent),
|
||||
login(""),
|
||||
id(0)
|
||||
{
|
||||
this->id = id;
|
||||
this->login = login;
|
||||
|
||||
setWordWrap(true);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOn);
|
||||
}
|
||||
|
||||
TabDialogMessenger::~TabDialogMessenger()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void TabDialogMessenger::addMsgWidgetLocal(QString text)
|
||||
{
|
||||
QListWidgetItem *listWidgetItem = new QListWidgetItem();
|
||||
QString avatar = ":/resources/icons/instructor.png";
|
||||
MsgWidget *msgWidget = new MsgWidget(avatar, MsgWidget::AligneAvatar::Left,
|
||||
width() - verticalScrollBar()->size().width());
|
||||
|
||||
addItem(listWidgetItem);
|
||||
setItemWidget(listWidgetItem, msgWidget);
|
||||
|
||||
msgWidget->setText(text);
|
||||
|
||||
//Корректировка высоты item
|
||||
listWidgetItem->setSizeHint (QSize(10, msgWidget->height()));
|
||||
|
||||
scrollToItem(listWidgetItem);
|
||||
}
|
||||
|
||||
void TabDialogMessenger::addMsgWidgetRemote(QString text)
|
||||
{
|
||||
QListWidgetItem *listWidgetItem = new QListWidgetItem();
|
||||
QString avatar = ":/resources/icons/trainee.png";
|
||||
MsgWidget *msgWidget = new MsgWidget(avatar, MsgWidget::AligneAvatar::Right,
|
||||
width() - verticalScrollBar()->size().width());
|
||||
|
||||
addItem(listWidgetItem);
|
||||
setItemWidget(listWidgetItem, msgWidget);
|
||||
|
||||
msgWidget->setText(text);
|
||||
|
||||
//Корректировка высоты item
|
||||
listWidgetItem->setSizeHint (QSize(10, msgWidget->height()));
|
||||
|
||||
scrollToItem(listWidgetItem);
|
||||
}
|
||||
29
InstructorsAndTrainees/messanger/tabdialogmessenger.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef TABDIALOGMESSENGER_H
|
||||
#define TABDIALOGMESSENGER_H
|
||||
|
||||
#include <QListWidget>
|
||||
|
||||
//Закладка ведения диалога с одним клиентом
|
||||
|
||||
//TODO сделать идентификацию по ID
|
||||
|
||||
class TabDialogMessenger : public QListWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TabDialogMessenger(int id, QString login, QWidget *parent = nullptr);
|
||||
~TabDialogMessenger();
|
||||
|
||||
QString getLogin() {return login;};
|
||||
int getID() {return id;};
|
||||
|
||||
void addMsgWidgetLocal(QString text);
|
||||
void addMsgWidgetRemote(QString text);
|
||||
|
||||
private:
|
||||
QString login;
|
||||
int id;
|
||||
};
|
||||
|
||||
#endif // TABDIALOGMESSENGER_H
|
||||
44
InstructorsAndTrainees/resources.qrc
Normal file
@@ -0,0 +1,44 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>resources/css/styleSheetMain.css</file>
|
||||
<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/messengerPrint.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/task.png</file>
|
||||
<file>resources/icons/procedure.png</file>
|
||||
<file>resources/icons/malfunction.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
230
InstructorsAndTrainees/resources/css/styleSheetMain.css
Normal file
@@ -0,0 +1,230 @@
|
||||
/*Обязательные поля*/
|
||||
*[mandatoryField="true"] {
|
||||
background-color: #fff2fb
|
||||
}
|
||||
|
||||
|
||||
/*Общие настройки виджетов*/
|
||||
QWidget {
|
||||
font-family: Tahoma;
|
||||
font-size: 14pt;
|
||||
icon-size: 24px;
|
||||
}
|
||||
|
||||
|
||||
QLineEdit, QTextEdit {
|
||||
border: 1px solid gray;
|
||||
border-radius: 4px;
|
||||
padding: 0px 8px;
|
||||
background: white;
|
||||
selection-background-color: darkgray;
|
||||
}
|
||||
QLineEdit[echoMode="2"] {
|
||||
lineedit-password-character: 9679; /*Сокрытие пароля*/
|
||||
}
|
||||
QLineEdit:read-only {
|
||||
background: lightblue;
|
||||
}
|
||||
|
||||
|
||||
QGroupBox {
|
||||
background: #E0E0E0;
|
||||
border: 1px solid gray;
|
||||
border-radius: 5px;
|
||||
margin-top: 5ex; /* leave space at the top for the title */
|
||||
}
|
||||
QGroupBox::title {
|
||||
border: 1px solid gray;
|
||||
border-bottom: none;
|
||||
border-radius: 5px;
|
||||
subcontrol-origin: margin;
|
||||
subcontrol-position: top left;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #A0CECE, stop: 1 #FFFFFF);
|
||||
}
|
||||
|
||||
|
||||
QPushButton, QToolButton {
|
||||
border: 2px solid #8f8f91;
|
||||
border-style: outset;
|
||||
border-radius: 5px;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #f6f7fa, stop: 1 #dadbde);
|
||||
min-width: 80px;
|
||||
height: 60px;
|
||||
padding: 1px;
|
||||
}
|
||||
QPushButton {
|
||||
height: 25px;
|
||||
}
|
||||
QToolButton {
|
||||
width: 200px;
|
||||
}
|
||||
QToolButton#btnSend { /*Кнопка Send Мессенджера*/
|
||||
width: 60px;
|
||||
}
|
||||
QPushButton:flat, QToolButton:flat {
|
||||
border: none; /* no border for a flat push button */
|
||||
}
|
||||
QPushButton:default, QToolButton:default {
|
||||
border-color: navy; /* make the default button prominent */
|
||||
}
|
||||
QPushButton:hover , QToolButton:hover {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #fafafa, stop: 0.4 #f4f4f4,
|
||||
stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
|
||||
}
|
||||
QPushButton:pressed, QToolButton:pressed {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #dadbde, stop: 1 #f6f7fa);
|
||||
border-style: inset;
|
||||
}
|
||||
QPushButton:checked, QToolButton:checked {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #dadbde, stop: 1 #f6f7fa);
|
||||
border-style: inset;
|
||||
}
|
||||
|
||||
|
||||
QCheckBox {
|
||||
spacing: 20px;
|
||||
}
|
||||
QCheckBox::indicator:checked {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
image: url(:/resources/icons/chekYes.png);
|
||||
}
|
||||
QCheckBox::indicator:!checked {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
image: url(:/resources/icons/chekNo.png);
|
||||
}
|
||||
|
||||
|
||||
QTreeWidget {
|
||||
font-size: 12pt;
|
||||
font-family: Tahoma;
|
||||
icon-size: 24px;
|
||||
}
|
||||
QTreeWidget::item {
|
||||
height: 30px;
|
||||
}
|
||||
/*Бранчи*/
|
||||
QTreeWidget::branch:has-siblings:!adjoins-item {
|
||||
border-image: url(:/resources/icons/vline.png) 0;
|
||||
|
||||
}
|
||||
QTreeWidget::branch:has-siblings:adjoins-item {
|
||||
border-image: url(:/resources/icons/branch-more.png) 0;
|
||||
|
||||
}
|
||||
QTreeWidget::branch:!has-children:!has-siblings:adjoins-item {
|
||||
border-image: url(:/resources/icons/branch-end.png) 0;
|
||||
}
|
||||
QTreeWidget::branch:closed:has-children:!has-siblings,
|
||||
QTreeWidget::branch:closed:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url(:/resources/icons/branch-closed.png);
|
||||
}
|
||||
QTreeWidget::branch:open:has-children:!has-siblings,
|
||||
QTreeWidget::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url(:/resources/icons/branch-open.png);
|
||||
}
|
||||
|
||||
QTreeWidget::item:hover,
|
||||
QTreeWidget::branch:hover {
|
||||
background: #aee1ff;
|
||||
}
|
||||
|
||||
QTreeWidget::item:selected {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);
|
||||
color: #ffff00;
|
||||
}
|
||||
|
||||
|
||||
QHeaderView::section {
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #c1c1c1, stop: 0.5 #505050,
|
||||
stop: 0.6 #434343, stop:1 #656565);
|
||||
color: white;
|
||||
padding-left: 4px;
|
||||
border: 1px solid #6c6c6c;
|
||||
}
|
||||
|
||||
|
||||
QTabWidget::pane { /* The tab widget frame */
|
||||
border-top: 1px solid #C2C7CB;
|
||||
background-image: url(:/resources/icons/messengerPrint.png);
|
||||
|
||||
}
|
||||
QTabWidget::tab-bar {
|
||||
left: 0px; /* move to the right by 0px */
|
||||
}
|
||||
QTabBar::tab {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
|
||||
stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
|
||||
border: 2px solid #C4C4C3;
|
||||
border-bottom-color: #C2C7CB; /* same as the pane color */
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
min-width: 8ex;
|
||||
padding: 2px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
QTabBar::tab:selected {
|
||||
border-color: #9B9B9B;
|
||||
border-bottom-color: #C2C7CB; /* same as pane color */
|
||||
/* expand/overlap to the left and right by 4px */
|
||||
margin-left: -4px;
|
||||
margin-right: -4px;
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);
|
||||
color: #ffffff;
|
||||
}
|
||||
QTabBar::tab:!selected {
|
||||
margin-top: 5px; /* make non-selected tabs look smaller */
|
||||
background: #ffffff;
|
||||
}
|
||||
QTabBar::tab:hover {
|
||||
background: #aee1ff;
|
||||
}
|
||||
|
||||
QTabBar::scroller { /* the width of the scroll buttons */
|
||||
width: 80px;
|
||||
}
|
||||
QTabBar QToolButton { /* the scroll buttons are tool buttons */
|
||||
min-width: 30px;
|
||||
width: 30px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
QListWidget::item {
|
||||
padding: -5px;
|
||||
}
|
||||
QListWidget {
|
||||
/*background: pink;*/
|
||||
background: transparent;
|
||||
background: #f0ffff;
|
||||
}
|
||||
|
||||
QTextEdit {
|
||||
padding: -20px;
|
||||
font-size: 12pt;
|
||||
|
||||
}
|
||||
QTextEdit#MsgWidgetLocal {
|
||||
background: lightgreen;
|
||||
}
|
||||
QTextEdit#MsgWidgetRemote {
|
||||
background: lightblue;
|
||||
}
|
||||
|
||||
QWidget {
|
||||
|
||||
}
|
||||
BIN
InstructorsAndTrainees/resources/icons/DB-instructors.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
InstructorsAndTrainees/resources/icons/DB-trainees.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
InstructorsAndTrainees/resources/icons/addInstructor.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
InstructorsAndTrainees/resources/icons/addTrainee.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
InstructorsAndTrainees/resources/icons/admin.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
InstructorsAndTrainees/resources/icons/archive.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
InstructorsAndTrainees/resources/icons/branch-closed.png
Normal file
|
After Width: | Height: | Size: 334 B |
BIN
InstructorsAndTrainees/resources/icons/branch-end.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
InstructorsAndTrainees/resources/icons/branch-more.png
Normal file
|
After Width: | Height: | Size: 136 B |
BIN
InstructorsAndTrainees/resources/icons/branch-open.png
Normal file
|
After Width: | Height: | Size: 346 B |
BIN
InstructorsAndTrainees/resources/icons/chekNo.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
InstructorsAndTrainees/resources/icons/chekYes.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
InstructorsAndTrainees/resources/icons/circleGray.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
InstructorsAndTrainees/resources/icons/circleGreen.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
InstructorsAndTrainees/resources/icons/connectDB.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
InstructorsAndTrainees/resources/icons/deleteGroup.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
InstructorsAndTrainees/resources/icons/deleteInstructor.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
InstructorsAndTrainees/resources/icons/deleteTrainee.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
InstructorsAndTrainees/resources/icons/docTasks.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
InstructorsAndTrainees/resources/icons/edit.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
InstructorsAndTrainees/resources/icons/group.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
InstructorsAndTrainees/resources/icons/instructor.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
InstructorsAndTrainees/resources/icons/instructorAdmin.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
InstructorsAndTrainees/resources/icons/instructorArchive.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
InstructorsAndTrainees/resources/icons/instructorFromArchive.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
InstructorsAndTrainees/resources/icons/login-user.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
InstructorsAndTrainees/resources/icons/malfunction.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
InstructorsAndTrainees/resources/icons/messengerPrint.png
Normal file
|
After Width: | Height: | Size: 5.2 MiB |
BIN
InstructorsAndTrainees/resources/icons/newGroup.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
InstructorsAndTrainees/resources/icons/procedure.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
InstructorsAndTrainees/resources/icons/rectGray.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
InstructorsAndTrainees/resources/icons/rectGreen.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
InstructorsAndTrainees/resources/icons/sendMsg.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
InstructorsAndTrainees/resources/icons/sign.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
InstructorsAndTrainees/resources/icons/sign.png.bak
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
InstructorsAndTrainees/resources/icons/task.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
InstructorsAndTrainees/resources/icons/trainee.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
InstructorsAndTrainees/resources/icons/traineeArchive.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
InstructorsAndTrainees/resources/icons/traineeFromArchive.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
InstructorsAndTrainees/resources/icons/vline.png
Normal file
|
After Width: | Height: | Size: 124 B |
48
InstructorsAndTrainees/tasks/taskswidget.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include "taskswidget.h"
|
||||
#include "ui_taskswidget.h"
|
||||
|
||||
TasksWidget::TasksWidget(InterfaceDataBaseLMS* dbLMS, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::TasksWidget),
|
||||
dbLMS(dbLMS)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
TasksWidget::~TasksWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TasksWidget::slot_traineeSelected(QString login)
|
||||
{
|
||||
viewListTasksForTrainee(login);
|
||||
}
|
||||
|
||||
void TasksWidget::slot_LanguageChanged(QString language)
|
||||
{
|
||||
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + language, QStringLiteral("."));
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
}
|
||||
|
||||
void TasksWidget::viewListTasksForTrainee(QString login)
|
||||
{
|
||||
/*
|
||||
QList<QString> listTasks;
|
||||
QStringList strListTasks;
|
||||
|
||||
listTasks = pDbTrainees->getTasks(login);
|
||||
|
||||
ui->listWidgetTasks->clear();
|
||||
ui->listWidgetTasks->addItems(listTasks);
|
||||
*/
|
||||
}
|
||||
|
||||
void TasksWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this); // переведём окно заново
|
||||
}
|
||||
}
|
||||
41
InstructorsAndTrainees/tasks/taskswidget.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef TASKSWIDGET_H
|
||||
#define TASKSWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTranslator>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "interfacedatabaselms.h"
|
||||
|
||||
namespace Ui {
|
||||
class TasksWidget;
|
||||
}
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT TasksWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TasksWidget(InterfaceDataBaseLMS* dbLMS, QWidget *parent = nullptr);
|
||||
~TasksWidget();
|
||||
|
||||
protected:
|
||||
// Метод получения событий
|
||||
// В нём будет производиться проверка события смены перевода приложения
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
public Q_SLOTS:
|
||||
//слот обработки сигнала о выборе обучаемого
|
||||
void slot_traineeSelected(QString login);
|
||||
void slot_LanguageChanged(QString language);
|
||||
|
||||
private:
|
||||
void viewListTasksForTrainee(QString login);
|
||||
|
||||
private:
|
||||
Ui::TasksWidget *ui;
|
||||
QTranslator qtLanguageTranslator;
|
||||
|
||||
InterfaceDataBaseLMS* dbLMS;
|
||||
};
|
||||
|
||||
#endif // TASKSWIDGET_H
|
||||