From 7bbc2a93b6f123dfe8d2b97df8a4239032a6397b Mon Sep 17 00:00:00 2001 From: Louie S Date: Fri, 16 Feb 2024 18:32:53 -0500 Subject: First commit --- .gitignore | 3 + CMakeLists.txt | 28 +++++++ src/add_entry_form.ui | 185 +++++++++++++++++++++++++++++++++++++++++ src/add_group_form.ui | 131 +++++++++++++++++++++++++++++ src/assignmentList.cpp | 80 ++++++++++++++++++ src/assignmentList.h | 41 +++++++++ src/main.cpp | 12 +++ src/main.ui | 207 ++++++++++++++++++++++++++++++++++++++++++++++ src/preferences_dialog.ui | 128 ++++++++++++++++++++++++++++ 9 files changed, 815 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 src/add_entry_form.ui create mode 100644 src/add_group_form.ui create mode 100644 src/assignmentList.cpp create mode 100644 src/assignmentList.h create mode 100644 src/main.cpp create mode 100644 src/main.ui create mode 100644 src/preferences_dialog.ui diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ebc041f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.cache +build +compile_commands.json diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b07fb66 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.1.0) + +project(assignment-list VERSION 0.0.1 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +if(CMAKE_VERSION VERSION_LESS "3.7.0") + set(CMAKE_INCLUDE_CURRENT_DIR ON) +endif() + +find_package(Qt5 COMPONENTS Core Gui UiTools Widgets REQUIRED) + +add_executable(assignment-list + "${CMAKE_CURRENT_SOURCE_DIR}/src/add_entry_form.ui" + "${CMAKE_CURRENT_SOURCE_DIR}/src/add_group_form.ui" + "${CMAKE_CURRENT_SOURCE_DIR}/src/assignmentList.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/src/assignmentList.h" + "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/src/main.ui" + "${CMAKE_CURRENT_SOURCE_DIR}/src/preferences_dialog.ui" +) + +target_link_libraries(assignment-list Qt5::Core Qt5::Gui Qt5::UiTools Qt5::Widgets) diff --git a/src/add_entry_form.ui b/src/add_entry_form.ui new file mode 100644 index 0000000..6f60175 --- /dev/null +++ b/src/add_entry_form.ui @@ -0,0 +1,185 @@ + + + Dialog + + + + 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() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/add_group_form.ui b/src/add_group_form.ui new file mode 100644 index 0000000..cda7d55 --- /dev/null +++ b/src/add_group_form.ui @@ -0,0 +1,131 @@ + + + Dialog + + + + 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() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/assignmentList.cpp b/src/assignmentList.cpp new file mode 100644 index 0000000..5adacc3 --- /dev/null +++ b/src/assignmentList.cpp @@ -0,0 +1,80 @@ +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "assignmentList.h" + +AssignmentList::AssignmentList() { + // load uic + QFile file("/home/louie/Development/projects/assignment-list-qt/src/main.ui"); + file.open(QIODevice::ReadOnly); + QUiLoader loader; + ui.setupUi(this); + + this->initializeUI(); +} + +void AssignmentList::initializeUI() { + this->createMenu(); + this->createToolbar(); + //Config() // from config.h + this->setupDB(); + this->displayWidgets(); + this->show(); +} + +void AssignmentList::createMenu() { + QObject::connect(ui.actionPreferences, &QAction::triggered, this, &AssignmentList::preferences); + QObject::connect(ui.actionReload, &QAction::triggered, this, &AssignmentList::reload); + QObject::connect(ui.actionExit, &QAction::triggered, this, QApplication::quit); + QObject::connect(ui.actionAdd_Group, &QAction::triggered, this, &AssignmentList::addGroup); + QObject::connect(ui.actionClean_Hidden, &QAction::triggered, this, &AssignmentList::cleanHidden); + QObject::connect(ui.actionAbout, &QAction::triggered, this, &AssignmentList::aboutDialog); +} + +void AssignmentList::createToolbar() { + ui.toolBar->addAction(ui.actionAdd_Group); +} + +void AssignmentList::setupDB() { + qDebug() << "WIP"; +} + +void AssignmentList::displayWidgets() { + QDate today = QDate::currentDate(); + ui.title->setText(today.toString("dddd, MMM d yyyy")); + this->drawGroups(); +} + +// Open the 'addGroup' form +void AssignmentList::addGroup() { + qDebug() << "WIP"; +} + +// Open the 'editGroup; form +void AssignmentList::editGroup(int id) { + qDebug() << "WIP"; +} + +void AssignmentList::preferences() { + qDebug() << "WIP"; +} + +void AssignmentList::reload() { + qDebug() << "WIP"; +} + +void AssignmentList::cleanHidden() { + qDebug() << "WIP"; +} + +void AssignmentList::aboutDialog() { + QMessageBox about; + about.about(this, "About Assignment List", "Created by Louie S. - 2023"); +} diff --git a/src/assignmentList.h b/src/assignmentList.h new file mode 100644 index 0000000..d87397c --- /dev/null +++ b/src/assignmentList.h @@ -0,0 +1,41 @@ +#ifndef ASSIGNMENTLIST_H +#define ASSIGNMENTLIST_H + +#include +#include "ui_main.h" + +class AssignmentList : public QMainWindow { + Q_OBJECT + + public: + AssignmentList(); + + private: + Ui::MainWindow ui; + + void initializeUI(); + void createMenu(); + void createToolbar(); + void setupDB(); + void displayWidgets(); + void editGroup(int id); + void removeGroup(int id); + void groupContextMenu(int group_id); + void addEntry(int parent); // TODO figure out type for parameter + void editEntry(int id); + void toggleDoneEntry(int id); + void removeEntry(int id); + void editRules(int id); + void entryContextMenu(int entry_id); + void drawGroups(); + void drawEntries(); + + private slots: + void preferences(); + void reload(); + void addGroup(); + void cleanHidden(); + void aboutDialog(); +}; + +#endif diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..f7d69ee --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,12 @@ +#include +#include + +#include "assignmentList.h" + +int main(int argc, char **argv) { + QApplication app (argc, argv); + + AssignmentList window; + + return app.exec(); +} diff --git a/src/main.ui b/src/main.ui new file mode 100644 index 0000000..bc3c0fb --- /dev/null +++ b/src/main.ui @@ -0,0 +1,207 @@ + + + MainWindow + + + + 0 + 0 + 640 + 480 + + + + Assignment List + + + + + + + true + + + + + 0 + 0 + 620 + 421 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + Arial + 17 + + + + [DATE] + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 20 + + + 5 + + + 20 + + + 5 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + 0 + 0 + 640 + 22 + + + + + File + + + + + + + + + Edit + + + + + + + + Help + + + + + + + + + + toolBar + + + TopToolBarArea + + + false + + + + + Preferences + + + Alt+Return + + + + + Reload + + + F5 + + + + + Exit + + + Ctrl+Q + + + + + Add Group + + + + + Permanently Delete Removed Groups and Entries + + + + + About + + + + + + diff --git a/src/preferences_dialog.ui b/src/preferences_dialog.ui new file mode 100644 index 0000000..244eb26 --- /dev/null +++ b/src/preferences_dialog.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 + + + + + + + + + + + + -- cgit