From 530fa6bac1e9db6086efb4d5884df8f31c7040b6 Mon Sep 17 00:00:00 2001 From: DrewTechs Date: Sat, 12 Mar 2022 03:40:32 -0500 Subject: [PATCH] Upload files to '' --- unfiledNotes.cpp | 84 ++++++++++++++++++++++++++++++ unfiledNotes.h | 40 ++++++++++++++ unfiledNotes.ui | 132 +++++++++++++++++++++++++++++++++++++++++++++++ unfilednotes.h | 17 ++++++ 4 files changed, 273 insertions(+) create mode 100644 unfiledNotes.cpp create mode 100644 unfiledNotes.h create mode 100644 unfiledNotes.ui create mode 100644 unfilednotes.h diff --git a/unfiledNotes.cpp b/unfiledNotes.cpp new file mode 100644 index 0000000..b4c36b3 --- /dev/null +++ b/unfiledNotes.cpp @@ -0,0 +1,84 @@ +#include "unfiledNotes.h" +#include "ui_unfiledNotes.h" + +UnfiledNotes::UnfiledNotes(QList appLaunchers, QWidget *parent) : + QDialog(parent), + ui(new Ui::UnfiledNotes) +{ + ui->setupUi(this); + setApplicationLauncher(appLaunchers); + init(); +} + +UnfiledNotes::~UnfiledNotes() +{ + delete ui; +} + +void UnfiledNotes::init() +{ + QStringList extensionItems; + QStringList extensions; + int appLauncher_idx = 0; + for(appLauncher_idx = 0; appLauncher_idx < applicationLaunchers.size(); appLauncher_idx++) + { + int extensions_idx = 0; + for(extensions_idx = 0; extensions_idx < applicationLaunchers.at(appLauncher_idx)->getApplicationExtensions().size(); extensions_idx++) + { + extensions.append(applicationLaunchers.at(appLauncher_idx)->getSingleApplicationExtension(extensions_idx)); + extensionItems.append(applicationLaunchers.at(appLauncher_idx)->getApplicationName() + + " (" + applicationLaunchers.at(appLauncher_idx)->getSingleApplicationExtension(extensions_idx) + ")"); + } + } + setExtensionList(extensions); + ui->fileExtensionBox->addItems(extensionItems); +} + + +void UnfiledNotes::on_buttonBox_accepted() +{ + if(ui->fileExtensionBox->currentText() != "") + { + int idx = 0; + for(idx = 0; idx < getExtensionList().size(); idx++) + { + if(idx == ui->fileExtensionBox->currentIndex()) + { + QString extension = extensionList.at(idx); + setExtension(idx); + } + } + } + accept(); +} + + +void UnfiledNotes::on_buttonBox_rejected() +{ + reject(); +} + +void UnfiledNotes::setApplicationLauncher(QList appLaunchers) +{ + applicationLaunchers = appLaunchers; +} +void UnfiledNotes::setExtensionList(QStringList newExtensionList) +{ + extensionList = newExtensionList; +} +void UnfiledNotes::setExtension(int idx) +{ + extension = extensionList.at(idx); +} +ApplicationLaunchers* UnfiledNotes::getApplicationLauncherAt(int idx) +{ + return applicationLaunchers.at(idx); +} +QStringList UnfiledNotes::getExtensionList() +{ + return extensionList; +} +QString UnfiledNotes::getExtension() +{ + return extension; +} diff --git a/unfiledNotes.h b/unfiledNotes.h new file mode 100644 index 0000000..95c5511 --- /dev/null +++ b/unfiledNotes.h @@ -0,0 +1,40 @@ +#ifndef UNFILEDNOTES_H +#define UNFILEDNOTES_H + +#include +#include "applicationlaunchers.h" + +namespace Ui { +class UnfiledNotes; +} + +class UnfiledNotes : public QDialog +{ + Q_OBJECT + +public: + explicit UnfiledNotes(QList appLaunchers, QWidget *parent = nullptr); + ~UnfiledNotes(); + + void init(); + + void setApplicationLauncher(QList appLaunchers); + QStringList getExtensionList(); + void setExtension(int idx); + + void setExtensionList(QStringList newExtensionList); + ApplicationLaunchers* getApplicationLauncherAt(int idx); + QString getExtension(); + +private slots: + void on_buttonBox_accepted(); + void on_buttonBox_rejected(); + +private: + Ui::UnfiledNotes *ui; + QList applicationLaunchers; + QStringList extensionList; + QString extension; +}; + +#endif // UNFILEDNOTES_H diff --git a/unfiledNotes.ui b/unfiledNotes.ui new file mode 100644 index 0000000..0a5e5e5 --- /dev/null +++ b/unfiledNotes.ui @@ -0,0 +1,132 @@ + + + UnfiledNotes + + + + 0 + 0 + 473 + 140 + + + + Create Unfiled Note + + + + + + + + + + + 12 + + + + Select Application: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 12 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + UnfiledNotes + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + UnfiledNotes + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/unfilednotes.h b/unfilednotes.h new file mode 100644 index 0000000..9ec3498 --- /dev/null +++ b/unfilednotes.h @@ -0,0 +1,17 @@ +#ifndef UNFILEDNOTES_H +#define UNFILEDNOTES_H + +#include +#include + +class UnfiledNotes +{ + Q_OBJECT +public: + UnfiledNotes(); + QString unfiledNoteName; + QString unfiledNoteLocation; + +}; + +#endif // UNFILEDNOTES_H