forked from qt-creator/qt-creator
CMake generation: Streamline confirmation dialog
Task-number: QDS-5991 Change-Id: I1cec8650703ca5de936739d1adbba77d0b64562e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
#include "generatecmakelistsconstants.h"
|
#include "generatecmakelistsconstants.h"
|
||||||
|
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
#include <utils/detailswidget.h>
|
||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
@@ -50,17 +51,14 @@ CmakeGeneratorDialog::CmakeGeneratorDialog(const FilePath &rootDir, const FilePa
|
|||||||
|
|
||||||
m_model = new CMakeGeneratorDialogTreeModel(rootDir, files, this);
|
m_model = new CMakeGeneratorDialogTreeModel(rootDir, files, this);
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
QVBoxLayout *dialogLayout = new QVBoxLayout(this);
|
||||||
setLayout(layout);
|
dialogLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
setLayout(dialogLayout);
|
||||||
|
|
||||||
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
|
QWidget *advancedInnerWidget = new QWidget(this);
|
||||||
|
QVBoxLayout *advancedInnerLayout = new QVBoxLayout(advancedInnerWidget);
|
||||||
auto *okButton = buttons->button(QDialogButtonBox::Ok);
|
advancedInnerWidget->setLayout(advancedInnerLayout);
|
||||||
okButton->setDefault(true);
|
advancedInnerWidget->setMinimumHeight(640);
|
||||||
|
|
||||||
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
|
||||||
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
|
||||||
connect(m_model, &CMakeGeneratorDialogTreeModel::checkedStateChanged, this, &CmakeGeneratorDialog::refreshNotificationText);
|
|
||||||
|
|
||||||
QTreeView *tree = new QTreeView(this);
|
QTreeView *tree = new QTreeView(this);
|
||||||
tree->setModel(m_model);
|
tree->setModel(m_model);
|
||||||
@@ -72,9 +70,31 @@ CmakeGeneratorDialog::CmakeGeneratorDialog(const FilePath &rootDir, const FilePa
|
|||||||
|
|
||||||
refreshNotificationText();
|
refreshNotificationText();
|
||||||
|
|
||||||
layout->addWidget(tree, 2);
|
advancedInnerLayout->addWidget(tree, 2);
|
||||||
layout->addWidget(m_notifications, 1);
|
advancedInnerLayout->addWidget(m_notifications, 1);
|
||||||
layout->addWidget(buttons);
|
|
||||||
|
DetailsWidget *advancedWidget = new DetailsWidget(this);
|
||||||
|
advancedWidget->setMinimumWidth(600);
|
||||||
|
advancedWidget->setWidget(advancedInnerWidget);
|
||||||
|
advancedWidget->setSummaryText(QCoreApplication::translate("QmlDesigner::GenerateCmake",
|
||||||
|
"Advanced Options"));
|
||||||
|
|
||||||
|
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
|
||||||
|
auto *okButton = buttons->button(QDialogButtonBox::Ok);
|
||||||
|
okButton->setDefault(true);
|
||||||
|
|
||||||
|
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
|
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
|
connect(m_model, &CMakeGeneratorDialogTreeModel::checkedStateChanged, this, &CmakeGeneratorDialog::refreshNotificationText);
|
||||||
|
|
||||||
|
QLabel *mainLabel = new QLabel(QCoreApplication::translate("QmlDesigner::GenerateCmake",
|
||||||
|
"Start CMakeFiles.txt generation"),
|
||||||
|
this);
|
||||||
|
mainLabel->setMargin(50);
|
||||||
|
|
||||||
|
dialogLayout->addWidget(mainLabel);
|
||||||
|
dialogLayout->addWidget(advancedWidget);
|
||||||
|
dialogLayout->addWidget(buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePaths CmakeGeneratorDialog::getFilePaths()
|
FilePaths CmakeGeneratorDialog::getFilePaths()
|
||||||
|
@@ -205,8 +205,6 @@ bool showConfirmationDialog(const Utils::FilePath &rootDir)
|
|||||||
files.append(file.filePath);
|
files.append(file.filePath);
|
||||||
|
|
||||||
CmakeGeneratorDialog dialog(rootDir, files);
|
CmakeGeneratorDialog dialog(rootDir, files);
|
||||||
dialog.setMinimumWidth(600);
|
|
||||||
dialog.setMinimumHeight(640);
|
|
||||||
if (dialog.exec()) {
|
if (dialog.exec()) {
|
||||||
Utils::FilePaths confirmedFiles = dialog.getFilePaths();
|
Utils::FilePaths confirmedFiles = dialog.getFilePaths();
|
||||||
removeUnconfirmedQueuedFiles(confirmedFiles);
|
removeUnconfirmedQueuedFiles(confirmedFiles);
|
||||||
|
Reference in New Issue
Block a user