-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathannotationtypeeditordialog.cpp
41 lines (31 loc) · 1.36 KB
/
annotationtypeeditordialog.cpp
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 "annotationtypeeditordialog.h"
#include "ui_annotationtypeeditordialog.h"
#include "annotationtype.h"
AnnotationTypeEditorDialog::AnnotationTypeEditorDialog(const QList<WritingSystem> &writingSystems, QWidget *parent) :
QDialog(parent),
ui(new Ui::AnnotationTypeEditorDialog)
{
ui->setupUi(this);
ui->writingSystemCombo->setWritingSystems(writingSystems);
ui->headerWritingSystemCombo->setWritingSystems(writingSystems);
}
AnnotationTypeEditorDialog::AnnotationTypeEditorDialog(AnnotationType type, const QList<WritingSystem> &writingSystems, QWidget *parent) :
QDialog(parent),
ui(new Ui::AnnotationTypeEditorDialog)
{
ui->setupUi(this);
ui->writingSystemCombo->setWritingSystems(writingSystems);
ui->writingSystemCombo->setCurrentWritingSystem( type.writingSystem() );
ui->headerWritingSystemCombo->setWritingSystems(writingSystems);
ui->headerWritingSystemCombo->setCurrentWritingSystem( type.headerWritingSystem() );
ui->nameEdit->setText( type.label() );
ui->markEdit->setText( type.mark() );
}
AnnotationTypeEditorDialog::~AnnotationTypeEditorDialog()
{
delete ui;
}
AnnotationType AnnotationTypeEditorDialog::annotationType() const
{
return AnnotationType(ui->nameEdit->text(), ui->markEdit->text(), ui->writingSystemCombo->currentWritingSystem(), ui->headerWritingSystemCombo->currentWritingSystem() );
}