LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / libs / utils / projectintropage.h
blobc1c6eddc20781bc31e2a95052d946021c32e6f22
1 /**
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.
7 * @brief
8 * @see The GNU Public License (GPL) Version 3
9 * @defgroup
10 * @{
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
22 * for more details.
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>
36 namespace Utils {
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
41 * functionality:
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
50 * hacks. */
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)
57 public:
58 explicit ProjectIntroPage(QWidget *parent = 0);
59 virtual ~ProjectIntroPage();
61 QString name() const;
62 QString path() const;
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);
73 signals:
74 void activated();
76 public slots:
77 void setPath(const QString &path);
78 void setName(const QString &name);
79 void setDescription(const QString &description);
81 private slots:
82 void slotChanged();
83 void slotActivated();
85 protected:
86 virtual void changeEvent(QEvent *e);
88 private:
89 enum StatusLabelMode { Error, Warning, Hint };
91 bool validate();
92 void displayStatusMessage(StatusLabelMode m, const QString &);
93 void hideStatusLabel();
95 ProjectIntroPagePrivate *m_d;
97 } // namespace Utils
99 #endif // PROJECTINTROPAGE_H