diff --git a/NoteBinder.pro.user b/NoteBinder.pro.user new file mode 100644 index 0000000..7c2fdcd --- /dev/null +++ b/NoteBinder.pro.user @@ -0,0 +1,268 @@ + + + + + + EnvironmentId + {661e7d28-8147-492e-844b-0221200ec4d8} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + Builtin.BuildSystem + + true + true + Builtin.DefaultTidyAndClazy + 4 + + + + true + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + Desktop + {70ccfa8d-7dd9-41a2-aa9f-478d3cfabfa9} + 0 + 0 + 0 + + 0 + /home/drew/build-NoteBinder-Desktop-Debug + /home/drew/build-NoteBinder-Desktop-Debug + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /home/drew/build-NoteBinder-Desktop-Release + /home/drew/build-NoteBinder-Desktop-Release + + + true + QtProjectManager.QMakeBuildStep + true + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + + 0 + /home/drew/build-NoteBinder-Desktop-Profile + /home/drew/build-NoteBinder-Desktop-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:/home/drew/NoteBinder/NoteBinder.pro + /home/drew/NoteBinder/NoteBinder.pro + false + true + true + false + true + /home/drew/build-NoteBinder-Desktop-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/NoteBinderLogo.png b/NoteBinderLogo.png new file mode 100644 index 0000000..8a2ab61 Binary files /dev/null and b/NoteBinderLogo.png differ diff --git a/notebook.cpp b/notebook.cpp new file mode 100644 index 0000000..6024307 --- /dev/null +++ b/notebook.cpp @@ -0,0 +1,11 @@ +/* DrewTechs + * Note Binder + * @Version 1.0 + */ + +#include "notebook.h" + +Notebook::Notebook() +{ + +} diff --git a/notebook.h b/notebook.h new file mode 100644 index 0000000..039048a --- /dev/null +++ b/notebook.h @@ -0,0 +1,34 @@ +/* DrewTechs + * Note Binder + * @Version 1.0 + */ + +#ifndef NOTEBOOK_H +#define NOTEBOOK_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "sectiongroup.h" + + +class Notebook +{ +public: + Notebook(); + void sortSectionGroupArray(); + long id; + QString name; + QString color; + QString location; + QStringList files; + QVector sectionGroupArray; + +}; + +#endif // NOTEBOOK_H diff --git a/notebooklist.cpp b/notebooklist.cpp new file mode 100644 index 0000000..8ebb376 --- /dev/null +++ b/notebooklist.cpp @@ -0,0 +1,143 @@ +/* DrewTechs + * Note Binder + * @Version 1.0 + */ + +#include "notebooklist.h" + +NotebookList::NotebookList(QObject *parent) + : QObject{parent} +{ + +} + +void NotebookList::addNotebookToList(Notebook* notebook) +{ + nbList.append(notebook); +} + +QTreeWidgetItem* NotebookList::createSectionIcon(QFileInfo fileInfo) +{ + QTreeWidgetItem* sectionNameItem = new QTreeWidgetItem(); + sectionNameItem->setIcon(0, QIcon("../NoteBinder/Icons/SectionIcon.png")); + sectionNameItem->setText(0, fileInfo.fileName()); + sectionNameItem->setText(1, fileInfo.absoluteFilePath()); + sectionNameItem->setText(2, getFileSize(fileInfo.size())); + return sectionNameItem; +} +QTreeWidgetItem* NotebookList::createSectionGroupIcon(SectionGroup* sectionGroup) +{ + QTreeWidgetItem* sectionGroupNameItem = new QTreeWidgetItem(); + sectionGroupNameItem->setIcon(0, SetSectionGroupIcon(sectionGroup->color)); + sectionGroupNameItem->setText(0, sectionGroup->name); + sectionGroupNameItem->setText(1, sectionGroup->location); + sectionGroupNameItem->setText(2, getDirectorySize(sectionGroup->location)); + return sectionGroupNameItem; +} +QTreeWidgetItem* NotebookList::createNotebookIcon(Notebook* notebook) +{ + QTreeWidgetItem* notebookNameItem = new QTreeWidgetItem(); + notebookNameItem->setIcon(0, SetNotebookIcon(notebook->color)); + notebookNameItem->setText(0, notebook->name); + notebookNameItem->setText(1, notebook->location); + notebookNameItem->setText(2, getDirectorySize(notebook->location)); + return notebookNameItem; +} + +QIcon NotebookList::SetNotebookIcon(QString notebookColor) +{ + QIcon icon; + QString iconPath = "../NoteBinder/Icons"; + if(!QDir(iconPath).exists()) + { + return icon; + } + if(notebookColor == "Red") { + icon = QIcon(iconPath + "/NotebookIcon_Red.png"); + } else if(notebookColor == "Blue") { + icon = QIcon(iconPath + "/NotebookIcon_Blue.png"); + } else if(notebookColor == "Purple") { + icon = QIcon(iconPath + "/NotebookIcon_Purple.png"); + } else if(notebookColor == "Orange") { + icon = QIcon(iconPath + "/NotebookIcon_Orange.png"); + } else if(notebookColor == "Yellow") { + icon = QIcon(iconPath + "/NotebookIcon_Yellow.png"); + } else if(notebookColor == "Green") { + icon = QIcon(iconPath + "/NotebookIcon_Green.png"); + } else if(notebookColor == "Cyan") { + icon = QIcon(iconPath + "/NotebookIcon_Cyan.png"); + } else if(notebookColor == "Tan") { + icon = QIcon(iconPath + "/NotebookIcon_Tan.png"); + } else if(notebookColor == "Teal") { + icon = QIcon(iconPath + "/NotebookIcon_Teal.png"); + } else if(notebookColor == "Red Chalk") { + icon = QIcon(iconPath + "/NotebookIcon_RedChalk.png"); + } else if(notebookColor == "Blue Mist") { + icon = QIcon(iconPath + "/NotebookIcon_BlueMist.png"); + } else if(notebookColor == "Purple Mist") { + icon = QIcon(iconPath + "/NotebookIcon_PurpleMist.png"); + } else if(notebookColor == "Magenta") { + icon = QIcon(iconPath + "/NotebookIcon_Magenta.png"); + } else if(notebookColor == "Lemon Lime") { + icon = QIcon(iconPath + "/NotebookIcon_LemonLime.png"); + } else if(notebookColor == "Apple") { + icon = QIcon(iconPath + "/NotebookIcon_Apple.png"); + } else if(notebookColor == "Silver") { + icon = QIcon(iconPath + "/NotebookIcon_Silver.png"); + } else if(notebookColor == "Black") { + icon = QIcon(iconPath + "/NotebookIcon_Black.png"); + } else { + // If it's either White/None or an invalid value, set to the white icon + icon = QIcon(iconPath + "/NotebookIcon_White.png"); + } + return icon; +} + +QIcon NotebookList::SetSectionGroupIcon(QString sectionGroupColor) +{ + QIcon icon; + QString iconPath = "../NoteBinder/Icons"; + if(!QDir(iconPath).exists()) + { + return icon; + } + if(sectionGroupColor == "Red") { + icon = QIcon(iconPath + "/SectionGroupIcon_Red.png"); + } else if(sectionGroupColor == "Blue") { + icon = QIcon(iconPath + "/SectionGroupIcon_Blue.png"); + } else if(sectionGroupColor == "Purple") { + icon = QIcon(iconPath + "/SectionGroupIcon_Purple.png"); + } else if(sectionGroupColor == "Orange") { + icon = QIcon(iconPath + "/SectionGroupIcon_Orange.png"); + } else if(sectionGroupColor == "Yellow") { + icon = QIcon(iconPath + "/SectionGroupIcon_Yellow.png"); + } else if(sectionGroupColor == "Green") { + icon = QIcon(iconPath + "/SectionGroupIcon_Green.png"); + } else if(sectionGroupColor == "Cyan") { + icon = QIcon(iconPath + "/SectionGroupIcon_Cyan.png"); + } else if(sectionGroupColor == "Tan") { + icon = QIcon(iconPath + "/SectionGroupIcon_Tan.png"); + } else if(sectionGroupColor == "Teal") { + icon = QIcon(iconPath + "/SectionGroupIcon_Teal.png"); + } else if(sectionGroupColor == "Red Chalk") { + icon = QIcon(iconPath + "/SectionGroupIcon_RedChalk.png"); + } else if(sectionGroupColor == "Blue Mist") { + icon = QIcon(iconPath + "/SectionGroupIcon_BlueMist.png"); + } else if(sectionGroupColor == "Purple Mist") { + icon = QIcon(iconPath + "/SectionGroupIcon_PurpleMist.png"); + } else if(sectionGroupColor == "Magenta") { + icon = QIcon(iconPath + "/SectionGroupIcon_Magenta.png"); + } else if(sectionGroupColor == "Lemon Lime") { + icon = QIcon(iconPath + "/SectionGroupIcon_LemonLime.png"); + } else if(sectionGroupColor == "Apple") { + icon = QIcon(iconPath + "/SectionGroupIcon_Apple.png"); + } else if(sectionGroupColor == "Silver") { + icon = QIcon(iconPath + "/SectionGroupIcon_Silver.png"); + } else if(sectionGroupColor == "Black") { + icon = QIcon(iconPath + "/SectionGroupIcon_Black.png"); + } else { + // If it's either White/None or an invalid value, set to the white icon + icon = QIcon(iconPath + "/SectionGroupIcon_White.png"); + } + return icon; +}