forked from qt-creator/qt-creator
Designer: Initially disable form preview.
Reviewed-by: Kai Köhne <kai.koehne@nokia.com> Task-number: QTCREATORBUG-1762
This commit is contained in:
@@ -152,6 +152,7 @@ FormEditorW::FormEditorW() :
|
||||
m_actionPrint(0),
|
||||
m_actionPreview(0),
|
||||
m_actionGroupPreviewInStyle(0),
|
||||
m_previewInStyleMenu(0),
|
||||
m_actionAboutPlugins(0),
|
||||
m_shortcutMapper(new QSignalMapper(this)),
|
||||
m_context(0),
|
||||
@@ -533,7 +534,10 @@ void FormEditorW::setupActions()
|
||||
|
||||
// Preview in style...
|
||||
m_actionGroupPreviewInStyle = m_fwm->actionGroupPreviewInStyle();
|
||||
mformtools->addMenu(createPreviewStyleMenu(am, m_actionGroupPreviewInStyle));
|
||||
Core::ActionContainer *previewAC = createPreviewStyleMenu(am, m_actionGroupPreviewInStyle);
|
||||
m_previewInStyleMenu = previewAC->menu();
|
||||
mformtools->addMenu(previewAC);
|
||||
setPreviewMenuEnabled(false);
|
||||
|
||||
// Form settings
|
||||
createSeparator(this, am, m_contexts, medit, QLatin1String("FormEditor.Edit.Separator2"), Core::Constants::G_EDIT_OTHER);
|
||||
@@ -608,6 +612,12 @@ Core::ActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManager *
|
||||
return menuPreviewStyle;
|
||||
}
|
||||
|
||||
void FormEditorW::setPreviewMenuEnabled(bool e)
|
||||
{
|
||||
m_actionPreview->setEnabled(e);
|
||||
m_previewInStyleMenu->setEnabled(e);
|
||||
}
|
||||
|
||||
void FormEditorW::saveSettings(QSettings *s)
|
||||
{
|
||||
s->beginGroup(settingsGroup);
|
||||
@@ -731,8 +741,7 @@ void FormEditorW::activeFormWindowChanged(QDesignerFormWindowInterface *afw)
|
||||
qDebug() << Q_FUNC_INFO << afw << " of " << m_fwm->formWindowCount();
|
||||
|
||||
m_fwm->closeAllPreviews();
|
||||
m_actionPreview->setEnabled(afw != 0);
|
||||
m_actionGroupPreviewInStyle->setEnabled(afw != 0);
|
||||
setPreviewMenuEnabled(afw != 0);
|
||||
}
|
||||
|
||||
EditorData FormEditorW::activeEditor() const
|
||||
|
||||
Reference in New Issue
Block a user