From fc00cab0368a6f76a2b1f276f3a3d8573b1fba82 Mon Sep 17 00:00:00 2001 From: Louie S Date: Sat, 9 Mar 2024 17:34:04 -0500 Subject: Standardize source file names --- src/addEntryForm.cpp | 49 ++++++++++++ src/addEntryForm.h | 24 ++++++ src/addGroupForm.cpp | 37 ++++++++++ src/addGroupForm.h | 21 ++++++ src/add_entry_form.cpp | 49 ------------ src/add_entry_form.h | 24 ------ src/add_group_form.cpp | 37 ---------- src/add_group_form.h | 21 ------ src/assignmentList.cpp | 2 +- src/editEntryForm.cpp | 15 ++++ src/editEntryForm.h | 25 +++++++ src/editGroupForm.cpp | 20 +++++ src/editGroupForm.h | 25 +++++++ src/edit_entry_form.cpp | 15 ---- src/edit_entry_form.h | 25 ------- src/edit_group_form.cpp | 20 ----- src/edit_group_form.h | 25 ------- src/entryForm.ui | 185 ++++++++++++++++++++++++++++++++++++++++++++++ src/entry_form.ui | 185 ---------------------------------------------- src/groupForm.ui | 131 ++++++++++++++++++++++++++++++++ src/groupLayout.cpp | 4 +- src/group_form.ui | 131 -------------------------------- src/preferencesDialog.ui | 128 ++++++++++++++++++++++++++++++++ src/preferences_dialog.ui | 128 -------------------------------- 24 files changed, 663 insertions(+), 663 deletions(-) create mode 100644 src/addEntryForm.cpp create mode 100644 src/addEntryForm.h create mode 100644 src/addGroupForm.cpp create mode 100644 src/addGroupForm.h delete mode 100644 src/add_entry_form.cpp delete mode 100644 src/add_entry_form.h delete mode 100644 src/add_group_form.cpp delete mode 100644 src/add_group_form.h create mode 100644 src/editEntryForm.cpp create mode 100644 src/editEntryForm.h create mode 100644 src/editGroupForm.cpp create mode 100644 src/editGroupForm.h delete mode 100644 src/edit_entry_form.cpp delete mode 100644 src/edit_entry_form.h delete mode 100644 src/edit_group_form.cpp delete mode 100644 src/edit_group_form.h create mode 100644 src/entryForm.ui delete mode 100644 src/entry_form.ui create mode 100644 src/groupForm.ui delete mode 100644 src/group_form.ui create mode 100644 src/preferencesDialog.ui delete mode 100644 src/preferences_dialog.ui (limited to 'src') diff --git a/src/addEntryForm.cpp b/src/addEntryForm.cpp new file mode 100644 index 0000000..adca32e --- /dev/null +++ b/src/addEntryForm.cpp @@ -0,0 +1,49 @@ +#include +#include +#include + +#include "addEntryForm.h" +#include "backend/db_sqlite.h" + +AddEntryForm::AddEntryForm(const Group &g) : + parent_group(g) +{ + // load uic + ui.setupUi(this); + + // set titles + this->setWindowTitle("Add Entry"); + ui.title->setText("Add Entry"); + + // widgets setup + ui.entry_due->setDate(QDate::currentDate()); +} + +void AddEntryForm::accept() { + 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; + + // Check that the new entry is not blank + if(desc_text.isEmpty()) { + error_message.setIcon(QMessageBox::Warning); + error_message.setWindowTitle("Error Message"); + error_message.setText("Description cannot be blank"); + error_message.exec(); + return; + } + + // replace due_text with null date if due_checkbox is unchecked + if(!ui.entry_due_checkbox->isChecked()) + due_text = QDateTime(); + + new_id = database.insertEntry(Entry(0, this->parent_group.id, desc_text, due_text, due_alt_text, link_text, color_text, highlight_text)); + + QDialog::accept(); +} diff --git a/src/addEntryForm.h b/src/addEntryForm.h new file mode 100644 index 0000000..81535f1 --- /dev/null +++ b/src/addEntryForm.h @@ -0,0 +1,24 @@ +#ifndef ADDENTRYFORM_H +#define ADDENTRYFORM_H + +#include + +#include "group.h" +#include "ui_entryForm.h" + +class AddEntryForm : public QDialog { + Q_OBJECT + + public: + AddEntryForm(const Group &g); + + private: + Ui::entryDialog ui; + + Group parent_group; + + private slots: + void accept(); +}; + +#endif diff --git a/src/addGroupForm.cpp b/src/addGroupForm.cpp new file mode 100644 index 0000000..d3fa72f --- /dev/null +++ b/src/addGroupForm.cpp @@ -0,0 +1,37 @@ +#include + +#include + +#include "addGroupForm.h" +#include "backend/db_sqlite.h" + +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.group_name->text(); + Group::Column column_value = Group::Column(ui.group_column->currentIndex()); + QString link_text = ui.group_link->text(); + QMessageBox error_message; + BackendDB database; + int new_id; + + if(name_text.isEmpty()) { + qDebug() << "Gets here"; + error_message.setIcon(QMessageBox::Warning); + error_message.setWindowTitle("Error Message"); + error_message.setText("Name cannot be blank"); + error_message.exec(); + return; + } + + new_id = database.insertGroup(Group(0, name_text, column_value, link_text)); + + QDialog::accept(); +} diff --git a/src/addGroupForm.h b/src/addGroupForm.h new file mode 100644 index 0000000..b181408 --- /dev/null +++ b/src/addGroupForm.h @@ -0,0 +1,21 @@ +#ifndef ADDGROUPFORM_H +#define ADDGROUPFORM_H + +#include + +#include "ui_groupForm.h" + +class AddGroupForm : public QDialog { + Q_OBJECT + + public: + AddGroupForm(); + + private: + Ui::groupDialog ui; + + private slots: + void accept(); +}; + +#endif diff --git a/src/add_entry_form.cpp b/src/add_entry_form.cpp deleted file mode 100644 index 7c8e59d..0000000 --- a/src/add_entry_form.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include -#include - -#include "add_entry_form.h" -#include "backend/db_sqlite.h" - -AddEntryForm::AddEntryForm(const Group &g) : - parent_group(g) -{ - // load uic - ui.setupUi(this); - - // set titles - this->setWindowTitle("Add Entry"); - ui.title->setText("Add Entry"); - - // widgets setup - ui.entry_due->setDate(QDate::currentDate()); -} - -void AddEntryForm::accept() { - 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; - - // Check that the new entry is not blank - if(desc_text.isEmpty()) { - error_message.setIcon(QMessageBox::Warning); - error_message.setWindowTitle("Error Message"); - error_message.setText("Description cannot be blank"); - error_message.exec(); - return; - } - - // replace due_text with null date if due_checkbox is unchecked - if(!ui.entry_due_checkbox->isChecked()) - due_text = QDateTime(); - - new_id = database.insertEntry(Entry(0, this->parent_group.id, desc_text, due_text, due_alt_text, link_text, color_text, highlight_text)); - - QDialog::accept(); -} diff --git a/src/add_entry_form.h b/src/add_entry_form.h deleted file mode 100644 index 0aa6ea4..0000000 --- a/src/add_entry_form.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef ADDENTRYFORM_H -#define ADDENTRYFORM_H - -#include - -#include "group.h" -#include "ui_entry_form.h" - -class AddEntryForm : public QDialog { - Q_OBJECT - - public: - AddEntryForm(const Group &g); - - private: - Ui::entryDialog ui; - - Group parent_group; - - private slots: - void accept(); -}; - -#endif diff --git a/src/add_group_form.cpp b/src/add_group_form.cpp deleted file mode 100644 index 8c799e2..0000000 --- a/src/add_group_form.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include - -#include - -#include "add_group_form.h" -#include "backend/db_sqlite.h" - -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.group_name->text(); - Group::Column column_value = Group::Column(ui.group_column->currentIndex()); - QString link_text = ui.group_link->text(); - QMessageBox error_message; - BackendDB database; - int new_id; - - if(name_text.isEmpty()) { - qDebug() << "Gets here"; - error_message.setIcon(QMessageBox::Warning); - error_message.setWindowTitle("Error Message"); - error_message.setText("Name cannot be blank"); - error_message.exec(); - return; - } - - new_id = database.insertGroup(Group(0, name_text, column_value, link_text)); - - QDialog::accept(); -} diff --git a/src/add_group_form.h b/src/add_group_form.h deleted file mode 100644 index 2e602b8..0000000 --- a/src/add_group_form.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef ADDGROUPFORM_H -#define ADDGROUPFORM_H - -#include - -#include "ui_group_form.h" - -class AddGroupForm : public QDialog { - Q_OBJECT - - public: - AddGroupForm(); - - private: - Ui::groupDialog ui; - - private slots: - void accept(); -}; - -#endif diff --git a/src/assignmentList.cpp b/src/assignmentList.cpp index 32e6125..0912031 100644 --- a/src/assignmentList.cpp +++ b/src/assignmentList.cpp @@ -12,7 +12,7 @@ #include #include -#include "add_group_form.h" +#include "addGroupForm.h" #include "assignmentList.h" #include "backend/db_sqlite.h" #include "entryLayout.h" diff --git a/src/editEntryForm.cpp b/src/editEntryForm.cpp new file mode 100644 index 0000000..68a29fe --- /dev/null +++ b/src/editEntryForm.cpp @@ -0,0 +1,15 @@ +#include "backend/db_sqlite.h" +#include "edit_entry_form.h" + +EditEntryForm::EditEntryForm(const Entry &e) : + entry(e) +{ + // load uic + ui.setupUi(this); + + // set titles + this->setWindowTitle("Edit Entry"); + ui.title->setText("Edit Entry"); + + // widgets setup +} diff --git a/src/editEntryForm.h b/src/editEntryForm.h new file mode 100644 index 0000000..6231478 --- /dev/null +++ b/src/editEntryForm.h @@ -0,0 +1,25 @@ +#ifndef EDITENTRYFORM_H +#define EDITENTRYFORM_H + +#include + +#include "entry.h" +#include "ui_entryForm.h" + +// form to edit/update an entry +class EditEntryForm : public QDialog { + Q_OBJECT + + public: + EditEntryForm(const Entry &e); + + private: + Ui::entryDialog ui; + + Entry entry; + + private slots: + void accept(); +}; + +#endif diff --git a/src/editGroupForm.cpp b/src/editGroupForm.cpp new file mode 100644 index 0000000..af22e78 --- /dev/null +++ b/src/editGroupForm.cpp @@ -0,0 +1,20 @@ +#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() { +} diff --git a/src/editGroupForm.h b/src/editGroupForm.h new file mode 100644 index 0000000..e04b46e --- /dev/null +++ b/src/editGroupForm.h @@ -0,0 +1,25 @@ +#ifndef EDITGROUPFORM_H +#define EDITGROUPFORM_H + +#include + +#include "group.h" +#include "ui_groupForm.h" + +// form to edit/update a group +class EditGroupForm : public QDialog { + Q_OBJECT + + public: + EditGroupForm(const Group &g); + + private: + Ui::groupDialog ui; + + Group group; + + private slots: + void accept(); +}; + +#endif diff --git a/src/edit_entry_form.cpp b/src/edit_entry_form.cpp deleted file mode 100644 index 68a29fe..0000000 --- a/src/edit_entry_form.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "backend/db_sqlite.h" -#include "edit_entry_form.h" - -EditEntryForm::EditEntryForm(const Entry &e) : - entry(e) -{ - // load uic - ui.setupUi(this); - - // set titles - this->setWindowTitle("Edit Entry"); - ui.title->setText("Edit Entry"); - - // widgets setup -} diff --git a/src/edit_entry_form.h b/src/edit_entry_form.h deleted file mode 100644 index 6a10a40..0000000 --- a/src/edit_entry_form.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef EDITENTRYFORM_H -#define EDITENTRYFORM_H - -#include - -#include "entry.h" -#include "ui_entry_form.h" - -// form to edit/update an entry -class EditEntryForm : public QDialog { - Q_OBJECT - - public: - EditEntryForm(const Entry &e); - - private: - Ui::entryDialog ui; - - Entry entry; - - private slots: - void accept(); -}; - -#endif diff --git a/src/edit_group_form.cpp b/src/edit_group_form.cpp deleted file mode 100644 index 7f659d8..0000000 --- a/src/edit_group_form.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "edit_group_form.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() { -} diff --git a/src/edit_group_form.h b/src/edit_group_form.h deleted file mode 100644 index 9b0112c..0000000 --- a/src/edit_group_form.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef EDITGROUPFORM_H -#define EDITGROUPFORM_H - -#include - -#include "group.h" -#include "ui_group_form.h" - -// form to edit/update a group -class EditGroupForm : public QDialog { - Q_OBJECT - - public: - EditGroupForm(const Group &g); - - private: - Ui::groupDialog ui; - - Group group; - - private slots: - void accept(); -}; - -#endif diff --git a/src/entryForm.ui b/src/entryForm.ui new file mode 100644 index 0000000..bce8ce3 --- /dev/null +++ b/src/entryForm.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/entry_form.ui b/src/entry_form.ui deleted file mode 100644 index bce8ce3..0000000 --- a/src/entry_form.ui +++ /dev/null @@ -1,185 +0,0 @@ - - - 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/groupForm.ui b/src/groupForm.ui new file mode 100644 index 0000000..4f58e1d --- /dev/null +++ b/src/groupForm.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 + + + + + diff --git a/src/groupLayout.cpp b/src/groupLayout.cpp index 3570623..11dea2a 100644 --- a/src/groupLayout.cpp +++ b/src/groupLayout.cpp @@ -4,8 +4,8 @@ #include -#include "add_entry_form.h" -#include "edit_group_form.h" +#include "addEntryForm.h" +#include "editGroupForm.h" #include "groupLayout.h" #include "lib.h" diff --git a/src/group_form.ui b/src/group_form.ui deleted file mode 100644 index 4f58e1d..0000000 --- a/src/group_form.ui +++ /dev/null @@ -1,131 +0,0 @@ - - - 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 - - - - - diff --git a/src/preferencesDialog.ui b/src/preferencesDialog.ui new file mode 100644 index 0000000..244eb26 --- /dev/null +++ b/src/preferencesDialog.ui @@ -0,0 +1,128 @@ + + + Dialog + + + + 0 + 0 + 500 + 320 + + + + Preferences + + + + + + + + 0 + + + + Paths + + + + + + + + + + + Database File: + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + 25 + 16777215 + + + + ... + + + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + + + Apply + + + + + + + Reload + + + + + + + + + + + + diff --git a/src/preferences_dialog.ui b/src/preferences_dialog.ui deleted file mode 100644 index 244eb26..0000000 --- a/src/preferences_dialog.ui +++ /dev/null @@ -1,128 +0,0 @@ - - - Dialog - - - - 0 - 0 - 500 - 320 - - - - Preferences - - - - - - - - 0 - - - - Paths - - - - - - - - - - - Database File: - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 25 - 16777215 - - - - ... - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Close - - - - - - - Apply - - - - - - - Reload - - - - - - - - - - - - -- cgit