PSQL 01.11.2024
90
DB_IaT/InstructorsAndTrainees/CMakeLists.txt
Normal file
@@ -0,0 +1,90 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(InstructorsAndTrainees LANGUAGES CXX)
|
||||
|
||||
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)
|
||||
|
||||
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/databasetrainees.h
|
||||
trainees/databasetrainees.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/databaseinstructors.cpp
|
||||
instructors/databaseinstructors.h
|
||||
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
|
||||
resources.qrc
|
||||
)
|
||||
|
||||
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_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Widgets)
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Sql)
|
||||
|
||||
target_compile_definitions(InstructorsAndTrainees PRIVATE INSTRUCTORSANDTRAINEES_LIBRARY)
|
||||
|
||||
|
||||
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_LMS/DataBaseLMS)
|
||||
if(PROJECT_TYPE_DEBUG)
|
||||
target_link_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_LMS/Debug64)
|
||||
elseif()
|
||||
target_link_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB_LMS/Release64)
|
||||
endif()
|
||||
target_link_libraries(InstructorsAndTrainees PRIVATE libDataBaseLMS.dll)
|
||||
|
||||
|
||||
#install(TARGETS InstructorsAndTrainees DESTINATION ${VEYON_LIB_DIR})
|
||||
618
DB_IaT/InstructorsAndTrainees/CMakeLists.txt.user
Normal file
@@ -0,0 +1,618 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.11.1, 2024-11-01T11:44:20. -->
|
||||
<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:/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>
|
||||
319
DB_IaT/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>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<groupsTrainees>
|
||||
</groupsTrainees>
|
||||
3
DB_IaT/InstructorsAndTrainees/blankXML/instructors.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<allInstructors>
|
||||
</allInstructors>
|
||||
37
DB_IaT/InstructorsAndTrainees/commonview.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "commonview.h"
|
||||
|
||||
|
||||
CommonView::CommonView(TypeView type, QWidget *parent):
|
||||
QWidget(parent),
|
||||
treeWidget(nullptr),
|
||||
typeView(type),
|
||||
archiveVisible(false),
|
||||
notLoggedInVisible(false),
|
||||
adminMode(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CommonView::setItemColorArchive(QTreeWidgetItem *item)
|
||||
{
|
||||
int columnCount = treeWidget->columnCount();
|
||||
|
||||
for (int i = 0; i < columnCount; i++)
|
||||
item->setBackground(i, QBrush(QColor(220, 220, 220)));
|
||||
}
|
||||
|
||||
void CommonView::setItemColorNoArchive(QTreeWidgetItem *item)
|
||||
{
|
||||
int columnCount = treeWidget->columnCount();
|
||||
|
||||
for (int i = 0; i < columnCount; i++)
|
||||
item->setBackground(i, QBrush(QColor(255, 255, 255)));
|
||||
}
|
||||
|
||||
void CommonView::setItemColor(QTreeWidgetItem *item, QColor color)
|
||||
{
|
||||
int columnCount = treeWidget->columnCount();
|
||||
|
||||
for (int i = 0; i < columnCount; i++)
|
||||
item->setBackground(i, color);
|
||||
}
|
||||
50
DB_IaT/InstructorsAndTrainees/commonview.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef COMMONVIEW_H
|
||||
#define COMMONVIEW_H
|
||||
|
||||
#include <QTreeWidget>
|
||||
#include <QTranslator>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
|
||||
//Родительский класс представления БД Инструкторов/Обучаемых (самого верхнего уровня)
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT CommonView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum TypeView
|
||||
{
|
||||
onlyView,
|
||||
control
|
||||
};
|
||||
|
||||
public:
|
||||
CommonView(TypeView type, QWidget *parent = nullptr);
|
||||
|
||||
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:
|
||||
QTreeWidget* treeWidget;
|
||||
TypeView typeView;
|
||||
bool archiveVisible;
|
||||
bool notLoggedInVisible;
|
||||
bool adminMode;
|
||||
|
||||
protected:
|
||||
QTranslator qtLanguageTranslator;
|
||||
};
|
||||
|
||||
#endif // COMMONVIEW_H
|
||||
BIN
DB_IaT/InstructorsAndTrainees/icons/DB-instructors.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/DB-trainees.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/addInstructor.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/addTrainee.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/admin.png
Normal file
|
After Width: | Height: | Size: 659 B |
BIN
DB_IaT/InstructorsAndTrainees/icons/archive.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/circleGray.png
Normal file
|
After Width: | Height: | Size: 392 B |
BIN
DB_IaT/InstructorsAndTrainees/icons/circleGreen.png
Normal file
|
After Width: | Height: | Size: 784 B |
BIN
DB_IaT/InstructorsAndTrainees/icons/deleteGroup.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/deleteInstructor.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/deleteTrainee.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/edit.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/group.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/instructor.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/instructorAdmin.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/instructorArchive.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/instructorFromArchive.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/newGroup.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/trainee.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/traineeArchive.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/traineeFromArchive.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1,266 @@
|
||||
#include <QMessageBox>
|
||||
#include <QApplication>
|
||||
#include "databaseinstructors.h"
|
||||
|
||||
DataBaseInstructors::DataBaseInstructors(DataBaseLMS* dbLMS):
|
||||
adminMode(false)
|
||||
{
|
||||
this->dbLMS = dbLMS;
|
||||
|
||||
LoadInstructorsPSQL();
|
||||
}
|
||||
|
||||
DataBaseInstructors::~DataBaseInstructors()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DataBaseInstructors::LoadInstructorsPSQL()
|
||||
{
|
||||
listOfInstructors.clear();
|
||||
listOfInstructors = dbLMS->selectAllInstructors();
|
||||
|
||||
QApplication::beep();
|
||||
}
|
||||
|
||||
bool DataBaseInstructors::AuthorizationInstructor(QString login, QString password)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getArchived())
|
||||
continue;
|
||||
|
||||
if(listOfInstructors[i].getLogin() == login && listOfInstructors[i].getPassword() == password)
|
||||
{
|
||||
listOfInstructors[i].setLoggedIn(true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DataBaseInstructors::deAuthorizationInstructor(QString login)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
//if(listOfInstructors[i].getArchived())
|
||||
//continue;
|
||||
|
||||
if(listOfInstructors[i].getLogin() == login)
|
||||
{
|
||||
listOfInstructors[i].setLoggedIn(false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Instructor DataBaseInstructors::getInstructor(QString name)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getName() == name)
|
||||
return listOfInstructors[i];
|
||||
}
|
||||
return Instructor();
|
||||
}
|
||||
|
||||
QString DataBaseInstructors::getNameInstructorByLogin(QString login)
|
||||
{
|
||||
for(Instructor instructor : listOfInstructors)
|
||||
{
|
||||
if(instructor.getLogin() == login)
|
||||
return instructor.getName();
|
||||
}
|
||||
return QString(QStringLiteral(""));
|
||||
}
|
||||
|
||||
QString DataBaseInstructors::getAuthorizedInstructorName()
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getLoggedIn())
|
||||
return listOfInstructors[i].getName();
|
||||
}
|
||||
return QStringLiteral("");
|
||||
}
|
||||
|
||||
QString DataBaseInstructors::newInstructor()
|
||||
{
|
||||
Instructor instructor;
|
||||
instructor.setName(generateDefaultNameInstructor());
|
||||
instructor.setLogin(generateDefaultLoginInstructor());
|
||||
instructor.setPassword(QStringLiteral("<password>"));
|
||||
instructor.setIsAdmin(false);
|
||||
instructor.setArchived(false);
|
||||
instructor.setLoggedIn(false);
|
||||
|
||||
bool result = dbLMS->insertInstructor(instructor);
|
||||
|
||||
if(result)
|
||||
{
|
||||
//listOfInstructors.append(instructor);
|
||||
LoadInstructorsPSQL();
|
||||
return instructor.getName();
|
||||
}
|
||||
else
|
||||
return QStringLiteral("");
|
||||
}
|
||||
|
||||
void DataBaseInstructors::deleteInstructor(QString name)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getName() == name)
|
||||
{
|
||||
int id = listOfInstructors[i].getID();
|
||||
|
||||
bool result = dbLMS->deleteInstructor(id);
|
||||
|
||||
if(result)
|
||||
LoadInstructorsPSQL();
|
||||
//listOfInstructors.removeAt(i);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DataBaseInstructors::toArchiveInstructor(QString name)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getName() == name)
|
||||
if(! listOfInstructors[i].getArchived())
|
||||
{
|
||||
Instructor instructor = listOfInstructors[i];
|
||||
instructor.setArchived(true);
|
||||
|
||||
bool result = dbLMS->updateInstructor(instructor);
|
||||
|
||||
if(result)
|
||||
LoadInstructorsPSQL();
|
||||
//listOfInstructors[i].setArchived(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DataBaseInstructors::fromeArchiveInstructor(QString name)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getName() == name)
|
||||
if(listOfInstructors[i].getArchived())
|
||||
{
|
||||
Instructor instructor = listOfInstructors[i];
|
||||
instructor.setArchived(false);
|
||||
|
||||
bool result = dbLMS->updateInstructor(instructor);
|
||||
|
||||
if(result)
|
||||
LoadInstructorsPSQL();
|
||||
//listOfInstructors[i].setArchived(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool DataBaseInstructors::editInstructor(QString name, Instructor instructor)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getName() == name)
|
||||
{
|
||||
if( (!checkExistNameInstructor(instructor.getName()) || instructor.getName() == name) &&
|
||||
(!checkExistLoginInstructor(instructor.getLogin()) || instructor.getLogin() == listOfInstructors[i].getLogin()) )
|
||||
{
|
||||
instructor.setID(listOfInstructors[i].getID());
|
||||
|
||||
bool result = dbLMS->updateInstructor(instructor);
|
||||
|
||||
if(result)
|
||||
{
|
||||
//listOfInstructors.replace(i, instructor);
|
||||
LoadInstructorsPSQL();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DataBaseInstructors::isAdmin(QString name)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getName() == name)
|
||||
return listOfInstructors[i].getIsAdmin();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DataBaseInstructors::isArchived(QString name)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getName() == name)
|
||||
return listOfInstructors[i].getArchived();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString DataBaseInstructors::generateDefaultNameInstructor()
|
||||
{
|
||||
int numInstructor = 0;
|
||||
QString name;
|
||||
do
|
||||
{
|
||||
name = QStringLiteral("<") + tr("Instructor") + QStringLiteral(" ") + QString::number(++numInstructor) + QStringLiteral(">");
|
||||
}while(checkExistNameInstructor(name));
|
||||
return name;
|
||||
}
|
||||
|
||||
bool DataBaseInstructors::checkExistNameInstructor(QString name)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getName() == name)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString DataBaseInstructors::generateDefaultLoginInstructor()
|
||||
{
|
||||
int numInstructor = 0;
|
||||
QString login;
|
||||
do
|
||||
{
|
||||
login = QStringLiteral("<I") + QString::number(++numInstructor) + QStringLiteral(">");
|
||||
}while(checkExistLoginInstructor(login));
|
||||
return login;
|
||||
}
|
||||
|
||||
bool DataBaseInstructors::checkExistLoginInstructor(QString login)
|
||||
{
|
||||
//Инструкторы
|
||||
for(int i = 0; i < listOfInstructors.count(); i++)
|
||||
{
|
||||
if(listOfInstructors[i].getLogin() == login)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
#ifndef DATABASEINSTRUCTORS_H
|
||||
#define DATABASEINSTRUCTORS_H
|
||||
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "instructor.h"
|
||||
|
||||
#include "databaselms.h"
|
||||
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT DataBaseInstructors : QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DataBaseInstructors(DataBaseLMS* dbLMS);
|
||||
~DataBaseInstructors();
|
||||
|
||||
void LoadInstructorsPSQL();
|
||||
|
||||
bool AuthorizationInstructor(QString login, QString password);
|
||||
bool deAuthorizationInstructor(QString login);
|
||||
|
||||
QList<Instructor> getListInstructors(){ return listOfInstructors; } //Для загрузки
|
||||
|
||||
Instructor getInstructor(QString name);
|
||||
|
||||
QString getNameInstructorByLogin(QString login);
|
||||
|
||||
QString getAuthorizedInstructorName();
|
||||
|
||||
QString newInstructor();
|
||||
void deleteInstructor(QString name);
|
||||
void toArchiveInstructor(QString name);
|
||||
void fromeArchiveInstructor(QString name);
|
||||
bool editInstructor(QString name, Instructor instructor);
|
||||
|
||||
bool isAdmin(QString name);
|
||||
bool isArchived(QString name);
|
||||
|
||||
|
||||
private:
|
||||
QString generateDefaultNameInstructor();
|
||||
bool checkExistNameInstructor(QString name);
|
||||
|
||||
QString generateDefaultLoginInstructor();
|
||||
bool checkExistLoginInstructor(QString login);
|
||||
|
||||
private:
|
||||
QList<Instructor> listOfInstructors;
|
||||
|
||||
bool adminMode;
|
||||
|
||||
DataBaseLMS* dbLMS;
|
||||
};
|
||||
|
||||
#endif // DATABASEINSTRUCTORS_H
|
||||
@@ -0,0 +1,14 @@
|
||||
#include "dialogauthorizationinstructor.h"
|
||||
#include "ui_dialogauthorizationinstructor.h"
|
||||
|
||||
DialogAuthorizationInstructor::DialogAuthorizationInstructor(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogAuthorizationInstructor)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
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,112 @@
|
||||
<?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>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Instructor authorization</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Login</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editLogin">
|
||||
<property name="text">
|
||||
<string>admin</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editPassword">
|
||||
<property name="text">
|
||||
<string>admin</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<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/>
|
||||
<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>
|
||||
@@ -0,0 +1,42 @@
|
||||
#include "dialogeditinstructor.h"
|
||||
#include "ui_dialogeditinstructor.h"
|
||||
|
||||
DialogEditInstructor::DialogEditInstructor(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogEditInstructor)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DialogEditInstructor::~DialogEditInstructor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DialogEditInstructor::setInstructor(Instructor 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;
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#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:
|
||||
Ui::DialogEditInstructor *ui;
|
||||
};
|
||||
|
||||
#endif // DIALOGEDITINSTRUCTOR_H
|
||||
@@ -0,0 +1,190 @@
|
||||
<?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>
|
||||
</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>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Login</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editLogin"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editPassword"/>
|
||||
</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="text">
|
||||
<string>Administrator</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/admin.png</normaloff>
|
||||
<disabledoff>:/icons/admin.png</disabledoff>:/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="text">
|
||||
<string>Archived</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/archive.png</normaloff>
|
||||
<disabledoff>:/icons/archive.png</disabledoff>:/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="text">
|
||||
<string>Logged</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/circleGreen.png</normaloff>
|
||||
<disabledoff>:/icons/circleGreen.png</disabledoff>:/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="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>
|
||||
189
DB_IaT/InstructorsAndTrainees/instructors/editorinstructors.cpp
Normal file
@@ -0,0 +1,189 @@
|
||||
#include <QMessageBox>
|
||||
#include "editorinstructors.h"
|
||||
#include "dialogeditinstructor.h"
|
||||
#include "ui_editorinstructors.h"
|
||||
|
||||
EditorInstructors::EditorInstructors(DataBaseInstructors* db, bool adminMode, QWidget *parent) :
|
||||
//QDialog(parent),
|
||||
InstructorsView(db, CommonView::TypeView::control, parent),
|
||||
ui(new Ui::EditorInstructors)
|
||||
{
|
||||
ui->setupUi((QDialog*)this);
|
||||
|
||||
preparationTreeWidget(ui->treeWidget);
|
||||
setNotLoggedInVisible(true);
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
|
||||
EditorInstructors::~EditorInstructors()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnNewInstructor_clicked()
|
||||
{
|
||||
QString name = dbInstructors->newInstructor();
|
||||
loadInstructorsFromDB();
|
||||
setCurrentInstructor(name);
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnDeleteInstructor_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран Инструктор
|
||||
|
||||
QString name = treeItemCurrent->text(0);
|
||||
|
||||
if(dbInstructors->isAdmin(name))
|
||||
{//Это Админ!
|
||||
QMessageBox::critical(this, tr("Error!"), tr("You cannot delete the Administrator."));
|
||||
return;
|
||||
}
|
||||
|
||||
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||
{
|
||||
dbInstructors->deleteInstructor(name);
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnToOrFromArchive_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран Инструктор
|
||||
|
||||
QString name = treeItemCurrent->text(0);
|
||||
|
||||
if(dbInstructors->isArchived(name))
|
||||
{//Архивный
|
||||
dbInstructors->fromeArchiveInstructor(name);
|
||||
loadInstructorsFromDB();
|
||||
setCurrentInstructor(name);
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
dbInstructors->toArchiveInstructor(name);
|
||||
loadInstructorsFromDB();
|
||||
if(archiveVisible)
|
||||
setCurrentInstructor(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnEdit_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent == nullptr)
|
||||
return;
|
||||
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран Инструктор
|
||||
|
||||
QString name = treeItemCurrent->text(0);
|
||||
|
||||
DialogEditInstructor dlg(this);
|
||||
dlg.setInstructor(dbInstructors->getInstructor(name));
|
||||
|
||||
switch( dlg.exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
if(dbInstructors->editInstructor(name, dlg.getInstructor()))
|
||||
{
|
||||
loadInstructorsFromDB();
|
||||
setCurrentInstructor(dlg.getInstructor().getName());
|
||||
}
|
||||
else
|
||||
QMessageBox::critical(this, tr("Editing error!"),
|
||||
tr("An existing instructor name or login has been entered.\nThe changes will not be accepted."));
|
||||
break;
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInstructors::on_btnArchive_clicked()
|
||||
{
|
||||
bool state = ui->btnArchive->isChecked();
|
||||
setArchiveVisible(state);
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
|
||||
void EditorInstructors::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
||||
{
|
||||
//Определяем доступность и функционал кнопок для выбранного элемента
|
||||
|
||||
if(current == nullptr)
|
||||
return;
|
||||
|
||||
QTreeWidgetItem *treeItemParent = current->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбран инструктор
|
||||
|
||||
QString name = current->text(0);
|
||||
|
||||
if(dbInstructors->isArchived(name))
|
||||
{//Архивный
|
||||
ui->btnToOrFromArchive->setText(tr("From archive"));
|
||||
ui->btnToOrFromArchive->setIcon(QIcon(QStringLiteral(":/icons/instructorFromArchive.png")));
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
ui->btnToOrFromArchive->setText(tr("To archive"));
|
||||
ui->btnToOrFromArchive->setIcon(QIcon(QStringLiteral(":/icons/instructorArchive.png")));
|
||||
}
|
||||
|
||||
ui->btnNewInstructor->setEnabled(true);
|
||||
|
||||
if(dbInstructors->isAdmin(name))
|
||||
{//Это Админ! Удалять/Архивировать нельзя!
|
||||
ui->btnDeleteInstructor->setEnabled(false);
|
||||
ui->btnToOrFromArchive->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnToOrFromArchive->setEnabled(true);
|
||||
|
||||
if(dbInstructors->isArchived(name))
|
||||
ui->btnDeleteInstructor->setEnabled(true);
|
||||
else
|
||||
ui->btnDeleteInstructor->setEnabled(false);
|
||||
}
|
||||
|
||||
ui->btnEdit->setEnabled(true);
|
||||
ui->btnArchive->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInstructors::setCurrentInstructor(QString name)
|
||||
{
|
||||
for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
|
||||
if(item != nullptr)
|
||||
if(item->text(0) == name)
|
||||
{
|
||||
treeWidget->setCurrentItem(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef DIALOGINSTRUCTORS_H
|
||||
#define DIALOGINSTRUCTORS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QTreeWidget>
|
||||
#include "databaseinstructors.h"
|
||||
#include "instructorsview.h"
|
||||
|
||||
namespace Ui {
|
||||
class EditorInstructors;
|
||||
}
|
||||
|
||||
//Диалог для просмотра и управления БД Инструкторов
|
||||
|
||||
class EditorInstructors : /*public QDialog,*/ public InstructorsView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EditorInstructors(DataBaseInstructors* db, bool adminMode = false, 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(QString name);
|
||||
|
||||
private:
|
||||
Ui::EditorInstructors *ui;
|
||||
};
|
||||
|
||||
#endif // DIALOGINSTRUCTORS_H
|
||||
299
DB_IaT/InstructorsAndTrainees/instructors/editorinstructors.ui
Normal file
@@ -0,0 +1,299 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EditorInstructors</class>
|
||||
<widget class="QDialog" name="EditorInstructors">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1300</width>
|
||||
<height>800</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>List instructors</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(240, 240, 240);</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_1">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>127</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(180, 180, 180);</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<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>:/icons/addInstructor.png</normaloff>:/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>:/icons/deleteInstructor.png</normaloff>:/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>:/icons/instructorArchive.png</normaloff>:/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>:/icons/edit.png</normaloff>:/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>:/icons/archive.png</normaloff>:/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>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
127
DB_IaT/InstructorsAndTrainees/instructors/instructorsview.cpp
Normal file
@@ -0,0 +1,127 @@
|
||||
#include <QHeaderView>
|
||||
#include <QTranslator>
|
||||
#include "instructorsview.h"
|
||||
|
||||
InstructorsView::InstructorsView(DataBaseInstructors* db, TypeView type, QWidget *parent):
|
||||
CommonView(type, parent),
|
||||
dbInstructors(db)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void InstructorsView::preparationTreeWidget(QTreeWidget* tree)
|
||||
{
|
||||
treeWidget = tree;
|
||||
|
||||
if(treeWidget == nullptr)
|
||||
return;
|
||||
|
||||
treeWidget->setColumnCount(6);
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
|
||||
treeWidget->header()->setStyleSheet(QStringLiteral("font-size: 12pt;"));
|
||||
|
||||
treeWidget->setColumnWidth(0, 200);
|
||||
treeWidget->setColumnWidth(1, 130);
|
||||
treeWidget->setColumnWidth(2, 130);
|
||||
treeWidget->setColumnWidth(3, 130);
|
||||
treeWidget->setColumnWidth(4, 130);
|
||||
treeWidget->setColumnWidth(5, 130);
|
||||
|
||||
if(typeView == TypeView::onlyView)
|
||||
{//onlyView
|
||||
treeWidget->setColumnHidden(1, true);
|
||||
treeWidget->setColumnHidden(2, true);
|
||||
treeWidget->setColumnHidden(4, true);
|
||||
}
|
||||
else
|
||||
{//control
|
||||
treeWidget->setColumnHidden(4, true);
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsView::loadInstructorsFromDB()
|
||||
{
|
||||
//dbInstructors->LoadInstructorsPSQL();
|
||||
|
||||
if(treeWidget == nullptr)
|
||||
return;
|
||||
|
||||
//Обновление дерева
|
||||
treeWidget->clear();
|
||||
|
||||
//Инструкторы
|
||||
QList<Instructor> listInstructors;
|
||||
listInstructors = dbInstructors->getListInstructors();
|
||||
for(Instructor instructor : listInstructors)
|
||||
{
|
||||
QTreeWidgetItem *ItemInstructor = new QTreeWidgetItem(treeWidget);
|
||||
|
||||
ItemInstructor->setText(0, instructor.getName());
|
||||
ItemInstructor->setText(1, instructor.getLogin());
|
||||
ItemInstructor->setText(2, instructor.getPassword());
|
||||
|
||||
if(instructor.getArchived())
|
||||
{//Архивный
|
||||
ItemInstructor->setText(4, tr("yes"));
|
||||
ItemInstructor->setIcon(0, QIcon(QStringLiteral(":/icons/instructorArchive.png")));
|
||||
setItemColorArchive(ItemInstructor);
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
ItemInstructor->setText(4, tr("no"));
|
||||
ItemInstructor->setIcon(0, QIcon(QStringLiteral(":/icons/instructor.png")));
|
||||
setItemColorNoArchive(ItemInstructor);
|
||||
}
|
||||
|
||||
if(instructor.getIsAdmin())
|
||||
{//Админ
|
||||
ItemInstructor->setText(3, tr("yes"));
|
||||
ItemInstructor->setIcon(0, QIcon(QStringLiteral(":/icons/admin.png")));
|
||||
}
|
||||
else
|
||||
{//Не Админ
|
||||
ItemInstructor->setText(3, tr("no"));
|
||||
}
|
||||
|
||||
if(instructor.getLoggedIn())
|
||||
{//Залогинен
|
||||
ItemInstructor->setText(5, tr("yes"));
|
||||
ItemInstructor->setIcon(5, QIcon(QStringLiteral(":/icons/circleGreen.png")));
|
||||
}
|
||||
else
|
||||
{//Не Залогинен
|
||||
ItemInstructor->setText(5, tr("no"));
|
||||
ItemInstructor->setIcon(5, QIcon(QStringLiteral(":/icons/circleGray.png")));
|
||||
}
|
||||
|
||||
//Скрываем архивных (при необходимости)
|
||||
if(instructor.getArchived())
|
||||
if(!archiveVisible)
|
||||
ItemInstructor->setHidden(true);
|
||||
|
||||
//Скрываем незалогиненых (при необходимости)
|
||||
if(! instructor.getLoggedIn())
|
||||
if(! notLoggedInVisible)
|
||||
ItemInstructor->setHidden(true);
|
||||
}
|
||||
|
||||
treeWidget->setSortingEnabled(true);
|
||||
treeWidget->sortItems(0, Qt::SortOrder::AscendingOrder);
|
||||
treeWidget->expandAll();
|
||||
|
||||
if(typeView == TypeView::control)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
|
||||
if(item != nullptr)
|
||||
treeWidget->setCurrentItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsView::reSetHeadTreeWidget()
|
||||
{
|
||||
QStringList listHeaders = {tr("Instructor"), tr("Login"), tr("Password"), tr("Administrator"), tr("Archived"), tr("Logged")};
|
||||
treeWidget->setHeaderLabels(listHeaders);
|
||||
}
|
||||
|
||||
27
DB_IaT/InstructorsAndTrainees/instructors/instructorsview.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef INSTRUCTORSVIEW_H
|
||||
#define INSTRUCTORSVIEW_H
|
||||
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "databaseinstructors.h"
|
||||
#include "commonview.h"
|
||||
|
||||
//Родительский класс представления БД Инструкторов (для просмотра и управления)
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT InstructorsView: public CommonView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
InstructorsView(DataBaseInstructors* db, TypeView type, QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
void preparationTreeWidget(QTreeWidget* tree);
|
||||
void loadInstructorsFromDB();
|
||||
|
||||
void reSetHeadTreeWidget();
|
||||
|
||||
protected:
|
||||
DataBaseInstructors* dbInstructors;
|
||||
};
|
||||
|
||||
#endif // INSTRUCTORSVIEW_H
|
||||
@@ -0,0 +1,78 @@
|
||||
#include <QMessageBox>
|
||||
#include "editorinstructors.h"
|
||||
#include "viewerinstructors.h"
|
||||
#include "ui_viewerinstructors.h"
|
||||
|
||||
ViewerInstructors::ViewerInstructors(DataBaseInstructors* db, bool adminMode, QWidget *parent) :
|
||||
//QWidget(parent),
|
||||
InstructorsView(db, CommonView::TypeView::onlyView, parent),
|
||||
ui(new Ui::ViewerInstructors)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
this->adminMode = adminMode;
|
||||
|
||||
// Сделаем первоначальную инициализацию перевода для окна виджета
|
||||
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + QString(QStringLiteral("ru_RU")), QStringLiteral("."));
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
|
||||
preparationTreeWidget(ui->treeWidget);
|
||||
setNotLoggedInVisible(true);
|
||||
loadInstructorsFromDB();
|
||||
|
||||
if(! this->adminMode)
|
||||
ui->btnEditorInstructors->setEnabled(false);
|
||||
}
|
||||
|
||||
ViewerInstructors::~ViewerInstructors()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ViewerInstructors::setFilterInstructorLoggedIn(bool enabled)
|
||||
{
|
||||
setNotLoggedInVisible(!enabled);
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
|
||||
void ViewerInstructors::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this); // переведём окно заново
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerInstructors::slot_LanguageChanged(QString language)
|
||||
{
|
||||
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + language, QStringLiteral("."));
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
}
|
||||
|
||||
void ViewerInstructors::on_btnEditorInstructors_clicked()
|
||||
{
|
||||
if(! adminMode)
|
||||
{
|
||||
QMessageBox::warning(this, tr("Attention!"),
|
||||
tr("Only the Administrator has the right to edit instructors."));
|
||||
return;
|
||||
}
|
||||
|
||||
EditorInstructors editorInstructors(dbInstructors, adminMode);
|
||||
//dlg.setWindowTitle(tr("List instructors"));
|
||||
//dlg.exec();
|
||||
//dlg.show();
|
||||
QDialog* dialog = new QDialog(this);
|
||||
QHBoxLayout *layout = new QHBoxLayout(dialog);
|
||||
layout->addWidget(&editorInstructors);
|
||||
dialog->setWindowTitle(tr("List instructors"));
|
||||
dialog->setMinimumSize(1400, 800);
|
||||
dialog->exec();
|
||||
|
||||
dbInstructors->LoadInstructorsPSQL();
|
||||
loadInstructorsFromDB();
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef INSTRUCTORSWIDGET_H
|
||||
#define INSTRUCTORSWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "databaseinstructors.h"
|
||||
#include "instructorsview.h"
|
||||
|
||||
namespace Ui {
|
||||
class ViewerInstructors;
|
||||
}
|
||||
|
||||
//Виджет только для просмотра БД Инструкторов
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT ViewerInstructors : /*public QWidget,*/ public InstructorsView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ViewerInstructors(DataBaseInstructors* db, bool adminMode, QWidget *parent = nullptr);
|
||||
~ViewerInstructors();
|
||||
|
||||
protected:
|
||||
// Метод получения событий
|
||||
// В нём будет производиться проверка события смены перевода приложения
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
public Q_SLOTS:
|
||||
void slot_LanguageChanged(QString language);
|
||||
|
||||
public:
|
||||
void setFilterInstructorLoggedIn( bool enabled );
|
||||
|
||||
private slots:
|
||||
void on_btnEditorInstructors_clicked();
|
||||
|
||||
private:
|
||||
Ui::ViewerInstructors *ui;
|
||||
};
|
||||
|
||||
#endif // INSTRUCTORSWIDGET_H
|
||||
109
DB_IaT/InstructorsAndTrainees/instructors/viewerinstructors.ui
Normal file
@@ -0,0 +1,109 @@
|
||||
<?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>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Instructors</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Instructors</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnEditorInstructors">
|
||||
<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>:/icons/DB-instructors.png</normaloff>:/icons/DB-instructors.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<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="QTreeWidget" name="treeWidget">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -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
|
||||
@@ -0,0 +1,92 @@
|
||||
#include <QMessageBox>
|
||||
#include "instructorsandtraineeswidget.h"
|
||||
#include "ui_instructorsandtraineeswidget.h"
|
||||
#include "dialogauthorizationinstructor.h"
|
||||
|
||||
InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::InstructorsAndTraineesWidget),
|
||||
adminMode(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
dbLMS = new DataBaseLMS();
|
||||
|
||||
dataBaseTrainees = new DataBaseTrainees(dbLMS);
|
||||
dataBaseInstructors = new DataBaseInstructors(dbLMS);
|
||||
|
||||
//Авторизация Инструктора (Администратора)
|
||||
while(! authorizationInstructor(this))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Instructor authorization"), tr("Invalid login or password!"));
|
||||
};
|
||||
QMessageBox::information(this, tr("Instructor authorization"), tr("Successfully!"));
|
||||
|
||||
m_viewerTrainees = new ViewerTrainees(dataBaseTrainees, adminMode);
|
||||
m_viewerInstructors = new ViewerInstructors(dataBaseInstructors, adminMode);
|
||||
|
||||
ui->verticalLayout->addWidget(m_viewerTrainees);
|
||||
ui->verticalLayout->addWidget(m_viewerInstructors);
|
||||
|
||||
m_viewerTrainees->setMinimumSize(800, 800);
|
||||
m_viewerInstructors->setMinimumSize(800, 300);
|
||||
}
|
||||
|
||||
InstructorsAndTraineesWidget::~InstructorsAndTraineesWidget()
|
||||
{
|
||||
delete m_viewerInstructors;
|
||||
delete m_viewerTrainees;
|
||||
delete dataBaseInstructors;
|
||||
delete dataBaseTrainees;
|
||||
delete dbLMS;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::authorizationInstructor(QWidget* parent)
|
||||
{
|
||||
DialogAuthorizationInstructor dlg(parent);
|
||||
dlg.setWindowTitle(tr("Instructor authorithation"));
|
||||
|
||||
switch( dlg.exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
QString login = dlg.getLogin();
|
||||
QString password = dlg.getPassword();
|
||||
|
||||
if(dataBaseInstructors->AuthorizationInstructor(login, password))
|
||||
{
|
||||
if(login == QStringLiteral("admin"))
|
||||
adminMode = true;
|
||||
return true;
|
||||
}
|
||||
//break;
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::authorizationTrainee(QString login, QString password, QString learnClass = QStringLiteral(""), QString computer = QStringLiteral(""))
|
||||
{
|
||||
return dataBaseTrainees->AuthorizationTrainee(login, password, learnClass, computer);
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::deAuthorizationTrainee(QString login)
|
||||
{
|
||||
return dataBaseTrainees->deAuthorizationTrainee(login);
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::authorizationInstructor(QString login, QString password)
|
||||
{
|
||||
return dataBaseInstructors->AuthorizationInstructor(login, password);
|
||||
}
|
||||
|
||||
bool InstructorsAndTraineesWidget::deAuthorizationInstructor(QString login)
|
||||
{
|
||||
return dataBaseInstructors->deAuthorizationInstructor(login);
|
||||
}
|
||||
49
DB_IaT/InstructorsAndTrainees/instructorsandtraineeswidget.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef INSTRUCTORSANDTRAINEESWIDGET_H
|
||||
#define INSTRUCTORSANDTRAINEESWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "databasetrainees.h"
|
||||
#include "databaseinstructors.h"
|
||||
#include "viewertrainees.h"
|
||||
#include "viewerinstructors.h"
|
||||
|
||||
namespace Ui {
|
||||
class InstructorsAndTraineesWidget;
|
||||
}
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT InstructorsAndTraineesWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InstructorsAndTraineesWidget(QWidget *parent = nullptr);
|
||||
~InstructorsAndTraineesWidget();
|
||||
|
||||
public:
|
||||
//Авторизация инструктора локальная
|
||||
bool authorizationInstructor(QWidget* parent = nullptr);
|
||||
|
||||
//Авторизация обучаемого на клиенте
|
||||
bool authorizationTrainee(QString login, QString password, QString learnClass, QString computer);
|
||||
bool deAuthorizationTrainee(QString login);
|
||||
|
||||
//Авторизация инструктора на клиенте
|
||||
bool authorizationInstructor(QString login, QString password);
|
||||
bool deAuthorizationInstructor(QString login);
|
||||
|
||||
private:
|
||||
Ui::InstructorsAndTraineesWidget *ui;
|
||||
|
||||
DataBaseLMS* dbLMS;
|
||||
|
||||
DataBaseTrainees* dataBaseTrainees;
|
||||
DataBaseInstructors* dataBaseInstructors;
|
||||
|
||||
ViewerTrainees* m_viewerTrainees;
|
||||
ViewerInstructors* m_viewerInstructors;
|
||||
|
||||
bool adminMode;
|
||||
};
|
||||
|
||||
#endif // INSTRUCTORSANDTRAINEESWIDGET_H
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</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>Database LMS</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
27
DB_IaT/InstructorsAndTrainees/resources.qrc
Normal file
@@ -0,0 +1,27 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icons/addTrainee.png</file>
|
||||
<file>icons/deleteGroup.png</file>
|
||||
<file>icons/deleteTrainee.png</file>
|
||||
<file>icons/edit.png</file>
|
||||
<file>icons/group.png</file>
|
||||
<file>icons/newGroup.png</file>
|
||||
<file>icons/trainee.png</file>
|
||||
<file>icons/archive.png</file>
|
||||
<file>icons/traineeArchive.png</file>
|
||||
<file>icons/circleGray.png</file>
|
||||
<file>icons/circleGreen.png</file>
|
||||
<file>icons/instructor.png</file>
|
||||
<file>icons/instructorArchive.png</file>
|
||||
<file>icons/addInstructor.png</file>
|
||||
<file>icons/deleteInstructor.png</file>
|
||||
<file>blankXML/groupsTrainees.xml</file>
|
||||
<file>blankXML/instructors.xml</file>
|
||||
<file>icons/instructorAdmin.png</file>
|
||||
<file>icons/instructorFromArchive.png</file>
|
||||
<file>icons/traineeFromArchive.png</file>
|
||||
<file>icons/admin.png</file>
|
||||
<file>icons/DB-instructors.png</file>
|
||||
<file>icons/DB-trainees.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
45
DB_IaT/InstructorsAndTrainees/tasks/taskswidget.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#include "taskswidget.h"
|
||||
#include "ui_taskswidget.h"
|
||||
|
||||
TasksWidget::TasksWidget(DataBaseTrainees* db, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::TasksWidget),
|
||||
pDbTrainees(db)
|
||||
{
|
||||
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)
|
||||
{
|
||||
QStringList listTasks;
|
||||
|
||||
listTasks = pDbTrainees->getWhatItDoes(login);
|
||||
|
||||
ui->listWidgetTasks->clear();
|
||||
ui->listWidgetTasks->addItems(listTasks);
|
||||
}
|
||||
|
||||
void TasksWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this); // переведём окно заново
|
||||
}
|
||||
}
|
||||
41
DB_IaT/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 "databasetrainees.h"
|
||||
|
||||
namespace Ui {
|
||||
class TasksWidget;
|
||||
}
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT TasksWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TasksWidget(DataBaseTrainees* db, 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;
|
||||
|
||||
DataBaseTrainees* pDbTrainees;
|
||||
};
|
||||
|
||||
#endif // TASKSWIDGET_H
|
||||
41
DB_IaT/InstructorsAndTrainees/tasks/taskswidget.ui
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TasksWidget</class>
|
||||
<widget class="QWidget" name="TasksWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Task manager</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>Task manager</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidgetTasks"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "computersLocations.h"
|
||||
|
||||
ComputersLocations::ComputersLocations():
|
||||
locations(),
|
||||
computers(),
|
||||
listComputerInLocation()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ComputersLocations::addComputer(QString computer, QString location)
|
||||
{
|
||||
if(!computers.contains(computer))
|
||||
{
|
||||
computers.append(computer);
|
||||
if(!locations.contains(location))
|
||||
locations.append(location);
|
||||
|
||||
computerInLocation comp = {computer, location};
|
||||
listComputerInLocation.append(comp);
|
||||
}
|
||||
}
|
||||
|
||||
QString ComputersLocations::getLocationOfComputer(QString computer)
|
||||
{
|
||||
for(computerInLocation compInLoc : listComputerInLocation)
|
||||
{
|
||||
if(computer == compInLoc.computer)
|
||||
return compInLoc.location;
|
||||
}
|
||||
return QString(QStringLiteral(""));
|
||||
}
|
||||
|
||||
QStringList ComputersLocations::getAllComputersOfLocation(QString location)
|
||||
{
|
||||
QStringList list;
|
||||
|
||||
for(computerInLocation compInLoc : listComputerInLocation)
|
||||
{
|
||||
if(location == compInLoc.location)
|
||||
list.append(compInLoc.computer);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
46
DB_IaT/InstructorsAndTrainees/trainees/computersLocations.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef COMPUTERSLOCATIONS_H
|
||||
#define COMPUTERSLOCATIONS_H
|
||||
|
||||
#include <QStringList>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT ComputersLocations
|
||||
{
|
||||
public:
|
||||
ComputersLocations();
|
||||
|
||||
struct computerInLocation
|
||||
{
|
||||
QString computer;
|
||||
QString location;
|
||||
};
|
||||
|
||||
void clear()
|
||||
{
|
||||
listComputerInLocation.clear();
|
||||
locations.clear();
|
||||
computers.clear();
|
||||
}
|
||||
|
||||
void addComputer(QString computer, QString location);
|
||||
|
||||
QStringList getAllLocations()
|
||||
{
|
||||
return locations;
|
||||
}
|
||||
|
||||
QStringList getAllComputers()
|
||||
{
|
||||
return computers;
|
||||
}
|
||||
|
||||
QString getLocationOfComputer(QString computer);
|
||||
QStringList getAllComputersOfLocation(QString location);
|
||||
|
||||
private:
|
||||
QStringList locations;
|
||||
QStringList computers;
|
||||
QList <computerInLocation> listComputerInLocation;
|
||||
};
|
||||
|
||||
#endif // COMPUTERSLOCATIONS_H
|
||||
482
DB_IaT/InstructorsAndTrainees/trainees/databasetrainees.cpp
Normal file
@@ -0,0 +1,482 @@
|
||||
#include "databasetrainees.h"
|
||||
#include <QApplication>
|
||||
|
||||
DataBaseTrainees::DataBaseTrainees(DataBaseLMS* dbLMS)
|
||||
{
|
||||
listOfColorGroup.append(QColor(170, 190, 170));
|
||||
listOfColorGroup.append(QColor(180, 180, 220));
|
||||
listOfColorGroup.append(QColor(240, 220, 230));
|
||||
listOfColorGroup.append(QColor(85, 170, 127));
|
||||
listOfColorGroup.append(QColor(170, 115, 120));
|
||||
listOfColorGroup.append(QColor(110, 160, 170));
|
||||
listOfColorGroup.append(QColor(110, 170, 130));
|
||||
listOfColorGroup.append(QColor(170, 170, 120));
|
||||
listOfColorGroup.append(QColor(160, 170, 45));
|
||||
listOfColorGroup.append(QColor(170, 140, 60));
|
||||
listOfColorGroup.append(QColor(200, 200, 200));
|
||||
|
||||
this->dbLMS = dbLMS;
|
||||
|
||||
LoadTraineesGroupsPSQL();
|
||||
}
|
||||
|
||||
DataBaseTrainees::~DataBaseTrainees()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DataBaseTrainees::LoadTraineesGroupsPSQL()
|
||||
{
|
||||
listOfTrainees.clear();
|
||||
listOfGroups.clear();
|
||||
|
||||
listOfTrainees = dbLMS->selectAllTrainees();
|
||||
listOfGroups = dbLMS->selectAllGroups();
|
||||
|
||||
QApplication::beep();
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::AuthorizationTrainee(QString login, QString password, QString learnClass, QString computer)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getArchived())
|
||||
continue;
|
||||
|
||||
if(listOfTrainees[i].getLogin() == login && listOfTrainees[i].getPassword() == password)
|
||||
{
|
||||
listOfTrainees[i].setLoggedIn(true);
|
||||
listOfTrainees[i].setLearnClass(learnClass);
|
||||
listOfTrainees[i].setComputer(computer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::deAuthorizationTrainee(QString login)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
//if(listOfTrainees[i].getArchived())
|
||||
//continue;
|
||||
|
||||
if(listOfTrainees[i].getLogin() == login)
|
||||
{
|
||||
listOfTrainees[i].setLoggedIn(false);
|
||||
listOfTrainees[i].setLearnClass(QStringLiteral(""));
|
||||
listOfTrainees[i].setComputer(QStringLiteral(""));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DataBaseTrainees::setWhatItDoes(QString login, QString whatItDoes)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getLogin() == login)
|
||||
listOfTrainees[i].setWhatItDoes(whatItDoes);
|
||||
}
|
||||
}
|
||||
|
||||
QStringList DataBaseTrainees::getWhatItDoes(QString login)
|
||||
{
|
||||
QString whatItDoes = QStringLiteral("");
|
||||
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getLogin() == login)
|
||||
whatItDoes = listOfTrainees[i].getWhatItDoes();
|
||||
}
|
||||
|
||||
return whatItDoes.split(QStringLiteral(";"));
|
||||
}
|
||||
|
||||
QString DataBaseTrainees::getNameTraineeOnComputer(QString computer)
|
||||
{
|
||||
for(Trainee trainee : listOfTrainees)
|
||||
{
|
||||
if(trainee.getComputer() == computer)
|
||||
return trainee.getName();
|
||||
}
|
||||
return QString(QStringLiteral(""));
|
||||
}
|
||||
|
||||
Trainee DataBaseTrainees::getTraineeOnComputer(QString computer)
|
||||
{
|
||||
for(Trainee trainee : listOfTrainees)
|
||||
{
|
||||
if(trainee.getComputer() == computer)
|
||||
return trainee;
|
||||
}
|
||||
return Trainee();
|
||||
}
|
||||
|
||||
QString DataBaseTrainees::getNameTraineeByLogin(QString login)
|
||||
{
|
||||
for(Trainee trainee : listOfTrainees)
|
||||
{
|
||||
if(trainee.getLogin() == login)
|
||||
return trainee.getName();
|
||||
}
|
||||
return QString(QStringLiteral(""));
|
||||
}
|
||||
|
||||
QColor DataBaseTrainees::getColorGroupByLogin(QString login)
|
||||
{
|
||||
QString nameTrainee = getNameTraineeByLogin(login);
|
||||
Trainee trainee = getTrainee(nameTrainee);
|
||||
QString nameGroup = trainee.getGroup();
|
||||
Group group = getGroup(nameGroup);
|
||||
return getColorGroup(group.getColor());
|
||||
}
|
||||
|
||||
QList<Trainee> DataBaseTrainees::getListTraineesInGroup(QString nameGroup)
|
||||
{
|
||||
QList<Trainee> listTrainees;
|
||||
|
||||
for(Trainee trainee : listOfTrainees)
|
||||
{
|
||||
if(trainee.getGroup() == nameGroup)
|
||||
listTrainees.append(trainee);
|
||||
}
|
||||
|
||||
return listTrainees;
|
||||
}
|
||||
|
||||
QList<Group> DataBaseTrainees::getListGroups()
|
||||
{
|
||||
return listOfGroups;
|
||||
}
|
||||
|
||||
QColor DataBaseTrainees::getColorGroup(Group::ColorGroup numColor)
|
||||
{
|
||||
if(numColor > listOfColorGroup.count() - 1)
|
||||
return listOfColorGroup.at(Group::ColorGroup::colorAther);
|
||||
|
||||
return listOfColorGroup.at(numColor);
|
||||
}
|
||||
|
||||
Trainee DataBaseTrainees::getTrainee(QString name)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getName() == name)
|
||||
return listOfTrainees[i];
|
||||
}
|
||||
return Trainee();
|
||||
}
|
||||
|
||||
Group DataBaseTrainees::getGroup(QString nameGroup)
|
||||
{
|
||||
//Группы
|
||||
for(int i = 0; i < listOfGroups.count(); i++)
|
||||
{
|
||||
if(listOfGroups[i].getName() == nameGroup)
|
||||
return listOfGroups[i];
|
||||
}
|
||||
return Group();
|
||||
}
|
||||
|
||||
QString DataBaseTrainees::newGroup()
|
||||
{
|
||||
Group group;
|
||||
group.setName(generateDefaultNameGroup());
|
||||
group.setColor(generateDefaultColorGroup());
|
||||
|
||||
bool result = dbLMS->insertGroup(group);
|
||||
|
||||
if(result)
|
||||
{
|
||||
//listOfGroups.append(group);
|
||||
LoadTraineesGroupsPSQL();
|
||||
return group.getName();
|
||||
}
|
||||
else
|
||||
return QStringLiteral("");
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::deleteGroup(QString name)
|
||||
{
|
||||
if(getListTraineesInGroup(name).count() > 0)
|
||||
{//Группа не пуста
|
||||
return false;
|
||||
}
|
||||
|
||||
//Группы
|
||||
for(int i = 0; i < listOfGroups.count(); i++)
|
||||
{
|
||||
if(listOfGroups[i].getName() == name)
|
||||
{
|
||||
int id = listOfGroups[i].getID();
|
||||
|
||||
bool result = dbLMS->deleteGroup(id);
|
||||
|
||||
if(result)
|
||||
LoadTraineesGroupsPSQL();
|
||||
//listOfGroups.removeAt(i);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::editGroup(QString name, QString newName)
|
||||
{
|
||||
//Группы
|
||||
for(int i = 0; i < listOfGroups.count(); i++)
|
||||
{
|
||||
if(listOfGroups[i].getName() == name)
|
||||
{
|
||||
if(!checkExistNameGroup(newName) || newName == name)
|
||||
{
|
||||
Group group = listOfGroups[i];
|
||||
group.setName(newName);
|
||||
|
||||
bool result = dbLMS->updateGroup(group);
|
||||
|
||||
if(result)
|
||||
{
|
||||
/*
|
||||
listOfGroups[i].setName(newName);
|
||||
|
||||
//Меняем имя группы у всех Обучаемых этой группы
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getGroup() == name)
|
||||
listOfTrainees[i].setGroup(newName);
|
||||
}
|
||||
*/
|
||||
LoadTraineesGroupsPSQL();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString DataBaseTrainees::newTrainee(QString nameGroup)
|
||||
{
|
||||
Trainee trainee;
|
||||
trainee.setGroup(nameGroup);
|
||||
trainee.setName(generateDefaultNameTrainee());
|
||||
trainee.setLogin(generateDefaultLoginTrainee());
|
||||
trainee.setPassword(QStringLiteral("<password>"));
|
||||
trainee.setLearnClass(QStringLiteral(""));
|
||||
trainee.setComputer(QStringLiteral(""));
|
||||
trainee.setArchived(false);
|
||||
trainee.setLoggedIn(false);
|
||||
trainee.setWhatItDoes(QStringLiteral(""));
|
||||
|
||||
bool result = dbLMS->insertTrainee(trainee);
|
||||
|
||||
if(result)
|
||||
{
|
||||
//listOfTrainees.append(trainee);
|
||||
LoadTraineesGroupsPSQL();
|
||||
return trainee.getName();
|
||||
}
|
||||
else
|
||||
return QStringLiteral("");
|
||||
}
|
||||
|
||||
void DataBaseTrainees::deleteTrainee(QString name)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getName() == name)
|
||||
{
|
||||
int id = listOfTrainees[i].getID();
|
||||
|
||||
bool result = dbLMS->deleteTrainee(id);
|
||||
|
||||
if(result)
|
||||
LoadTraineesGroupsPSQL();
|
||||
//listOfTrainees.removeAt(i);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DataBaseTrainees::toArchiveTrainee(QString name)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getName() == name)
|
||||
if(! listOfTrainees[i].getArchived())
|
||||
{
|
||||
Trainee trainee = listOfTrainees[i];
|
||||
trainee.setArchived(true);
|
||||
|
||||
bool result = dbLMS->updateTrainee(trainee);
|
||||
|
||||
if(result)
|
||||
LoadTraineesGroupsPSQL();
|
||||
//listOfTrainees[i].setArchived(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DataBaseTrainees::fromeArchiveTrainee(QString name)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getName() == name)
|
||||
if(listOfTrainees[i].getArchived())
|
||||
{
|
||||
Trainee trainee = listOfTrainees[i];
|
||||
trainee.setArchived(false);
|
||||
|
||||
bool result = dbLMS->updateTrainee(trainee);
|
||||
|
||||
if(result)
|
||||
LoadTraineesGroupsPSQL();
|
||||
//listOfTrainees[i].setArchived(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::editTrainee(QString name, Trainee trainee)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getName() == name)
|
||||
{
|
||||
if( (!checkExistNameTrainee(trainee.getName()) || trainee.getName() == name) &&
|
||||
(!checkExistLoginTrainee(trainee.getLogin()) || trainee.getLogin() == listOfTrainees[i].getLogin()) )
|
||||
{
|
||||
trainee.setID(listOfTrainees[i].getID());
|
||||
|
||||
bool result = dbLMS->updateTrainee(trainee);
|
||||
|
||||
if(result)
|
||||
{
|
||||
//listOfTrainees.replace(i, trainee);
|
||||
LoadTraineesGroupsPSQL();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::isArchived(QString name)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getName() == name)
|
||||
return listOfTrainees[i].getArchived();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString DataBaseTrainees::generateDefaultNameGroup()
|
||||
{
|
||||
int numGroup = 0;
|
||||
QString name;
|
||||
do
|
||||
{
|
||||
name = tr("Group") + QStringLiteral(" ") + QString::number(++numGroup);
|
||||
}while(checkExistNameGroup(name));
|
||||
return name;
|
||||
}
|
||||
|
||||
QString DataBaseTrainees::generateDefaultNameTrainee()
|
||||
{
|
||||
int numTrainee = 0;
|
||||
QString name;
|
||||
do
|
||||
{
|
||||
name = QStringLiteral("<") + tr("Trainee") + QStringLiteral(" ") + QString::number(++numTrainee) + QStringLiteral(">");
|
||||
}while(checkExistNameTrainee(name));
|
||||
return name;
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::checkExistNameGroup(QString name)
|
||||
{
|
||||
//Группы
|
||||
for(int i = 0; i < listOfGroups.count(); i++)
|
||||
{
|
||||
if(listOfGroups[i].getName() == name)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::checkExistNameTrainee(QString name)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getName() == name)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString DataBaseTrainees::generateDefaultLoginTrainee()
|
||||
{
|
||||
int numTrainee = 0;
|
||||
QString login;
|
||||
do
|
||||
{
|
||||
login = QStringLiteral("<O") + QString::number(++numTrainee) + QStringLiteral(">");
|
||||
}while(checkExistLoginTrainee(login));
|
||||
return login;
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::checkExistLoginTrainee(QString login)
|
||||
{
|
||||
//Обучаемые
|
||||
for(int i = 0; i < listOfTrainees.count(); i++)
|
||||
{
|
||||
if(listOfTrainees[i].getLogin() == login)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Group::ColorGroup DataBaseTrainees::generateDefaultColorGroup()
|
||||
{
|
||||
for(int i = 0; i < Group::ColorGroup::countColor; i++)
|
||||
{
|
||||
Group::ColorGroup color = (Group::ColorGroup)i;
|
||||
if(!checkExistColorGroup(color))
|
||||
return color;
|
||||
}
|
||||
return Group::ColorGroup::colorAther;
|
||||
}
|
||||
|
||||
bool DataBaseTrainees::checkExistColorGroup(Group::ColorGroup color)
|
||||
{
|
||||
//Группы
|
||||
for(int i = 0; i < listOfGroups.count(); i++)
|
||||
{
|
||||
if(listOfGroups[i].getColor() == color)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
77
DB_IaT/InstructorsAndTrainees/trainees/databasetrainees.h
Normal file
@@ -0,0 +1,77 @@
|
||||
#ifndef DATABASETRAINEES_H
|
||||
#define DATABASETRAINEES_H
|
||||
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
|
||||
#include "databaselms.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QColor>
|
||||
#include <QObject>
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT DataBaseTrainees : QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DataBaseTrainees(DataBaseLMS* dbLMS);
|
||||
~DataBaseTrainees();
|
||||
|
||||
void LoadTraineesGroupsPSQL();
|
||||
|
||||
bool AuthorizationTrainee(QString login, QString password, QString learnClass, QString computer);
|
||||
bool deAuthorizationTrainee(QString login);
|
||||
|
||||
void setWhatItDoes(QString login, QString whatItDoes);
|
||||
QStringList getWhatItDoes(QString login);
|
||||
|
||||
QString getNameTraineeOnComputer(QString computer);
|
||||
Trainee getTraineeOnComputer(QString computer);
|
||||
|
||||
QString getNameTraineeByLogin(QString login);
|
||||
QColor getColorGroupByLogin(QString login);
|
||||
|
||||
QList<Trainee> getListTraineesInGroup(QString nameGroup);
|
||||
QList<Group> getListGroups();
|
||||
|
||||
QColor getColorGroup(Group::ColorGroup numColor);
|
||||
|
||||
Trainee getTrainee(QString name);
|
||||
Group getGroup(QString nameGroup);
|
||||
|
||||
QString newGroup();
|
||||
bool deleteGroup(QString name);
|
||||
bool editGroup(QString name, QString newName);
|
||||
|
||||
QString newTrainee(QString nameGroup);
|
||||
void deleteTrainee(QString name);
|
||||
void toArchiveTrainee(QString name);
|
||||
void fromeArchiveTrainee(QString name);
|
||||
bool editTrainee(QString name, Trainee trainee);
|
||||
|
||||
bool isArchived(QString name);
|
||||
|
||||
private:
|
||||
QString generateDefaultNameGroup();
|
||||
QString generateDefaultNameTrainee();
|
||||
bool checkExistNameGroup(QString name);
|
||||
bool checkExistNameTrainee(QString name);
|
||||
|
||||
QString generateDefaultLoginTrainee();
|
||||
bool checkExistLoginTrainee(QString login);
|
||||
|
||||
Group::ColorGroup generateDefaultColorGroup();
|
||||
bool checkExistColorGroup(Group::ColorGroup color);
|
||||
|
||||
private:
|
||||
QList<Trainee> listOfTrainees;
|
||||
QList<Group> listOfGroups;
|
||||
|
||||
QList<QColor> listOfColorGroup;
|
||||
|
||||
DataBaseLMS* dbLMS;
|
||||
};
|
||||
|
||||
#endif // DATABASETRAINEES_H
|
||||
14
DB_IaT/InstructorsAndTrainees/trainees/dialogeditgroup.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "dialogeditgroup.h"
|
||||
#include "computersLocations.h"
|
||||
|
||||
DialogEditGroup::DialogEditGroup(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogEditGroup)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DialogEditGroup::~DialogEditGroup()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
34
DB_IaT/InstructorsAndTrainees/trainees/dialogeditgroup.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef DIALOGEDITGROUP_H
|
||||
#define DIALOGEDITGROUP_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "ui_dialogeditgroup.h"
|
||||
#include "computersLocations.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogEditGroup;
|
||||
}
|
||||
|
||||
class DialogEditGroup : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogEditGroup(QWidget *parent = nullptr);
|
||||
~DialogEditGroup();
|
||||
|
||||
void setName(QString name)
|
||||
{
|
||||
ui->editName->setText(name);
|
||||
}
|
||||
|
||||
QString getName()
|
||||
{
|
||||
return ui->editName->text();
|
||||
}
|
||||
|
||||
private:
|
||||
Ui::DialogEditGroup *ui;
|
||||
};
|
||||
|
||||
#endif // DIALOGEDITGROUP_H
|
||||
96
DB_IaT/InstructorsAndTrainees/trainees/dialogeditgroup.ui
Normal file
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DialogEditGroup</class>
|
||||
<widget class="QDialog" name="DialogEditGroup">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>96</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Group</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/group.png</normaloff>:/icons/group.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<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>DialogEditGroup</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>DialogEditGroup</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>
|
||||
44
DB_IaT/InstructorsAndTrainees/trainees/dialogedittrainee.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#include "dialogedittrainee.h"
|
||||
#include "ui_dialogedittrainee.h"
|
||||
|
||||
DialogEditTrainee::DialogEditTrainee(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogEditTrainee),
|
||||
nameGroup()
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DialogEditTrainee::~DialogEditTrainee()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DialogEditTrainee::setTrainee(Trainee trainee)
|
||||
{
|
||||
ui->editName->setText(trainee.getName());
|
||||
ui->editLogin->setText(trainee.getLogin());
|
||||
ui->editPassword->setText(trainee.getPassword());
|
||||
|
||||
ui->checkArchived->setChecked(trainee.getArchived());
|
||||
ui->checkLoggedIn->setChecked(trainee.getLoggedIn());
|
||||
|
||||
nameGroup = trainee.getGroup();
|
||||
}
|
||||
|
||||
Trainee DialogEditTrainee::getTrainee()
|
||||
{
|
||||
Trainee trainee;
|
||||
trainee.setName(ui->editName->text());
|
||||
trainee.setLogin(ui->editLogin->text());
|
||||
trainee.setPassword(ui->editPassword->text());
|
||||
trainee.setLearnClass(QStringLiteral(""));
|
||||
trainee.setComputer(QStringLiteral(""));
|
||||
trainee.setArchived(ui->checkArchived->isChecked());
|
||||
trainee.setLoggedIn(ui->checkLoggedIn->isChecked());
|
||||
trainee.setWhatItDoes(QStringLiteral(""));
|
||||
|
||||
trainee.setGroup(nameGroup);
|
||||
|
||||
return trainee;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
#include "dialogedittrainee.h"
|
||||
#include "ui_dialogedittrainee.h"
|
||||
#include "computersLocations.h"
|
||||
|
||||
DialogEditTrainee::DialogEditTrainee(ComputersLocations* computersLocations, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogEditTrainee),
|
||||
computersLocations(computersLocations),
|
||||
nameGroup()
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->comboLocation->clear();
|
||||
ui->comboLocation->addItems(computersLocations->getAllLocations());
|
||||
ui->comboLocation->setCurrentIndex(0);
|
||||
//setLocation(getLocation());
|
||||
ui->comboComputer->clear();
|
||||
ui->comboComputer->addItems(computersLocations->getAllComputersOfLocation(ui->comboLocation->currentText()));
|
||||
}
|
||||
|
||||
DialogEditTrainee::~DialogEditTrainee()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DialogEditTrainee::setTrainee(Trainee trainee)
|
||||
{
|
||||
ui->editName->setText(trainee.getName());
|
||||
ui->editLogin->setText(trainee.getLogin());
|
||||
ui->editPassword->setText(trainee.getPassword());
|
||||
|
||||
ui->comboLocation->setCurrentText(trainee.getLearnClass());
|
||||
ui->comboComputer->clear();
|
||||
ui->comboComputer->addItems(computersLocations->getAllComputersOfLocation(ui->comboLocation->currentText()));
|
||||
|
||||
ui->comboComputer->setCurrentText(trainee.getComputer());
|
||||
ui->checkArchived->setChecked(trainee.getArchived());
|
||||
ui->checkLoggedIn->setChecked(trainee.getLoggedIn());
|
||||
ui->editWhatItDoes->setText(trainee.getWhatItDoes());
|
||||
|
||||
nameGroup = trainee.getGroup();
|
||||
}
|
||||
|
||||
Trainee DialogEditTrainee::getTrainee()
|
||||
{
|
||||
Trainee trainee;
|
||||
trainee.setName(ui->editName->text());
|
||||
trainee.setLogin(ui->editLogin->text());
|
||||
trainee.setPassword(ui->editPassword->text());
|
||||
trainee.setLearnClass(ui->comboLocation->currentText());
|
||||
trainee.setComputer(ui->comboComputer->currentText());
|
||||
trainee.setArchived(ui->checkArchived->isChecked());
|
||||
trainee.setLoggedIn(ui->checkLoggedIn->isChecked());
|
||||
trainee.setWhatItDoes(ui->editWhatItDoes->text());
|
||||
|
||||
trainee.setGroup(nameGroup);
|
||||
|
||||
return trainee;
|
||||
}
|
||||
|
||||
void DialogEditTrainee::on_comboLocation_currentIndexChanged(const QString &arg1)
|
||||
{
|
||||
ui->comboComputer->clear();
|
||||
ui->comboComputer->addItems(computersLocations->getAllComputersOfLocation(arg1));
|
||||
}
|
||||
28
DB_IaT/InstructorsAndTrainees/trainees/dialogedittrainee.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef DIALOGEDITTRAINEE_H
|
||||
#define DIALOGEDITTRAINEE_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "trainee.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogEditTrainee;
|
||||
}
|
||||
|
||||
class DialogEditTrainee : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogEditTrainee(QWidget *parent = nullptr);
|
||||
~DialogEditTrainee();
|
||||
|
||||
void setTrainee(Trainee trainee);
|
||||
Trainee getTrainee();
|
||||
|
||||
private:
|
||||
Ui::DialogEditTrainee *ui;
|
||||
|
||||
QString nameGroup;
|
||||
};
|
||||
|
||||
#endif // DIALOGEDITTRAINEE_H
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef DIALOGEDITTRAINEE_H
|
||||
#define DIALOGEDITTRAINEE_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "trainee.h"
|
||||
#include "computersLocations.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogEditTrainee;
|
||||
}
|
||||
|
||||
class DialogEditTrainee : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogEditTrainee(ComputersLocations* computersLocations, QWidget *parent = nullptr);
|
||||
~DialogEditTrainee();
|
||||
|
||||
void setTrainee(Trainee trainee);
|
||||
Trainee getTrainee();
|
||||
|
||||
private slots:
|
||||
void on_comboLocation_currentIndexChanged(const QString &arg1);
|
||||
|
||||
private:
|
||||
Ui::DialogEditTrainee *ui;
|
||||
ComputersLocations* computersLocations;
|
||||
|
||||
QString nameGroup;
|
||||
};
|
||||
|
||||
#endif // DIALOGEDITTRAINEE_H
|
||||
165
DB_IaT/InstructorsAndTrainees/trainees/dialogedittrainee.ui
Normal file
@@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DialogEditTrainee</class>
|
||||
<widget class="QDialog" name="DialogEditTrainee">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>252</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Trainee</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/trainee.png</normaloff>:/icons/trainee.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<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>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Login</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editLogin"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editPassword"/>
|
||||
</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="text">
|
||||
<string>Archived</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/archive.png</normaloff>
|
||||
<disabledoff>:/icons/archive.png</disabledoff>:/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="text">
|
||||
<string>Logged</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/circleGreen.png</normaloff>
|
||||
<disabledoff>:/icons/circleGreen.png</disabledoff>:/icons/circleGreen.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>DialogEditTrainee</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>DialogEditTrainee</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>
|
||||
279
DB_IaT/InstructorsAndTrainees/trainees/editortrainees.cpp
Normal file
@@ -0,0 +1,279 @@
|
||||
#include <QMessageBox>
|
||||
#include "editortrainees.h"
|
||||
#include "ui_editortrainees.h"
|
||||
#include "dialogeditgroup.h"
|
||||
#include "dialogedittrainee.h"
|
||||
|
||||
EditorTrainees::EditorTrainees(DataBaseTrainees* db, bool adminMode, QWidget *parent) :
|
||||
//QDialog(parent),
|
||||
TraineesView(db, CommonView::TypeView::control, parent),
|
||||
ui(new Ui::EditorTrainees)
|
||||
{
|
||||
ui->setupUi((QDialog*)this);
|
||||
|
||||
preparationTreeWidget(ui->treeWidget);
|
||||
setNotLoggedInVisible(true);
|
||||
loadTraineesFromDB();
|
||||
}
|
||||
|
||||
EditorTrainees::~EditorTrainees()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void EditorTrainees::on_btnNewGroup_clicked()
|
||||
{
|
||||
QString nameGroup = dbTrainees->newGroup();
|
||||
loadTraineesFromDB();
|
||||
setCurrentGroup(nameGroup);
|
||||
}
|
||||
|
||||
void EditorTrainees::on_btnDeleteGroup_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбрана группа
|
||||
QString name = treeItemCurrent->text(0);
|
||||
if(dbTrainees->deleteGroup(name))
|
||||
{//Удалено
|
||||
loadTraineesFromDB();
|
||||
}
|
||||
else
|
||||
QMessageBox::critical(this, tr("Editing error!"), tr("The group is not empty.\nIt is not possible to delete a non-empty group."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorTrainees::on_btnNewTrainee_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбрана группа. Можно добавить Обучаемого
|
||||
QString nameGroup = treeItemCurrent->text(0);
|
||||
dbTrainees->newTrainee(nameGroup);
|
||||
loadTraineesFromDB();
|
||||
setCurrentGroup(nameGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorTrainees::on_btnDeleteTrainee_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent != nullptr)
|
||||
{//Выбран обучаемый
|
||||
|
||||
QString name = treeItemCurrent->text(0);
|
||||
QString nameGroup = treeItemParent->text(0);
|
||||
|
||||
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
|
||||
{
|
||||
dbTrainees->deleteTrainee(name);
|
||||
loadTraineesFromDB();
|
||||
setCurrentGroup(nameGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorTrainees::on_btnToOrFromArchiveTrainee_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent != nullptr)
|
||||
{
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent != nullptr)
|
||||
{//Выбран обучаемый
|
||||
|
||||
QString name = treeItemCurrent->text(0);
|
||||
|
||||
if(dbTrainees->isArchived(name))
|
||||
{//Архивный
|
||||
dbTrainees->fromeArchiveTrainee(name);
|
||||
loadTraineesFromDB();
|
||||
setCurrentTrainee(name);
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
dbTrainees->toArchiveTrainee(name);
|
||||
|
||||
if(!archiveVisible)
|
||||
ui->btnArchive->click();
|
||||
|
||||
loadTraineesFromDB();
|
||||
setCurrentTrainee(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorTrainees::on_btnEdit_clicked()
|
||||
{
|
||||
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
|
||||
|
||||
if(treeItemCurrent == nullptr)
|
||||
return;
|
||||
|
||||
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбрана группа
|
||||
|
||||
QString nameGroup = treeItemCurrent->text(0);
|
||||
|
||||
DialogEditGroup dlg(this);
|
||||
dlg.setName(nameGroup);
|
||||
switch( dlg.exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
if(dbTrainees->editGroup(nameGroup, dlg.getName()))
|
||||
{
|
||||
loadTraineesFromDB();
|
||||
setCurrentGroup(dlg.getName());
|
||||
}
|
||||
else
|
||||
QMessageBox::critical(this, tr("Editing error!"),
|
||||
tr("An existing group name has been entered.\nThe changes will not be accepted."));
|
||||
break;
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{//Выбран обучаемый
|
||||
|
||||
QString name = treeItemCurrent->text(0);
|
||||
|
||||
DialogEditTrainee dlg(this);
|
||||
dlg.setTrainee(dbTrainees->getTrainee(name));
|
||||
|
||||
switch( dlg.exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
{
|
||||
if(dbTrainees->editTrainee(name, dlg.getTrainee()))
|
||||
{
|
||||
loadTraineesFromDB();
|
||||
setCurrentTrainee(dlg.getTrainee().getName());
|
||||
}
|
||||
else
|
||||
QMessageBox::critical(this, tr("Editing error!"),
|
||||
tr("An existing trainee's name or login has been entered.\nThe changes will not be accepted."));
|
||||
break;
|
||||
}
|
||||
case QDialog::Rejected:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorTrainees::on_btnArchive_clicked()
|
||||
{
|
||||
bool state = ui->btnArchive->isChecked();
|
||||
setArchiveVisible(state);
|
||||
loadTraineesFromDB();
|
||||
}
|
||||
|
||||
void EditorTrainees::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
||||
{
|
||||
//Определяем доступность и функционал кнопок для выбранного элемента
|
||||
|
||||
if(current == nullptr)
|
||||
return;
|
||||
|
||||
QTreeWidgetItem *treeItemParent = current->parent();
|
||||
if(treeItemParent == nullptr)
|
||||
{//Выбрана группа
|
||||
ui->btnNewGroup->setEnabled(true);
|
||||
ui->btnDeleteGroup->setEnabled(true);
|
||||
ui->btnNewTrainee->setEnabled(true);
|
||||
ui->btnDeleteTrainee->setEnabled(false);
|
||||
ui->btnToOrFromArchiveTrainee->setEnabled(false);
|
||||
ui->btnEdit->setEnabled(true);
|
||||
ui->btnArchive->setEnabled(true);
|
||||
|
||||
ui->btnToOrFromArchiveTrainee->setText(tr("To archive"));
|
||||
ui->btnToOrFromArchiveTrainee->setIcon(QIcon(QStringLiteral(":/icons/traineeArchive.png")));
|
||||
}
|
||||
else
|
||||
{//Выбран обучаемый
|
||||
QString name = current->text(0);
|
||||
|
||||
ui->btnNewGroup->setEnabled(false);
|
||||
ui->btnDeleteGroup->setEnabled(false);
|
||||
ui->btnNewTrainee->setEnabled(false);
|
||||
|
||||
if(dbTrainees->isArchived(name))
|
||||
{//Архивный
|
||||
ui->btnDeleteTrainee->setEnabled(true);
|
||||
|
||||
ui->btnToOrFromArchiveTrainee->setText(tr("From archive"));
|
||||
ui->btnToOrFromArchiveTrainee->setIcon(QIcon(QStringLiteral(":/icons/traineeFromArchive.png")));
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
ui->btnDeleteTrainee->setEnabled(false);
|
||||
|
||||
ui->btnToOrFromArchiveTrainee->setText(tr("To archive"));
|
||||
ui->btnToOrFromArchiveTrainee->setIcon(QIcon(QStringLiteral(":/icons/traineeArchive.png")));
|
||||
}
|
||||
|
||||
ui->btnToOrFromArchiveTrainee->setEnabled(true);
|
||||
|
||||
ui->btnEdit->setEnabled(true);
|
||||
ui->btnArchive->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorTrainees::setCurrentGroup(QString nameGroup)
|
||||
{
|
||||
for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
|
||||
if(item != nullptr)
|
||||
if(item->text(0) == nameGroup)
|
||||
{
|
||||
treeWidget->setCurrentItem(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorTrainees::setCurrentTrainee(QString name)
|
||||
{
|
||||
for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
|
||||
if(item != nullptr)
|
||||
{
|
||||
for (int j = 0; j < item->childCount(); j++)
|
||||
{
|
||||
QTreeWidgetItem * itemChild = item->child(j);
|
||||
if(itemChild != nullptr)
|
||||
if(itemChild->text(0) == name)
|
||||
{
|
||||
treeWidget->setCurrentItem(itemChild);
|
||||
break;
|
||||
}
|
||||
}//for (int j = 0; j < item->childCount(); j++)
|
||||
}
|
||||
}//for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
|
||||
}
|
||||
42
DB_IaT/InstructorsAndTrainees/trainees/editortrainees.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef DIALOGTRAINEESGROUPS_H
|
||||
#define DIALOGTRAINEESGROUPS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QTreeWidget>
|
||||
//#include "computersLocations.h"
|
||||
#include "databasetrainees.h"
|
||||
#include "traineesview.h"
|
||||
|
||||
namespace Ui {
|
||||
class EditorTrainees;
|
||||
}
|
||||
|
||||
//Диалог для просмотра и управления БД Обучаемых
|
||||
|
||||
class EditorTrainees : /*public QDialog,*/ public TraineesView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EditorTrainees(DataBaseTrainees* db, bool adminMode = false, QWidget *parent = nullptr);
|
||||
~EditorTrainees();
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_btnNewGroup_clicked();
|
||||
void on_btnDeleteGroup_clicked();
|
||||
void on_btnNewTrainee_clicked();
|
||||
void on_btnDeleteTrainee_clicked();
|
||||
void on_btnToOrFromArchiveTrainee_clicked();
|
||||
void on_btnEdit_clicked();
|
||||
void on_btnArchive_clicked();
|
||||
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
|
||||
private:
|
||||
void setCurrentGroup(QString nameGroup);
|
||||
void setCurrentTrainee(QString name);
|
||||
|
||||
private:
|
||||
Ui::EditorTrainees *ui;
|
||||
};
|
||||
|
||||
#endif // DIALOGTRAINEESGROUPS_H
|
||||
390
DB_IaT/InstructorsAndTrainees/trainees/editortrainees.ui
Normal file
@@ -0,0 +1,390 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EditorTrainees</class>
|
||||
<widget class="QDialog" name="EditorTrainees">
|
||||
<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 trainees</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(240, 240, 240);</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_1">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(180, 180, 180);</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnNewGroup">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New group</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/newGroup.png</normaloff>:/icons/newGroup.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="btnDeleteGroup">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete group</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/deleteGroup.png</normaloff>:/icons/deleteGroup.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="btnNewTrainee">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New trainee</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/addTrainee.png</normaloff>:/icons/addTrainee.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="btnDeleteTrainee">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete trainee</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/deleteTrainee.png</normaloff>:/icons/deleteTrainee.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="btnToOrFromArchiveTrainee">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</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>:/icons/traineeArchive.png</normaloff>:/icons/traineeArchive.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</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>:/icons/edit.png</normaloff>:/icons/edit.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnArchive">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</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>:/icons/archive.png</normaloff>:/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>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
134
DB_IaT/InstructorsAndTrainees/trainees/traineesview.cpp
Normal file
@@ -0,0 +1,134 @@
|
||||
#include <QHeaderView>
|
||||
#include "traineesview.h"
|
||||
|
||||
TraineesView::TraineesView(DataBaseTrainees* db, TypeView type, QWidget *parent):
|
||||
CommonView(type, parent),
|
||||
dbTrainees(db)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void TraineesView::preparationTreeWidget(QTreeWidget *tree)
|
||||
{
|
||||
treeWidget = tree;
|
||||
|
||||
if(treeWidget == nullptr)
|
||||
return;
|
||||
|
||||
treeWidget->setColumnCount(8);
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
|
||||
treeWidget->header()->setStyleSheet(QStringLiteral("font-size: 12pt;"));
|
||||
|
||||
treeWidget->setColumnWidth(0, 200);
|
||||
treeWidget->setColumnWidth(1, 130);
|
||||
treeWidget->setColumnWidth(2, 130);
|
||||
treeWidget->setColumnWidth(3, 130);
|
||||
treeWidget->setColumnWidth(4, 130);
|
||||
treeWidget->setColumnWidth(5, 130);
|
||||
treeWidget->setColumnWidth(6, 130);
|
||||
treeWidget->setColumnWidth(7, 100);
|
||||
|
||||
if(typeView == TypeView::onlyView)
|
||||
{//onlyView
|
||||
treeWidget->setColumnHidden(1, true);
|
||||
treeWidget->setColumnHidden(2, true);
|
||||
treeWidget->setColumnHidden(5, true);
|
||||
treeWidget->setColumnHidden(7, true);
|
||||
}
|
||||
else
|
||||
{//control
|
||||
treeWidget->setColumnHidden(5, true);
|
||||
}
|
||||
}
|
||||
|
||||
void TraineesView::loadTraineesFromDB()
|
||||
{
|
||||
//dbTrainees->LoadTraineesGroupsPSQL();
|
||||
|
||||
if(treeWidget == nullptr)
|
||||
return;
|
||||
|
||||
//Обновление дерева
|
||||
treeWidget->clear();
|
||||
|
||||
for(Group group : dbTrainees->getListGroups())
|
||||
{
|
||||
//Группа
|
||||
QTreeWidgetItem *ItemGroup = new QTreeWidgetItem(treeWidget);
|
||||
ItemGroup->setText(0, group.getName());
|
||||
ItemGroup->setIcon(0, QIcon(QStringLiteral(":/icons/group.png")));
|
||||
QColor color = dbTrainees->getColorGroup(/*group.getColor()*/Group::color0);
|
||||
setItemColor(ItemGroup, color);
|
||||
|
||||
//Обучаемые
|
||||
QList<Trainee> listTrainees;
|
||||
listTrainees = dbTrainees->getListTraineesInGroup(group.getName());
|
||||
for(Trainee trainee : listTrainees)
|
||||
{
|
||||
QTreeWidgetItem *ItemTrainee = new QTreeWidgetItem();
|
||||
|
||||
ItemTrainee->setText(0, trainee.getName());
|
||||
ItemTrainee->setText(1, trainee.getLogin());
|
||||
ItemTrainee->setText(2, trainee.getPassword());
|
||||
ItemTrainee->setText(3, trainee.getLearnClass());
|
||||
ItemTrainee->setText(4, trainee.getComputer());
|
||||
|
||||
if(trainee.getArchived())
|
||||
{//Архивный
|
||||
ItemTrainee->setText(5, tr("yes"));
|
||||
ItemTrainee->setIcon(0, QIcon(QStringLiteral(":/icons/traineeArchive.png")));
|
||||
setItemColorArchive(ItemTrainee);
|
||||
}
|
||||
else
|
||||
{//Не Архивный
|
||||
ItemTrainee->setText(5, tr("no"));
|
||||
ItemTrainee->setIcon(0, QIcon(QStringLiteral(":/icons/trainee.png")));
|
||||
setItemColorNoArchive(ItemTrainee);
|
||||
}
|
||||
|
||||
if(trainee.getLoggedIn())
|
||||
{//Залогинен
|
||||
ItemTrainee->setText(6, tr("yes"));
|
||||
ItemTrainee->setIcon(6, QIcon(QStringLiteral(":/icons/circleGreen.png")));
|
||||
}
|
||||
else
|
||||
{//Не Залогинен
|
||||
ItemTrainee->setText(6, tr("no"));
|
||||
ItemTrainee->setIcon(6, QIcon(QStringLiteral(":/icons/circleGray.png")));
|
||||
}
|
||||
|
||||
ItemTrainee->setText(7, trainee.getWhatItDoes());
|
||||
|
||||
ItemGroup->addChild(ItemTrainee);
|
||||
|
||||
//Скрываем архивных (при необходимости)
|
||||
if(trainee.getArchived())
|
||||
if(!archiveVisible)
|
||||
ItemTrainee->setHidden(true);
|
||||
|
||||
//Скрываем незалогиненых (при необходимости)
|
||||
if(! trainee.getLoggedIn())
|
||||
if(! notLoggedInVisible)
|
||||
ItemTrainee->setHidden(true);
|
||||
}
|
||||
}
|
||||
|
||||
treeWidget->setSortingEnabled(true);
|
||||
treeWidget->sortItems(0, Qt::SortOrder::AscendingOrder);
|
||||
treeWidget->expandAll();
|
||||
|
||||
if(typeView == TypeView::control)
|
||||
{
|
||||
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
|
||||
if(item != nullptr)
|
||||
treeWidget->setCurrentItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
void TraineesView::reSetHeadTreeWidget()
|
||||
{
|
||||
QStringList listHeaders = {tr("Trainee"), tr("Login"), tr("Password"), tr("Class"), tr("Computer"), tr("Archived"), tr("Logged"), tr("Tasks")};
|
||||
treeWidget->setHeaderLabels(listHeaders);
|
||||
}
|
||||
27
DB_IaT/InstructorsAndTrainees/trainees/traineesview.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef TRAINEESVIEW_H
|
||||
#define TRAINEESVIEW_H
|
||||
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "databasetrainees.h"
|
||||
#include "commonview.h"
|
||||
|
||||
//Родительский класс представления БД Обучаемых (для просмотра и управления)
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT TraineesView: public CommonView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TraineesView(DataBaseTrainees* db, TypeView type, QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
void preparationTreeWidget(QTreeWidget* tree);
|
||||
void loadTraineesFromDB();
|
||||
|
||||
void reSetHeadTreeWidget();
|
||||
|
||||
protected:
|
||||
DataBaseTrainees* dbTrainees;
|
||||
};
|
||||
|
||||
#endif // TRAINEESVIEW_H
|
||||
95
DB_IaT/InstructorsAndTrainees/trainees/viewertrainees.cpp
Normal file
@@ -0,0 +1,95 @@
|
||||
#include "editortrainees.h"
|
||||
#include "viewertrainees.h"
|
||||
#include "ui_viewertrainees.h"
|
||||
|
||||
ViewerTrainees::ViewerTrainees(DataBaseTrainees* db, bool adminMode, QWidget *parent) :
|
||||
//QWidget(parent),
|
||||
TraineesView(db, CommonView::TypeView::onlyView, parent),
|
||||
ui(new Ui::ViewerTrainees)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
this->adminMode = adminMode;
|
||||
|
||||
// Сделаем первоначальную инициализацию перевода для окна виджета
|
||||
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + QString(QStringLiteral("ru_RU")), QStringLiteral("."));
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
|
||||
preparationTreeWidget(ui->treeWidget);
|
||||
setNotLoggedInVisible(true);
|
||||
loadTraineesFromDB();
|
||||
}
|
||||
|
||||
ViewerTrainees::~ViewerTrainees()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ViewerTrainees::setFilterTraineeLoggedIn(bool enabled)
|
||||
{
|
||||
setNotLoggedInVisible(!enabled);
|
||||
loadTraineesFromDB();
|
||||
}
|
||||
|
||||
void ViewerTrainees::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
if(item->childCount() == 0)
|
||||
{//Выбран обучаемый
|
||||
QString login = item->text(1);
|
||||
Q_EMIT signal_traineeSelected(login);
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerTrainees::slot_tabMessengerChanged(QString login)
|
||||
{
|
||||
for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)
|
||||
{//Проход по группам
|
||||
int countChild = ui->treeWidget->topLevelItem(i)->childCount();
|
||||
|
||||
for (int j = 0; j < countChild; j++)
|
||||
{//Проход по обучаемым
|
||||
QString loginChild = ui->treeWidget->topLevelItem(i)->child(j)->text(1);
|
||||
if(loginChild == login)
|
||||
{
|
||||
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(i)->child(j));
|
||||
Q_EMIT signal_traineeSelected(login);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerTrainees::changeEvent(QEvent *event)
|
||||
{
|
||||
// В случае получения события изменения языка приложения
|
||||
if (event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this); // переведём окно заново
|
||||
|
||||
reSetHeadTreeWidget();
|
||||
loadTraineesFromDB();
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerTrainees::slot_LanguageChanged(QString language)
|
||||
{
|
||||
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + language, QStringLiteral("."));
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
}
|
||||
|
||||
void ViewerTrainees::on_btnEditorTrainees_clicked()
|
||||
{
|
||||
EditorTrainees editorTraineesGroups(dbTrainees, adminMode);
|
||||
//dlg.setWindowTitle(tr("List trainees"));
|
||||
//dlg.exec();
|
||||
//dlg.show();
|
||||
QDialog* dialog = new QDialog(this);
|
||||
QHBoxLayout *layout = new QHBoxLayout(dialog);
|
||||
layout->addWidget(&editorTraineesGroups);
|
||||
dialog->setWindowTitle(tr("List trainees"));
|
||||
dialog->setMinimumSize(1400, 800);
|
||||
dialog->exec();
|
||||
|
||||
dbTrainees->LoadTraineesGroupsPSQL();
|
||||
loadTraineesFromDB();
|
||||
}
|
||||
53
DB_IaT/InstructorsAndTrainees/trainees/viewertrainees.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef TRAINEESWIDGET_H
|
||||
#define TRAINEESWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QObject>
|
||||
#include <QEvent>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
#include "databasetrainees.h"
|
||||
#include "traineesview.h"
|
||||
|
||||
namespace Ui {
|
||||
class ViewerTrainees;
|
||||
}
|
||||
|
||||
//Виджет только для просмотра БД Обучаемых
|
||||
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT ViewerTrainees : /*public QWidget,*/ public TraineesView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ViewerTrainees(DataBaseTrainees* db, bool adminMode, QWidget *parent = nullptr);
|
||||
~ViewerTrainees();
|
||||
|
||||
protected:
|
||||
// Метод получения событий
|
||||
// В нём будет производиться проверка события смены перевода приложения
|
||||
void changeEvent(QEvent * event) override;
|
||||
|
||||
public Q_SLOTS:
|
||||
void slot_LanguageChanged(QString language);
|
||||
|
||||
public:
|
||||
void setFilterTraineeLoggedIn( bool enabled );
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
|
||||
|
||||
void on_btnEditorTrainees_clicked();
|
||||
|
||||
public Q_SLOTS:
|
||||
//слот обработки сигнала об изменении вкладки диалога в мессенджере
|
||||
void slot_tabMessengerChanged(QString login);
|
||||
|
||||
Q_SIGNALS:
|
||||
//сигнал о выборе обучаемого
|
||||
void signal_traineeSelected(QString login);
|
||||
|
||||
private:
|
||||
Ui::ViewerTrainees *ui;
|
||||
};
|
||||
|
||||
#endif // TRAINEESWIDGET_H
|
||||
112
DB_IaT/InstructorsAndTrainees/trainees/viewertrainees.ui
Normal file
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ViewerTrainees</class>
|
||||
<widget class="QWidget" name="ViewerTrainees">
|
||||
<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>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Trainees</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2" rowspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Trainees</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnEditorTrainees">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Editor of Trainees</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/icons/DB-trainees.png</normaloff>:/icons/DB-trainees.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<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="QTreeWidget" name="treeWidget">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Tahoma</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||