| 722 | } |
| 723 | |
| 724 | void ProjectTree::actionNewDocument(const QStandardItem *item) |
| 725 | { |
| 726 | auto dialog = new DDialog(this); |
| 727 | auto inputEdit = new DLineEdit(dialog); |
| 728 | |
| 729 | inputEdit->setPlaceholderText(tr("New Document Name")); |
| 730 | inputEdit->lineEdit()->setAlignment(Qt::AlignLeft); |
| 731 | |
| 732 | dialog->setAttribute(Qt::WA_DeleteOnClose); |
| 733 | dialog->setWindowTitle(tr("New Document")); |
| 734 | dialog->setFocusProxy(inputEdit); |
| 735 | |
| 736 | dialog->addContent(inputEdit); |
| 737 | dialog->addButton(tr("Ok"), true, DDialog::ButtonRecommend); |
| 738 | |
| 739 | QObject::connect(dialog, &DDialog::buttonClicked, dialog, [=]() { |
| 740 | if (!inputEdit->text().isEmpty()) { |
| 741 | creatNewDocument(item, inputEdit->text()); |
| 742 | } |
| 743 | dialog->close(); |
| 744 | }); |
| 745 | |
| 746 | dialog->exec(); |
| 747 | } |
| 748 | |
| 749 | void ProjectTree::actionDeleteDocument(QStandardItem *item) |
| 750 | { |
nothing calls this directly
no test coverage detected