Compare commits
4 Commits
0.3.1
...
v0.3.1-bet
| Author | SHA1 | Date | |
|---|---|---|---|
| 34cb5776f6 | |||
| 3112e16326 | |||
| 09e5f4cd41 | |||
| e40dfb8f69 |
@@ -77,12 +77,10 @@ SOURCES += \
|
|||||||
src/frames/namedialog.cpp \
|
src/frames/namedialog.cpp \
|
||||||
src/frames/prefdialog.cpp \
|
src/frames/prefdialog.cpp \
|
||||||
src/models/filter.cpp \
|
src/models/filter.cpp \
|
||||||
src/models/generalpreferences.cpp \
|
|
||||||
src/models/priority.cpp \
|
src/models/priority.cpp \
|
||||||
src/models/status.cpp \
|
src/models/status.cpp \
|
||||||
src/models/task.cpp \
|
src/models/task.cpp \
|
||||||
src/frames/taskdialog.cpp \
|
src/frames/taskdialog.cpp \
|
||||||
src/services/configservice.cpp \
|
|
||||||
src/services/taskstateservice.cpp \
|
src/services/taskstateservice.cpp \
|
||||||
src/tools.cpp
|
src/tools.cpp
|
||||||
|
|
||||||
@@ -95,12 +93,10 @@ HEADERS += \
|
|||||||
src/frames/namedialog.h \
|
src/frames/namedialog.h \
|
||||||
src/frames/prefdialog.h \
|
src/frames/prefdialog.h \
|
||||||
src/models/filter.h \
|
src/models/filter.h \
|
||||||
src/models/generalpreferences.h \
|
|
||||||
src/models/priority.h \
|
src/models/priority.h \
|
||||||
src/models/status.h \
|
src/models/status.h \
|
||||||
src/models/task.h \
|
src/models/task.h \
|
||||||
src/frames/taskdialog.h \
|
src/frames/taskdialog.h \
|
||||||
src/services/configservice.h \
|
|
||||||
src/services/taskstateservice.h \
|
src/services/taskstateservice.h \
|
||||||
src/tools.h
|
src/tools.h
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,10 @@ QString AboutDialog::getCompilerInfo()
|
|||||||
#elif __GNUC__
|
#elif __GNUC__
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
return QString("MinGW_%1.%2").arg(QString::number(__MINGW32_MAJOR_VERSION), QString::number(__MINGW32_MINOR_VERSION));
|
return QString("MinGW_%1.%2").arg(QString::number(__MINGW32_MAJOR_VERSION), QString::number(__MINGW32_MINOR_VERSION));
|
||||||
#else
|
#elif __linux__
|
||||||
return QString("GLIBC_%1.%2").arg(QString::number(__GLIBC__), QString::number(__GLIBC_MINOR__));
|
return QString("GLIBC_%1.%2").arg(QString::number(__GLIBC__), QString::number(__GLIBC_MINOR__));
|
||||||
|
#else
|
||||||
|
return "unknown";
|
||||||
#endif
|
#endif
|
||||||
#elif _MSC_VER
|
#elif _MSC_VER
|
||||||
return QString("MSVC_%1").arg(_MSC_VER);
|
return QString("MSVC_%1").arg(_MSC_VER);
|
||||||
|
|||||||
@@ -11,17 +11,18 @@ BoardConfigDialog::BoardConfigDialog(Board *b, QWidget *parent) :
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->nameField->setText(b->getName());
|
ui->nameField->setText(b->getName());
|
||||||
ui->descriptionField->setPlainText(b->getDescription());
|
ui->descriptionField->setPlainText(b->getDescription());
|
||||||
ui->boardStatusModeComboBox->setCurrentIndex(b->getStatusMode());
|
ui->showStatusCheckbox->setChecked(b->isShowingStatus());
|
||||||
if (b->getStatusMode() == CUSTOM_STATUS_MODE)
|
if (!b->isAutoStatus())
|
||||||
{
|
{
|
||||||
QVector<Status> statuses = TaskStateService::getInstance()->getStatuses();
|
QVector<Status> statuses = TaskStateService::getInstance()->getStatuses();
|
||||||
foreach (Status s, statuses)
|
foreach (Status s, statuses)
|
||||||
{
|
{
|
||||||
ui->statusCombobox->addItem(s.getName(), s.getUUID());
|
ui->statusCombobox->addItem(s.getName(), s.getUUID());
|
||||||
}
|
}
|
||||||
|
ui->autoStatusCheckbox->setChecked(false);
|
||||||
ui->statusCombobox->setEnabled(true);
|
ui->statusCombobox->setEnabled(true);
|
||||||
}
|
}
|
||||||
connect(ui->boardStatusModeComboBox, &QComboBox::currentIndexChanged, this, &BoardConfigDialog::onAutoStatusCheckboxChange);
|
connect(ui->autoStatusCheckbox, &QCheckBox::stateChanged, this, &BoardConfigDialog::onAutoStatusCheckboxChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
BoardConfigDialog::~BoardConfigDialog()
|
BoardConfigDialog::~BoardConfigDialog()
|
||||||
@@ -39,14 +40,19 @@ const QString BoardConfigDialog::getDescription()
|
|||||||
return ui->descriptionField->toPlainText();
|
return ui->descriptionField->toPlainText();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t BoardConfigDialog::getBoardStatusMode()
|
bool BoardConfigDialog::isAutoStatus()
|
||||||
{
|
{
|
||||||
return ui->boardStatusModeComboBox->currentIndex();
|
return ui->autoStatusCheckbox->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BoardConfigDialog::isShowingStatus()
|
||||||
|
{
|
||||||
|
return ui->showStatusCheckbox->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString BoardConfigDialog::getStatus()
|
const QString BoardConfigDialog::getStatus()
|
||||||
{
|
{
|
||||||
if (ui->boardStatusModeComboBox->currentIndex() == CUSTOM_STATUS_MODE)
|
if (!ui->autoStatusCheckbox->isChecked())
|
||||||
{
|
{
|
||||||
if (!ui->statusCombobox->currentData().isNull())
|
if (!ui->statusCombobox->currentData().isNull())
|
||||||
{
|
{
|
||||||
@@ -56,9 +62,9 @@ const QString BoardConfigDialog::getStatus()
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoardConfigDialog::onAutoStatusCheckboxChange(int status)
|
void BoardConfigDialog::onAutoStatusCheckboxChange(int state)
|
||||||
{
|
{
|
||||||
if (status == CUSTOM_STATUS_MODE)
|
if (state == Qt::CheckState::Unchecked)
|
||||||
{
|
{
|
||||||
QVector<Status> statuses = TaskStateService::getInstance()->getStatuses();
|
QVector<Status> statuses = TaskStateService::getInstance()->getStatuses();
|
||||||
foreach (Status s, statuses)
|
foreach (Status s, statuses)
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ public:
|
|||||||
|
|
||||||
const QString getName();
|
const QString getName();
|
||||||
const QString getDescription();
|
const QString getDescription();
|
||||||
uint8_t getBoardStatusMode();
|
bool isAutoStatus();
|
||||||
|
bool isShowingStatus();
|
||||||
const QString getStatus();
|
const QString getStatus();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
@@ -37,42 +37,29 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line">
|
<widget class="Line" name="line">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="showStatusCheckbox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show the board status</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="autoStatusCheckbox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Auto determine status</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>Board status mode</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="boardStatusModeComboBox">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Auto</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Manual</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>None</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="statusContainer">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -92,10 +79,10 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#define STATUS_KEY "status"
|
#define STATUS_KEY "status"
|
||||||
#define BOARDS_KEY "boards"
|
#define BOARDS_KEY "boards"
|
||||||
#define FILTERS_KEY "filters"
|
#define FILTERS_KEY "filters"
|
||||||
|
#define DEFAULT_STATUS "default_status"
|
||||||
|
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
@@ -69,6 +70,7 @@ void MainWindow::openPreferences()
|
|||||||
{
|
{
|
||||||
TaskStateService::getInstance()->updatePriorities(dialog.getPriorities());
|
TaskStateService::getInstance()->updatePriorities(dialog.getPriorities());
|
||||||
TaskStateService::getInstance()->updateStatuses(dialog.getStatus());
|
TaskStateService::getInstance()->updateStatuses(dialog.getStatus());
|
||||||
|
TaskStateService::getInstance()->setDefaultStatus(dialog.getDefaultStatus());
|
||||||
save();
|
save();
|
||||||
redrawTaskTree();
|
redrawTaskTree();
|
||||||
}
|
}
|
||||||
@@ -355,12 +357,23 @@ void MainWindow::onEditNameBoardMenu()
|
|||||||
QString newDesc = dialog.getDescription();
|
QString newDesc = dialog.getDescription();
|
||||||
b->setName(newName);
|
b->setName(newName);
|
||||||
b->setDescription(newDesc);
|
b->setDescription(newDesc);
|
||||||
std::optional<Status> status = TaskStateService::getInstance()->getStatusByUUID(dialog.getStatus());
|
b->setShowingStatus(dialog.isShowingStatus());
|
||||||
if (status.has_value())
|
if (!dialog.isAutoStatus())
|
||||||
{
|
{
|
||||||
b->setStatus(status.value());
|
std::optional<Status> status = TaskStateService::getInstance()->getStatusByUUID(dialog.getStatus());
|
||||||
|
if (status.has_value())
|
||||||
|
{
|
||||||
|
b->setDirtyStatus(status.value());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b->removeDirtyStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b->removeDirtyStatus();
|
||||||
}
|
}
|
||||||
b->setStatusMode(dialog.getBoardStatusMode());
|
|
||||||
QListWidgetItem *item = ui->boardList->item(i);
|
QListWidgetItem *item = ui->boardList->item(i);
|
||||||
item->setText(newName);
|
item->setText(newName);
|
||||||
item->setToolTip(newDesc);
|
item->setToolTip(newDesc);
|
||||||
@@ -475,6 +488,14 @@ void MainWindow::init()
|
|||||||
}
|
}
|
||||||
TaskStateService::getInstance()->updatePriorities(priorities);
|
TaskStateService::getInstance()->updatePriorities(priorities);
|
||||||
TaskStateService::getInstance()->updateStatuses(statuses);
|
TaskStateService::getInstance()->updateStatuses(statuses);
|
||||||
|
QString defaultStatusUUID = save[DEFAULT_STATUS].toString("");
|
||||||
|
for (Status s : TaskStateService::getInstance()->getStatuses())
|
||||||
|
{
|
||||||
|
if (s.getUUID() == defaultStatusUUID)
|
||||||
|
{
|
||||||
|
TaskStateService::getInstance()->setDefaultStatus(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
redrawFilterList();
|
redrawFilterList();
|
||||||
redrawBoardList();
|
redrawBoardList();
|
||||||
return;
|
return;
|
||||||
@@ -560,6 +581,7 @@ const QJsonDocument MainWindow::getJsonSave()
|
|||||||
obj[STATUS_KEY] = jsonStatus;
|
obj[STATUS_KEY] = jsonStatus;
|
||||||
obj[BOARDS_KEY] = jsonBoards;
|
obj[BOARDS_KEY] = jsonBoards;
|
||||||
obj[FILTERS_KEY] = jsonFilters;
|
obj[FILTERS_KEY] = jsonFilters;
|
||||||
|
obj[DEFAULT_STATUS] = TaskStateService::getInstance()->getDefaultStatus().getUUID();
|
||||||
doc.setObject(obj);
|
doc.setObject(obj);
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
@@ -680,6 +702,10 @@ void MainWindow::redrawTaskTree()
|
|||||||
{
|
{
|
||||||
QTreeWidget *l = ui->taskList;
|
QTreeWidget *l = ui->taskList;
|
||||||
uint16_t itemCount = l->topLevelItemCount();
|
uint16_t itemCount = l->topLevelItemCount();
|
||||||
|
if (itemCount == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (int16_t i = itemCount; i >= 0; i--)
|
for (int16_t i = itemCount; i >= 0; i--)
|
||||||
{
|
{
|
||||||
delete l->takeTopLevelItem(i);
|
delete l->takeTopLevelItem(i);
|
||||||
@@ -721,12 +747,15 @@ void MainWindow::redrawBoardStatus()
|
|||||||
if (selectedBoardIndex > -1)
|
if (selectedBoardIndex > -1)
|
||||||
{
|
{
|
||||||
Board *b = boards[selectedBoardIndex];
|
Board *b = boards[selectedBoardIndex];
|
||||||
std::optional<Status> boardStatus = TaskStateService::getInstance()->getStatusByUUID(b->getStatus());
|
if (b->isShowingStatus())
|
||||||
if (boardStatus.has_value())
|
|
||||||
{
|
{
|
||||||
ui->boardStatus->setStyleSheet(Tools::getStatusLabelStylesheet(boardStatus.value()));
|
std::optional<Status> boardStatus = TaskStateService::getInstance()->getStatusByUUID(b->getStatus());
|
||||||
ui->boardStatus->setText(boardStatus.value().getName());
|
if (boardStatus.has_value())
|
||||||
ui->boardStatus->setVisible(true);
|
{
|
||||||
|
ui->boardStatus->setStyleSheet(Tools::getStatusLabelStylesheet(boardStatus.value()));
|
||||||
|
ui->boardStatus->setText(boardStatus.value().getName());
|
||||||
|
ui->boardStatus->setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ private:
|
|||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
|
// properties
|
||||||
|
|
||||||
int16_t selectedBoardIndex;
|
int16_t selectedBoardIndex;
|
||||||
int16_t selectedFilterIndex;
|
int16_t selectedFilterIndex;
|
||||||
|
|
||||||
@@ -60,6 +62,8 @@ private:
|
|||||||
QVector<Board*> boards;
|
QVector<Board*> boards;
|
||||||
QVector<Filter> filters;
|
QVector<Filter> filters;
|
||||||
|
|
||||||
|
// functions
|
||||||
|
|
||||||
QVector<Priority> defaultPriorities();
|
QVector<Priority> defaultPriorities();
|
||||||
QVector<Status> defaultStatus();
|
QVector<Status> defaultStatus();
|
||||||
QVector<Filter> defaultFilters();
|
QVector<Filter> defaultFilters();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ PrefDialog::PrefDialog(QWidget *parent) :
|
|||||||
statusUUIDRef.append(s.getUUID());
|
statusUUIDRef.append(s.getUUID());
|
||||||
setItemColor(item, s.getColor());
|
setItemColor(item, s.getColor());
|
||||||
ui->statusListWidget->addItem(item);
|
ui->statusListWidget->addItem(item);
|
||||||
|
ui->defaultStatusCombobox->addItem(s.getName(), s.getUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<Priority> priorities = TaskStateService::getInstance()->getPriorities();
|
QVector<Priority> priorities = TaskStateService::getInstance()->getPriorities();
|
||||||
@@ -31,6 +32,8 @@ PrefDialog::PrefDialog(QWidget *parent) :
|
|||||||
ui->priorityListWidget->addItem(item);
|
ui->priorityListWidget->addItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->defaultStatusCombobox->setCurrentText(TaskStateService::getInstance()->getDefaultStatus().getName());
|
||||||
|
|
||||||
connect(ui->addStatusButton, &QPushButton::clicked, this, &PrefDialog::onAddStatusButtonClick);
|
connect(ui->addStatusButton, &QPushButton::clicked, this, &PrefDialog::onAddStatusButtonClick);
|
||||||
connect(ui->addPriorityButton, &QPushButton::clicked, this, &PrefDialog::onAddPriorityButtonClick);
|
connect(ui->addPriorityButton, &QPushButton::clicked, this, &PrefDialog::onAddPriorityButtonClick);
|
||||||
connect(ui->statusListWidget, &QListWidget::currentRowChanged, this, &PrefDialog::onItemSelectionChange);
|
connect(ui->statusListWidget, &QListWidget::currentRowChanged, this, &PrefDialog::onItemSelectionChange);
|
||||||
@@ -80,6 +83,24 @@ QVector<Status> PrefDialog::getStatus()
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status PrefDialog::getDefaultStatus()
|
||||||
|
{
|
||||||
|
QVector<Status> status = TaskStateService::getInstance()->getStatuses();
|
||||||
|
QString uuid = ui->defaultStatusCombobox->currentData().toString();
|
||||||
|
for (Status s : status)
|
||||||
|
{
|
||||||
|
if (uuid == s.getUUID())
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (status.count() > 0)
|
||||||
|
{
|
||||||
|
return status[0];
|
||||||
|
}
|
||||||
|
return Status("", "", QColor::fromRgb(0, 0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
void PrefDialog::onAddStatusButtonClick()
|
void PrefDialog::onAddStatusButtonClick()
|
||||||
{
|
{
|
||||||
QColor bgColor = Tools::getRandomColor();
|
QColor bgColor = Tools::getRandomColor();
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public:
|
|||||||
|
|
||||||
QVector<Priority> getPriorities();
|
QVector<Priority> getPriorities();
|
||||||
QVector<Status> getStatus();
|
QVector<Status> getStatus();
|
||||||
|
Status getDefaultStatus();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onAddStatusButtonClick();
|
void onAddStatusButtonClick();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<class>PrefDialog</class>
|
<class>PrefDialog</class>
|
||||||
<widget class="QDialog" name="PrefDialog">
|
<widget class="QDialog" name="PrefDialog">
|
||||||
<property name="windowModality">
|
<property name="windowModality">
|
||||||
<enum>Qt::ApplicationModal</enum>
|
<enum>Qt::WindowModality::ApplicationModal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
@@ -41,10 +41,10 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
@@ -59,52 +59,6 @@
|
|||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_3">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>General</string>
|
|
||||||
</attribute>
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>161</width>
|
|
||||||
<height>18</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>At startup</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>81</width>
|
|
||||||
<height>18</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Open...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QComboBox" name="comboBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>100</x>
|
|
||||||
<y>35</y>
|
|
||||||
<width>521</width>
|
|
||||||
<height>26</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Status</string>
|
<string>Status</string>
|
||||||
@@ -112,10 +66,10 @@
|
|||||||
<widget class="QListWidget" name="statusListWidget">
|
<widget class="QListWidget" name="statusListWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>40</x>
|
||||||
<y>10</y>
|
<y>64</y>
|
||||||
<width>601</width>
|
<width>571</width>
|
||||||
<height>291</height>
|
<height>161</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -126,7 +80,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>90</x>
|
<x>90</x>
|
||||||
<y>350</y>
|
<y>290</y>
|
||||||
<width>521</width>
|
<width>521</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -136,7 +90,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>352</y>
|
<y>292</y>
|
||||||
<width>58</width>
|
<width>58</width>
|
||||||
<height>16</height>
|
<height>16</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -149,7 +103,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>390</y>
|
<y>330</y>
|
||||||
<width>58</width>
|
<width>58</width>
|
||||||
<height>16</height>
|
<height>16</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -165,7 +119,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>90</x>
|
<x>90</x>
|
||||||
<y>390</y>
|
<y>330</y>
|
||||||
<width>113</width>
|
<width>113</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -181,7 +135,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>210</x>
|
<x>210</x>
|
||||||
<y>390</y>
|
<y>330</y>
|
||||||
<width>26</width>
|
<width>26</width>
|
||||||
<height>22</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -194,9 +148,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>570</x>
|
<x>570</x>
|
||||||
<y>310</y>
|
<y>240</y>
|
||||||
<width>41</width>
|
<width>41</width>
|
||||||
<height>21</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -210,9 +164,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>520</x>
|
<x>520</x>
|
||||||
<y>310</y>
|
<y>240</y>
|
||||||
<width>41</width>
|
<width>41</width>
|
||||||
<height>21</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -225,10 +179,10 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>10</x>
|
||||||
<y>310</y>
|
<y>240</y>
|
||||||
<width>41</width>
|
<width>51</width>
|
||||||
<height>21</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -242,15 +196,115 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>70</x>
|
<x>70</x>
|
||||||
<y>310</y>
|
<y>240</y>
|
||||||
<width>41</width>
|
<width>51</width>
|
||||||
<height>21</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Up</string>
|
<string>Up</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>11</x>
|
||||||
|
<y>4</y>
|
||||||
|
<width>601</width>
|
||||||
|
<height>41</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p>Sort status by display priority. The lowest status will only be displayed if higher statuses are not assigned to the board.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>79</y>
|
||||||
|
<width>20</width>
|
||||||
|
<height>121</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>60</y>
|
||||||
|
<width>41</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Low</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>204</y>
|
||||||
|
<width>41</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>High</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="Line" name="line_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>360</y>
|
||||||
|
<width>591</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_8">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>390</y>
|
||||||
|
<width>141</width>
|
||||||
|
<height>18</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default (for new task)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QComboBox" name="defaultStatusCombobox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>440</x>
|
||||||
|
<y>384</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>26</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ TaskDialog::TaskDialog(QWidget *parent) :
|
|||||||
QDate expectedFor = QDate::currentDate();
|
QDate expectedFor = QDate::currentDate();
|
||||||
expectedFor = expectedFor.addDays(10);
|
expectedFor = expectedFor.addDays(10);
|
||||||
ui->expectedForEdit->setDate(expectedFor);
|
ui->expectedForEdit->setDate(expectedFor);
|
||||||
|
ui->statusCombo->setCurrentText(TaskStateService::getInstance()->getDefaultStatus().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskDialog::TaskDialog(Task *t, QWidget *parent) :
|
TaskDialog::TaskDialog(Task *t, QWidget *parent) :
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
#define UUID_KEY "uuid"
|
#define UUID_KEY "uuid"
|
||||||
#define DESCRIPTION_KEY "description"
|
#define DESCRIPTION_KEY "description"
|
||||||
#define AUTOSTATUS_KEY "auto_status"
|
#define AUTOSTATUS_KEY "auto_status"
|
||||||
#define STATUSMODE_KEY "status_mode"
|
|
||||||
#define STATUS_KEY "status"
|
#define STATUS_KEY "status"
|
||||||
|
#define SHOW_STATUS_KEY "show_status"
|
||||||
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonValue>
|
#include <QJsonValue>
|
||||||
@@ -20,7 +20,6 @@ Board::Board(QString name, QString description)
|
|||||||
this->uuid = uuid.toString(QUuid::WithoutBraces);
|
this->uuid = uuid.toString(QUuid::WithoutBraces);
|
||||||
this->name = name;
|
this->name = name;
|
||||||
this->description = description;
|
this->description = description;
|
||||||
this->statusMode = NO_STATUS_MODE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Board::Board(QJsonObject obj)
|
Board::Board(QJsonObject obj)
|
||||||
@@ -29,20 +28,9 @@ Board::Board(QJsonObject obj)
|
|||||||
this->uuid = obj[UUID_KEY].toString(uuid.toString(QUuid::WithoutBraces));
|
this->uuid = obj[UUID_KEY].toString(uuid.toString(QUuid::WithoutBraces));
|
||||||
this->name = obj[NAME_KEY].toString("!Missing name!");
|
this->name = obj[NAME_KEY].toString("!Missing name!");
|
||||||
this->description = obj[DESCRIPTION_KEY].toString("");
|
this->description = obj[DESCRIPTION_KEY].toString("");
|
||||||
if (obj.contains(AUTOSTATUS_KEY))
|
this->autoStatus = obj[AUTOSTATUS_KEY].toBool(true);
|
||||||
{
|
|
||||||
this->statusMode = obj[AUTOSTATUS_KEY].toBool(true) ? AUTO_STATUS_MODE : CUSTOM_STATUS_MODE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int val = obj[STATUSMODE_KEY].toInt(NO_STATUS_MODE);
|
|
||||||
if (val > std::numeric_limits<uint8_t>::max() || val < 0)
|
|
||||||
{
|
|
||||||
val = AUTO_STATUS_MODE;
|
|
||||||
}
|
|
||||||
this->statusMode = val;
|
|
||||||
}
|
|
||||||
this->statusUUID = obj[STATUS_KEY].toString();
|
this->statusUUID = obj[STATUS_KEY].toString();
|
||||||
|
this->showStatus = obj[SHOW_STATUS_KEY].toBool(!this->autoStatus);
|
||||||
QJsonArray jsonTasks = obj[TASKS_KEY].toArray();
|
QJsonArray jsonTasks = obj[TASKS_KEY].toArray();
|
||||||
foreach (QJsonValue value, jsonTasks) {
|
foreach (QJsonValue value, jsonTasks) {
|
||||||
Task *t = new Task(value.toObject());
|
Task *t = new Task(value.toObject());
|
||||||
@@ -76,7 +64,7 @@ const QString Board::getDescription()
|
|||||||
|
|
||||||
const QString Board::getStatus()
|
const QString Board::getStatus()
|
||||||
{
|
{
|
||||||
if (statusMode == AUTO_STATUS_MODE)
|
if (autoStatus)
|
||||||
{
|
{
|
||||||
TaskStateService *tss = TaskStateService::getInstance();
|
TaskStateService *tss = TaskStateService::getInstance();
|
||||||
int16_t h = -1;
|
int16_t h = -1;
|
||||||
@@ -92,16 +80,17 @@ const QString Board::getStatus()
|
|||||||
}
|
}
|
||||||
return suuid;
|
return suuid;
|
||||||
}
|
}
|
||||||
else if (statusMode == NO_STATUS_MODE)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return statusUUID;
|
return statusUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Board::getStatusMode()
|
bool Board::isShowingStatus()
|
||||||
{
|
{
|
||||||
return statusMode;
|
return showStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Board::isAutoStatus()
|
||||||
|
{
|
||||||
|
return autoStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Board::setName(const QString name)
|
void Board::setName(const QString name)
|
||||||
@@ -114,20 +103,21 @@ void Board::setDescription(const QString description)
|
|||||||
this->description = description;
|
this->description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Board::setStatus(Status s)
|
void Board::setDirtyStatus(Status s)
|
||||||
{
|
{
|
||||||
this->statusMode = CUSTOM_STATUS_MODE;
|
this->autoStatus = false;
|
||||||
this->statusUUID = s.getUUID();
|
this->statusUUID = s.getUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Board::setShowingStatus(bool v)
|
||||||
void Board::setStatusMode(uint8_t mode)
|
|
||||||
{
|
{
|
||||||
this->statusMode = mode;
|
this->showStatus = v;
|
||||||
if (mode != CUSTOM_STATUS_MODE)
|
}
|
||||||
{
|
|
||||||
this->statusUUID = "";
|
void Board::removeDirtyStatus()
|
||||||
}
|
{
|
||||||
|
this->autoStatus = true;
|
||||||
|
this->statusUUID = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void Board::add(Task t)
|
void Board::add(Task t)
|
||||||
@@ -167,9 +157,10 @@ const QJsonObject Board::toJson()
|
|||||||
obj[NAME_KEY] = this->name;
|
obj[NAME_KEY] = this->name;
|
||||||
obj[UUID_KEY] = this->uuid;
|
obj[UUID_KEY] = this->uuid;
|
||||||
obj[STATUS_KEY] = this->statusUUID;
|
obj[STATUS_KEY] = this->statusUUID;
|
||||||
obj[STATUSMODE_KEY] = this->statusMode;
|
obj[AUTOSTATUS_KEY] = this->autoStatus;
|
||||||
obj[TASKS_KEY] = array;
|
obj[TASKS_KEY] = array;
|
||||||
obj[DESCRIPTION_KEY] = description;
|
obj[DESCRIPTION_KEY] = description;
|
||||||
|
obj[SHOW_STATUS_KEY] = this->showStatus;
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,6 @@
|
|||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "status.h"
|
#include "status.h"
|
||||||
|
|
||||||
#define AUTO_STATUS_MODE 0
|
|
||||||
#define CUSTOM_STATUS_MODE 1
|
|
||||||
#define NO_STATUS_MODE 2
|
|
||||||
|
|
||||||
class Board
|
class Board
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -23,12 +19,14 @@ public:
|
|||||||
const QString getName();
|
const QString getName();
|
||||||
const QString getDescription();
|
const QString getDescription();
|
||||||
const QString getStatus();
|
const QString getStatus();
|
||||||
uint8_t getStatusMode();
|
bool isShowingStatus();
|
||||||
|
bool isAutoStatus();
|
||||||
|
|
||||||
void setName(const QString name);
|
void setName(const QString name);
|
||||||
void setDescription(const QString description);
|
void setDescription(const QString description);
|
||||||
void setStatus(Status s);
|
void setDirtyStatus(Status s);
|
||||||
void setStatusMode(uint8_t mode);
|
void setShowingStatus(bool);
|
||||||
|
void removeDirtyStatus();
|
||||||
|
|
||||||
void add(Task);
|
void add(Task);
|
||||||
void remove(uint16_t index);
|
void remove(uint16_t index);
|
||||||
@@ -45,7 +43,9 @@ private:
|
|||||||
QString description;
|
QString description;
|
||||||
|
|
||||||
QString statusUUID;
|
QString statusUUID;
|
||||||
uint8_t statusMode;
|
bool autoStatus;
|
||||||
|
bool showStatus;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BOARD_H
|
#endif // BOARD_H
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
#include "generalpreferences.h"
|
|
||||||
|
|
||||||
#define PRELOAD_TYPE_KEY "preload_type"
|
|
||||||
#define PRELOAD_FACE_UUID_KEY "pr_face_uuid"
|
|
||||||
|
|
||||||
GeneralPreferences::GeneralPreferences()
|
|
||||||
{
|
|
||||||
this->preloadType = NO_PRELOAD_TYPE;
|
|
||||||
this->preloadUUID = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
GeneralPreferences::GeneralPreferences(QJsonObject obj)
|
|
||||||
{
|
|
||||||
int val = obj[PRELOAD_TYPE_KEY].toInt(NO_PRELOAD_TYPE);
|
|
||||||
if (val > std::numeric_limits<uint8_t>::max() || val < 0)
|
|
||||||
{
|
|
||||||
val = NO_PRELOAD_TYPE;
|
|
||||||
}
|
|
||||||
this->preloadType = val;
|
|
||||||
this->preloadUUID = obj[PRELOAD_FACE_UUID_KEY].toString("");
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t GeneralPreferences::getPreloadType()
|
|
||||||
{
|
|
||||||
return this->preloadType;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<QString> GeneralPreferences::getPreloadUUID()
|
|
||||||
{
|
|
||||||
if (this->preloadType == NO_PRELOAD_TYPE || this->preloadUUID.isEmpty())
|
|
||||||
{
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
return std::optional<QString> {this->preloadUUID};
|
|
||||||
}
|
|
||||||
|
|
||||||
void GeneralPreferences::setPreloadType(uint8_t type)
|
|
||||||
{
|
|
||||||
this->preloadType = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GeneralPreferences::setPreloadUUID(QString uuid)
|
|
||||||
{
|
|
||||||
this->preloadUUID = uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QJsonObject GeneralPreferences::toJson()
|
|
||||||
{
|
|
||||||
QJsonObject obj;
|
|
||||||
|
|
||||||
obj[PRELOAD_TYPE_KEY] = this->preloadType;
|
|
||||||
obj[PRELOAD_FACE_UUID_KEY] = this->preloadUUID;
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#ifndef GENERALPREFERENCES_H
|
|
||||||
#define GENERALPREFERENCES_H
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QString>
|
|
||||||
#include <QJsonObject>
|
|
||||||
|
|
||||||
#define NO_PRELOAD_TYPE 0
|
|
||||||
#define FILTER_PRELOAD_TYPE 1
|
|
||||||
#define BOARD_PRELOAD_TYPE 2
|
|
||||||
|
|
||||||
class GeneralPreferences
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
GeneralPreferences();
|
|
||||||
GeneralPreferences(QJsonObject);
|
|
||||||
|
|
||||||
uint8_t getPreloadType();
|
|
||||||
std::optional<QString> getPreloadUUID();
|
|
||||||
|
|
||||||
void setPreloadType(uint8_t type);
|
|
||||||
void setPreloadUUID(QString uuid);
|
|
||||||
|
|
||||||
const QJsonObject toJson();
|
|
||||||
|
|
||||||
private:
|
|
||||||
uint8_t preloadType;
|
|
||||||
QString preloadUUID;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // GENERALPREFERENCES_H
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
#include "configservice.h"
|
|
||||||
|
|
||||||
ConfigService *ConfigService::instance = nullptr;
|
|
||||||
|
|
||||||
ConfigService::~ConfigService()
|
|
||||||
{
|
|
||||||
delete data;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigService *ConfigService::getInstance()
|
|
||||||
{
|
|
||||||
if (instance == nullptr)
|
|
||||||
{
|
|
||||||
instance = new ConfigService();
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigService::loadConfig(GeneralPreferences data)
|
|
||||||
{
|
|
||||||
delete this->data;
|
|
||||||
this->data = new GeneralPreferences(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
GeneralPreferences *ConfigService::getConfig()
|
|
||||||
{
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigService::ConfigService()
|
|
||||||
{
|
|
||||||
data = new GeneralPreferences();
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#ifndef CONFIGSERVICE_H
|
|
||||||
#define CONFIGSERVICE_H
|
|
||||||
|
|
||||||
#include "../models/generalpreferences.h"
|
|
||||||
|
|
||||||
class ConfigService
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
~ConfigService();
|
|
||||||
static ConfigService *getInstance();
|
|
||||||
|
|
||||||
void loadConfig(GeneralPreferences);
|
|
||||||
GeneralPreferences *getConfig();
|
|
||||||
|
|
||||||
private:
|
|
||||||
static ConfigService *instance;
|
|
||||||
ConfigService();
|
|
||||||
|
|
||||||
GeneralPreferences *data;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CONFIGSERVICE_H
|
|
||||||
@@ -21,6 +21,11 @@ void TaskStateService::updatePriorities(QVector<Priority> priorities)
|
|||||||
this->priorities = priorities;
|
this->priorities = priorities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TaskStateService::setDefaultStatus(Status s)
|
||||||
|
{
|
||||||
|
this->defaultStatus = s;
|
||||||
|
}
|
||||||
|
|
||||||
QVector<Status> TaskStateService::getStatuses()
|
QVector<Status> TaskStateService::getStatuses()
|
||||||
{
|
{
|
||||||
return statuses;
|
return statuses;
|
||||||
@@ -31,6 +36,11 @@ QVector<Priority> TaskStateService::getPriorities()
|
|||||||
return priorities;
|
return priorities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status TaskStateService::getDefaultStatus()
|
||||||
|
{
|
||||||
|
return this->defaultStatus;
|
||||||
|
}
|
||||||
|
|
||||||
std::optional<Status> TaskStateService::getStatusByUUID(QString uuid)
|
std::optional<Status> TaskStateService::getStatusByUUID(QString uuid)
|
||||||
{
|
{
|
||||||
foreach (Status s, statuses) {
|
foreach (Status s, statuses) {
|
||||||
@@ -74,7 +84,9 @@ TaskStateService::TaskStateService()
|
|||||||
priorities.append(Priority(QUuid::createUuid().toString(QUuid::WithoutBraces), "Medium", QColor(176, 142, 48)));
|
priorities.append(Priority(QUuid::createUuid().toString(QUuid::WithoutBraces), "Medium", QColor(176, 142, 48)));
|
||||||
priorities.append(Priority(QUuid::createUuid().toString(QUuid::WithoutBraces), "High", QColor(176, 67, 48)));
|
priorities.append(Priority(QUuid::createUuid().toString(QUuid::WithoutBraces), "High", QColor(176, 67, 48)));
|
||||||
|
|
||||||
statuses.append(Status(QUuid::createUuid().toString(QUuid::WithoutBraces), "To Do", QColor(143, 143, 143)));
|
Status defaultStatus = Status(QUuid::createUuid().toString(QUuid::WithoutBraces), "To Do", QColor(143, 143, 143));
|
||||||
statuses.append(Status(QUuid::createUuid().toString(QUuid::WithoutBraces), "Working on", QColor(95, 48, 176)));
|
|
||||||
statuses.append(Status(QUuid::createUuid().toString(QUuid::WithoutBraces), "Completed", QColor(48, 176, 73)));
|
statuses.append(Status(QUuid::createUuid().toString(QUuid::WithoutBraces), "Completed", QColor(48, 176, 73)));
|
||||||
|
statuses.append(defaultStatus);
|
||||||
|
statuses.append(Status(QUuid::createUuid().toString(QUuid::WithoutBraces), "Working on", QColor(95, 48, 176)));
|
||||||
|
this->defaultStatus = defaultStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,11 @@ public:
|
|||||||
|
|
||||||
void updateStatuses(QVector<Status>);
|
void updateStatuses(QVector<Status>);
|
||||||
void updatePriorities(QVector<Priority>);
|
void updatePriorities(QVector<Priority>);
|
||||||
|
void setDefaultStatus(Status s);
|
||||||
|
|
||||||
QVector<Status> getStatuses();
|
QVector<Status> getStatuses();
|
||||||
QVector<Priority> getPriorities();
|
QVector<Priority> getPriorities();
|
||||||
|
Status getDefaultStatus();
|
||||||
|
|
||||||
std::optional<Status> getStatusByUUID(QString);
|
std::optional<Status> getStatusByUUID(QString);
|
||||||
std::optional<Priority> getPriorityByUUID(QString);
|
std::optional<Priority> getPriorityByUUID(QString);
|
||||||
@@ -26,6 +28,8 @@ private:
|
|||||||
TaskStateService();
|
TaskStateService();
|
||||||
static TaskStateService *instance;
|
static TaskStateService *instance;
|
||||||
|
|
||||||
|
Status defaultStatus = Status("", "", QColor::fromRgb(0,0,0));
|
||||||
|
|
||||||
QVector<Priority> priorities;
|
QVector<Priority> priorities;
|
||||||
QVector<Status> statuses;
|
QVector<Status> statuses;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user