Skip to content

Commit

Permalink
Merge pull request #89 from mitchcamza/wip2
Browse files Browse the repository at this point in the history
Tidy up documentation for COS3711-02-02
  • Loading branch information
mitchcamza authored Jul 18, 2024
2 parents 4cf6dd3 + cb9fedc commit 083a8b2
Show file tree
Hide file tree
Showing 20 changed files with 182 additions and 359 deletions.
23 changes: 3 additions & 20 deletions COS3711-02-02/guestregistration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,34 @@
* @author Mitch Campbell
* @date 2024-07-11
* @copyright Copyright (c) Mitch Campbell 2024
* @brief Implementation file for the GuestRegistration class.
* @details This file contains the implementation of the GuestRegistration class, which represents a registration for a guest attendee.
*/


#include "guestregistration.h"


/**
* @brief Constructs a GuestRegistration object with the given attendee, booking date, and category.
* @param attendee The person attending the event.
* @param bookingDate The date of the booking.
* @param category The category of the guest registration.
*/
GuestRegistration::GuestRegistration(const Person &attendee, const QDate &bookingDate, const QString &category)
: Registration(attendee, bookingDate),
m_Category(category)
{

}

/**
* @brief Calculates the registration fee for the guest registration.
* @return The calculated registration fee.
*/

double GuestRegistration::calculateFee() const
{
return STANDARD_FEE * 0.1;
}

/**
* @brief Returns a string representation of the guest registration.
* @return The string representation of the guest registration.
*/

QString GuestRegistration::toString() const
{
return Registration::toString() + QString("Category: %1\nRegistration Fee: %2\n")
.arg(m_Category)
.arg(calculateFee());
}

/**
* @brief Returns the category of the guest registration.
* @return The category of the guest registration.
*/

QString GuestRegistration::getCategory() const
{
return m_Category;
Expand Down
60 changes: 18 additions & 42 deletions COS3711-02-02/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,33 @@
* @author Mitch Campbell
* @date 2024-07-11
* @copyright Copyright (c) Mitch Campbell 2024
* @brief Implementation file for the MainWindow class.
* @details This file contains the implementation of the MainWindow class, which represents the main application window for a conference registration system. It includes the setup of the user interface, menu actions, toolbar, and signal-slot connections for various actions.
*/


#include "mainwindow.h"
#include "newregistrationdialog.h"
#include "registrationfilterproxymodel.h"
#include "registrationlist.h"
#include "registrationmodel.h"
#include "totalfeesdialog.h"
#include "totalregistereddialog.h"
#include "registrationmodel.h"
#include "registrationlist.h"
#include "registrationfilterproxymodel.h"
#include "registrationlistwriter.h"
#include "registration.h"

#include <QTableView>
#include <QStandardItem>
#include <QGridLayout>
#include <QHeaderView>
#include <QMenuBar>
#include <QStatusBar>
#include <QToolBar>
#include <QIcon>
#include <QGridLayout>
#include <QLineEdit>
#include <QMenuBar>
#include <QPushButton>
#include <QStandardItem>
#include <QStatusBar>
#include <QTableView>
#include <QToolBar>
#include <QFileDialog>
#include <QMessageBox>


/**
* @brief Constructs a MainWindow object.
* @param parent The parent widget.
*/
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent),
registrationModel(new RegistrationModel(this)),
Expand Down Expand Up @@ -64,18 +58,13 @@ MainWindow::MainWindow(QWidget *parent)
setupUI(this);
}

/**
* @brief Destroys the MainWindow object.
*/

MainWindow::~MainWindow()
{

}

/**
* @brief Sets up the user interface for the main application window.
* @param mainApplicationWindow The main application window.
*/

void MainWindow::setupUI(QMainWindow *mainApplicationWindow)
{
// Main Application window
Expand All @@ -99,13 +88,12 @@ void MainWindow::setupUI(QMainWindow *mainApplicationWindow)
editMenu->addAction(actionAddAttendee);

// Reports Menu
QMenu *reports = menuBar->addMenu(tr("&Reports"));
reports->addAction(actionGetTotalFees);
reports->addAction(actionGetNumberOfAttendeesForAffiliation);
QMenu *reportsMenu = menuBar->addMenu(tr("&Reports"));
reportsMenu->addAction(actionGetTotalFees);
reportsMenu->addAction(actionGetNumberOfAttendeesForAffiliation);

// Help Menu
QMenu *helpMenu = menuBar->addMenu(tr("&Help"));
// TODO: Add help actions

// Statusbar
statusBar = new QStatusBar(mainApplicationWindow);
Expand Down Expand Up @@ -143,40 +131,28 @@ void MainWindow::setupUI(QMainWindow *mainApplicationWindow)
gridLayout->addWidget(tableViewRegistrations, 1, 0, 1, 4);
}

/**
* @brief Slot for the "New Registration" action.
* Opens the dialog for adding a new registration.
*/

void MainWindow::on_actionAddAttendee_triggered()
{
NewRegistrationDialog *newRegistrationDialog = new NewRegistrationDialog(registrationList);
newRegistrationDialog->show();
}

/**
* @brief Slot for the "Total Fees" action.
* Opens the dialog for displaying the total fees.
*/

void MainWindow::on_actionGetTotalFees_triggered()
{
TotalFeesDialog *totalFeesDialog = new TotalFeesDialog(registrationList);
totalFeesDialog->show();
}

/**
* @brief Slot for the "Registration per Affiliation" action.
* Opens the dialog for displaying the total number of attendees per affiliation.
*/

void MainWindow::on_actionGetNumberOfAttendeesFromAffiliation_triggered()
{
TotalRegisteredDialog *totalRegisteredDialog = new TotalRegisteredDialog(registrationList);
totalRegisteredDialog->show();
}

/**
* @brief Slot for the "Clear Filter" action.
* Clears the search filter and sets focus to the search bar.
*/

void MainWindow::on_actionClearFilter_triggered()
{
lineEditSearch->clear();
Expand Down
Loading

0 comments on commit 083a8b2

Please sign in to comment.