Axivion: Make use of Dto::IssueKind enum
Use Dto::IssueKindMeta::enumToStr() to convert it to string. Rename icons accordingly. Change-Id: I8a955f2f0075793eea761cd4a41374a65d2aaea2 Reviewed-by: hjk <hjk@qt.io>
@@ -2,18 +2,18 @@
|
|||||||
<qresource prefix="/axivion">
|
<qresource prefix="/axivion">
|
||||||
<file>images/axivion.png</file>
|
<file>images/axivion.png</file>
|
||||||
<file>images/axivion@2x.png</file>
|
<file>images/axivion@2x.png</file>
|
||||||
<file>images/button-av.png</file>
|
<file>images/button-AV.png</file>
|
||||||
<file>images/button-av@2x.png</file>
|
<file>images/button-AV@2x.png</file>
|
||||||
<file>images/button-cl.png</file>
|
<file>images/button-CL.png</file>
|
||||||
<file>images/button-cl@2x.png</file>
|
<file>images/button-CL@2x.png</file>
|
||||||
<file>images/button-cy.png</file>
|
<file>images/button-CY.png</file>
|
||||||
<file>images/button-cy@2x.png</file>
|
<file>images/button-CY@2x.png</file>
|
||||||
<file>images/button-de.png</file>
|
<file>images/button-DE.png</file>
|
||||||
<file>images/button-de@2x.png</file>
|
<file>images/button-DE@2x.png</file>
|
||||||
<file>images/button-mv.png</file>
|
<file>images/button-MV.png</file>
|
||||||
<file>images/button-mv@2x.png</file>
|
<file>images/button-MV@2x.png</file>
|
||||||
<file>images/button-sv.png</file>
|
<file>images/button-SV.png</file>
|
||||||
<file>images/button-sv@2x.png</file>
|
<file>images/button-SV@2x.png</file>
|
||||||
<file>images/sortAsc.png</file>
|
<file>images/sortAsc.png</file>
|
||||||
<file>images/sortAsc@2x.png</file>
|
<file>images/sortAsc@2x.png</file>
|
||||||
<file>images/sortDesc.png</file>
|
<file>images/sortDesc.png</file>
|
||||||
|
@@ -564,7 +564,7 @@ void IssuesWidget::updateBasicProjectInfo(std::optional<Dto::ProjectInfoDto> inf
|
|||||||
int buttonId = 0;
|
int buttonId = 0;
|
||||||
for (const Dto::IssueKindInfoDto &kind : issueKinds) {
|
for (const Dto::IssueKindInfoDto &kind : issueKinds) {
|
||||||
auto button = new QToolButton(this);
|
auto button = new QToolButton(this);
|
||||||
button->setIcon(iconForIssue(kind.prefix));
|
button->setIcon(iconForIssue(kind.getOptionalPrefixEnum()));
|
||||||
button->setToolTip(kind.nicePluralName);
|
button->setToolTip(kind.nicePluralName);
|
||||||
button->setCheckable(true);
|
button->setCheckable(true);
|
||||||
connect(button, &QToolButton::clicked, this, [this, prefix = kind.prefix]{
|
connect(button, &QToolButton::clicked, this, [this, prefix = kind.prefix]{
|
||||||
|
@@ -63,16 +63,18 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace Axivion::Internal {
|
namespace Axivion::Internal {
|
||||||
|
|
||||||
QIcon iconForIssue(const QString &prefix)
|
QIcon iconForIssue(const std::optional<Dto::IssueKind> &issueKind)
|
||||||
{
|
{
|
||||||
static QHash<QString, QIcon> prefixToIcon;
|
if (!issueKind)
|
||||||
auto it = prefixToIcon.find(prefix);
|
return {};
|
||||||
|
|
||||||
if (it == prefixToIcon.end()) {
|
static QHash<Dto::IssueKind, QIcon> prefixToIcon;
|
||||||
Icon icon({{FilePath::fromString(":/axivion/images/button-" + prefix.toLower() + ".png"),
|
auto it = prefixToIcon.constFind(*issueKind);
|
||||||
Theme::PaletteButtonText}},
|
if (it == prefixToIcon.constEnd()) {
|
||||||
Icon::Tint);
|
const auto prefix = Dto::IssueKindMeta::enumToStr(*issueKind);
|
||||||
it = prefixToIcon.insert(prefix, icon.icon());
|
const Icon icon({{FilePath::fromString(":/axivion/images/button-" + prefix + ".png"),
|
||||||
|
Theme::PaletteButtonText}}, Icon::Tint);
|
||||||
|
it = prefixToIcon.insert(*issueKind, icon.icon());
|
||||||
}
|
}
|
||||||
return it.value();
|
return it.value();
|
||||||
}
|
}
|
||||||
@@ -226,7 +228,7 @@ public:
|
|||||||
const QString markText = issue.description;
|
const QString markText = issue.description;
|
||||||
const QString id = issue.kind + QString::number(issue.id.value_or(-1));
|
const QString id = issue.kind + QString::number(issue.id.value_or(-1));
|
||||||
setToolTip(id + '\n' + markText);
|
setToolTip(id + '\n' + markText);
|
||||||
setIcon(iconForIssue(issue.kind));
|
setIcon(iconForIssue(issue.getOptionalKindEnum()));
|
||||||
if (color)
|
if (color)
|
||||||
setColor(*color);
|
setColor(*color);
|
||||||
setPriority(TextMark::NormalPriority);
|
setPriority(TextMark::NormalPriority);
|
||||||
|
@@ -71,7 +71,7 @@ void fetchProjectInfo(const QString &projectName);
|
|||||||
std::optional<Dto::ProjectInfoDto> projectInfo();
|
std::optional<Dto::ProjectInfoDto> projectInfo();
|
||||||
bool handleCertificateIssue();
|
bool handleCertificateIssue();
|
||||||
|
|
||||||
QIcon iconForIssue(const QString &prefix);
|
QIcon iconForIssue(const std::optional<Dto::IssueKind> &issueKind);
|
||||||
QString anyToSimpleString(const Dto::Any &any);
|
QString anyToSimpleString(const Dto::Any &any);
|
||||||
void fetchIssueInfo(const QString &id);
|
void fetchIssueInfo(const QString &id);
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 179 B |
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 205 B |
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 397 B After Width: | Height: | Size: 397 B |
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 230 B After Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 175 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
@@ -3813,7 +3813,7 @@
|
|||||||
r="1.5" />
|
r="1.5" />
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="src/plugins/axivion/images/button-av"
|
id="src/plugins/axivion/images/button-AV"
|
||||||
transform="translate(17)">
|
transform="translate(17)">
|
||||||
<use
|
<use
|
||||||
style="display:inline"
|
style="display:inline"
|
||||||
@@ -3830,7 +3830,7 @@
|
|||||||
style="fill:none;stroke:#000000" />
|
style="fill:none;stroke:#000000" />
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="src/plugins/axivion/images/button-cl"
|
id="src/plugins/axivion/images/button-CL"
|
||||||
transform="translate(34)">
|
transform="translate(34)">
|
||||||
<use
|
<use
|
||||||
style="display:inline"
|
style="display:inline"
|
||||||
@@ -3862,7 +3862,7 @@
|
|||||||
d="m 2027.5,579 v 1 m -6,-7 v 1" />
|
d="m 2027.5,579 v 1 m -6,-7 v 1" />
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="src/plugins/axivion/images/button-cy"
|
id="src/plugins/axivion/images/button-CY"
|
||||||
transform="translate(51)">
|
transform="translate(51)">
|
||||||
<use
|
<use
|
||||||
style="display:inline"
|
style="display:inline"
|
||||||
@@ -3885,7 +3885,7 @@
|
|||||||
transform="rotate(180,2025,576)" />
|
transform="rotate(180,2025,576)" />
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="src/plugins/axivion/images/button-de"
|
id="src/plugins/axivion/images/button-DE"
|
||||||
transform="translate(68)">
|
transform="translate(68)">
|
||||||
<use
|
<use
|
||||||
style="display:inline"
|
style="display:inline"
|
||||||
@@ -3916,7 +3916,7 @@
|
|||||||
style="display:inline" />
|
style="display:inline" />
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="src/plugins/axivion/images/button-mv"
|
id="src/plugins/axivion/images/button-MV"
|
||||||
transform="translate(85)">
|
transform="translate(85)">
|
||||||
<use
|
<use
|
||||||
style="display:inline"
|
style="display:inline"
|
||||||
@@ -3933,7 +3933,7 @@
|
|||||||
d="m 2020,573.5 h -1 m 1,3 h -1 m 1,3 h -1 m 2.5,-3 v 3 h 3 z m -3,6 h 13 l -13,-13 z" />
|
d="m 2020,573.5 h -1 m 1,3 h -1 m 1,3 h -1 m 2.5,-3 v 3 h 3 z m -3,6 h 13 l -13,-13 z" />
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="src/plugins/axivion/images/button-sv"
|
id="src/plugins/axivion/images/button-SV"
|
||||||
transform="translate(102)">
|
transform="translate(102)">
|
||||||
<use
|
<use
|
||||||
style="display:inline"
|
style="display:inline"
|
||||||
|
Before Width: | Height: | Size: 373 KiB After Width: | Height: | Size: 373 KiB |