forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/6.0'
Change-Id: Ie8406c1854738cabcc85ef6ddaee7559d5227bec
This commit is contained in:
@@ -263,11 +263,13 @@ Row {
|
|||||||
// Build the combobox model
|
// Build the combobox model
|
||||||
comboBox.items.clear()
|
comboBox.items.clear()
|
||||||
|
|
||||||
for (var i = 0; i < urlChooser.defaultItems.length; ++i) {
|
if (urlChooser.defaultItems !== undefined) {
|
||||||
comboBox.items.append({
|
for (var i = 0; i < urlChooser.defaultItems.length; ++i) {
|
||||||
fullPath: urlChooser.defaultItems[i],
|
comboBox.items.append({
|
||||||
name: urlChooser.defaultItems[i]
|
fullPath: urlChooser.defaultItems[i],
|
||||||
})
|
name: urlChooser.defaultItems[i]
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var j = 0; j < fileModel.fullPathModel.length; ++j) {
|
for (var j = 0; j < fileModel.fullPathModel.length; ++j) {
|
||||||
|
@@ -79,7 +79,7 @@ static QStringList scanDirectory(const FilePath &path, const QString &prefix)
|
|||||||
QStringList result;
|
QStringList result;
|
||||||
qCDebug(cmInputLog) << "Scanning for directories matching" << prefix << "in" << path;
|
qCDebug(cmInputLog) << "Scanning for directories matching" << prefix << "in" << path;
|
||||||
|
|
||||||
foreach (const FilePath &entry, path.dirEntries({prefix + ".*"}, QDir::Dirs | QDir::NoDotAndDotDot)) {
|
foreach (const FilePath &entry, path.dirEntries({prefix + "*"}, QDir::Dirs | QDir::NoDotAndDotDot)) {
|
||||||
QTC_ASSERT(entry.isDir(), continue);
|
QTC_ASSERT(entry.isDir(), continue);
|
||||||
result.append(entry.toString());
|
result.append(entry.toString());
|
||||||
}
|
}
|
||||||
|
@@ -252,10 +252,12 @@ void LanguageClientManager::shutdown()
|
|||||||
return;
|
return;
|
||||||
qCDebug(Log) << "shutdown manager";
|
qCDebug(Log) << "shutdown manager";
|
||||||
managerInstance->m_shuttingDown = true;
|
managerInstance->m_shuttingDown = true;
|
||||||
for (Client *client : qAsConst(managerInstance->m_clients))
|
const auto clients = managerInstance->clients();
|
||||||
|
for (Client *client : clients)
|
||||||
shutdownClient(client);
|
shutdownClient(client);
|
||||||
QTimer::singleShot(3000, managerInstance, [](){
|
QTimer::singleShot(3000, managerInstance, [] {
|
||||||
for (Client *client : qAsConst(managerInstance->m_clients))
|
const auto clients = managerInstance->clients();
|
||||||
|
for (Client *client : clients)
|
||||||
deleteClient(client);
|
deleteClient(client);
|
||||||
emit managerInstance->shutdownFinished();
|
emit managerInstance->shutdownFinished();
|
||||||
});
|
});
|
||||||
|
@@ -311,7 +311,7 @@ std::pair<int, QStringList> JsonWizardFactory::screenSizeInfoFromPage(const QStr
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
const QVariantMap screenFactorDataMap = screenFactorData.toMap();
|
const QVariantMap screenFactorDataMap = screenFactorData.toMap();
|
||||||
if (not screenFactorDataMap.contains("items"))
|
if (!screenFactorDataMap.contains("items"))
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
@@ -1471,16 +1471,20 @@ void DesignerActionManager::createDefaultDesignerActions()
|
|||||||
&singleSelection,
|
&singleSelection,
|
||||||
&singleSelection));
|
&singleSelection));
|
||||||
|
|
||||||
addDesignerAction(new ModelNodeContextMenuAction(
|
const bool standaloneMode
|
||||||
goToImplementationCommandId,
|
= Core::ICore::settings()->value(DesignerSettingsKey::STANDALONE_MODE).toBool();
|
||||||
goToImplementationDisplayName,
|
|
||||||
{},
|
if (!standaloneMode) {
|
||||||
rootCategory,
|
addDesignerAction(new ModelNodeContextMenuAction(goToImplementationCommandId,
|
||||||
QKeySequence(),
|
goToImplementationDisplayName,
|
||||||
42,
|
{},
|
||||||
&goImplementation,
|
rootCategory,
|
||||||
&singleSelectedAndUiFile,
|
QKeySequence(),
|
||||||
&singleSelectedAndUiFile));
|
42,
|
||||||
|
&goImplementation,
|
||||||
|
&singleSelectedAndUiFile,
|
||||||
|
&singleSelectedAndUiFile));
|
||||||
|
}
|
||||||
|
|
||||||
addDesignerAction(new ModelNodeContextMenuAction(
|
addDesignerAction(new ModelNodeContextMenuAction(
|
||||||
addSignalHandlerCommandId,
|
addSignalHandlerCommandId,
|
||||||
@@ -1550,16 +1554,27 @@ void DesignerActionManager::createDefaultAddResourceHandler()
|
|||||||
registerAddResourceHandler(AddResourceHandler(category, ext, op));
|
registerAddResourceHandler(AddResourceHandler(category, ext, op));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Having a single image type category creates too large of a filter, so we split images into
|
||||||
|
// categories according to their mime types
|
||||||
|
const QList<QByteArray> mimeTypes = QImageReader::supportedMimeTypes();
|
||||||
auto transformer = [](const QByteArray& format) -> QString { return QString("*.") + format; };
|
auto transformer = [](const QByteArray& format) -> QString { return QString("*.") + format; };
|
||||||
auto imageFormats = Utils::transform(QImageReader::supportedImageFormats(), transformer);
|
QHash<QByteArray, QStringList> imageFormats;
|
||||||
imageFormats.push_back("*.hdr");
|
for (const auto &mimeType : mimeTypes)
|
||||||
imageFormats.push_back("*.ktx");
|
imageFormats.insert(mimeType, Utils::transform(QImageReader::imageFormatsForMimeType(mimeType), transformer));
|
||||||
|
imageFormats.insert("image/vnd.radiance", {"*.hdr"});
|
||||||
|
imageFormats.insert("image/ktx", {"*.ktx"});
|
||||||
|
|
||||||
// The filters will be displayed in reverse order to these lists in file dialog,
|
// The filters will be displayed in reverse order to these lists in file dialog,
|
||||||
// so declare most common types last
|
// so declare most common types last
|
||||||
registerHandlers(imageFormats,
|
QHash<QByteArray, QStringList>::const_iterator i = imageFormats.constBegin();
|
||||||
ModelNodeOperations::addImageToProject,
|
while (i != imageFormats.constEnd()) {
|
||||||
ComponentCoreConstants::addImagesDisplayString);
|
registerHandlers(i.value(),
|
||||||
|
ModelNodeOperations::addImageToProject,
|
||||||
|
QObject::tr("%1: %2")
|
||||||
|
.arg(ComponentCoreConstants::addImagesDisplayString)
|
||||||
|
.arg(QString::fromLatin1(i.key())));
|
||||||
|
++i;
|
||||||
|
}
|
||||||
registerHandlers({"*.otf", "*.ttf"},
|
registerHandlers({"*.otf", "*.ttf"},
|
||||||
ModelNodeOperations::addFontToProject,
|
ModelNodeOperations::addFontToProject,
|
||||||
ComponentCoreConstants::addFontsDisplayString);
|
ComponentCoreConstants::addFontsDisplayString);
|
||||||
|
@@ -635,7 +635,7 @@ void ItemLibraryWidget::addResources(const QStringList &files)
|
|||||||
return priorities.value(first) < priorities.value(second);
|
return priorities.value(first) < priorities.value(second);
|
||||||
});
|
});
|
||||||
|
|
||||||
QStringList filters { tr("All Files (%1)").arg(map.values().join(' ')) };
|
QStringList filters { tr("All Files (%1)").arg("*.*") };
|
||||||
QString filterTemplate = "%1 (%2)";
|
QString filterTemplate = "%1 (%2)";
|
||||||
for (const QString &key : qAsConst(sortedKeys))
|
for (const QString &key : qAsConst(sortedKeys))
|
||||||
filters.append(filterTemplate.arg(key, map.values(key).join(' ')));
|
filters.append(filterTemplate.arg(key, map.values(key).join(' ')));
|
||||||
@@ -676,11 +676,17 @@ void ItemLibraryWidget::addResources(const QStringList &files)
|
|||||||
AddResourceOperation operation = categoryToOperation.value(category);
|
AddResourceOperation operation = categoryToOperation.value(category);
|
||||||
QmlDesignerPlugin::emitUsageStatistics(Constants::EVENT_RESOURCE_IMPORTED + category);
|
QmlDesignerPlugin::emitUsageStatistics(Constants::EVENT_RESOURCE_IMPORTED + category);
|
||||||
if (operation) {
|
if (operation) {
|
||||||
AddFilesResult result = operation(fileNames, document->fileName().parentDir().toString());
|
AddFilesResult result = operation(fileNames,
|
||||||
|
document->fileName().parentDir().toString());
|
||||||
if (result == AddFilesResult::Failed) {
|
if (result == AddFilesResult::Failed) {
|
||||||
Core::AsynchronousMessageBox::warning(tr("Failed to Add Files"),
|
Core::AsynchronousMessageBox::warning(tr("Failed to Add Files"),
|
||||||
tr("Could not add %1 to project.").arg(fileNames.join(' ')));
|
tr("Could not add %1 to project.")
|
||||||
|
.arg(fileNames.join(' ')));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Core::AsynchronousMessageBox::warning(tr("Failed to Add Files"),
|
||||||
|
tr("Could not add %1 to project. Unsupported file format.")
|
||||||
|
.arg(fileNames.join(' ')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -231,6 +231,9 @@ void DesignModeWidget::setup()
|
|||||||
|
|
||||||
ADS::DockManager::setConfigFlags(ADS::DockManager::DefaultNonOpaqueConfig);
|
ADS::DockManager::setConfigFlags(ADS::DockManager::DefaultNonOpaqueConfig);
|
||||||
ADS::DockManager::setConfigFlag(ADS::DockManager::FocusHighlighting, true);
|
ADS::DockManager::setConfigFlag(ADS::DockManager::FocusHighlighting, true);
|
||||||
|
ADS::DockManager::setConfigFlag(ADS::DockManager::DockAreaHasCloseButton, false);
|
||||||
|
ADS::DockManager::setConfigFlag(ADS::DockManager::DockAreaHasUndockButton, false);
|
||||||
|
ADS::DockManager::setConfigFlag(ADS::DockManager::DockAreaHasTabsMenuButton, false);
|
||||||
ADS::DockManager::setConfigFlag(ADS::DockManager::OpaqueSplitterResize, true);
|
ADS::DockManager::setConfigFlag(ADS::DockManager::OpaqueSplitterResize, true);
|
||||||
ADS::DockManager::setConfigFlag(ADS::DockManager::AllTabsHaveCloseButton, true);
|
ADS::DockManager::setConfigFlag(ADS::DockManager::AllTabsHaveCloseButton, true);
|
||||||
m_dockManager = new ADS::DockManager(this);
|
m_dockManager = new ADS::DockManager(this);
|
||||||
@@ -251,10 +254,6 @@ void DesignModeWidget::setup()
|
|||||||
const QString fontName = "qtds_propertyIconFont.ttf";
|
const QString fontName = "qtds_propertyIconFont.ttf";
|
||||||
const QSize size = QSize(28, 28);
|
const QSize size = QSize(28, 28);
|
||||||
|
|
||||||
const QIcon closeIcon = Utils::StyleHelper::getIconFromIconFont(fontName, closeUnicode, 28, 28, iconColor);
|
|
||||||
const QIcon menuIcon = Utils::StyleHelper::getIconFromIconFont(fontName, menuUnicode, 28, 28, iconColor);
|
|
||||||
const QIcon undockIcon = Utils::StyleHelper::getIconFromIconFont(fontName, undockUnicode, 28, 28, iconColor);
|
|
||||||
|
|
||||||
auto tabCloseIconNormal = Utils::StyleHelper::IconFontHelper(
|
auto tabCloseIconNormal = Utils::StyleHelper::IconFontHelper(
|
||||||
closeUnicode, Theme::getColor(Theme::DStabInactiveIcon), size, QIcon::Normal, QIcon::Off);
|
closeUnicode, Theme::getColor(Theme::DStabInactiveIcon), size, QIcon::Normal, QIcon::Off);
|
||||||
auto tabCloseIconActive = Utils::StyleHelper::IconFontHelper(
|
auto tabCloseIconActive = Utils::StyleHelper::IconFontHelper(
|
||||||
@@ -268,10 +267,6 @@ void DesignModeWidget::setup()
|
|||||||
tabCloseIconFocus});
|
tabCloseIconFocus});
|
||||||
|
|
||||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::TabCloseIcon, tabsCloseIcon);
|
ADS::DockManager::iconProvider().registerCustomIcon(ADS::TabCloseIcon, tabsCloseIcon);
|
||||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaMenuIcon, menuIcon);
|
|
||||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaUndockIcon, undockIcon);
|
|
||||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaCloseIcon, closeIcon);
|
|
||||||
ADS::DockManager::iconProvider().registerCustomIcon(ADS::FloatingWidgetCloseIcon, closeIcon);
|
|
||||||
|
|
||||||
// Setup Actions and Menus
|
// Setup Actions and Menus
|
||||||
Core::ActionContainer *mview = Core::ActionManager::actionContainer(Core::Constants::M_VIEW);
|
Core::ActionContainer *mview = Core::ActionManager::actionContainer(Core::Constants::M_VIEW);
|
||||||
|
@@ -45,7 +45,7 @@ using namespace Utils;
|
|||||||
|
|
||||||
ExampleCheckout::ExampleCheckout(QObject *) {}
|
ExampleCheckout::ExampleCheckout(QObject *) {}
|
||||||
|
|
||||||
void ExampleCheckout::checkoutExample(const QUrl &url)
|
void ExampleCheckout::registerTypes()
|
||||||
{
|
{
|
||||||
FileDownloader::registerQmlType();
|
FileDownloader::registerQmlType();
|
||||||
static bool once = []() {
|
static bool once = []() {
|
||||||
@@ -55,6 +55,11 @@ void ExampleCheckout::checkoutExample(const QUrl &url)
|
|||||||
}();
|
}();
|
||||||
|
|
||||||
QTC_ASSERT(once, ;);
|
QTC_ASSERT(once, ;);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExampleCheckout::checkoutExample(const QUrl &url, const QString &tempFile, const QString &completeBaseFileName)
|
||||||
|
{
|
||||||
|
registerTypes();
|
||||||
|
|
||||||
m_dialog.reset(new QDialog(Core::ICore::dialogParent()));
|
m_dialog.reset(new QDialog(Core::ICore::dialogParent()));
|
||||||
m_dialog->setModal(true);
|
m_dialog->setModal(true);
|
||||||
@@ -80,6 +85,8 @@ void ExampleCheckout::checkoutExample(const QUrl &url)
|
|||||||
QTC_ASSERT(rootObject, qWarning() << "QML error"; return );
|
QTC_ASSERT(rootObject, qWarning() << "QML error"; return );
|
||||||
|
|
||||||
rootObject->setProperty("url", url);
|
rootObject->setProperty("url", url);
|
||||||
|
rootObject->setProperty("tempFile", tempFile);
|
||||||
|
rootObject->setProperty("completeBaseName", completeBaseFileName);
|
||||||
|
|
||||||
m_dialog->show();
|
m_dialog->show();
|
||||||
|
|
||||||
@@ -260,6 +267,7 @@ void FileExtractor::setSourceFile(QString &sourceFilePath)
|
|||||||
void FileExtractor::setArchiveName(QString &filePath)
|
void FileExtractor::setArchiveName(QString &filePath)
|
||||||
{
|
{
|
||||||
m_archiveName = filePath;
|
m_archiveName = filePath;
|
||||||
|
emit targetFolderExistsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString FileExtractor::detailedText()
|
const QString FileExtractor::detailedText()
|
||||||
|
@@ -43,18 +43,21 @@ class ExampleCheckout : public QObject
|
|||||||
public:
|
public:
|
||||||
explicit ExampleCheckout(QObject *parent = nullptr);
|
explicit ExampleCheckout(QObject *parent = nullptr);
|
||||||
|
|
||||||
Q_INVOKABLE void checkoutExample(const QUrl &url);
|
Q_INVOKABLE void checkoutExample(const QUrl &url, const QString &tempFile, const QString &completeBaseFileName);
|
||||||
|
|
||||||
QString extractionFolder() const;
|
QString extractionFolder() const;
|
||||||
|
|
||||||
~ExampleCheckout();
|
~ExampleCheckout();
|
||||||
|
|
||||||
|
static void registerTypes();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void handleCancel();
|
void handleCancel();
|
||||||
void handleAccepted();
|
void handleAccepted();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void finishedSucessfully();
|
void finishedSucessfully();
|
||||||
|
void progressChanged(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<QDialog> m_dialog;
|
std::unique_ptr<QDialog> m_dialog;
|
||||||
|
@@ -45,15 +45,18 @@ Rectangle {
|
|||||||
signal canceled
|
signal canceled
|
||||||
signal accepted
|
signal accepted
|
||||||
|
|
||||||
|
property string tempFile
|
||||||
|
property string completeBaseName
|
||||||
|
|
||||||
StackLayout {
|
StackLayout {
|
||||||
id: stackLayout
|
id: stackLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
currentIndex: 0
|
currentIndex: root.tempFile.length === 0 ? 0 : 1
|
||||||
|
|
||||||
FileExtractor {
|
FileExtractor {
|
||||||
id: fileExtractor
|
id: fileExtractor
|
||||||
sourceFile: downloader.tempFile
|
archiveName: root.completeBaseName.length === 0 ? downloader.completeBaseName : root.completeBaseName
|
||||||
archiveName: downloader.completeBaseName
|
sourceFile: root.tempFile.length === 0 ? downloader.tempFile : root.tempFile
|
||||||
}
|
}
|
||||||
|
|
||||||
FileDownloader {
|
FileDownloader {
|
||||||
|
@@ -231,11 +231,13 @@ public:
|
|||||||
Q_INVOKABLE void openExample(const QString &example,
|
Q_INVOKABLE void openExample(const QString &example,
|
||||||
const QString &formFile,
|
const QString &formFile,
|
||||||
const QString &url,
|
const QString &url,
|
||||||
const QString &explicitQmlproject)
|
const QString &explicitQmlproject,
|
||||||
|
const QString &tempFile,
|
||||||
|
const QString &completeBaseName)
|
||||||
{
|
{
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
ExampleCheckout *checkout = new ExampleCheckout;
|
ExampleCheckout *checkout = new ExampleCheckout;
|
||||||
checkout->checkoutExample(QUrl::fromUserInput(url));
|
checkout->checkoutExample(QUrl::fromUserInput(url), tempFile, completeBaseName);
|
||||||
connect(checkout,
|
connect(checkout,
|
||||||
&ExampleCheckout::finishedSucessfully,
|
&ExampleCheckout::finishedSucessfully,
|
||||||
this,
|
this,
|
||||||
@@ -631,6 +633,7 @@ WelcomeMode::WelcomeMode()
|
|||||||
setContext(Core::Context(Core::Constants::C_WELCOME_MODE));
|
setContext(Core::Context(Core::Constants::C_WELCOME_MODE));
|
||||||
|
|
||||||
QFontDatabase::addApplicationFont(":/studiofonts/TitilliumWeb-Regular.ttf");
|
QFontDatabase::addApplicationFont(":/studiofonts/TitilliumWeb-Regular.ttf");
|
||||||
|
ExampleCheckout::registerTypes();
|
||||||
|
|
||||||
m_modeWidget = new QQuickWidget;
|
m_modeWidget = new QQuickWidget;
|
||||||
m_modeWidget->setMinimumSize(1024, 768);
|
m_modeWidget->setMinimumSize(1024, 768);
|
||||||
|
@@ -154,7 +154,10 @@ FunctionHintProposalWidget::FunctionHintProposalWidget()
|
|||||||
|
|
||||||
connect(upArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::previousPage);
|
connect(upArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::previousPage);
|
||||||
connect(downArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::nextPage);
|
connect(downArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::nextPage);
|
||||||
connect(d->m_popupFrame.data(), &QObject::destroyed, this, &FunctionHintProposalWidget::abort);
|
connect(d->m_popupFrame.data(), &QObject::destroyed, this, [this](){
|
||||||
|
qApp->removeEventFilter(this);
|
||||||
|
deleteLater();
|
||||||
|
});
|
||||||
|
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
}
|
}
|
||||||
|
@@ -104,7 +104,7 @@ protected:
|
|||||||
void configureFactory(MockWizardFactory &factory, IWizardFactory::WizardKind kind,
|
void configureFactory(MockWizardFactory &factory, IWizardFactory::WizardKind kind,
|
||||||
bool requiresQtStudio = true,
|
bool requiresQtStudio = true,
|
||||||
const QPair<QString, bool> &availableOnPlatform = {},
|
const QPair<QString, bool> &availableOnPlatform = {},
|
||||||
const QPair<int, QStringList> &sizes = {})
|
const std::pair<int, QStringList> &sizes = {})
|
||||||
{
|
{
|
||||||
if (kind == IWizardFactory::ProjectWizard) {
|
if (kind == IWizardFactory::ProjectWizard) {
|
||||||
QSet<Utils::Id> supported{Utils::Id{"QmlProjectManager.QmlProject"}};
|
QSet<Utils::Id> supported{Utils::Id{"QmlProjectManager.QmlProject"}};
|
||||||
|
Reference in New Issue
Block a user