Merge remote-tracking branch 'origin/4.13' into 4.14

Change-Id: Ifa2e1ced939e1d049ba6de667b31ab9945094b87
This commit is contained in:
Orgad Shaneh
2020-10-12 14:55:54 +03:00
4 changed files with 70 additions and 3 deletions

View File

@@ -477,6 +477,7 @@ void BuildManager::finish()
{ {
const QString elapsedTime = Utils::formatElapsedTime(d->m_elapsed.elapsed()); const QString elapsedTime = Utils::formatElapsedTime(d->m_elapsed.elapsed());
m_instance->addToOutputWindow(elapsedTime, BuildStep::OutputFormat::NormalMessage); m_instance->addToOutputWindow(elapsedTime, BuildStep::OutputFormat::NormalMessage);
d->m_outputWindow->flush();
QApplication::alert(ICore::dialogParent(), 3000); QApplication::alert(ICore::dialogParent(), 3000);
} }
@@ -696,7 +697,7 @@ void BuildManager::nextStep()
} }
static const auto finishedHandler = [](bool success) { static const auto finishedHandler = [](bool success) {
d->m_outputWindow->outputFormatter()->flush(); d->m_outputWindow->flush();
d->m_lastStepSucceeded = success; d->m_lastStepSucceeded = success;
disconnect(d->m_currentBuildStep, nullptr, instance(), nullptr); disconnect(d->m_currentBuildStep, nullptr, instance(), nullptr);
BuildManager::nextBuildQueue(); BuildManager::nextBuildQueue();

View File

@@ -286,6 +286,7 @@ bool FormEditorItem::flowHitTest(const QPointF & ) const
void FormEditorItem::setFrameColor(const QColor &color) void FormEditorItem::setFrameColor(const QColor &color)
{ {
m_frameColor = color; m_frameColor = color;
update();
} }
FormEditorItem::~FormEditorItem() FormEditorItem::~FormEditorItem()

View File

@@ -38,6 +38,7 @@
#include <utils/outputformatter.h> #include <utils/outputformatter.h>
#include <utils/utilsicons.h> #include <utils/utilsicons.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/qtcolorbutton.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <extensionsystem/pluginspec.h> #include <extensionsystem/pluginspec.h>
@@ -94,6 +95,11 @@ namespace QmlPreview {
QmlDebugTranslationWidget::QmlDebugTranslationWidget(QWidget *parent, TestLanguageGetter languagesGetterMethod) QmlDebugTranslationWidget::QmlDebugTranslationWidget(QWidget *parent, TestLanguageGetter languagesGetterMethod)
: QWidget(parent) : QWidget(parent)
, m_testLanguagesGetter(languagesGetterMethod) , m_testLanguagesGetter(languagesGetterMethod)
, m_warningColor(Qt::red)
//, m_foundTrColor(Qt::green) // invalid color -> init without the frame
, m_lastWarningColor(m_warningColor)
, m_lastfoundTrColor(Qt::green)
{ {
auto mainLayout = new QVBoxLayout(this); auto mainLayout = new QVBoxLayout(this);
@@ -121,12 +127,54 @@ QmlDebugTranslationWidget::QmlDebugTranslationWidget(QWidget *parent, TestLangua
m_selectLanguageLayout = new QHBoxLayout; m_selectLanguageLayout = new QHBoxLayout;
mainLayout->addLayout(m_selectLanguageLayout); mainLayout->addLayout(m_selectLanguageLayout);
auto settingsLayout = new QHBoxLayout();
mainLayout->addLayout(settingsLayout);
auto elideWarningCheckBox = new QCheckBox(tr("Enable elide warning")); auto elideWarningCheckBox = new QCheckBox(tr("Enable elide warning"));
layout()->addWidget(elideWarningCheckBox);
connect(elideWarningCheckBox, &QCheckBox::stateChanged, [this] (int state) { connect(elideWarningCheckBox, &QCheckBox::stateChanged, [this] (int state) {
m_elideWarning = (state == Qt::Checked); m_elideWarning = (state == Qt::Checked);
}); });
settingsLayout->addWidget(elideWarningCheckBox);
auto warningColorCheckbox = new QCheckBox(tr("select Warning color: "));
settingsLayout->addWidget(warningColorCheckbox);
auto warningColorButton = new Utils::QtColorButton();
connect(warningColorCheckbox, &QCheckBox::stateChanged, [warningColorButton, this] (int state) {
if (state == Qt::Checked) {
warningColorButton->setColor(m_lastWarningColor);
warningColorButton->setEnabled(true);
} else {
m_lastWarningColor = warningColorButton->color();
warningColorButton->setColor({});
warningColorButton->setEnabled(false);
}
});
connect(warningColorButton, &Utils::QtColorButton::colorChanged, [this](const QColor &color) {
m_warningColor = color;
});
warningColorCheckbox->setCheckState(Qt::Checked);
settingsLayout->addWidget(warningColorButton);
auto foundTrColorCheckbox = new QCheckBox(tr("select found 'tr' color: "));
settingsLayout->addWidget(foundTrColorCheckbox);
auto foundTrColorButton = new Utils::QtColorButton();
foundTrColorButton->setDisabled(true);
connect(foundTrColorCheckbox, &QCheckBox::stateChanged, [foundTrColorButton, this] (int state) {
if (state == Qt::Checked) {
foundTrColorButton->setColor(m_lastfoundTrColor);
foundTrColorButton->setEnabled(true);
} else {
m_lastfoundTrColor = foundTrColorButton->color();
foundTrColorButton->setColor({});
foundTrColorButton->setEnabled(false);
}
});
connect(foundTrColorButton, &Utils::QtColorButton::colorChanged, [this](const QColor &color) {
m_foundTrColor = color;
});
settingsLayout->addWidget(foundTrColorButton);
settingsLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
auto controlLayout = new QHBoxLayout; auto controlLayout = new QHBoxLayout;
mainLayout->addLayout(controlLayout); mainLayout->addLayout(controlLayout);
@@ -232,6 +280,16 @@ void QmlDebugTranslationWidget::updateStartupProjectTranslations()
updateCurrentTranslations(ProjectExplorer::SessionManager::startupProject()); updateCurrentTranslations(ProjectExplorer::SessionManager::startupProject());
} }
QColor QmlDebugTranslationWidget::warningColor()
{
return m_warningColor;
}
QColor QmlDebugTranslationWidget::foundTrColor()
{
return m_foundTrColor;
}
void QmlDebugTranslationWidget::updateCurrentTranslations(ProjectExplorer::Project *project) void QmlDebugTranslationWidget::updateCurrentTranslations(ProjectExplorer::Project *project)
{ {
m_testLanguages.clear(); m_testLanguages.clear();

View File

@@ -63,6 +63,9 @@ public:
void setCurrentFile(const Utils::FilePath &filepath); void setCurrentFile(const Utils::FilePath &filepath);
void setFiles(const Utils::FilePaths &filePathes); void setFiles(const Utils::FilePaths &filePathes);
void updateStartupProjectTranslations(); void updateStartupProjectTranslations();
QColor warningColor();
QColor foundTrColor();
private: private:
void updateCurrentEditor(const Core::IEditor *editor); void updateCurrentEditor(const Core::IEditor *editor);
void updateCurrentTranslations(ProjectExplorer::Project *project); void updateCurrentTranslations(ProjectExplorer::Project *project);
@@ -98,6 +101,10 @@ private:
QHBoxLayout *m_selectLanguageLayout; QHBoxLayout *m_selectLanguageLayout;
TestLanguageGetter m_testLanguagesGetter; TestLanguageGetter m_testLanguagesGetter;
QColor m_warningColor;
QColor m_foundTrColor;
QColor m_lastWarningColor;
QColor m_lastfoundTrColor;
}; };
} // namespace QmlPreview } // namespace QmlPreview