summaryrefslogtreecommitdiff
path: root/src/editGroupForm.cpp
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-03-09 18:15:46 -0500
committerLouie S <louie@example.com>2024-03-09 18:15:46 -0500
commit848cdae813648f0a2c39942dc01d8f991787b338 (patch)
treed886cf963496d916ae06045faea5bda21ddb8122 /src/editGroupForm.cpp
parentfc00cab0368a6f76a2b1f276f3a3d8573b1fba82 (diff)
accept for edit group form
Diffstat (limited to 'src/editGroupForm.cpp')
-rw-r--r--src/editGroupForm.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/editGroupForm.cpp b/src/editGroupForm.cpp
index af22e78..351fddd 100644
--- a/src/editGroupForm.cpp
+++ b/src/editGroupForm.cpp
@@ -1,3 +1,6 @@
+#include <QMessageBox>
+
+#include "backend/db_sqlite.h"
#include "editGroupForm.h"
EditGroupForm::EditGroupForm(const Group &g) :
@@ -17,4 +20,21 @@ EditGroupForm::EditGroupForm(const Group &g) :
}
void EditGroupForm::accept() {
+ group.name = ui.group_name->text();
+ group.column = Group::Column(ui.group_column->currentIndex());
+ group.link = ui.group_link->text();
+ QMessageBox error_message;
+ BackendDB database;
+
+ if(group.name.isEmpty()) {
+ error_message.setIcon(QMessageBox::Warning);
+ error_message.setWindowTitle("Error Message");
+ error_message.setText("Name cannot be blank");
+ error_message.exec();
+ return;
+ }
+
+ database.updateGroup(this->group);
+
+ QDialog::accept();
}