forked from qt-creator/qt-creator
Squish: Provide error message for license issues
Change-Id: I1b3ca3aba19df2fbc2accd9ecf9e4ec2d862c6d8 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
auto squishTools = SquishTools::instance();
|
||||
connect(squishTools, &SquishTools::queryFinished, this,
|
||||
[this] (const QString &out) {
|
||||
[this] (const QString &out, const QString &) {
|
||||
SquishServerSettings s;
|
||||
s.setFromXmlOutput(out);
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
@@ -393,7 +393,7 @@ SquishServerSettingsWidget::SquishServerSettingsWidget(QWidget *parent)
|
||||
// query settings
|
||||
SquishTools *squishTools = SquishTools::instance();
|
||||
connect(squishTools, &SquishTools::queryFinished, this,
|
||||
[this, progress] (const QString &out) {
|
||||
[this, progress] (const QString &out, const QString &) {
|
||||
m_serverSettings.setFromXmlOutput(out);
|
||||
m_originalSettings.setFromXmlOutput(out);
|
||||
repopulateApplicationView();
|
||||
|
@@ -521,6 +521,7 @@ void SquishTools::startSquishServer(Request request)
|
||||
{
|
||||
if (m_shutdownInitiated)
|
||||
return;
|
||||
m_licenseIssues = false;
|
||||
QTC_ASSERT(m_perspective.perspectiveMode() != SquishPerspective::NoMode, return);
|
||||
m_request = request;
|
||||
if (m_serverProcess.state() != QProcess::NotRunning) {
|
||||
@@ -683,7 +684,9 @@ void SquishTools::onRunnerFinished()
|
||||
{
|
||||
qCDebug(LOG) << "Runner finished";
|
||||
if (m_request == RunnerQueryRequested) {
|
||||
emit queryFinished(m_fullRunnerOutput);
|
||||
const QString error = m_licenseIssues ? Tr::tr("Could not get Squish license from server.")
|
||||
: QString();
|
||||
emit queryFinished(m_fullRunnerOutput, error);
|
||||
setState(RunnerStopped);
|
||||
m_fullRunnerOutput.clear();
|
||||
return;
|
||||
@@ -894,6 +897,9 @@ void SquishTools::onRunnerErrorOutput()
|
||||
"squishserver settings.\n"
|
||||
"(Tools > Squish > Server Settings...)")
|
||||
.arg(m_suiteConf.aut()));
|
||||
} else if (trimmed.startsWith("Couldn't get license")
|
||||
|| trimmed.contains("UNLICENSED version of Squish")) {
|
||||
m_licenseIssues = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ signals:
|
||||
void squishTestRunStarted();
|
||||
void squishTestRunFinished();
|
||||
void resultOutputCreated(const QByteArray &output);
|
||||
void queryFinished(const QString &output);
|
||||
void queryFinished(const QString &output, const QString &error);
|
||||
void configChangesFailed(QProcess::ProcessError error);
|
||||
void configChangesWritten();
|
||||
void localsUpdated(const QString &output);
|
||||
@@ -163,6 +163,7 @@ private:
|
||||
int m_autId = 0;
|
||||
bool m_shutdownInitiated = false;
|
||||
bool m_closeRunnerOnEndRecord = false;
|
||||
bool m_licenseIssues = false;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -127,7 +127,7 @@ void SquishToolkitsPage::fetchServerSettings()
|
||||
QTC_ASSERT(squishTools, return);
|
||||
|
||||
connect(squishTools, &SquishTools::queryFinished, this,
|
||||
[this] (const QString &out) {
|
||||
[this] (const QString &out, const QString &error) {
|
||||
SquishServerSettings s;
|
||||
s.setFromXmlOutput(out);
|
||||
QApplication::restoreOverrideCursor();
|
||||
@@ -143,6 +143,11 @@ void SquishToolkitsPage::fetchServerSettings()
|
||||
}
|
||||
}
|
||||
m_hiddenLineEdit->setText(s.mappedAuts.keys().join('\n'));
|
||||
|
||||
if (!error.isEmpty()) {
|
||||
m_errorLabel->setText(error);
|
||||
m_errorLabel->setVisible(true);
|
||||
}
|
||||
});
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
squishTools->queryServerSettings();
|
||||
|
Reference in New Issue
Block a user