Commit 8d384fc6 authored by Friedemann Kleint's avatar Friedemann Kleint

Fix QSettings keys of FancyMainWindow in QtCreator.ini.

Do not use localized Window Titles. Use objectName
or default to dockWidget<n>".

Task-number: QTCREATORBUG-1059
parent a8eb7172
......@@ -65,8 +65,14 @@ FancyMainWindow::~FancyMainWindow()
QDockWidget *FancyMainWindow::addDockForWidget(QWidget *widget)
{
QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), this);
dockWidget->setObjectName(widget->windowTitle());
dockWidget->setWidget(widget);
// Set an object name to be used in settings, derive from widget name
const QString objectName = widget->objectName();
if (objectName.isEmpty()) {
dockWidget->setObjectName(QLatin1String("dockWidget") + QString::number(d->m_dockWidgets.size() + 1));
} else {
dockWidget->setObjectName(objectName + QLatin1String("DockWidget"));
}
connect(dockWidget->toggleViewAction(), SIGNAL(triggered()),
this, SLOT(onDockActionTriggered()), Qt::QueuedConnection);
connect(dockWidget, SIGNAL(visibilityChanged(bool)),
......@@ -172,7 +178,7 @@ void FancyMainWindow::saveSettings(QSettings *settings) const
}
}
void FancyMainWindow::restoreSettings(QSettings *settings)
void FancyMainWindow::restoreSettings(const QSettings *settings)
{
QHash<QString, QVariant> hash;
foreach (const QString &key, settings->childKeys()) {
......
......@@ -50,6 +50,8 @@ public:
explicit FancyMainWindow(QWidget *parent = 0);
virtual ~FancyMainWindow();
/* The widget passed in should have an objectname set
* which will then be used as key for QSettings. */
QDockWidget *addDockForWidget(QWidget *widget);
QList<QDockWidget *> dockWidgets() const;
......@@ -57,7 +59,7 @@ public:
bool isLocked() const;
void saveSettings(QSettings *settings) const;
void restoreSettings(QSettings *settings);
void restoreSettings(const QSettings *settings);
QHash<QString, QVariant> saveSettings() const;
void restoreSettings(const QHash<QString, QVariant> &settings);
......
......@@ -364,15 +364,26 @@ void DebuggerManager::init()
d->m_statusLabel->setMinimumSize(QSize(30, 10));
d->m_breakWindow = new BreakWindow(this);
d->m_breakWindow->setObjectName(QLatin1String("CppDebugBreakpoints"));
d->m_modulesWindow = new ModulesWindow(this);
d->m_modulesWindow->setObjectName(QLatin1String("CppDebugModules"));
d->m_outputWindow = new DebuggerOutputWindow;
d->m_outputWindow->setObjectName(QLatin1String("CppDebugOutput"));
d->m_registerWindow = new RegisterWindow(this);
d->m_registerWindow->setObjectName(QLatin1String("CppDebugRegisters"));
d->m_snapshotWindow = new SnapshotWindow(this);
d->m_snapshotWindow->setObjectName(QLatin1String("CppDebugSnapshots"));
d->m_stackWindow = new StackWindow(this);
d->m_stackWindow->setObjectName(QLatin1String("CppDebugStack"));
d->m_sourceFilesWindow = new SourceFilesWindow;
d->m_sourceFilesWindow->setObjectName(QLatin1String("CppDebugSources"));
d->m_threadsWindow = new ThreadsWindow;
d->m_threadsWindow->setObjectName(QLatin1String("CppDebugThreads"));
d->m_localsWindow = new WatchWindow(WatchWindow::LocalsType, this);
d->m_localsWindow->setObjectName(QLatin1String("CppDebugLocals"));
d->m_watchersWindow = new WatchWindow(WatchWindow::WatchersType, this);
d->m_watchersWindow->setObjectName(QLatin1String("CppDebugWatchers"));
d->m_statusTimer = new QTimer(this);
d->m_mainWindow = qobject_cast<Debugger::Internal::DebuggerMainWindow*>(DebuggerUISwitcher::instance()->mainWindow());
......@@ -598,6 +609,7 @@ void DebuggerManager::init()
d->m_threadsDock = uiSwitcher->createDockWidget(LANG_CPP, d->m_threadsWindow);
QSplitter *localsAndWatchers = new Core::MiniSplitter(Qt::Vertical);
localsAndWatchers->setObjectName(QLatin1String("CppDebugLocalsAndWatchers"));
localsAndWatchers->setWindowTitle(d->m_localsWindow->windowTitle());
localsAndWatchers->addWidget(d->m_localsWindow);
localsAndWatchers->addWidget(d->m_watchersWindow);
......
......@@ -347,25 +347,30 @@ void FormEditorW::initDesignerSubWindows()
QDesignerWidgetBoxInterface *wb = QDesignerComponents::createWidgetBox(m_formeditor, 0);
wb->setWindowTitle(tr("Widget Box"));
wb->setObjectName(QLatin1String("WidgetBox"));
m_formeditor->setWidgetBox(wb);
m_designerSubWindows[WidgetBoxSubWindow] = wb;
QDesignerObjectInspectorInterface *oi = QDesignerComponents::createObjectInspector(m_formeditor, 0);
oi->setWindowTitle(tr("Object Inspector"));
oi->setObjectName(QLatin1String("ObjectInspector"));
m_formeditor->setObjectInspector(oi);
m_designerSubWindows[ObjectInspectorSubWindow] = oi;
QDesignerPropertyEditorInterface *pe = QDesignerComponents::createPropertyEditor(m_formeditor, 0);
pe->setWindowTitle(tr("Property Editor"));
pe->setObjectName(QLatin1String("PropertyEditor"));
m_formeditor->setPropertyEditor(pe);
m_designerSubWindows[PropertyEditorSubWindow] = pe;
QWidget *se = QDesignerComponents::createSignalSlotEditor(m_formeditor, 0);
se->setWindowTitle(tr("Signals && Slots Editor"));
se->setObjectName(QLatin1String("SignalsAndSlotsEditor"));
m_designerSubWindows[SignalSlotEditorSubWindow] = se;
QDesignerActionEditorInterface *ae = QDesignerComponents::createActionEditor(m_formeditor, 0);
ae->setWindowTitle(tr("Action Editor"));
ae->setObjectName(QLatin1String("ActionEditor"));
m_formeditor->setActionEditor(ae);
m_designerSubWindows[ActionEditorSubWindow] = ae;
}
......
......@@ -176,6 +176,7 @@ QmlInspector::QmlInspector(QObject *parent)
m_propertiesWidget = new Internal::ObjectPropertiesView;
m_watchTableView = new Internal::WatchTableView(m_watchTableModel);
m_frameRateWidget = new Internal::CanvasFrameRate;
m_frameRateWidget->setObjectName(QLatin1String("QmlDebugFrameRate"));
m_expressionWidget = new Internal::ExpressionQueryWidget(Internal::ExpressionQueryWidget::SeparateEntryMode);
}
......@@ -315,6 +316,7 @@ void QmlInspector::createDockWidgets()
treeOptionBarLayout->addWidget(m_engineSpinBox);
QWidget *treeWindow = new QWidget;
treeWindow->setObjectName(QLatin1String("QmlDebugTree"));
treeWindow->setWindowTitle(tr("Object Tree"));
QVBoxLayout *treeWindowLayout = new QVBoxLayout(treeWindow);
treeWindowLayout->setMargin(0);
......@@ -358,6 +360,7 @@ void QmlInspector::createDockWidgets()
leftSplitter->setStretchFactor(1, 1);
Core::MiniSplitter *propSplitter = new Core::MiniSplitter(Qt::Horizontal);
propSplitter->setObjectName(QLatin1String("QmlDebugProperties"));
propSplitter->addWidget(leftSplitter);
propSplitter->addWidget(m_expressionWidget);
propSplitter->setStretchFactor(0, 2);
......@@ -367,6 +370,7 @@ void QmlInspector::createDockWidgets()
InspectorOutputWidget *inspectorOutput = new InspectorOutputWidget();
inspectorOutput->setObjectName(QLatin1String("QmlDebugInspectorOutput"));
connect(this, SIGNAL(statusMessage(QString)),
inspectorOutput, SLOT(addInspectorStatus(QString)));
......
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