diff options
Diffstat (limited to 'src/editGroupForm.cpp')
-rw-r--r-- | src/editGroupForm.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/editGroupForm.cpp b/src/editGroupForm.cpp deleted file mode 100644 index 52c45ac..0000000 --- a/src/editGroupForm.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include <QMessageBox> - -#include "backend/db_sqlite.h" -#include "editGroupForm.h" - -EditGroupForm::EditGroupForm(const Group &g) : - group(g) -{ - // load uic - ui.setupUi(this); - - // set titles - this->setWindowTitle("Edit Group"); - ui.title->setText("Edit Group"); - - // widgets setup - ui.group_name->setText(this->group.name); - ui.group_column->setCurrentIndex(this->group.column); - ui.group_link->setText(this->group.link); -} - -void EditGroupForm::accept() { - this->group.name = ui.group_name->text(); - this->group.column = Group::Column(ui.group_column->currentIndex()); - this->group.link = ui.group_link->text(); - QMessageBox error_message; - BackendDB database; - - if(this->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(); -} |