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

Method actionRenameDocument

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

Source from the content-addressed store, hash-verified

617}
618
619void ProjectTree::actionRenameDocument(const QStandardItem *item)
620{
621 auto dialog = new DDialog(this);
622 auto inputEdit = new DLineEdit(dialog);
623
624 inputEdit->setPlaceholderText(tr("New Document Name"));
625 inputEdit->lineEdit()->setAlignment(Qt::AlignLeft);
626
627 dialog->setAttribute(Qt::WA_DeleteOnClose);
628 dialog->setWindowTitle(tr("Rename"));
629
630 dialog->addContent(inputEdit);
631 dialog->addButton(tr("Ok"), true, DDialog::ButtonRecommend);
632
633 QObject::connect(dialog, &DDialog::buttonClicked, dialog, [=]() {
634 if (!inputEdit->text().isEmpty()) {
635 renameDocument(item, inputEdit->text());
636 }
637 dialog->close();
638 });
639
640 dialog->exec();
641}
642
643void ProjectTree::renameDocument(const QStandardItem *item, const QString &newFileName)
644{

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