Cavoke  1.1.0
A Platform for creating and hosting multiplayer turn-based board games
Loading...
Searching...
No Matches
settingsview.cpp
1#include "settingsview.h"
2#include "AuthenticationManager.h"
3#include "ui_settingsview.h"
4
5SettingsView::SettingsView(QWidget *parent)
6 : QMainWindow(parent), ui(new Ui::SettingsView) {
7 ui->setupUi(this);
8}
9
10SettingsView::~SettingsView() {
11 delete ui;
12}
13
14void SettingsView::initStartValues(const QString &displayName,
15 const QString &host) {
16 ui->nicknameInput->setText(displayName);
17 oldDisplayName = displayName;
18 ui->serverAddressInput->setText(host);
19}
20
21void SettingsView::updateDisplayName(const QString &displayName) {
22 ui->nicknameInput->setText(displayName);
23 oldDisplayName = displayName;
24}
25
26void SettingsView::on_backButton_clicked() {
27 this->close();
28 emit shownStartView();
29}
30void SettingsView::on_updateSettingsButton_clicked() {
31 if (ui->nicknameInput->text() != oldDisplayName) {
32 if (!AuthDialog::verifyAuth(this)) {
33 return;
34 }
35 }
36 emit updatedSettings(ui->nicknameInput->text(),
37 ui->serverAddressInput->text());
38 this->close();
39 emit shownStartView();
40}
41void SettingsView::on_reloginButton_clicked() {
43}
static bool verifyAuth(QWidget *parent=nullptr)
Definition: authdialog.cpp:28
static AuthenticationManager & getInstance()
Singleton wrapper.