Рефакт Администрирование БД 1

This commit is contained in:
2025-11-05 16:17:26 +03:00
parent 84ea6ca512
commit 99d9c6d1e3
8 changed files with 86 additions and 24 deletions

View File

@@ -71,6 +71,15 @@ else()
endif()
target_link_libraries(ServerLMS PRIVATE libDataBaseLMS.dll)
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees)
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/instructors)
if(PROJECT_TYPE_DEBUG)
target_link_directories(ServerLMS PUBLIC ${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees)
else()
target_link_directories(ServerLMS PUBLIC ${REPO_PATH}/BUILDS/Release64/InstructorsAndTrainees)
endif()
target_link_libraries(ServerLMS PRIVATE libInstructorsAndTrainees.dll)
target_compile_definitions(ServerLMS PRIVATE SERVERLMS_LIBRARY)
if(PROJECT_TYPE_DEBUG)

View File

@@ -4,6 +4,7 @@
#include "Systems/tools.h"
#include "ui_dialogsettingstray.h"
#include "dialogcheckdb.h"
#include "dialogauthorizationinstructor.h"
DialogSettingsTray::DialogSettingsTray(ProviderDBLMS* providerDBLMS, QWidget *parent) :
QDialog(parent),
@@ -252,9 +253,33 @@ void DialogSettingsTray::on_btnCheckDB_clicked()
QString UserNamePostgres;
QString PasswordPostgres;
DialogAuthorizationInstructor dlg(this);
dlg.setWindowTitle(tr("Superuser PostgreSQL authorization"));
dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowContextHelpButtonHint);
dlg.setStyleSheet(this->styleSheet());
#ifdef PROJECT_TYPE_DEBUG
dlg.setLogin("postgres");
dlg.setPassword("");
#endif
switch( dlg.exec() )
{
case QDialog::Accepted:
{
UserNamePostgres = dlg.getLogin();
PasswordPostgres = dlg.getPassword();
break;
}
case QDialog::Rejected:
return;
default:
return;
}
//Имитация
UserNamePostgres = "postgres";
PasswordPostgres = "12345678";
//UserNamePostgres = "postgres";
//PasswordPostgres = "12345678";
if(providerDBLMS->setUserPasswordPostgres(UserNamePostgres, PasswordPostgres))
{