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">
|
||||
<file>images/axivion.png</file>
|
||||
<file>images/axivion@2x.png</file>
|
||||
<file>images/button-av.png</file>
|
||||
<file>images/button-av@2x.png</file>
|
||||
<file>images/button-cl.png</file>
|
||||
<file>images/button-cl@2x.png</file>
|
||||
<file>images/button-cy.png</file>
|
||||
<file>images/button-cy@2x.png</file>
|
||||
<file>images/button-de.png</file>
|
||||
<file>images/button-de@2x.png</file>
|
||||
<file>images/button-mv.png</file>
|
||||
<file>images/button-mv@2x.png</file>
|
||||
<file>images/button-sv.png</file>
|
||||
<file>images/button-sv@2x.png</file>
|
||||
<file>images/button-AV.png</file>
|
||||
<file>images/button-AV@2x.png</file>
|
||||
<file>images/button-CL.png</file>
|
||||
<file>images/button-CL@2x.png</file>
|
||||
<file>images/button-CY.png</file>
|
||||
<file>images/button-CY@2x.png</file>
|
||||
<file>images/button-DE.png</file>
|
||||
<file>images/button-DE@2x.png</file>
|
||||
<file>images/button-MV.png</file>
|
||||
<file>images/button-MV@2x.png</file>
|
||||
<file>images/button-SV.png</file>
|
||||
<file>images/button-SV@2x.png</file>
|
||||
<file>images/sortAsc.png</file>
|
||||
<file>images/sortAsc@2x.png</file>
|
||||
<file>images/sortDesc.png</file>
|
||||
|
@@ -564,7 +564,7 @@ void IssuesWidget::updateBasicProjectInfo(std::optional<Dto::ProjectInfoDto> inf
|
||||
int buttonId = 0;
|
||||
for (const Dto::IssueKindInfoDto &kind : issueKinds) {
|
||||
auto button = new QToolButton(this);
|
||||
button->setIcon(iconForIssue(kind.prefix));
|
||||
button->setIcon(iconForIssue(kind.getOptionalPrefixEnum()));
|
||||
button->setToolTip(kind.nicePluralName);
|
||||
button->setCheckable(true);
|
||||
connect(button, &QToolButton::clicked, this, [this, prefix = kind.prefix]{
|
||||
|
@@ -63,16 +63,18 @@ using namespace Utils;
|
||||
|
||||
namespace Axivion::Internal {
|
||||
|
||||
QIcon iconForIssue(const QString &prefix)
|
||||
QIcon iconForIssue(const std::optional<Dto::IssueKind> &issueKind)
|
||||
{
|
||||
static QHash<QString, QIcon> prefixToIcon;
|
||||
auto it = prefixToIcon.find(prefix);
|
||||
if (!issueKind)
|
||||
return {};
|
||||
|
||||
if (it == prefixToIcon.end()) {
|
||||
Icon icon({{FilePath::fromString(":/axivion/images/button-" + prefix.toLower() + ".png"),
|
||||
Theme::PaletteButtonText}},
|
||||
Icon::Tint);
|
||||
it = prefixToIcon.insert(prefix, icon.icon());
|
||||
static QHash<Dto::IssueKind, QIcon> prefixToIcon;
|
||||
auto it = prefixToIcon.constFind(*issueKind);
|
||||
if (it == prefixToIcon.constEnd()) {
|
||||
const auto prefix = Dto::IssueKindMeta::enumToStr(*issueKind);
|
||||
const Icon icon({{FilePath::fromString(":/axivion/images/button-" + prefix + ".png"),
|
||||
Theme::PaletteButtonText}}, Icon::Tint);
|
||||
it = prefixToIcon.insert(*issueKind, icon.icon());
|
||||
}
|
||||
return it.value();
|
||||
}
|
||||
@@ -226,7 +228,7 @@ public:
|
||||
const QString markText = issue.description;
|
||||
const QString id = issue.kind + QString::number(issue.id.value_or(-1));
|
||||
setToolTip(id + '\n' + markText);
|
||||
setIcon(iconForIssue(issue.kind));
|
||||
setIcon(iconForIssue(issue.getOptionalKindEnum()));
|
||||
if (color)
|
||||
setColor(*color);
|
||||
setPriority(TextMark::NormalPriority);
|
||||
|
@@ -71,7 +71,7 @@ void fetchProjectInfo(const QString &projectName);
|
||||
std::optional<Dto::ProjectInfoDto> projectInfo();
|
||||
bool handleCertificateIssue();
|
||||
|
||||
QIcon iconForIssue(const QString &prefix);
|
||||
QIcon iconForIssue(const std::optional<Dto::IssueKind> &issueKind);
|
||||
QString anyToSimpleString(const Dto::Any &any);
|
||||
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" />
|
||||
</g>
|
||||
<g
|
||||
id="src/plugins/axivion/images/button-av"
|
||||
id="src/plugins/axivion/images/button-AV"
|
||||
transform="translate(17)">
|
||||
<use
|
||||
style="display:inline"
|
||||
@@ -3830,7 +3830,7 @@
|
||||
style="fill:none;stroke:#000000" />
|
||||
</g>
|
||||
<g
|
||||
id="src/plugins/axivion/images/button-cl"
|
||||
id="src/plugins/axivion/images/button-CL"
|
||||
transform="translate(34)">
|
||||
<use
|
||||
style="display:inline"
|
||||
@@ -3862,7 +3862,7 @@
|
||||
d="m 2027.5,579 v 1 m -6,-7 v 1" />
|
||||
</g>
|
||||
<g
|
||||
id="src/plugins/axivion/images/button-cy"
|
||||
id="src/plugins/axivion/images/button-CY"
|
||||
transform="translate(51)">
|
||||
<use
|
||||
style="display:inline"
|
||||
@@ -3885,7 +3885,7 @@
|
||||
transform="rotate(180,2025,576)" />
|
||||
</g>
|
||||
<g
|
||||
id="src/plugins/axivion/images/button-de"
|
||||
id="src/plugins/axivion/images/button-DE"
|
||||
transform="translate(68)">
|
||||
<use
|
||||
style="display:inline"
|
||||
@@ -3916,7 +3916,7 @@
|
||||
style="display:inline" />
|
||||
</g>
|
||||
<g
|
||||
id="src/plugins/axivion/images/button-mv"
|
||||
id="src/plugins/axivion/images/button-MV"
|
||||
transform="translate(85)">
|
||||
<use
|
||||
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" />
|
||||
</g>
|
||||
<g
|
||||
id="src/plugins/axivion/images/button-sv"
|
||||
id="src/plugins/axivion/images/button-SV"
|
||||
transform="translate(102)">
|
||||
<use
|
||||
style="display:inline"
|
||||
|
Before Width: | Height: | Size: 373 KiB After Width: | Height: | Size: 373 KiB |