Skip to content

Commit

Permalink
Refs #99. Added dialog to create new test invitations
Browse files Browse the repository at this point in the history
  • Loading branch information
SBriere committed Dec 12, 2024
1 parent a00de90 commit bd18b60
Show file tree
Hide file tree
Showing 6 changed files with 438 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set(headers
dialogs/GeneratePasswordDialog.h
dialogs/PasswordStrengthDialog.h
dialogs/QRCodeDialog.h
dialogs/TestInvitationDialog.h
dialogs/TransferProgressDialog.h

# Editors
Expand Down Expand Up @@ -205,6 +206,7 @@ set(srcs
dialogs/GeneratePasswordDialog.cpp
dialogs/PasswordStrengthDialog.cpp
dialogs/QRCodeDialog.cpp
dialogs/TestInvitationDialog.cpp
dialogs/TransferProgressDialog.cpp

# Editors
Expand Down Expand Up @@ -323,6 +325,7 @@ SET(uis
dialogs/QRCodeDialog.ui
dialogs/SessionLobbyDialog.ui
dialogs/StartSessionDialog.ui
dialogs/TestInvitationDialog.ui
dialogs/TransferProgressDialog.ui
dialogs/WebLoginDialog.ui

Expand Down
58 changes: 58 additions & 0 deletions client/src/dialogs/TestInvitationDialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "TestInvitationDialog.h"
#include "ui_TestInvitationDialog.h"

TestInvitationDialog::TestInvitationDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::TestInvitationDialog)
{
ui->setupUi(this);
setModal(true);

initUI();
}

TestInvitationDialog::~TestInvitationDialog()
{
delete ui;
}

void TestInvitationDialog::initUI()
{
ui->stackedPages->setCurrentIndex(0);
ui->btnPrevious->setEnabled(false);
ui->btnOK->setEnabled(false);
}

void TestInvitationDialog::on_btnCancel_clicked()
{
reject();
}


void TestInvitationDialog::on_stackedPages_currentChanged(int current_index)
{
ui->btnPrevious->setEnabled(current_index>0);
ui->btnNext->setEnabled(current_index < ui->stackedPages->count() - 1);
ui->btnOK->setEnabled(current_index == ui->stackedPages->count() -1);
}


void TestInvitationDialog::on_btnPrevious_clicked()
{
if (ui->stackedPages->currentIndex() > 0)
ui->stackedPages->setCurrentIndex(ui->stackedPages->currentIndex()-1);
}


void TestInvitationDialog::on_btnNext_clicked()
{
if (ui->stackedPages->currentIndex() < ui->stackedPages->count() -1)
ui->stackedPages->setCurrentIndex(ui->stackedPages->currentIndex()+1);
}


void TestInvitationDialog::on_btnOK_clicked()
{
accept();
}

33 changes: 33 additions & 0 deletions client/src/dialogs/TestInvitationDialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef TESTINVITATIONDIALOG_H
#define TESTINVITATIONDIALOG_H

#include <QDialog>

namespace Ui {
class TestInvitationDialog;
}

class TestInvitationDialog : public QDialog
{
Q_OBJECT

public:
explicit TestInvitationDialog(QWidget *parent = nullptr);
~TestInvitationDialog();

private slots:
void on_btnCancel_clicked();

void on_stackedPages_currentChanged(int current_index);

void on_btnPrevious_clicked();

void on_btnNext_clicked();

private:
Ui::TestInvitationDialog *ui;

void initUI();
};

#endif // TESTINVITATIONDIALOG_H
Loading

0 comments on commit bd18b60

Please sign in to comment.