+void SdiWindow::Internal::MainWindow::addPanel(QString const & name, Gui::Panel * panel)
+{
+ mPanels.append(panel);
+ mPanelNames.insert(name, panel);
+
+ // If this is the predefined main panel, add it to this window
+ if (!mMainPanelName.isEmpty()) {
+ if (name == mMainPanelName) {
+ mMainPanel = panel;
+ mLayout->addWidget(panel);
+ }
+ }
+
+ // If the predefined main panel name is not set, use the first panel
+ else {
+ if (!mMainPanel) {
+ mMainPanel = panel;
+ mLayout->addWidget(panel);
+ }
+ }
+}
+
+Gui::Panel * SdiWindow::Internal::MainWindow::panel(QString const & name) const
+{
+ QHash<QString, QWeakPointer<Gui::Panel> >::const_iterator it = mPanelNames.constFind(name);
+ if (it != mPanelNames.constEnd())
+ return it.value().data();
+ return 0;
+}
+
+bool SdiWindow::Internal::MainWindow::showPanel(QString const & name)
+{
+ Gui::Panel * p = panel(name);
+ if (p) {
+ p->show();
+ return true;
+ }
+ return false;
+}
+
+void SdiWindow::Internal::MainWindow::saveSettings()