| 693 | } |
| 694 | |
| 695 | void ProjectTree::actionNewDirectory(const QStandardItem *item) |
| 696 | { |
| 697 | auto dialog = new DDialog(this); |
| 698 | auto inputEdit = new DLineEdit(dialog); |
| 699 | |
| 700 | inputEdit->setPlaceholderText(tr("New Dirctory Name")); |
| 701 | inputEdit->lineEdit()->setAlignment(Qt::AlignLeft); |
| 702 | |
| 703 | dialog->setAttribute(Qt::WA_DeleteOnClose); |
| 704 | dialog->setWindowTitle(tr("New Dirctory")); |
| 705 | dialog->setFocusProxy(inputEdit); |
| 706 | |
| 707 | dialog->addContent(inputEdit); |
| 708 | dialog->addButton(tr("Ok"), true, DDialog::ButtonRecommend); |
| 709 | dialog->setOnButtonClickedClose(false); |
| 710 | |
| 711 | QObject::connect(dialog, &DDialog::buttonClicked, dialog, [=]() { |
| 712 | auto ret = false; |
| 713 | if (!inputEdit->text().isEmpty()) { |
| 714 | ret = createNewDirectory(item, inputEdit->text()); |
| 715 | } |
| 716 | |
| 717 | if (ret) |
| 718 | dialog->close(); |
| 719 | }); |
| 720 | |
| 721 | dialog->exec(); |
| 722 | } |
| 723 | |
| 724 | void ProjectTree::actionNewDocument(const QStandardItem *item) |
| 725 | { |
nothing calls this directly
no test coverage detected