-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnewprojectwin.cpp
More file actions
42 lines (36 loc) · 1.04 KB
/
newprojectwin.cpp
File metadata and controls
42 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "newprojectwin.h"
#include "ui_newprojectwin.h"
NewProjectWin::NewProjectWin(QWidget *parent) :
QDialog(parent),
ui(new Ui::NewProjectWin)
{
ui->setupUi(this);
setWindowTitle("Creazione nuovo progetto");
}
NewProjectWin::~NewProjectWin()
{
delete ui;
}
void NewProjectWin::on_buttonBox_accepted()
{
// creo il progetto
proj = new Project(ui->projPathEdit->text(), ui->projNameEdit->text().replace(' ', '_'), ProjectType::Complete);
QTextDocument* doc;
doc = ui->descriptionEdit->document();
// converto il testo in html e lo imposto
proj->setDescription(doc->toHtml());
}
Project* NewProjectWin::getProject(){
return proj;
}
void NewProjectWin::on_showFiles_clicked()
{
// creo il dialogo
QFileDialog *dial = new QFileDialog();
dial->setFileMode(QFileDialog::DirectoryOnly);
QString path;
path = QFileDialog::getExistingDirectory(0, ("Select Output Folder"), QDir::currentPath());
// correggo il percorso
path = adjustPath(path);
ui->projPathEdit->setText(path);
}