2 ******************************************************************************
4 * @file projectintropage.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
8 * @see The GNU Public License (GPL) Version 3
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef PROJECTINTROPAGE_H
30 #define PROJECTINTROPAGE_H
32 #include "utils_global.h"
34 #include <QWizardPage>
37 struct ProjectIntroPagePrivate
;
39 /* Standard wizard page for a single file letting the user choose name
40 * and path. Looks similar to FileWizardPage, but provides additional
42 * - Description label at the top for displaying introductory text
43 * - It does on the fly validation (connected to changed()) and displays
44 * warnings/errors in a status label at the bottom (the page is complete
45 * when fully validated, validatePage() is thus not implemented).
47 * Note: Careful when changing projectintropage.ui. It must have main
48 * geometry cleared and QLayout::SetMinimumSize constraint on the main
49 * layout, otherwise, QWizard will squeeze it due to its strange expanding
52 class QTCREATOR_UTILS_EXPORT ProjectIntroPage
: public QWizardPage
{
53 Q_OBJECT
Q_DISABLE_COPY(ProjectIntroPage
)
54 Q_PROPERTY(QString description READ description WRITE setPath DESIGNABLE
true)
55 Q_PROPERTY(QString path READ path WRITE setPath DESIGNABLE
true)
56 Q_PROPERTY(QString name READ name WRITE setName DESIGNABLE
true)
58 explicit ProjectIntroPage(QWidget
*parent
= 0);
59 virtual ~ProjectIntroPage();
63 QString
description() const;
65 // Insert an additional control into the form layout for the target.
66 void insertControl(int row
, QWidget
*label
, QWidget
*control
);
68 virtual bool isComplete() const;
70 // Validate a project directory name entry field
71 static bool validateProjectDirectory(const QString
&name
, QString
*errorMessage
);
77 void setPath(const QString
&path
);
78 void setName(const QString
&name
);
79 void setDescription(const QString
&description
);
86 virtual void changeEvent(QEvent
*e
);
89 enum StatusLabelMode
{ Error
, Warning
, Hint
};
92 void displayStatusMessage(StatusLabelMode m
, const QString
&);
93 void hideStatusLabel();
95 ProjectIntroPagePrivate
*m_d
;
99 #endif // PROJECTINTROPAGE_H