disable status showing for boards, add helper labels in pref dialog
This commit is contained in:
@@ -4,8 +4,8 @@ greaterThan(QT_MAJOR_VERSION, 5): QT += widgets
|
||||
|
||||
CONFIG += c++17
|
||||
|
||||
win32:VERSION = 0.3.0.0 # major.minor.patch.build
|
||||
else:VERSION = 0.3.0 # major.minor.patch
|
||||
win32:VERSION = 0.3.1.0 # major.minor.patch.build
|
||||
else:VERSION = 0.3.1 # major.minor.patch
|
||||
|
||||
DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"
|
||||
DEFINES += APP_NAME=\"\\\"TaskBoard\\\"\"
|
||||
|
||||
@@ -11,6 +11,7 @@ BoardConfigDialog::BoardConfigDialog(Board *b, QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
ui->nameField->setText(b->getName());
|
||||
ui->descriptionField->setPlainText(b->getDescription());
|
||||
ui->showStatusCheckbox->setChecked(b->isShowingStatus());
|
||||
if (!b->isAutoStatus())
|
||||
{
|
||||
QVector<Status> statuses = TaskStateService::getInstance()->getStatuses();
|
||||
@@ -44,6 +45,11 @@ bool BoardConfigDialog::isAutoStatus()
|
||||
return ui->autoStatusCheckbox->isChecked();
|
||||
}
|
||||
|
||||
bool BoardConfigDialog::isShowingStatus()
|
||||
{
|
||||
return ui->showStatusCheckbox->isChecked();
|
||||
}
|
||||
|
||||
const QString BoardConfigDialog::getStatus()
|
||||
{
|
||||
if (!ui->autoStatusCheckbox->isChecked())
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
const QString getName();
|
||||
const QString getDescription();
|
||||
bool isAutoStatus();
|
||||
bool isShowingStatus();
|
||||
const QString getStatus();
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -37,7 +37,14 @@
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<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>
|
||||
@@ -72,10 +79,10 @@
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -355,6 +355,7 @@ void MainWindow::onEditNameBoardMenu()
|
||||
QString newDesc = dialog.getDescription();
|
||||
b->setName(newName);
|
||||
b->setDescription(newDesc);
|
||||
b->setShowingStatus(dialog.isShowingStatus());
|
||||
if (!dialog.isAutoStatus())
|
||||
{
|
||||
std::optional<Status> status = TaskStateService::getInstance()->getStatusByUUID(dialog.getStatus());
|
||||
@@ -731,6 +732,8 @@ void MainWindow::redrawBoardStatus()
|
||||
if (selectedBoardIndex > -1)
|
||||
{
|
||||
Board *b = boards[selectedBoardIndex];
|
||||
if (b->isShowingStatus())
|
||||
{
|
||||
std::optional<Status> boardStatus = TaskStateService::getInstance()->getStatusByUUID(b->getStatus());
|
||||
if (boardStatus.has_value())
|
||||
{
|
||||
@@ -740,6 +743,7 @@ void MainWindow::redrawBoardStatus()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::save()
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<class>PrefDialog</class>
|
||||
<widget class="QDialog" name="PrefDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::ApplicationModal</enum>
|
||||
<enum>Qt::WindowModality::ApplicationModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
@@ -41,10 +41,10 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
@@ -66,10 +66,10 @@
|
||||
<widget class="QListWidget" name="statusListWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>601</width>
|
||||
<height>291</height>
|
||||
<x>40</x>
|
||||
<y>50</y>
|
||||
<width>571</width>
|
||||
<height>251</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -150,7 +150,7 @@
|
||||
<x>570</x>
|
||||
<y>310</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -166,7 +166,7 @@
|
||||
<x>520</x>
|
||||
<y>310</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -179,10 +179,10 @@
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<x>10</x>
|
||||
<y>310</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
<width>51</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -197,14 +197,78 @@
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>310</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
<width>51</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Up</string>
|
||||
</property>
|
||||
</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>7</x>
|
||||
<y>65</y>
|
||||
<width>20</width>
|
||||
<height>221</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>-4</x>
|
||||
<y>46</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>-3</x>
|
||||
<y>290</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>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define DESCRIPTION_KEY "description"
|
||||
#define AUTOSTATUS_KEY "auto_status"
|
||||
#define STATUS_KEY "status"
|
||||
#define SHOW_STATUS_KEY "show_status"
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonValue>
|
||||
@@ -29,6 +30,7 @@ Board::Board(QJsonObject obj)
|
||||
this->description = obj[DESCRIPTION_KEY].toString("");
|
||||
this->autoStatus = obj[AUTOSTATUS_KEY].toBool(true);
|
||||
this->statusUUID = obj[STATUS_KEY].toString();
|
||||
this->showStatus = obj[SHOW_STATUS_KEY].toBool(!this->autoStatus);
|
||||
QJsonArray jsonTasks = obj[TASKS_KEY].toArray();
|
||||
foreach (QJsonValue value, jsonTasks) {
|
||||
Task *t = new Task(value.toObject());
|
||||
@@ -81,6 +83,11 @@ const QString Board::getStatus()
|
||||
return statusUUID;
|
||||
}
|
||||
|
||||
bool Board::isShowingStatus()
|
||||
{
|
||||
return showStatus;
|
||||
}
|
||||
|
||||
bool Board::isAutoStatus()
|
||||
{
|
||||
return autoStatus;
|
||||
@@ -102,6 +109,11 @@ void Board::setDirtyStatus(Status s)
|
||||
this->statusUUID = s.getUUID();
|
||||
}
|
||||
|
||||
void Board::setShowingStatus(bool v)
|
||||
{
|
||||
this->showStatus = v;
|
||||
}
|
||||
|
||||
void Board::removeDirtyStatus()
|
||||
{
|
||||
this->autoStatus = true;
|
||||
@@ -148,6 +160,7 @@ const QJsonObject Board::toJson()
|
||||
obj[AUTOSTATUS_KEY] = this->autoStatus;
|
||||
obj[TASKS_KEY] = array;
|
||||
obj[DESCRIPTION_KEY] = description;
|
||||
obj[SHOW_STATUS_KEY] = this->showStatus;
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,13 @@ public:
|
||||
const QString getName();
|
||||
const QString getDescription();
|
||||
const QString getStatus();
|
||||
bool isShowingStatus();
|
||||
bool isAutoStatus();
|
||||
|
||||
void setName(const QString name);
|
||||
void setDescription(const QString description);
|
||||
void setDirtyStatus(Status s);
|
||||
void setShowingStatus(bool);
|
||||
void removeDirtyStatus();
|
||||
|
||||
void add(Task);
|
||||
@@ -42,6 +44,7 @@ private:
|
||||
|
||||
QString statusUUID;
|
||||
bool autoStatus;
|
||||
bool showStatus;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user