2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2010-03-05 11:25:49 +01:00
|
|
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Nokia.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "projectwindow.h"
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
#include "doubletabwidget.h"
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
#include "project.h"
|
2009-09-29 11:39:55 +02:00
|
|
|
#include "environment.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "projectexplorer.h"
|
|
|
|
|
#include "projectexplorerconstants.h"
|
|
|
|
|
#include "iprojectproperties.h"
|
|
|
|
|
#include "session.h"
|
2010-02-08 15:50:06 +01:00
|
|
|
#include "target.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "projecttreewidget.h"
|
2009-09-17 13:59:10 +02:00
|
|
|
#include "runconfiguration.h"
|
2009-09-21 17:54:02 +02:00
|
|
|
#include "buildconfiguration.h"
|
2010-02-08 15:50:06 +01:00
|
|
|
#include "buildsettingspropertiespage.h"
|
|
|
|
|
#include "runsettingspropertiespage.h"
|
|
|
|
|
#include "targetsettingspanel.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include <coreplugin/minisplitter.h>
|
|
|
|
|
#include <coreplugin/fileiconprovider.h>
|
|
|
|
|
#include <coreplugin/icore.h>
|
2009-09-29 11:39:55 +02:00
|
|
|
#include <coreplugin/ifile.h>
|
2009-01-19 12:39:20 +01:00
|
|
|
#include <extensionsystem/pluginmanager.h>
|
2009-11-30 16:23:28 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2009-07-16 17:34:04 +02:00
|
|
|
#include <utils/styledbar.h>
|
2009-09-29 18:06:13 +02:00
|
|
|
#include <utils/stylehelper.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2008-12-10 16:48:28 +01:00
|
|
|
#include <QtGui/QApplication>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <QtGui/QBoxLayout>
|
|
|
|
|
#include <QtGui/QComboBox>
|
2009-07-10 14:54:46 +02:00
|
|
|
#include <QtGui/QScrollArea>
|
2009-07-16 15:33:19 +02:00
|
|
|
#include <QtGui/QLabel>
|
2009-09-17 13:59:10 +02:00
|
|
|
#include <QtGui/QPainter>
|
|
|
|
|
#include <QtGui/QPaintEvent>
|
2009-09-29 18:06:13 +02:00
|
|
|
#include <QtGui/QMenu>
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace ProjectExplorer::Internal;
|
|
|
|
|
|
|
|
|
|
namespace {
|
2009-11-25 16:01:46 +01:00
|
|
|
const int ICON_SIZE(64);
|
2009-11-30 16:23:28 +01:00
|
|
|
|
|
|
|
|
const int ABOVE_HEADING_MARGIN(10);
|
|
|
|
|
const int ABOVE_CONTENTS_MARGIN(4);
|
|
|
|
|
const int BELOW_CONTENTS_MARGIN(16);
|
2010-02-08 15:50:06 +01:00
|
|
|
|
|
|
|
|
bool skipPanelFactory(Project *project, IPanelFactory *factory)
|
|
|
|
|
{
|
|
|
|
|
bool simplifyTargets(project->supportedTargetIds().count() <= 1);
|
|
|
|
|
if (simplifyTargets) {
|
|
|
|
|
// Do not show the targets list:
|
|
|
|
|
if (factory->id() == QLatin1String(TARGETSETTINGS_PANEL_ID))
|
|
|
|
|
return true;
|
|
|
|
|
// Skip build settigns if none are available anyway:
|
|
|
|
|
if (project->activeTarget() &&
|
|
|
|
|
!project->activeTarget()->buildConfigurationFactory() &&
|
|
|
|
|
factory->id() == QLatin1String(BUILDSETTINGS_PANEL_ID))
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
// Skip panels embedded into the targets panel:
|
|
|
|
|
if (factory->id() == QLatin1String(BUILDSETTINGS_PANEL_ID) ||
|
|
|
|
|
factory->id() == QLatin1String(RUNSETTINGS_PANEL_ID))
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
} // namespace
|
|
|
|
|
|
2009-11-25 15:12:34 +01:00
|
|
|
///
|
|
|
|
|
// OnePixelBlackLine
|
|
|
|
|
///
|
|
|
|
|
|
|
|
|
|
class OnePixelBlackLine : public QWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
OnePixelBlackLine(QWidget *parent)
|
|
|
|
|
: QWidget(parent)
|
|
|
|
|
{
|
|
|
|
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
|
|
|
setMinimumHeight(1);
|
|
|
|
|
setMaximumHeight(1);
|
|
|
|
|
}
|
|
|
|
|
void paintEvent(QPaintEvent *e)
|
|
|
|
|
{
|
2009-11-30 16:23:28 +01:00
|
|
|
Q_UNUSED(e);
|
2009-11-25 15:12:34 +01:00
|
|
|
QPainter p(this);
|
2009-11-30 16:23:28 +01:00
|
|
|
p.fillRect(contentsRect(), QBrush(Utils::StyleHelper::borderColor()));
|
2009-11-25 15:12:34 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
// PanelsWidget
|
|
|
|
|
///
|
|
|
|
|
|
2009-11-25 16:01:46 +01:00
|
|
|
PanelsWidget::PanelsWidget(QWidget *parent) :
|
|
|
|
|
QScrollArea(parent),
|
|
|
|
|
m_root(new QWidget(this))
|
2009-07-16 15:33:19 +02:00
|
|
|
{
|
2009-12-07 15:24:57 +01:00
|
|
|
// We want a 900px wide widget with and the scrollbar at the
|
2009-11-25 16:01:46 +01:00
|
|
|
// side of the screen.
|
2009-12-07 15:24:57 +01:00
|
|
|
m_root->setFixedWidth(900);
|
2009-11-25 16:01:46 +01:00
|
|
|
// The layout holding the individual panels:
|
2009-11-30 16:23:28 +01:00
|
|
|
m_layout = new QGridLayout(m_root);
|
|
|
|
|
m_layout->setColumnMinimumWidth(0, ICON_SIZE + 4);
|
|
|
|
|
m_layout->setSpacing(0);
|
2009-11-25 16:01:46 +01:00
|
|
|
|
2009-12-09 13:01:09 +01:00
|
|
|
setWidget(m_root);
|
2009-07-16 15:33:19 +02:00
|
|
|
setFrameStyle(QFrame::NoFrame);
|
2009-08-11 16:37:24 +02:00
|
|
|
setWidgetResizable(true);
|
2009-07-16 15:33:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PanelsWidget::~PanelsWidget()
|
|
|
|
|
{
|
2010-01-21 13:46:19 +01:00
|
|
|
qDeleteAll(m_panels);
|
2009-09-17 13:59:10 +02:00
|
|
|
}
|
|
|
|
|
|
2009-11-25 16:01:46 +01:00
|
|
|
/*
|
|
|
|
|
* Add a widget with heading information into the grid
|
|
|
|
|
* layout of the PanelsWidget.
|
|
|
|
|
*
|
|
|
|
|
* ...
|
2009-11-30 16:23:28 +01:00
|
|
|
* +--------+-------------------------------------------+ ABOVE_HEADING_MARGIN
|
2009-11-25 16:01:46 +01:00
|
|
|
* | icon | name |
|
|
|
|
|
* + +-------------------------------------------+
|
2009-11-30 16:23:28 +01:00
|
|
|
* | | line |
|
|
|
|
|
* +--------+-------------------------------------------+ ABOVE_CONTENTS_MARGIN
|
|
|
|
|
* | widget (with contentsmargins adjusted!) |
|
|
|
|
|
* +--------+-------------------------------------------+ BELOW_CONTENTS_MARGIN
|
2009-11-25 16:01:46 +01:00
|
|
|
*/
|
2010-01-21 13:46:19 +01:00
|
|
|
void PanelsWidget::addPropertiesPanel(IPropertiesPanel *panel)
|
2009-07-16 15:33:19 +02:00
|
|
|
{
|
2010-01-21 13:46:19 +01:00
|
|
|
QTC_ASSERT(panel, return);
|
2009-11-25 16:01:46 +01:00
|
|
|
|
2009-11-30 16:23:28 +01:00
|
|
|
const int headerRow(m_layout->rowCount() - 1);
|
|
|
|
|
m_layout->setRowStretch(headerRow, 0);
|
|
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
// icon:
|
2010-01-21 13:46:19 +01:00
|
|
|
if (!panel->icon().isNull()) {
|
|
|
|
|
QLabel *iconLabel = new QLabel(m_root);
|
|
|
|
|
iconLabel->setPixmap(panel->icon().pixmap(ICON_SIZE, ICON_SIZE));
|
|
|
|
|
iconLabel->setContentsMargins(0, ABOVE_HEADING_MARGIN, 0, 0);
|
2010-02-19 14:16:37 +01:00
|
|
|
m_layout->addWidget(iconLabel, headerRow, 0, 3, 1, Qt::AlignTop | Qt::AlignHCenter);
|
2009-11-25 16:01:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// name:
|
2010-01-21 13:46:19 +01:00
|
|
|
QLabel *nameLabel = new QLabel(m_root);
|
|
|
|
|
nameLabel->setText(panel->displayName());
|
|
|
|
|
nameLabel->setContentsMargins(0, ABOVE_HEADING_MARGIN, 0, 0);
|
|
|
|
|
QFont f = nameLabel->font();
|
2009-07-16 15:33:19 +02:00
|
|
|
f.setBold(true);
|
2010-02-19 14:16:37 +01:00
|
|
|
f.setPointSizeF(f.pointSizeF() * 1.6);
|
2010-01-21 13:46:19 +01:00
|
|
|
nameLabel->setFont(f);
|
2010-02-19 14:16:37 +01:00
|
|
|
m_layout->addWidget(nameLabel, headerRow, 1, 1, 1, Qt::AlignVCenter | Qt::AlignLeft);
|
2009-11-25 16:01:46 +01:00
|
|
|
|
|
|
|
|
// line:
|
|
|
|
|
const int lineRow(headerRow + 1);
|
2010-02-19 14:16:37 +01:00
|
|
|
QWidget *line = new OnePixelBlackLine(m_root);
|
|
|
|
|
m_layout->addWidget(line, lineRow, 1, 1, -1, Qt::AlignTop);
|
2009-11-25 16:01:46 +01:00
|
|
|
|
2009-11-30 16:23:28 +01:00
|
|
|
// add the widget:
|
2009-11-25 16:01:46 +01:00
|
|
|
const int widgetRow(lineRow + 1);
|
2010-01-21 13:46:19 +01:00
|
|
|
addPanelWidget(panel, widgetRow);
|
2009-07-16 15:33:19 +02:00
|
|
|
}
|
|
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
void PanelsWidget::addPanelWidget(IPropertiesPanel *panel, int row)
|
2009-11-30 16:23:28 +01:00
|
|
|
{
|
2010-01-21 13:46:19 +01:00
|
|
|
QWidget *widget = panel->widget();
|
2010-02-08 15:50:06 +01:00
|
|
|
int leftMargin = (panel->flags() & IPropertiesPanel::NoLeftMargin)
|
|
|
|
|
? 0 : Constants::PANEL_LEFT_MARGIN;
|
|
|
|
|
widget->setContentsMargins(leftMargin,
|
|
|
|
|
ABOVE_CONTENTS_MARGIN, 0,
|
|
|
|
|
BELOW_CONTENTS_MARGIN);
|
2010-01-21 13:46:19 +01:00
|
|
|
widget->setParent(m_root);
|
|
|
|
|
m_layout->addWidget(widget, row, 0, 1, 2);
|
2009-11-30 16:23:28 +01:00
|
|
|
|
|
|
|
|
const int stretchRow(row + 1);
|
|
|
|
|
m_layout->setRowStretch(stretchRow, 10);
|
|
|
|
|
|
|
|
|
|
m_panels.append(panel);
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-06 15:31:32 +02:00
|
|
|
///
|
|
|
|
|
// ProjectWindow
|
|
|
|
|
///
|
|
|
|
|
|
2009-06-08 19:13:46 +02:00
|
|
|
ProjectWindow::ProjectWindow(QWidget *parent)
|
2010-01-21 13:46:19 +01:00
|
|
|
: QWidget(parent),
|
2010-02-08 15:50:06 +01:00
|
|
|
m_currentWidget(0),
|
|
|
|
|
m_currentPanel(0)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-10-07 15:46:07 +02:00
|
|
|
ProjectExplorer::SessionManager *session = ProjectExplorerPlugin::instance()->session();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-11-25 16:01:46 +01:00
|
|
|
// Setup overall layout:
|
|
|
|
|
QVBoxLayout *viewLayout = new QVBoxLayout(this);
|
|
|
|
|
viewLayout->setMargin(0);
|
|
|
|
|
viewLayout->setSpacing(0);
|
2009-09-17 13:59:10 +02:00
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
m_tabWidget = new DoubleTabWidget(this);
|
|
|
|
|
m_tabWidget->setTitle(tr("Select a Project:"));
|
|
|
|
|
viewLayout->addWidget(m_tabWidget);
|
2009-10-07 15:46:07 +02:00
|
|
|
|
2009-11-25 16:01:46 +01:00
|
|
|
// Setup our container for the contents:
|
2010-01-21 13:46:19 +01:00
|
|
|
m_centralWidget = new QStackedWidget(this);
|
|
|
|
|
viewLayout->addWidget(m_centralWidget);
|
2009-11-25 16:01:46 +01:00
|
|
|
|
|
|
|
|
// connects:
|
2010-01-21 13:46:19 +01:00
|
|
|
connect(m_tabWidget, SIGNAL(currentIndexChanged(int,int)),
|
|
|
|
|
this, SLOT(showProperties(int,int)));
|
2009-09-17 13:59:10 +02:00
|
|
|
|
2009-10-07 15:46:07 +02:00
|
|
|
connect(session, SIGNAL(sessionLoaded()), this, SLOT(restoreStatus()));
|
|
|
|
|
connect(session, SIGNAL(aboutToSaveSession()), this, SLOT(saveStatus()));
|
|
|
|
|
|
|
|
|
|
connect(session, SIGNAL(projectAdded(ProjectExplorer::Project*)),
|
2010-01-21 13:46:19 +01:00
|
|
|
this, SLOT(projectAdded(ProjectExplorer::Project*)));
|
|
|
|
|
connect(session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
|
|
|
|
|
this, SLOT(aboutToRemoveProject(ProjectExplorer::Project*)));
|
2009-11-25 15:18:51 +01:00
|
|
|
|
|
|
|
|
// Update properties to empty project for now:
|
2010-01-21 13:46:19 +01:00
|
|
|
showProperties(-1, -1);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ProjectWindow::~ProjectWindow()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
void ProjectWindow::shutdown()
|
2009-10-07 15:46:07 +02:00
|
|
|
{
|
2010-01-21 13:46:19 +01:00
|
|
|
showProperties(-1, -1); // TODO that's a bit stupid, but otherwise stuff is still
|
|
|
|
|
// connected to the session
|
|
|
|
|
disconnect(ProjectExplorerPlugin::instance()->session(), 0, this, 0);
|
2009-10-07 15:46:07 +02:00
|
|
|
}
|
|
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
void ProjectWindow::projectAdded(ProjectExplorer::Project *project)
|
2009-10-07 15:46:07 +02:00
|
|
|
{
|
2010-03-05 09:36:05 +01:00
|
|
|
if (!project || m_tabIndexToProject.contains(project))
|
2010-02-08 15:50:06 +01:00
|
|
|
return;
|
|
|
|
|
|
2010-03-05 09:36:05 +01:00
|
|
|
// find index to insert:
|
|
|
|
|
int index = -1;
|
|
|
|
|
for (int i = 0; i <= m_tabIndexToProject.count(); ++i) {
|
|
|
|
|
if (i == m_tabIndexToProject.count() ||
|
|
|
|
|
m_tabIndexToProject.at(i)->displayName() > project->displayName()) {
|
|
|
|
|
index = i;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
QStringList subtabs;
|
|
|
|
|
foreach (IPanelFactory *panelFactory, ExtensionSystem::PluginManager::instance()->getObjects<IPanelFactory>()) {
|
2010-02-08 15:50:06 +01:00
|
|
|
if (skipPanelFactory(project, panelFactory))
|
|
|
|
|
continue;
|
|
|
|
|
subtabs << panelFactory->displayName();
|
2009-10-07 15:46:07 +02:00
|
|
|
}
|
2010-02-08 15:50:06 +01:00
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
m_tabIndexToProject.insert(index, project);
|
|
|
|
|
m_tabWidget->insertTab(index, project->displayName(), subtabs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProjectWindow::aboutToRemoveProject(ProjectExplorer::Project *project)
|
|
|
|
|
{
|
|
|
|
|
int index = m_tabIndexToProject.indexOf(project);
|
2010-03-05 09:36:05 +01:00
|
|
|
if (index < 0)
|
|
|
|
|
return;
|
2010-01-21 13:46:19 +01:00
|
|
|
m_tabIndexToProject.removeAt(index);
|
|
|
|
|
m_tabWidget->removeTab(index);
|
2009-10-07 15:46:07 +02:00
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void ProjectWindow::restoreStatus()
|
|
|
|
|
{
|
2009-07-16 15:33:19 +02:00
|
|
|
// TODO
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProjectWindow::saveStatus()
|
|
|
|
|
{
|
2009-07-16 15:33:19 +02:00
|
|
|
// TODO
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
void ProjectWindow::showProperties(int index, int subIndex)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-02-22 15:47:47 +01:00
|
|
|
if (index < 0 || index >= m_tabIndexToProject.count())
|
2010-01-21 13:46:19 +01:00
|
|
|
return;
|
2010-02-22 15:47:47 +01:00
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
Project *project = m_tabIndexToProject.at(index);
|
2009-11-04 18:50:37 +01:00
|
|
|
|
2009-11-25 15:18:51 +01:00
|
|
|
// Set up custom panels again:
|
2010-02-08 15:50:06 +01:00
|
|
|
int pos = 0;
|
|
|
|
|
foreach (IPanelFactory *panelFactory, ExtensionSystem::PluginManager::instance()->getObjects<IPanelFactory>()) {
|
|
|
|
|
if (skipPanelFactory(project, panelFactory))
|
|
|
|
|
continue;
|
|
|
|
|
if (pos == subIndex) {
|
|
|
|
|
removeCurrentWidget();
|
|
|
|
|
IPropertiesPanel *panel(panelFactory->createPanel(project));
|
|
|
|
|
if (panel->flags() & IPropertiesPanel::NoAutomaticStyle) {
|
|
|
|
|
m_currentWidget = panel->widget();
|
|
|
|
|
m_currentPanel = panel;
|
|
|
|
|
} else {
|
|
|
|
|
PanelsWidget *panelsWidget = new PanelsWidget(m_centralWidget);
|
2010-01-21 13:46:19 +01:00
|
|
|
panelsWidget->addPropertiesPanel(panel);
|
2010-02-08 15:50:06 +01:00
|
|
|
m_currentWidget = panelsWidget;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
2010-02-08 15:50:06 +01:00
|
|
|
m_centralWidget->addWidget(m_currentWidget);
|
|
|
|
|
m_centralWidget->setCurrentWidget(m_currentWidget);
|
|
|
|
|
break;
|
2010-01-21 13:46:19 +01:00
|
|
|
}
|
2010-02-08 15:50:06 +01:00
|
|
|
++pos;
|
2010-01-21 13:46:19 +01:00
|
|
|
}
|
2010-02-08 15:50:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProjectWindow::removeCurrentWidget()
|
|
|
|
|
{
|
|
|
|
|
if (m_currentWidget) {
|
|
|
|
|
m_centralWidget->removeWidget(m_currentWidget);
|
|
|
|
|
if (m_currentPanel) {
|
|
|
|
|
delete m_currentPanel;
|
|
|
|
|
m_currentPanel = 0;
|
|
|
|
|
m_currentWidget = 0; // is deleted by the panel
|
|
|
|
|
} else if (m_currentWidget) {
|
|
|
|
|
delete m_currentWidget;
|
|
|
|
|
m_currentWidget = 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|