1 #include "ModifyDialog.h"
3 QString
ModifyDialog::str("");
5 ModifyDialog::ModifyDialog(QWidget
*parent
)
11 ModifyDialog::~ModifyDialog()
16 QString
ModifyDialog::getDicItmeString(const std::string
&defaultWord
,
17 const std::string
&defaultPhon
,
18 const std::string
&defaultTran
,
19 const std::string
&defaultExam
,
22 ModifyDialog
*dialog
= new ModifyDialog(parent
);
23 dialog
->setModal(true);
24 dialog
->wordLineEdit
->setText(defaultWord
.c_str());
25 dialog
->soundmarkLineEdit
->setText(defaultPhon
.c_str());
26 dialog
->translationTextEdit
->setText(QString::fromUtf8(defaultTran
.c_str()));
27 dialog
->exampleTextEdit
->setText(QString::fromUtf8(defaultExam
.c_str()));
28 connect(dialog
->okButton
,SIGNAL(clicked()),
30 connect(dialog
->cancelButton
,SIGNAL(clicked()),
31 dialog
,SLOT(Cancel()));
36 void ModifyDialog::Cancel() {
37 ModifyDialog::str
= "";
41 void ModifyDialog::Ok() {
42 QString usage
= translationTextEdit
->toPlainText();
43 usage
.replace("\n","<br />");
45 QString example
= exampleTextEdit
->toPlainText();
46 example
.replace("\n","<br />");
48 ModifyDialog::str
= "[W]" + wordLineEdit
->text() +
49 "[T]" + soundmarkLineEdit
->text() +