forked from qt-creator/qt-creator
QmlDesigner: Remove warning widget from DesignModeWidget
The form editor is now handling even initial warnings. There is no need for an extra warning widget in the DesignModeWidget. Change-Id: Iac85c1968e8040ee5f11435fa2876ce2d152c194 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -199,7 +199,7 @@ void DesignModeWidget::enableWidgets()
|
||||
{
|
||||
if (debug)
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
hideWarningWidget();
|
||||
|
||||
viewManager().enableWidgets();
|
||||
m_isDisabled = false;
|
||||
}
|
||||
@@ -221,20 +221,6 @@ void DesignModeWidget::switchTextOrForm()
|
||||
m_centralTabWidget->switchTo(viewManager().widget("TextEditor"));
|
||||
}
|
||||
|
||||
void DesignModeWidget::showWarningMessageBox(const QList<DocumentMessage> &warnings)
|
||||
{
|
||||
Q_ASSERT(!warnings.isEmpty());
|
||||
warningWidget()->setWarnings(warnings);
|
||||
warningWidget()->setVisible(true);
|
||||
}
|
||||
|
||||
bool DesignModeWidget::gotoCodeWasClicked()
|
||||
{
|
||||
if (m_warningWidget)
|
||||
return warningWidget()->gotoCodeWasClicked();
|
||||
return false;
|
||||
}
|
||||
|
||||
static void hideToolButtons(QList<QToolButton*> &buttons)
|
||||
{
|
||||
foreach (QToolButton *button, buttons)
|
||||
@@ -528,28 +514,6 @@ QWidget *DesignModeWidget::createCrumbleBarFrame()
|
||||
return frame;
|
||||
}
|
||||
|
||||
DocumentWarningWidget *DesignModeWidget::warningWidget()
|
||||
{
|
||||
if (m_warningWidget.isNull()) {
|
||||
m_warningWidget = new DocumentWarningWidget(this);
|
||||
connect(m_warningWidget.data(), &DocumentWarningWidget::gotoCodeClicked, [=]
|
||||
(const QString &filePath, int codeLine, int codeColumn) {
|
||||
Q_UNUSED(filePath);
|
||||
|
||||
if (currentDesignDocument() && currentDesignDocument()->textEditor())
|
||||
currentDesignDocument()->textEditor()->gotoLine(codeLine, codeColumn);
|
||||
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
|
||||
});
|
||||
}
|
||||
return m_warningWidget;
|
||||
}
|
||||
|
||||
void DesignModeWidget::hideWarningWidget()
|
||||
{
|
||||
if (m_warningWidget)
|
||||
m_warningWidget->setVisible(false);
|
||||
}
|
||||
|
||||
CrumbleBar *DesignModeWidget::crumbleBar() const
|
||||
{
|
||||
return m_crumbleBar;
|
||||
|
||||
@@ -78,9 +78,6 @@ public:
|
||||
void disableWidgets();
|
||||
void switchTextOrForm();
|
||||
|
||||
void showWarningMessageBox(const QList<DocumentMessage> &warnings);
|
||||
bool gotoCodeWasClicked();
|
||||
|
||||
CrumbleBar* crumbleBar() const;
|
||||
void showInternalTextEditor();
|
||||
|
||||
@@ -100,12 +97,9 @@ private: // functions
|
||||
void addNavigatorHistoryEntry(const Utils::FileName &fileName);
|
||||
QWidget *createCenterWidget();
|
||||
QWidget *createCrumbleBarFrame();
|
||||
DocumentWarningWidget *warningWidget();
|
||||
void hideWarningWidget();
|
||||
|
||||
private: // variables
|
||||
QSplitter *m_mainSplitter = nullptr;
|
||||
QPointer<DocumentWarningWidget> m_warningWidget;
|
||||
SwitchSplitTabWidget* m_centralTabWidget = nullptr;
|
||||
|
||||
QScopedPointer<Core::SideBar> m_leftSideBar;
|
||||
|
||||
@@ -329,13 +329,7 @@ void QmlDesignerPlugin::showDesigner()
|
||||
|
||||
void QmlDesignerPlugin::hideDesigner()
|
||||
{
|
||||
if (currentDesignDocument() && currentModel()) {
|
||||
// the message box handle the cursor jump itself
|
||||
}
|
||||
|
||||
if (d->documentManager.hasCurrentDesignDocument()) {
|
||||
if (currentModel() && !mainWidget()->gotoCodeWasClicked())
|
||||
jumpTextCursorToSelectedModelNode();
|
||||
deactivateAutoSynchronization();
|
||||
d->mainWidget->saveSettings();
|
||||
}
|
||||
@@ -417,8 +411,6 @@ void QmlDesignerPlugin::activateAutoSynchronization()
|
||||
selectModelNodeUnderTextCursor();
|
||||
|
||||
d->mainWidget->setupNavigatorHistory(currentDesignDocument()->textEditor());
|
||||
if (showWarningsForFeaturesInDesigner() && currentDesignDocument()->hasQmlParseWarnings())
|
||||
d->mainWidget->showWarningMessageBox(currentDesignDocument()->qmlParseWarnings());
|
||||
|
||||
currentDesignDocument()->updateSubcomponentManager();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user