From 2473da03572c3b9d8e29ae6120e5177156699f2a Mon Sep 17 00:00:00 2001 From: Louie S Date: Mon, 26 Feb 2024 17:48:02 -0500 Subject: Create skeleton for add_group_form --- src/add_group_form.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/add_group_form.cpp (limited to 'src/add_group_form.cpp') diff --git a/src/add_group_form.cpp b/src/add_group_form.cpp new file mode 100644 index 0000000..5662208 --- /dev/null +++ b/src/add_group_form.cpp @@ -0,0 +1,30 @@ +#include + +#include "add_group_form.h" + +AddGroupForm::AddGroupForm() { + // load uic + ui.setupUi(this); + + // setup dialog button connections + QObject::connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + QObject::connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &AddGroupForm::handleSubmit); +} + +void AddGroupForm::handleSubmit() { + QString name_text = ui.new_group_name->text(); + QString column_text = ui.new_group_column->currentText(); + QString link_text = ui.new_group_link->text(); + QMessageBox error_message; + + if(name_text.isEmpty()) { + error_message.setIcon(QMessageBox::Warning); + error_message.setWindowTitle("Error Message"); + error_message.setText("Name cannot be blank"); + error_message.setParent(this); + error_message.show(); + } + + // TODO insert into database + this->close(); +} -- cgit