From 312ea44966ca5ee65185fc837d15143e7dd59761 Mon Sep 17 00:00:00 2001 From: Louie S Date: Sat, 9 Mar 2024 15:56:27 -0500 Subject: Rename group and entry forms --- CMakeLists.txt | 4 +- src/add_entry_form.cpp | 20 +++--- src/add_entry_form.h | 4 +- src/add_entry_form.ui | 185 ------------------------------------------------- src/add_group_form.cpp | 10 ++- src/add_group_form.h | 6 +- src/add_group_form.ui | 131 ---------------------------------- src/entry_form.ui | 185 +++++++++++++++++++++++++++++++++++++++++++++++++ src/group_form.ui | 131 ++++++++++++++++++++++++++++++++++ 9 files changed, 343 insertions(+), 333 deletions(-) delete mode 100644 src/add_entry_form.ui delete mode 100644 src/add_group_form.ui create mode 100644 src/entry_form.ui create mode 100644 src/group_form.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index cfb8660..a8fd55c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,10 +34,8 @@ endforeach() set(project_sources "src/add_entry_form.cpp" "src/add_entry_form.h" - "src/add_entry_form.ui" "src/add_group_form.cpp" "src/add_group_form.h" - "src/add_group_form.ui" "src/backend/db_sqlite.cpp" "src/backend/db_sqlite.h" "src/assignmentList.cpp" @@ -45,8 +43,10 @@ set(project_sources "src/assignmentList.ui" "src/entry.cpp" "src/entry.h" + "src/entry_form.ui" "src/group.cpp" "src/group.h" + "src/group_form.ui" "src/lib.cpp" "src/lib.h" "src/main.cpp" diff --git a/src/add_entry_form.cpp b/src/add_entry_form.cpp index b08fedc..25a8af2 100644 --- a/src/add_entry_form.cpp +++ b/src/add_entry_form.cpp @@ -11,17 +11,21 @@ AddEntryForm::AddEntryForm(int parent_id) : // load uic ui.setupUi(this); + // set titles + this->setWindowTitle("Add Entry"); + ui.title->setText("Add Entry"); + // widgets setup - ui.new_entry_due->setDate(QDate::currentDate()); + ui.entry_due->setDate(QDate::currentDate()); } void AddEntryForm::accept() { - QString desc_text = ui.new_entry_desc->text(); - QDateTime due_text = ui.new_entry_due->date().startOfDay(); - QString due_alt_text = ui.new_entry_due_alt->text(); - QString link_text = ui.new_entry_link->text(); - QString color_text = ui.new_entry_color->text(); - QString highlight_text = ui.new_entry_highlight->text(); + QString desc_text = ui.entry_desc->text(); + QDateTime due_text = ui.entry_due->date().startOfDay(); + QString due_alt_text = ui.entry_due_alt->text(); + QString link_text = ui.entry_link->text(); + QString color_text = ui.entry_color->text(); + QString highlight_text = ui.entry_highlight->text(); QMessageBox error_message; BackendDB database; int new_id; @@ -36,7 +40,7 @@ void AddEntryForm::accept() { } // replace due_text with null date if due_checkbox is unchecked - if(!ui.new_entry_due_checkbox->isChecked()) + if(!ui.entry_due_checkbox->isChecked()) due_text = QDateTime(); new_id = database.insertEntry(Entry(0, this->parent_id, desc_text, due_text, due_alt_text, link_text, color_text, highlight_text)); diff --git a/src/add_entry_form.h b/src/add_entry_form.h index 863dc57..7cf1ad1 100644 --- a/src/add_entry_form.h +++ b/src/add_entry_form.h @@ -3,7 +3,7 @@ #include -#include "ui_add_entry_form.h" +#include "ui_entry_form.h" class AddEntryForm : public QDialog { Q_OBJECT @@ -12,7 +12,7 @@ class AddEntryForm : public QDialog { AddEntryForm(int parent_id); private: - Ui::addEntryDialog ui; + Ui::entryDialog ui; int parent_id; diff --git a/src/add_entry_form.ui b/src/add_entry_form.ui deleted file mode 100644 index 7a33856..0000000 --- a/src/add_entry_form.ui +++ /dev/null @@ -1,185 +0,0 @@ - - - addEntryDialog - - - - 0 - 0 - 400 - 266 - - - - Add Entry - - - - - - - - Description: - - - - - - - - - - - Arial - 18 - - - - Add Entry - - - Qt::AlignCenter - - - - - - - Due Date: - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - MM/dd/yyyy - - - - - - - true - - - - - - true - - - - - - - - - - Due Date (Alt): - - - - - - - - - - Link: - - - - - - - - - - Color: - - - - - - - - - - Highlight: - - - - - - - - - - - - Qt::LeftToRight - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - true - - - - - - - - - buttonBox - accepted() - addEntryDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - addEntryDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/src/add_group_form.cpp b/src/add_group_form.cpp index 4a84934..98cdb63 100644 --- a/src/add_group_form.cpp +++ b/src/add_group_form.cpp @@ -8,12 +8,16 @@ AddGroupForm::AddGroupForm() { // load uic ui.setupUi(this); + + // set titles + this->setWindowTitle("Add Group"); + ui.title->setText("Add Group"); } void AddGroupForm::accept() { - QString name_text = ui.new_group_name->text(); - QString column_text = ui.new_group_column->currentText(); - QString link_text = ui.new_group_link->text(); + QString name_text = ui.group_name->text(); + QString column_text = ui.group_column->currentText(); + QString link_text = ui.group_link->text(); QMessageBox error_message; BackendDB database; int new_id; diff --git a/src/add_group_form.h b/src/add_group_form.h index 3b9c381..2e602b8 100644 --- a/src/add_group_form.h +++ b/src/add_group_form.h @@ -1,7 +1,9 @@ #ifndef ADDGROUPFORM_H #define ADDGROUPFORM_H -#include "ui_add_group_form.h" +#include + +#include "ui_group_form.h" class AddGroupForm : public QDialog { Q_OBJECT @@ -10,7 +12,7 @@ class AddGroupForm : public QDialog { AddGroupForm(); private: - Ui::addGroupDialog ui; + Ui::groupDialog ui; private slots: void accept(); diff --git a/src/add_group_form.ui b/src/add_group_form.ui deleted file mode 100644 index 53b854b..0000000 --- a/src/add_group_form.ui +++ /dev/null @@ -1,131 +0,0 @@ - - - addGroupDialog - - - - 0 - 0 - 400 - 172 - - - - Add Entry - - - - - - - - - Arial - 18 - - - - Add Group - - - Qt::AlignCenter - - - - - - - Name: - - - - - - - - - - Column: - - - - - - - - Left - - - - - Right - - - - - - - - Link: - - - - - - - - - - - - Qt::LeftToRight - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - true - - - - - - - - - buttonBox - accepted() - addGroupDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - addGroupDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/src/entry_form.ui b/src/entry_form.ui new file mode 100644 index 0000000..bce8ce3 --- /dev/null +++ b/src/entry_form.ui @@ -0,0 +1,185 @@ + + + entryDialog + + + + 0 + 0 + 400 + 266 + + + + Add Entry + + + + + + + + Description: + + + + + + + + + + + Arial + 18 + + + + [TITLE] + + + Qt::AlignCenter + + + + + + + Due Date: + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + MM/dd/yyyy + + + + + + + true + + + + + + true + + + + + + + + + + Due Date (Alt): + + + + + + + + + + Link: + + + + + + + + + + Color: + + + + + + + + + + Highlight: + + + + + + + + + + + + Qt::LeftToRight + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + true + + + + + + + + + buttonBox + accepted() + entryDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + entryDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/group_form.ui b/src/group_form.ui new file mode 100644 index 0000000..4f58e1d --- /dev/null +++ b/src/group_form.ui @@ -0,0 +1,131 @@ + + + groupDialog + + + + 0 + 0 + 400 + 172 + + + + Group Form + + + + + + + + + Arial + 18 + + + + [TITLE] + + + Qt::AlignCenter + + + + + + + Name: + + + + + + + + + + Column: + + + + + + + + Left + + + + + Right + + + + + + + + Link: + + + + + + + + + + + + Qt::LeftToRight + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + true + + + + + + + + + buttonBox + accepted() + groupDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + groupDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + -- cgit