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
****************************************************************************/
30
#include "html5appwizardpages.h"
31
#include "ui_html5appwizardsourcespage.h"
33
namespace QmakeProjectManager {
36
class Html5AppWizardOptionsPagePrivate
38
Ui::Html5AppWizardSourcesPage ui;
39
friend class Html5AppWizardOptionsPage;
42
Html5AppWizardOptionsPage::Html5AppWizardOptionsPage(QWidget *parent)
44
, d(new Html5AppWizardOptionsPagePrivate)
47
d->ui.importLineEdit->setExpectedKind(Utils::PathChooser::File);
48
d->ui.importLineEdit->setPromptDialogFilter(QLatin1String("*.html"));
49
d->ui.importLineEdit->setPromptDialogTitle(tr("Select HTML File"));
50
connect(d->ui.importLineEdit, SIGNAL(changed(QString)), SIGNAL(completeChanged()));
51
connect(d->ui.importRadioButton,
52
SIGNAL(toggled(bool)), SIGNAL(completeChanged()));
53
connect(d->ui.generateRadioButton, SIGNAL(toggled(bool)), SLOT(setLineEditsEnabled()));
54
connect(d->ui.importRadioButton, SIGNAL(toggled(bool)), SLOT(setLineEditsEnabled()));
55
connect(d->ui.urlRadioButton, SIGNAL(toggled(bool)), SLOT(setLineEditsEnabled()));
56
d->ui.generateRadioButton->setChecked(true);
59
Html5AppWizardOptionsPage::~Html5AppWizardOptionsPage()
64
Html5App::Mode Html5AppWizardOptionsPage::mainHtmlMode() const
66
Html5App::Mode result = Html5App::ModeGenerate;
67
if (d->ui.importRadioButton->isChecked())
68
result = Html5App::ModeImport;
69
else if (d->ui.urlRadioButton->isChecked())
70
result = Html5App::ModeUrl;
74
QString Html5AppWizardOptionsPage::mainHtmlData() const
76
switch (mainHtmlMode()) {
77
case Html5App::ModeImport: return d->ui.importLineEdit->path();
78
case Html5App::ModeUrl: return d->ui.urlLineEdit->text();
80
case Html5App::ModeGenerate: return QString();
84
void Html5AppWizardOptionsPage::setTouchOptimizationEndabled(bool enabled)
86
d->ui.touchOptimizationCheckBox->setChecked(enabled);
89
bool Html5AppWizardOptionsPage::touchOptimizationEndabled() const
91
return d->ui.touchOptimizationCheckBox->isChecked();
94
bool Html5AppWizardOptionsPage::isComplete() const
96
return mainHtmlMode() != Html5App::ModeImport || d->ui.importLineEdit->isValid();
99
void Html5AppWizardOptionsPage::setLineEditsEnabled()
101
d->ui.importLineEdit->setEnabled(d->ui.importRadioButton->isChecked());
102
d->ui.urlLineEdit->setEnabled(d->ui.urlRadioButton->isChecked());
105
} // namespace Internal
106
} // namespace QmakeProjectManager