forked from qt-creator/qt-creator
Docker: Inform user early if adding device fails
When retrieving the list of images there is no indicator when something failed, so add one. Change-Id: I2e0cde4ba33527e1b2abeecb5b3a06507dabf472 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -51,6 +51,7 @@
|
|||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/infolabel.h>
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/overridecursor.h>
|
#include <utils/overridecursor.h>
|
||||||
#include <utils/pathlisteditor.h>
|
#include <utils/pathlisteditor.h>
|
||||||
@@ -1859,12 +1860,19 @@ public:
|
|||||||
m_log = new QTextBrowser;
|
m_log = new QTextBrowser;
|
||||||
m_log->setVisible(false);
|
m_log->setVisible(false);
|
||||||
|
|
||||||
|
const QString fail = QString{"Docker: "}
|
||||||
|
+ QCoreApplication::translate("Debugger::Internal::GdbEngine",
|
||||||
|
"Process failed to start.");
|
||||||
|
auto errorLabel = new Utils::InfoLabel(fail, Utils::InfoLabel::Error, this);
|
||||||
|
errorLabel->setVisible(false);
|
||||||
|
|
||||||
m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
|
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
Column {
|
Column {
|
||||||
m_view,
|
m_view,
|
||||||
m_log,
|
m_log,
|
||||||
|
errorLabel,
|
||||||
m_buttons,
|
m_buttons,
|
||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
|
|
||||||
@@ -1902,6 +1910,13 @@ public:
|
|||||||
m_log->append(DockerDevice::tr("Error: %1").arg(out));
|
m_log->append(DockerDevice::tr("Error: %1").arg(out));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(m_process, &Utils::QtcProcess::finished,
|
||||||
|
this, [this, errorLabel]() {
|
||||||
|
if (m_process->exitCode() != 0) {
|
||||||
|
errorLabel->setVisible(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, [this] {
|
connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, [this] {
|
||||||
const QModelIndexList selectedRows = m_view->selectionModel()->selectedRows();
|
const QModelIndexList selectedRows = m_view->selectionModel()->selectedRows();
|
||||||
QTC_ASSERT(selectedRows.size() == 1, return);
|
QTC_ASSERT(selectedRows.size() == 1, return);
|
||||||
|
Reference in New Issue
Block a user