diff options
author | Tim Jenssen <tim.jenssen@theqtcompany.com> | 2016-05-18 17:27:45 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@theqtcompany.com> | 2016-05-20 10:29:16 +0000 |
commit | 6512227302732594d700c91588437fb94f331f83 (patch) | |
tree | c6aefba57b687c325326bf80cb69b60ac1d93f6b /src/plugins/qmldesigner/documentwarningwidget.h | |
parent | 5f45ed1c7b0667fc6d23dc4d727b004792a32178 (diff) |
QmlDesigner: merge QmlWarningDialog and DocumentWarningWidget
- fixed cases where the user got the one and the other
dialog
- not only the first error is shown, the user can browse
Task-number: QTCREATORBUG-15772
Change-Id: I27786b0e4f9c987646a69d8d7d9ff33e3702587a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmldesigner/documentwarningwidget.h')
-rw-r--r-- | src/plugins/qmldesigner/documentwarningwidget.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/plugins/qmldesigner/documentwarningwidget.h b/src/plugins/qmldesigner/documentwarningwidget.h index bd0d0d3549..7dc1990ea6 100644 --- a/src/plugins/qmldesigner/documentwarningwidget.h +++ b/src/plugins/qmldesigner/documentwarningwidget.h @@ -30,6 +30,8 @@ QT_BEGIN_NAMESPACE class QLabel; +class QCheckBox; +class QPushButton; QT_END_NAMESPACE @@ -39,22 +41,39 @@ namespace Internal { class DocumentWarningWidget : public Utils::FakeToolTip { Q_OBJECT + enum Mode{ + NoMode = -1, + ErrorMode, + WarningMode + }; public: explicit DocumentWarningWidget(QWidget *parent); - void setError(const RewriterError &error); + void setErrors(const QList<RewriterError> &errors); + void setWarnings(const QList<RewriterError> &warnings); + + bool warningsEnabled() const; signals: void gotoCodeClicked(const QString filePath, int codeLine, int codeColumn); protected: bool eventFilter(QObject *object, QEvent *event) override; void showEvent(QShowEvent *event) override; private: + void setMessages(const QList<RewriterError> &messages); void moveToParentCenter(); + void refreshContent(); + QString generateNavigateLinks(); + void ignoreCheckBoxToggled(bool b); - QLabel *m_errorMessage; - QLabel *m_goToError; - RewriterError m_error; + QLabel *m_headerLabel; + QLabel *m_messageLabel; + QLabel *m_navigateLabel; + QCheckBox *m_ignoreWarningsCheckBox; + QPushButton *m_continueButton; + QList<RewriterError> m_messages; + int m_currentMessage = 0; + Mode m_mode = NoMode; }; } // namespace Internal |