Setting the server URL for displaying the users bidding link on program start from settings. Doesn't get updated after settings have been changed.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "itemdetailmapper.h"
|
||||
|
||||
#include <data/settingshandler.h>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QComboBox>
|
||||
#include <QDataWidgetMapper>
|
||||
@ -157,6 +158,10 @@ ItemDetailMapper::ItemDetailMapper(QWidget* parent)
|
||||
outerLayout->addLayout(rightLayout);
|
||||
setLayout(outerLayout);
|
||||
|
||||
const QVariantMap serverSettings = SettingsHandler::getSettings("Server");
|
||||
const QString urlValue = serverSettings.value("url").toString();
|
||||
m_serverUrl = urlValue;
|
||||
|
||||
/// online user account
|
||||
connect(m_mailEdit, &QLineEdit::textChanged, this, &ItemDetailMapper::onMailEditChanged);
|
||||
connect(m_onlineIdDisplay, &QLineEdit::textChanged, this, &ItemDetailMapper::onOnlineIDChanged);
|
||||
@ -287,14 +292,15 @@ void ItemDetailMapper::onOnlineIDChanged(const QString& text) {
|
||||
}
|
||||
}
|
||||
|
||||
void ItemDetailMapper::onAccessCodeChanged(const QString& text) {
|
||||
if (text.isEmpty()) {
|
||||
void ItemDetailMapper::onAccessCodeChanged(const QString& accessCode) {
|
||||
if (accessCode.isEmpty()) {
|
||||
m_sendInviteMailButton->setEnabled(false);
|
||||
m_accessUrlDisplay->setText("");
|
||||
updateQRCode("");
|
||||
} else {
|
||||
m_sendInviteMailButton->setEnabled(true);
|
||||
const QString accessUrl = "http://127.0.0.1:4000/log_in/" + text;
|
||||
const QString accessUrl = m_serverUrl + "/log_in/" + accessCode;
|
||||
// const QString accessUrl = "https://bietrunde.das-gruene-zebra.de/log_in/" + text;
|
||||
m_accessUrlDisplay->setText(accessUrl);
|
||||
updateQRCode(accessUrl);
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class ItemDetailMapper : public QWidget {
|
||||
void updateQRCode(const QString text = "");
|
||||
void onMailEditChanged(const QString& text);
|
||||
void onOnlineIDChanged(const QString& text);
|
||||
void onAccessCodeChanged(const QString& text);
|
||||
void onAccessCodeChanged(const QString& accessCode);
|
||||
void onCreateOnlineAccountTriggered();
|
||||
void onSendInviteMailTriggered();
|
||||
|
||||
@ -57,6 +57,7 @@ class ItemDetailMapper : public QWidget {
|
||||
|
||||
std::unique_ptr<QDataWidgetMapper> m_mapper;
|
||||
|
||||
QString m_serverUrl;
|
||||
/// *** GUI elements ***
|
||||
/// left layout
|
||||
QLabel* m_numberLabel;
|
||||
|
||||
Reference in New Issue
Block a user