forked from qt-creator/qt-creator
Show build and search progress detail also in status bar.
A widget specifically layouted for the status bar can now be registered with the progress information. The newest one is made visible next to the summary progress bar. If a newer one vanishes, the older becomes visible again. Change-Id: Iedf0e88a542ea442ae86fa51c792c68fbc6eef3c Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -42,17 +42,27 @@
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
|
||||
BuildProgress::BuildProgress(TaskWindow *taskWindow)
|
||||
: m_errorIcon(new QLabel),
|
||||
BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation)
|
||||
: m_contentWidget(new QWidget),
|
||||
m_errorIcon(new QLabel),
|
||||
m_warningIcon(new QLabel),
|
||||
m_errorLabel(new QLabel),
|
||||
m_warningLabel(new QLabel),
|
||||
m_taskWindow(taskWindow)
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
QHBoxLayout *contentLayout = new QHBoxLayout;
|
||||
contentLayout->setContentsMargins(0, 0, 0, 0);
|
||||
contentLayout->setSpacing(0);
|
||||
setLayout(contentLayout);
|
||||
contentLayout->addWidget(m_contentWidget);
|
||||
QBoxLayout *layout;
|
||||
if (orientation == Qt::Horizontal)
|
||||
layout = new QHBoxLayout;
|
||||
else
|
||||
layout = new QVBoxLayout;
|
||||
layout->setContentsMargins(8, 2, 0, 2);
|
||||
layout->setSpacing(2);
|
||||
setLayout(layout);
|
||||
m_contentWidget->setLayout(layout);
|
||||
QHBoxLayout *errorLayout = new QHBoxLayout;
|
||||
errorLayout->setSpacing(2);
|
||||
layout->addLayout(errorLayout);
|
||||
@@ -78,7 +88,7 @@ BuildProgress::BuildProgress(TaskWindow *taskWindow)
|
||||
m_errorIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_error.png")));
|
||||
m_warningIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
|
||||
|
||||
hide();
|
||||
m_contentWidget->hide();
|
||||
|
||||
connect(m_taskWindow, SIGNAL(tasksChanged()), this, SLOT(updateState()));
|
||||
}
|
||||
@@ -105,5 +115,5 @@ void BuildProgress::updateState()
|
||||
m_warningLabel->setVisible(haveWarnings);
|
||||
m_errorIcon->setVisible(haveErrors);
|
||||
m_errorLabel->setVisible(haveErrors);
|
||||
setVisible(haveWarnings || haveErrors);
|
||||
m_contentWidget->setVisible(haveWarnings || haveErrors);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user