-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtfiledirective.cpp
More file actions
52 lines (41 loc) · 1.21 KB
/
tfiledirective.cpp
File metadata and controls
52 lines (41 loc) · 1.21 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
42
43
44
45
46
47
48
49
50
51
52
#include "tfiledirective.h"
#include "ui_tfiledirective.h"
TFileDirective::TFileDirective(QWidget *parent) :
QDialog(parent),
ui(new Ui::TFileDirective)
{
setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
ui->setupUi(this);
}
TFileDirective::~TFileDirective()
{
delete ui;
}
QString TFileDirective::getFileDirective()
{
return m_filedirective;
}
void TFileDirective::on_bCancel_clicked()
{
close();
}
void TFileDirective::on_bOk_clicked()
{
QString sFilename = ui->tFilename->text();
QString sSegment = ui->tSegment->text();
QString sType = ui->cType->currentText();
if(sFilename.isEmpty()) {
ui->tFilename->setFocus();
return;
}
if(sSegment.isEmpty()) {
ui->tSegment->setFocus();
return;
}
QString sBetween = "type=\""+sType+"\"";
if (ui->cMbfiles->isChecked()) sBetween = "mbfiles";
m_filedirective = QString("\n.file [name=\"%1.%3\", %4, segments=\"%2\"]\n.segment %2[]\n").arg(sFilename).arg(sSegment).arg(sType).arg(sBetween);
if(ui->cInsertBasicUpstart2->isChecked())
m_filedirective += "BasicUpstart2(start)\nstart:\n\n";
close();
}