1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 #include "projectloadwizard.h"
34 #include "wizards/targetsetuppage.h"
35 #include "qt4project.h"
37 #include <QtGui/QCheckBox>
38 #include <QtGui/QHeaderView>
39 #include <QtGui/QLabel>
40 #include <QtGui/QVBoxLayout>
41 #include <QtGui/QWizardPage>
42 #include <QtGui/QApplication>
44 using namespace Qt4ProjectManager;
45 using namespace Qt4ProjectManager::Internal;
47 ProjectLoadWizard::ProjectLoadWizard(Qt4Project *project, QWidget *parent, Qt::WindowFlags flags)
48 : QWizard(parent, flags), m_project(project), m_targetSetupPage(0)
52 setWindowTitle(tr("Project Setup"));
56 setOptions(options() | QWizard::NoBackButtonOnLastPage);
59 // We don't want to actually show the dialog if we don't show the import page
60 // We used to simply call ::exec() on the dialog
61 void ProjectLoadWizard::execDialog()
63 if (!pageIds().isEmpty()) {
64 QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
66 QApplication::restoreOverrideCursor();
68 done(QDialog::Accepted);
72 ProjectLoadWizard::~ProjectLoadWizard()
76 void ProjectLoadWizard::done(int result)
78 QWizard::done(result);
79 // This normally happens on showing the final page, but since we
80 // don't show it anymore, do it here
82 if (result == Accepted)
86 void ProjectLoadWizard::setupTargetPage()
88 if (m_targetSetupPage)
91 m_targetSetupPage = new TargetSetupPage(this);
92 m_targetSetupPage->setProFilePath(m_project->file()->fileName());
93 m_targetSetupPage->setImportSearch(true);
96 addPage(m_targetSetupPage);
99 void ProjectLoadWizard::applySettings()
101 Q_ASSERT(m_targetSetupPage);
102 m_targetSetupPage->setupProject(m_project);