1
/****************************************************************************
3
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of Qt Creator.
8
** Commercial License Usage
9
** Licensees holding valid commercial Qt licenses may use this file in
10
** accordance with the commercial license agreement provided with the
11
** Software or, alternatively, in accordance with the terms contained in
12
** a written agreement between you and Digia. For licensing terms and
13
** conditions see http://qt.digia.com/licensing. For further information
14
** use the contact form at http://qt.digia.com/contact-us.
16
** GNU Lesser General Public License Usage
17
** Alternatively, this file may be used under the terms of the GNU Lesser
18
** General Public License version 2.1 as published by the Free Software
19
** Foundation and appearing in the file LICENSE.LGPL included in the
20
** packaging of this file. Please review the following information to
21
** ensure the GNU Lesser General Public License version 2.1 requirements
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
** In addition, as a special exception, Digia gives you certain additional
25
** rights. These rights are described in the Digia Qt LGPL Exception
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
****************************************************************************/
29
#include "maemopublishingbuildsettingspagefremantlefree.h"
30
#include "ui_maemopublishingbuildsettingspagefremantlefree.h"
32
#include "maemoconstants.h"
33
#include "maemoglobal.h"
34
#include "maemopublisherfremantlefree.h"
36
#include <projectexplorer/project.h>
37
#include <projectexplorer/target.h>
38
#include <qt4projectmanager/qt4buildconfiguration.h>
39
#include <qt4projectmanager/qt4projectmanagerconstants.h>
40
#include <qtsupport/baseqtversion.h>
41
#include <qtsupport/qtkitinformation.h>
42
#include <qtsupport/qtsupportconstants.h>
43
#include <utils/qtcassert.h>
45
using namespace ProjectExplorer;
46
using namespace Qt4ProjectManager;
51
MaemoPublishingBuildSettingsPageFremantleFree::MaemoPublishingBuildSettingsPageFremantleFree(const Project *project,
52
MaemoPublisherFremantleFree *publisher, QWidget *parent) :
54
m_publisher(publisher),
55
ui(new Ui::MaemoPublishingWizardPageFremantleFree)
59
collectBuildConfigurations(project);
60
QTC_ASSERT(!m_buildConfigs.isEmpty(), return);
62
foreach (const Qt4BuildConfiguration *const bc, m_buildConfigs)
63
ui->buildConfigComboBox->addItem(bc->displayName());
65
ui->buildConfigComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContentsOnFirstShow);
66
ui->buildConfigComboBox->setCurrentIndex(0);
67
connect(ui->skipUploadCheckBox, SIGNAL(toggled(bool)),
68
SLOT(handleNoUploadSettingChanged()));
71
MaemoPublishingBuildSettingsPageFremantleFree::~MaemoPublishingBuildSettingsPageFremantleFree()
76
void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(const Project *project)
78
m_buildConfigs.clear();
80
foreach (const Target *const target, project->targets()) {
81
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
82
if (!version || version->platformName() != QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))
84
foreach (BuildConfiguration *const bc, target->buildConfigurations()) {
85
Qt4BuildConfiguration *const qt4Bc = qobject_cast<Qt4BuildConfiguration *>(bc);
87
m_buildConfigs << qt4Bc;
92
void MaemoPublishingBuildSettingsPageFremantleFree::initializePage()
94
ui->skipUploadCheckBox->setChecked(true);
97
bool MaemoPublishingBuildSettingsPageFremantleFree::validatePage()
99
m_publisher->setBuildConfiguration(m_buildConfigs.at(ui->buildConfigComboBox->currentIndex()));
100
m_publisher->setDoUpload(!skipUpload());
104
void MaemoPublishingBuildSettingsPageFremantleFree::handleNoUploadSettingChanged()
106
setCommitPage(skipUpload());
109
bool MaemoPublishingBuildSettingsPageFremantleFree::skipUpload() const
111
return ui->skipUploadCheckBox->isChecked();
114
} // namespace Internal