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_actionPrint(0),
|
||||||
m_actionPreview(0),
|
m_actionPreview(0),
|
||||||
m_actionGroupPreviewInStyle(0),
|
m_actionGroupPreviewInStyle(0),
|
||||||
|
m_previewInStyleMenu(0),
|
||||||
m_actionAboutPlugins(0),
|
m_actionAboutPlugins(0),
|
||||||
m_shortcutMapper(new QSignalMapper(this)),
|
m_shortcutMapper(new QSignalMapper(this)),
|
||||||
m_context(0),
|
m_context(0),
|
||||||
@@ -533,7 +534,10 @@ void FormEditorW::setupActions()
|
|||||||
|
|
||||||
// Preview in style...
|
// Preview in style...
|
||||||
m_actionGroupPreviewInStyle = m_fwm->actionGroupPreviewInStyle();
|
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
|
// Form settings
|
||||||
createSeparator(this, am, m_contexts, medit, QLatin1String("FormEditor.Edit.Separator2"), Core::Constants::G_EDIT_OTHER);
|
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;
|
return menuPreviewStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FormEditorW::setPreviewMenuEnabled(bool e)
|
||||||
|
{
|
||||||
|
m_actionPreview->setEnabled(e);
|
||||||
|
m_previewInStyleMenu->setEnabled(e);
|
||||||
|
}
|
||||||
|
|
||||||
void FormEditorW::saveSettings(QSettings *s)
|
void FormEditorW::saveSettings(QSettings *s)
|
||||||
{
|
{
|
||||||
s->beginGroup(settingsGroup);
|
s->beginGroup(settingsGroup);
|
||||||
@@ -731,8 +741,7 @@ void FormEditorW::activeFormWindowChanged(QDesignerFormWindowInterface *afw)
|
|||||||
qDebug() << Q_FUNC_INFO << afw << " of " << m_fwm->formWindowCount();
|
qDebug() << Q_FUNC_INFO << afw << " of " << m_fwm->formWindowCount();
|
||||||
|
|
||||||
m_fwm->closeAllPreviews();
|
m_fwm->closeAllPreviews();
|
||||||
m_actionPreview->setEnabled(afw != 0);
|
setPreviewMenuEnabled(afw != 0);
|
||||||
m_actionGroupPreviewInStyle->setEnabled(afw != 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorData FormEditorW::activeEditor() const
|
EditorData FormEditorW::activeEditor() const
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class QDesignerFormWindowInterface;
|
|||||||
|
|
||||||
class QAction;
|
class QAction;
|
||||||
class QActionGroup;
|
class QActionGroup;
|
||||||
|
class QMenu;
|
||||||
class QSignalMapper;
|
class QSignalMapper;
|
||||||
class QSettings;
|
class QSettings;
|
||||||
class QToolBar;
|
class QToolBar;
|
||||||
@@ -122,6 +123,7 @@ private slots:
|
|||||||
void currentEditorChanged(Core::IEditor *editor);
|
void currentEditorChanged(Core::IEditor *editor);
|
||||||
void toolChanged(int);
|
void toolChanged(int);
|
||||||
void print();
|
void print();
|
||||||
|
void setPreviewMenuEnabled(bool e);
|
||||||
|
|
||||||
void updateShortcut(QObject *command);
|
void updateShortcut(QObject *command);
|
||||||
void closeFormEditorsForXmlEditors(QList<Core::IEditor*> editors);
|
void closeFormEditorsForXmlEditors(QList<Core::IEditor*> editors);
|
||||||
@@ -179,6 +181,7 @@ private:
|
|||||||
QAction *m_actionPrint;
|
QAction *m_actionPrint;
|
||||||
QAction *m_actionPreview;
|
QAction *m_actionPreview;
|
||||||
QActionGroup *m_actionGroupPreviewInStyle;
|
QActionGroup *m_actionGroupPreviewInStyle;
|
||||||
|
QMenu *m_previewInStyleMenu;
|
||||||
QAction *m_actionAboutPlugins;
|
QAction *m_actionAboutPlugins;
|
||||||
QAction *m_modeActionSeparator;
|
QAction *m_modeActionSeparator;
|
||||||
QSignalMapper *m_shortcutMapper;
|
QSignalMapper *m_shortcutMapper;
|
||||||
|
|||||||
Reference in New Issue
Block a user