2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2010-09-23 12:37:12 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-09-23 12:37:12 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDialog>
|
2010-09-23 12:37:12 +02:00
|
|
|
|
2022-08-17 17:13:21 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
class QDialogButtonBox;
|
|
|
|
|
class QLabel;
|
|
|
|
|
class QListWidget;
|
|
|
|
|
class QPlainTextEdit;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Utils {
|
|
|
|
|
class ClassNameValidatingLineEdit;
|
|
|
|
|
class PathChooser;
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-23 15:15:01 +00:00
|
|
|
namespace QmlJSEditor {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2010-09-23 12:37:12 +02:00
|
|
|
class ComponentNameDialog : public QDialog
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-11-24 02:45:30 +01:00
|
|
|
explicit ComponentNameDialog(QWidget *parent = nullptr);
|
2010-09-23 12:37:12 +02:00
|
|
|
|
2016-09-29 15:38:29 +02:00
|
|
|
static bool go(QString *proposedName, QString *proposedPath, QString *proposedSuffix,
|
2016-04-29 10:31:21 +02:00
|
|
|
const QStringList &properties, const QStringList &sourcePreview, const QString &oldFileName,
|
|
|
|
|
QStringList *result,
|
2018-11-24 02:45:30 +01:00
|
|
|
QWidget *parent = nullptr);
|
2016-04-29 10:31:21 +02:00
|
|
|
|
|
|
|
|
void setProperties(const QStringList &properties);
|
|
|
|
|
|
|
|
|
|
QStringList propertiesToKeep() const;
|
|
|
|
|
|
|
|
|
|
void generateCodePreview();
|
2010-09-23 12:37:12 +02:00
|
|
|
|
|
|
|
|
void validate();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
QString isValid() const;
|
|
|
|
|
|
|
|
|
|
private:
|
2016-04-29 10:31:21 +02:00
|
|
|
QStringList m_sourcePreview;
|
2022-08-17 17:13:21 +02:00
|
|
|
|
|
|
|
|
Utils::ClassNameValidatingLineEdit *m_componentNameEdit;
|
|
|
|
|
QLabel *m_messageLabel;
|
|
|
|
|
Utils::PathChooser *m_pathEdit;
|
|
|
|
|
QLabel *m_label;
|
|
|
|
|
QListWidget *m_listWidget;
|
|
|
|
|
QPlainTextEdit *m_plainTextEdit;
|
|
|
|
|
QCheckBox *m_checkBox;
|
|
|
|
|
QDialogButtonBox *m_buttonBox;
|
2010-09-23 12:37:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlJSEditor
|