1 /*
2     SPDX-FileCopyrightText: 2001 Bernd Gehrmann <bernd@kdevelop.org>
3     SPDX-FileCopyrightText: 2004-2005 Sascha Cunz <sascha@kdevelop.org>
4     SPDX-FileCopyrightText: 2007 Alexander Dymo <adymo@kdevelop.org>
5     SPDX-FileCopyrightText: 2008 Anne-Marie Mahfouf <annma@kde.org>
6 
7     SPDX-License-Identifier: GPL-2.0-or-later
8 */
9 
10 #ifndef CHOICEPAGE_H
11 #define CHOICEPAGE_H
12 
13 #include <QWizardPage>
14 
15 #include "ui_choice.h"
16 
17 class AppTemplatesModel;
18 
19 class ChoicePage : public QWizardPage
20 {
21     Q_OBJECT
22     Q_PROPERTY(QString templateName READ templateName NOTIFY templateNameChanged)
23 
24 public:
25     explicit ChoicePage( QWidget *parent = nullptr);
26 
27     AppTemplatesModel *templatesModel;
28     QString m_baseName;
29     bool isComplete () const override;
templateName()30     QString templateName() const { return m_baseName; }
31 
32 Q_SIGNALS:
33     void templateNameChanged(const QString&);
34 
35 private:
36     Ui::choice ui_choice;
37 
38 private Q_SLOTS:
39     /**
40     * Saves project name in config file
41     */
42     void saveConfig();
43 
44     void loadFromFile();
45 #ifdef KAPPTEMLATE_SOLVEDGHNS
46     void getMoreTemplates();
47 #endif
48 
49 protected Q_SLOTS:
50     void itemSelected(const QModelIndex &index);
51 };
52 
53 #endif // CHOICEPAGE_H
54