forked from qt-creator/qt-creator
Axivion: Remove one intermediate widget
Dashboard overview has been removed, so there is no need for keeping the stacked widget. Minor preparation for moving the issues widget to a perspective. Change-Id: I3e4661ff39e432352f8e8a8e622aff157cb0b349 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -42,7 +42,6 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QStackedWidget>
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
|
|
||||||
@@ -766,22 +765,20 @@ public:
|
|||||||
setDisplayName(Tr::tr("Axivion"));
|
setDisplayName(Tr::tr("Axivion"));
|
||||||
setPriorityInStatusBar(-50);
|
setPriorityInStatusBar(-50);
|
||||||
|
|
||||||
m_outputWidget = new QStackedWidget;
|
m_issuesWidget = new IssuesWidget;
|
||||||
IssuesWidget *issuesWidget = new IssuesWidget(m_outputWidget);
|
|
||||||
m_outputWidget->addWidget(issuesWidget);
|
|
||||||
|
|
||||||
QPalette pal = m_outputWidget->palette();
|
QPalette pal = m_issuesWidget->palette();
|
||||||
pal.setColor(QPalette::Window, creatorColor(Theme::Color::BackgroundColorNormal));
|
pal.setColor(QPalette::Window, creatorColor(Theme::Color::BackgroundColorNormal));
|
||||||
m_outputWidget->setPalette(pal);
|
m_issuesWidget->setPalette(pal);
|
||||||
|
|
||||||
m_disableInlineIssues = new QToolButton(m_outputWidget);
|
m_disableInlineIssues = new QToolButton(m_issuesWidget);
|
||||||
m_disableInlineIssues->setIcon(ProjectExplorer::Icons::BUILDSTEP_DISABLE.icon());
|
m_disableInlineIssues->setIcon(ProjectExplorer::Icons::BUILDSTEP_DISABLE.icon());
|
||||||
m_disableInlineIssues->setToolTip(Tr::tr("Disable inline issues"));
|
m_disableInlineIssues->setToolTip(Tr::tr("Disable inline issues"));
|
||||||
m_disableInlineIssues->setCheckable(true);
|
m_disableInlineIssues->setCheckable(true);
|
||||||
m_disableInlineIssues->setChecked(false);
|
m_disableInlineIssues->setChecked(false);
|
||||||
connect(m_disableInlineIssues, &QToolButton::toggled,
|
connect(m_disableInlineIssues, &QToolButton::toggled,
|
||||||
this, [](bool checked) { disableInlineIssues(checked); });
|
this, [](bool checked) { disableInlineIssues(checked); });
|
||||||
m_toggleIssues = new QToolButton(m_outputWidget);
|
m_toggleIssues = new QToolButton(m_issuesWidget);
|
||||||
m_toggleIssues->setIcon(Utils::Icons::WARNING_TOOLBAR.icon());
|
m_toggleIssues->setIcon(Utils::Icons::WARNING_TOOLBAR.icon());
|
||||||
m_toggleIssues->setToolTip(Tr::tr("Show issue annotations inline"));
|
m_toggleIssues->setToolTip(Tr::tr("Show issue annotations inline"));
|
||||||
m_toggleIssues->setCheckable(true);
|
m_toggleIssues->setCheckable(true);
|
||||||
@@ -796,17 +793,17 @@ public:
|
|||||||
|
|
||||||
~AxivionOutputPane()
|
~AxivionOutputPane()
|
||||||
{
|
{
|
||||||
if (!m_outputWidget->parent())
|
if (!m_issuesWidget->parent())
|
||||||
delete m_outputWidget;
|
delete m_issuesWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *outputWidget(QWidget *parent) final
|
QWidget *outputWidget(QWidget *parent) final
|
||||||
{
|
{
|
||||||
if (m_outputWidget)
|
if (m_issuesWidget)
|
||||||
m_outputWidget->setParent(parent);
|
m_issuesWidget->setParent(parent);
|
||||||
else
|
else
|
||||||
QTC_CHECK(false);
|
QTC_CHECK(false);
|
||||||
return m_outputWidget;
|
return m_issuesWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QWidget *> toolBarWidgets() const final
|
QList<QWidget *> toolBarWidgets() const final
|
||||||
@@ -826,38 +823,27 @@ public:
|
|||||||
|
|
||||||
void handleShowIssues(const QString &kind)
|
void handleShowIssues(const QString &kind)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_outputWidget, return);
|
m_issuesWidget->updateUi(kind);
|
||||||
m_outputWidget->setCurrentIndex(0);
|
|
||||||
if (auto issues = static_cast<IssuesWidget *>(m_outputWidget->widget(0)))
|
|
||||||
issues->updateUi(kind);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleShowFilterException(const QString &errorMessage)
|
void handleShowFilterException(const QString &errorMessage)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_outputWidget, return);
|
m_issuesWidget->showOverlay(errorMessage);
|
||||||
if (auto issues = static_cast<IssuesWidget *>(m_outputWidget->widget(0)))
|
|
||||||
issues->showOverlay(errorMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void reinitDashboardList(const QString &preferredProject)
|
void reinitDashboardList(const QString &preferredProject)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_outputWidget, return);
|
m_issuesWidget->initDashboardList(preferredProject);
|
||||||
if (auto issues = static_cast<IssuesWidget *>(m_outputWidget->widget(0)))
|
|
||||||
issues->initDashboardList(preferredProject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetDashboard()
|
void resetDashboard()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_outputWidget, return);
|
m_issuesWidget->resetDashboard();
|
||||||
if (auto issues = static_cast<IssuesWidget *>(m_outputWidget->widget(0)))
|
|
||||||
issues->resetDashboard();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool handleContextMenu(const QString &issue, const ItemViewEvent &e)
|
bool handleContextMenu(const QString &issue, const ItemViewEvent &e)
|
||||||
{
|
{
|
||||||
auto issues = static_cast<IssuesWidget *>(m_outputWidget->widget(0));
|
std::optional<Dto::TableInfoDto> tableInfoOpt = m_issuesWidget->currentTableInfo();
|
||||||
std::optional<Dto::TableInfoDto> tableInfoOpt = issues ? issues->currentTableInfo()
|
|
||||||
: std::nullopt;
|
|
||||||
if (!tableInfoOpt)
|
if (!tableInfoOpt)
|
||||||
return false;
|
return false;
|
||||||
const QString baseUri = tableInfoOpt->issueBaseViewUri.value_or(QString());
|
const QString baseUri = tableInfoOpt->issueBaseViewUri.value_or(QString());
|
||||||
@@ -869,7 +855,7 @@ public:
|
|||||||
|
|
||||||
QUrl issueBaseUrl = info->source.resolved(baseUri).resolved(issue);
|
QUrl issueBaseUrl = info->source.resolved(baseUri).resolved(issue);
|
||||||
QUrl dashboardUrl = info->source.resolved(baseUri);
|
QUrl dashboardUrl = info->source.resolved(baseUri);
|
||||||
const IssueListSearch search = issues->searchFromUi();
|
const IssueListSearch search = m_issuesWidget->searchFromUi();
|
||||||
issueBaseUrl.setQuery(search.toUrlQuery(QueryMode::SimpleQuery));
|
issueBaseUrl.setQuery(search.toUrlQuery(QueryMode::SimpleQuery));
|
||||||
dashboardUrl.setQuery(search.toUrlQuery(QueryMode::FilterQuery));
|
dashboardUrl.setQuery(search.toUrlQuery(QueryMode::FilterQuery));
|
||||||
|
|
||||||
@@ -896,7 +882,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStackedWidget *m_outputWidget = nullptr;
|
IssuesWidget *m_issuesWidget = nullptr;
|
||||||
QToolButton *m_toggleIssues = nullptr;
|
QToolButton *m_toggleIssues = nullptr;
|
||||||
QToolButton *m_disableInlineIssues = nullptr;
|
QToolButton *m_disableInlineIssues = nullptr;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user