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
|
||||
comboBox.items.clear()
|
||||
|
||||
for (var i = 0; i < urlChooser.defaultItems.length; ++i) {
|
||||
comboBox.items.append({
|
||||
fullPath: urlChooser.defaultItems[i],
|
||||
name: urlChooser.defaultItems[i]
|
||||
})
|
||||
if (urlChooser.defaultItems !== undefined) {
|
||||
for (var i = 0; i < urlChooser.defaultItems.length; ++i) {
|
||||
comboBox.items.append({
|
||||
fullPath: urlChooser.defaultItems[i],
|
||||
name: urlChooser.defaultItems[i]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
for (var j = 0; j < fileModel.fullPathModel.length; ++j) {
|
||||
|
@@ -79,7 +79,7 @@ static QStringList scanDirectory(const FilePath &path, const QString &prefix)
|
||||
QStringList result;
|
||||
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);
|
||||
result.append(entry.toString());
|
||||
}
|
||||
|
@@ -252,10 +252,12 @@ void LanguageClientManager::shutdown()
|
||||
return;
|
||||
qCDebug(Log) << "shutdown manager";
|
||||
managerInstance->m_shuttingDown = true;
|
||||
for (Client *client : qAsConst(managerInstance->m_clients))
|
||||
const auto clients = managerInstance->clients();
|
||||
for (Client *client : clients)
|
||||
shutdownClient(client);
|
||||
QTimer::singleShot(3000, managerInstance, [](){
|
||||
for (Client *client : qAsConst(managerInstance->m_clients))
|
||||
QTimer::singleShot(3000, managerInstance, [] {
|
||||
const auto clients = managerInstance->clients();
|
||||
for (Client *client : clients)
|
||||
deleteClient(client);
|
||||
emit managerInstance->shutdownFinished();
|
||||
});
|
||||
|
@@ -311,7 +311,7 @@ std::pair<int, QStringList> JsonWizardFactory::screenSizeInfoFromPage(const QStr
|
||||
return {};
|
||||
|
||||
const QVariantMap screenFactorDataMap = screenFactorData.toMap();
|
||||
if (not screenFactorDataMap.contains("items"))
|
||||
if (!screenFactorDataMap.contains("items"))
|
||||
return {};
|
||||
|
||||
bool ok = false;
|
||||
|
@@ -1471,16 +1471,20 @@ void DesignerActionManager::createDefaultDesignerActions()
|
||||
&singleSelection,
|
||||
&singleSelection));
|
||||
|
||||
addDesignerAction(new ModelNodeContextMenuAction(
|
||||
goToImplementationCommandId,
|
||||
goToImplementationDisplayName,
|
||||
{},
|
||||
rootCategory,
|
||||
QKeySequence(),
|
||||
42,
|
||||
&goImplementation,
|
||||
&singleSelectedAndUiFile,
|
||||
&singleSelectedAndUiFile));
|
||||
const bool standaloneMode
|
||||
= Core::ICore::settings()->value(DesignerSettingsKey::STANDALONE_MODE).toBool();
|
||||
|
||||
if (!standaloneMode) {
|
||||
addDesignerAction(new ModelNodeContextMenuAction(goToImplementationCommandId,
|
||||
goToImplementationDisplayName,
|
||||
{},
|
||||
rootCategory,
|
||||
QKeySequence(),
|
||||
42,
|
||||
&goImplementation,
|
||||
&singleSelectedAndUiFile,
|
||||
&singleSelectedAndUiFile));
|
||||
}
|
||||
|
||||
addDesignerAction(new ModelNodeContextMenuAction(
|
||||
addSignalHandlerCommandId,
|
||||
@@ -1550,16 +1554,27 @@ void DesignerActionManager::createDefaultAddResourceHandler()
|
||||
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 imageFormats = Utils::transform(QImageReader::supportedImageFormats(), transformer);
|
||||
imageFormats.push_back("*.hdr");
|
||||
imageFormats.push_back("*.ktx");
|
||||
QHash<QByteArray, QStringList> imageFormats;
|
||||
for (const auto &mimeType : mimeTypes)
|
||||
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,
|
||||
// so declare most common types last
|
||||
registerHandlers(imageFormats,
|
||||
ModelNodeOperations::addImageToProject,
|
||||
ComponentCoreConstants::addImagesDisplayString);
|
||||
QHash<QByteArray, QStringList>::const_iterator i = imageFormats.constBegin();
|
||||
while (i != imageFormats.constEnd()) {
|
||||
registerHandlers(i.value(),
|
||||
ModelNodeOperations::addImageToProject,
|
||||
QObject::tr("%1: %2")
|
||||
.arg(ComponentCoreConstants::addImagesDisplayString)
|
||||
.arg(QString::fromLatin1(i.key())));
|
||||
++i;
|
||||
}
|
||||
registerHandlers({"*.otf", "*.ttf"},
|
||||
ModelNodeOperations::addFontToProject,
|
||||
ComponentCoreConstants::addFontsDisplayString);
|
||||
|
@@ -635,7 +635,7 @@ void ItemLibraryWidget::addResources(const QStringList &files)
|
||||
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)";
|
||||
for (const QString &key : qAsConst(sortedKeys))
|
||||
filters.append(filterTemplate.arg(key, map.values(key).join(' ')));
|
||||
@@ -676,11 +676,17 @@ void ItemLibraryWidget::addResources(const QStringList &files)
|
||||
AddResourceOperation operation = categoryToOperation.value(category);
|
||||
QmlDesignerPlugin::emitUsageStatistics(Constants::EVENT_RESOURCE_IMPORTED + category);
|
||||
if (operation) {
|
||||
AddFilesResult result = operation(fileNames, document->fileName().parentDir().toString());
|
||||
AddFilesResult result = operation(fileNames,
|
||||
document->fileName().parentDir().toString());
|
||||
if (result == AddFilesResult::Failed) {
|
||||
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::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::AllTabsHaveCloseButton, true);
|
||||
m_dockManager = new ADS::DockManager(this);
|
||||
@@ -251,10 +254,6 @@ void DesignModeWidget::setup()
|
||||
const QString fontName = "qtds_propertyIconFont.ttf";
|
||||
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(
|
||||
closeUnicode, Theme::getColor(Theme::DStabInactiveIcon), size, QIcon::Normal, QIcon::Off);
|
||||
auto tabCloseIconActive = Utils::StyleHelper::IconFontHelper(
|
||||
@@ -268,10 +267,6 @@ void DesignModeWidget::setup()
|
||||
tabCloseIconFocus});
|
||||
|
||||
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
|
||||
Core::ActionContainer *mview = Core::ActionManager::actionContainer(Core::Constants::M_VIEW);
|
||||
|
@@ -45,7 +45,7 @@ using namespace Utils;
|
||||
|
||||
ExampleCheckout::ExampleCheckout(QObject *) {}
|
||||
|
||||
void ExampleCheckout::checkoutExample(const QUrl &url)
|
||||
void ExampleCheckout::registerTypes()
|
||||
{
|
||||
FileDownloader::registerQmlType();
|
||||
static bool once = []() {
|
||||
@@ -55,6 +55,11 @@ void ExampleCheckout::checkoutExample(const QUrl &url)
|
||||
}();
|
||||
|
||||
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->setModal(true);
|
||||
@@ -80,6 +85,8 @@ void ExampleCheckout::checkoutExample(const QUrl &url)
|
||||
QTC_ASSERT(rootObject, qWarning() << "QML error"; return );
|
||||
|
||||
rootObject->setProperty("url", url);
|
||||
rootObject->setProperty("tempFile", tempFile);
|
||||
rootObject->setProperty("completeBaseName", completeBaseFileName);
|
||||
|
||||
m_dialog->show();
|
||||
|
||||
@@ -260,6 +267,7 @@ void FileExtractor::setSourceFile(QString &sourceFilePath)
|
||||
void FileExtractor::setArchiveName(QString &filePath)
|
||||
{
|
||||
m_archiveName = filePath;
|
||||
emit targetFolderExistsChanged();
|
||||
}
|
||||
|
||||
const QString FileExtractor::detailedText()
|
||||
|
@@ -43,18 +43,21 @@ class ExampleCheckout : public QObject
|
||||
public:
|
||||
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;
|
||||
|
||||
~ExampleCheckout();
|
||||
|
||||
static void registerTypes();
|
||||
|
||||
public slots:
|
||||
void handleCancel();
|
||||
void handleAccepted();
|
||||
|
||||
signals:
|
||||
void finishedSucessfully();
|
||||
void progressChanged(int);
|
||||
|
||||
private:
|
||||
std::unique_ptr<QDialog> m_dialog;
|
||||
|
@@ -45,15 +45,18 @@ Rectangle {
|
||||
signal canceled
|
||||
signal accepted
|
||||
|
||||
property string tempFile
|
||||
property string completeBaseName
|
||||
|
||||
StackLayout {
|
||||
id: stackLayout
|
||||
anchors.fill: parent
|
||||
currentIndex: 0
|
||||
currentIndex: root.tempFile.length === 0 ? 0 : 1
|
||||
|
||||
FileExtractor {
|
||||
id: fileExtractor
|
||||
sourceFile: downloader.tempFile
|
||||
archiveName: downloader.completeBaseName
|
||||
archiveName: root.completeBaseName.length === 0 ? downloader.completeBaseName : root.completeBaseName
|
||||
sourceFile: root.tempFile.length === 0 ? downloader.tempFile : root.tempFile
|
||||
}
|
||||
|
||||
FileDownloader {
|
||||
|
@@ -231,11 +231,13 @@ public:
|
||||
Q_INVOKABLE void openExample(const QString &example,
|
||||
const QString &formFile,
|
||||
const QString &url,
|
||||
const QString &explicitQmlproject)
|
||||
const QString &explicitQmlproject,
|
||||
const QString &tempFile,
|
||||
const QString &completeBaseName)
|
||||
{
|
||||
if (!url.isEmpty()) {
|
||||
ExampleCheckout *checkout = new ExampleCheckout;
|
||||
checkout->checkoutExample(QUrl::fromUserInput(url));
|
||||
checkout->checkoutExample(QUrl::fromUserInput(url), tempFile, completeBaseName);
|
||||
connect(checkout,
|
||||
&ExampleCheckout::finishedSucessfully,
|
||||
this,
|
||||
@@ -631,6 +633,7 @@ WelcomeMode::WelcomeMode()
|
||||
setContext(Core::Context(Core::Constants::C_WELCOME_MODE));
|
||||
|
||||
QFontDatabase::addApplicationFont(":/studiofonts/TitilliumWeb-Regular.ttf");
|
||||
ExampleCheckout::registerTypes();
|
||||
|
||||
m_modeWidget = new QQuickWidget;
|
||||
m_modeWidget->setMinimumSize(1024, 768);
|
||||
|
@@ -154,7 +154,10 @@ FunctionHintProposalWidget::FunctionHintProposalWidget()
|
||||
|
||||
connect(upArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::previousPage);
|
||||
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);
|
||||
}
|
||||
|
@@ -104,7 +104,7 @@ protected:
|
||||
void configureFactory(MockWizardFactory &factory, IWizardFactory::WizardKind kind,
|
||||
bool requiresQtStudio = true,
|
||||
const QPair<QString, bool> &availableOnPlatform = {},
|
||||
const QPair<int, QStringList> &sizes = {})
|
||||
const std::pair<int, QStringList> &sizes = {})
|
||||
{
|
||||
if (kind == IWizardFactory::ProjectWizard) {
|
||||
QSet<Utils::Id> supported{Utils::Id{"QmlProjectManager.QmlProject"}};
|
||||
|
Reference in New Issue
Block a user