MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / actionNewDocument

Method actionNewDocument

src/plugins/project/mainframe/projecttree.cpp:724–747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722}
723
724void 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
749void ProjectTree::actionDeleteDocument(QStandardItem *item)
750{

Callers

nothing calls this directly

Calls 8

connectFunction · 0.85
setPlaceholderTextMethod · 0.80
addContentMethod · 0.80
setAttributeMethod · 0.45
isEmptyMethod · 0.45
textMethod · 0.45
closeMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected