~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
**
3
 
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4
 
** Contact: http://www.qt-project.org/legal
5
 
**
6
 
** This file is part of Qt Creator.
7
 
**
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.
15
 
**
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.
23
 
**
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.
27
 
**
28
 
****************************************************************************/
29
 
#include "maemopublishingbuildsettingspagefremantlefree.h"
30
 
#include "ui_maemopublishingbuildsettingspagefremantlefree.h"
31
 
 
32
 
#include "maemoconstants.h"
33
 
#include "maemoglobal.h"
34
 
#include "maemopublisherfremantlefree.h"
35
 
 
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>
44
 
 
45
 
using namespace ProjectExplorer;
46
 
using namespace Qt4ProjectManager;
47
 
 
48
 
namespace Madde {
49
 
namespace Internal {
50
 
 
51
 
MaemoPublishingBuildSettingsPageFremantleFree::MaemoPublishingBuildSettingsPageFremantleFree(const Project *project,
52
 
    MaemoPublisherFremantleFree *publisher, QWidget *parent) :
53
 
    QWizardPage(parent),
54
 
    m_publisher(publisher),
55
 
    ui(new Ui::MaemoPublishingWizardPageFremantleFree)
56
 
{
57
 
    ui->setupUi(this);
58
 
 
59
 
    collectBuildConfigurations(project);
60
 
    QTC_ASSERT(!m_buildConfigs.isEmpty(), return);
61
 
 
62
 
    foreach (const Qt4BuildConfiguration *const bc, m_buildConfigs)
63
 
        ui->buildConfigComboBox->addItem(bc->displayName());
64
 
 
65
 
    ui->buildConfigComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContentsOnFirstShow);
66
 
    ui->buildConfigComboBox->setCurrentIndex(0);
67
 
    connect(ui->skipUploadCheckBox, SIGNAL(toggled(bool)),
68
 
        SLOT(handleNoUploadSettingChanged()));
69
 
}
70
 
 
71
 
MaemoPublishingBuildSettingsPageFremantleFree::~MaemoPublishingBuildSettingsPageFremantleFree()
72
 
{
73
 
    delete ui;
74
 
}
75
 
 
76
 
void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(const Project *project)
77
 
{
78
 
    m_buildConfigs.clear();
79
 
 
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))
83
 
            continue;
84
 
        foreach (BuildConfiguration *const bc, target->buildConfigurations()) {
85
 
            Qt4BuildConfiguration *const qt4Bc = qobject_cast<Qt4BuildConfiguration *>(bc);
86
 
            if (qt4Bc)
87
 
                m_buildConfigs << qt4Bc;
88
 
        }
89
 
    }
90
 
}
91
 
 
92
 
void MaemoPublishingBuildSettingsPageFremantleFree::initializePage()
93
 
{
94
 
    ui->skipUploadCheckBox->setChecked(true);
95
 
}
96
 
 
97
 
bool MaemoPublishingBuildSettingsPageFremantleFree::validatePage()
98
 
{
99
 
    m_publisher->setBuildConfiguration(m_buildConfigs.at(ui->buildConfigComboBox->currentIndex()));
100
 
    m_publisher->setDoUpload(!skipUpload());
101
 
    return true;
102
 
}
103
 
 
104
 
void MaemoPublishingBuildSettingsPageFremantleFree::handleNoUploadSettingChanged()
105
 
{
106
 
    setCommitPage(skipUpload());
107
 
}
108
 
 
109
 
bool MaemoPublishingBuildSettingsPageFremantleFree::skipUpload() const
110
 
{
111
 
    return ui->skipUploadCheckBox->isChecked();
112
 
}
113
 
 
114
 
} // namespace Internal
115
 
} // namespace Madde