RedPanda-CPP/RedPandaIDE/widgets/newprojectdialog.h

47 lines
1.1 KiB
C
Raw Normal View History

2021-09-16 12:03:10 +08:00
#ifndef NEWPROJECTDIALOG_H
#define NEWPROJECTDIALOG_H
#include <QDialog>
2021-09-16 23:51:05 +08:00
#include <QListWidget>
2021-09-16 12:03:10 +08:00
#include <QTabBar>
#include "projecttemplate.h"
namespace Ui {
class NewProjectDialog;
}
class NewProjectDialog : public QDialog
{
Q_OBJECT
public:
explicit NewProjectDialog(QWidget *parent = nullptr);
~NewProjectDialog();
2021-09-16 23:51:05 +08:00
PProjectTemplate getTemplate();
QString getLocation();
QString getProjectName();
bool useAsDefaultProjectDir();
2021-09-16 23:51:05 +08:00
bool isCProject();
bool isCppProject();
bool makeDefaultLanguage();
2021-09-16 23:51:05 +08:00
private slots:
void updateView();
void updateProjectLocation();
void on_lstTemplates_itemDoubleClicked(QListWidgetItem *item);
void on_lstTemplates_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
void on_btnBrowse_clicked();
2021-09-16 23:51:05 +08:00
2021-09-16 12:03:10 +08:00
private:
void addTemplate(const QString& filename);
void readTemplateDir();
2021-09-16 23:51:05 +08:00
void rebuildTabs();
2021-09-16 12:03:10 +08:00
private:
Ui::NewProjectDialog *ui;
QList<PProjectTemplate> mTemplates;
QTabBar* mTemplatesTabBar;
2021-09-16 23:51:05 +08:00
QMap<QString,int> mCategories;
2021-09-16 12:03:10 +08:00
};
#endif // NEWPROJECTDIALOG_H