mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Кнопка Обновить версию в Настройках
This commit is contained in:
@@ -13,6 +13,10 @@
|
||||
<property name="windowTitle">
|
||||
<string>Learning management system (LMS)</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="testDBpgSQL.qrc">
|
||||
<normaloff>:/resources/lms.png</normaloff>:/resources/lms.png</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
@@ -36,6 +40,8 @@
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="testDBpgSQL.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
BIN
GUIdataBaseLMS/resources/lms.png
Normal file
BIN
GUIdataBaseLMS/resources/lms.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
@@ -1,3 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/"/>
|
||||
<qresource prefix="/">
|
||||
<file>resources/lms.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -5,15 +5,17 @@
|
||||
#include <QXmlStreamReader>
|
||||
#include <QRegExpValidator>
|
||||
|
||||
DialogSettings::DialogSettings(bool serverIsConnected, QWidget *parent) :
|
||||
DialogSettings::DialogSettings(ConnectorToServer* connectorToServer, bool instructorIsLogged, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogSettings),
|
||||
settings(nullptr)
|
||||
settings(nullptr),
|
||||
connectorToServer(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->btnUpdateStyle->setObjectName("btnUpdateStyle");
|
||||
ui->btnSave->setObjectName("btnSave");
|
||||
|
||||
this->connectorToServer = connectorToServer;
|
||||
|
||||
/* Создаем строку для регулярного выражения */
|
||||
QString ipRange = "(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])";
|
||||
@@ -49,12 +51,17 @@ DialogSettings::DialogSettings(bool serverIsConnected, QWidget *parent) :
|
||||
ui->checkAutoStart->setChecked(settings->isAutoStart);
|
||||
}
|
||||
|
||||
if(serverIsConnected)
|
||||
{
|
||||
ui->editAddress->setEnabled(false);
|
||||
ui->editPort->setEnabled(false);
|
||||
ui->checkAutoStart->setEnabled(false);
|
||||
}
|
||||
ui->btnSetVersion->setEnabled(false);
|
||||
if(connectorToServer)
|
||||
if(connectorToServer->getIsConnected())
|
||||
{
|
||||
ui->editAddress->setEnabled(false);
|
||||
ui->editPort->setEnabled(false);
|
||||
ui->checkAutoStart->setEnabled(false);
|
||||
|
||||
if(instructorIsLogged)
|
||||
ui->btnSetVersion->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
DialogSettings::~DialogSettings()
|
||||
@@ -199,3 +206,10 @@ void DialogSettings::on_DialogSettings_rejected()
|
||||
|
||||
emit signal_LanguageChanged(language);
|
||||
}
|
||||
|
||||
void DialogSettings::on_btnSetVersion_clicked()
|
||||
{
|
||||
if(connectorToServer)
|
||||
if(connectorToServer->getIsConnected())
|
||||
connectorToServer->showVersionSelect();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <QTranslator>
|
||||
#include <QEvent>
|
||||
#include "Datas.h"
|
||||
#include "connectortoserver.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogSettings;
|
||||
@@ -15,7 +16,7 @@ class DialogSettings : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogSettings(bool serverIsConnected, QWidget *parent = nullptr);
|
||||
explicit DialogSettings(ConnectorToServer* connectorToServer, bool instructorIsLogged, QWidget *parent = nullptr);
|
||||
~DialogSettings();
|
||||
|
||||
protected:
|
||||
@@ -35,6 +36,8 @@ private slots:
|
||||
|
||||
void on_DialogSettings_rejected();
|
||||
|
||||
void on_btnSetVersion_clicked();
|
||||
|
||||
private:
|
||||
bool loadSettings();
|
||||
bool saveSettings();
|
||||
@@ -44,6 +47,7 @@ private:
|
||||
QTranslator qtLanguageTranslator;
|
||||
|
||||
ServerSettings *settings;
|
||||
ConnectorToServer* connectorToServer;
|
||||
};
|
||||
|
||||
#endif // DIALOGSETTINGS_H
|
||||
|
||||
@@ -225,6 +225,32 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnSetVersion">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>58</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Update version</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/resources/icons/updateVersion.png</normaloff>:/resources/icons/updateVersion.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="btnUpdateStyle">
|
||||
<property name="minimumSize">
|
||||
|
||||
@@ -212,7 +212,7 @@ void InstructorsAndTraineesWidget::checkLoginResult(ServerAuthorization *serverA
|
||||
viewerTrainees->setAuthComplited(true);
|
||||
|
||||
Q_EMIT signal_NeedUpdateUI(true, true);
|
||||
ui->btnSetVersion->show();
|
||||
//ui->btnSetVersion->show();
|
||||
ui->btnAuthorizationInstructor->setText(tr("Deauthorization Instructor"));
|
||||
|
||||
updateLabelLoggedInInstructor(serverAuth->Login, serverAuth->ClientName);
|
||||
@@ -275,7 +275,7 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
||||
ui->btnAuthorizationInstructor->setEnabled(false);
|
||||
ui->btnAuthorizationInstructor->setText(tr("Authorization Instructor"));
|
||||
ui->btnAuthorizationInstructor->setChecked(false);
|
||||
ui->btnSetVersion->hide();
|
||||
//ui->btnSetVersion->hide();
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
ui->lblServer->setText(tr("none"));
|
||||
|
||||
@@ -470,11 +470,7 @@ void InstructorsAndTraineesWidget::on_tabWidget_currentChanged(int index)
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnSettings_clicked()
|
||||
{
|
||||
bool serverIsConnected = false;
|
||||
if(connectorToServer)
|
||||
serverIsConnected = connectorToServer->getIsConnected();
|
||||
|
||||
DialogSettings dlg(serverIsConnected, this);
|
||||
DialogSettings dlg(connectorToServer, (loginInstructorLoggedInLocal != ""), this);
|
||||
|
||||
connect(&dlg, &DialogSettings::signal_LanguageChanged, this, &InstructorsAndTraineesWidget::slot_LanguageChanged);
|
||||
connect(&dlg, &DialogSettings::signal_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet);
|
||||
|
||||
@@ -49,5 +49,6 @@
|
||||
<file>resources/icons/circleYellow.png</file>
|
||||
<file>resources/icons/settings.png</file>
|
||||
<file>resources/icons/style.png</file>
|
||||
<file>resources/icons/updateVersion.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
BIN
InstructorsAndTrainees/resources/icons/updateVersion.png
Normal file
BIN
InstructorsAndTrainees/resources/icons/updateVersion.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
Reference in New Issue
Block a user