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

Method actionNewDirectory

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

Source from the content-addressed store, hash-verified

693}
694
695void 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
724void ProjectTree::actionNewDocument(const QStandardItem *item)
725{

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