Commit 17b5354e authored by Friedemann Kleint's avatar Friedemann Kleint

Designer: Initially disable form preview.

Reviewed-by: default avatarKai Köhne <kai.koehne@nokia.com>
Task-number: QTCREATORBUG-1762
parent 5df0e9dc
......@@ -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
......
......@@ -44,6 +44,7 @@ class QDesignerFormWindowInterface;
class QAction;
class QActionGroup;
class QMenu;
class QSignalMapper;
class QSettings;
class QToolBar;
......@@ -122,6 +123,7 @@ private slots:
void currentEditorChanged(Core::IEditor *editor);
void toolChanged(int);
void print();
void setPreviewMenuEnabled(bool e);
void updateShortcut(QObject *command);
void closeFormEditorsForXmlEditors(QList<Core::IEditor*> editors);
......@@ -179,6 +181,7 @@ private:
QAction *m_actionPrint;
QAction *m_actionPreview;
QActionGroup *m_actionGroupPreviewInStyle;
QMenu *m_previewInStyleMenu;
QAction *m_actionAboutPlugins;
QAction *m_modeActionSeparator;
QSignalMapper *m_shortcutMapper;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment