613 ) |
613 ) |
614 |
614 |
615 newName, ok = QInputDialog.getText( |
615 newName, ok = QInputDialog.getText( |
616 self, |
616 self, |
617 title, |
617 title, |
618 self.tr("<p>Enter the new name <b>{0}</b>:</p>").format(item.text(0)), |
618 self.tr("<p>Enter the new name for <b>{0}</b>:</p>").format(item.text(0)), |
619 QLineEdit.EchoMode.Normal, |
619 QLineEdit.EchoMode.Normal, |
620 item.text(0), |
620 item.text(0), |
621 ) |
621 ) |
622 if ok and newName: |
622 if ok and newName: |
623 if newName in self.__directoryCache or newName in self.__filenameCache: |
623 if newName in self.__directoryCache or newName in self.__filenameCache: |
655 @type QTreeWidgetItem |
655 @type QTreeWidgetItem |
656 """ |
656 """ |
657 isDir = item.data(0, EricServerFileDialog.IsDirectoryRole) |
657 isDir = item.data(0, EricServerFileDialog.IsDirectoryRole) |
658 if isDir: |
658 if isDir: |
659 title = self.tr("Delete Directory") |
659 title = self.tr("Delete Directory") |
660 itemType = self.tr("directory") |
660 question = self.tr("Shall the selected directory really be deleted?") |
661 else: |
661 else: |
662 title = self.tr("Delete File") |
662 title = self.tr("Delete File") |
663 itemType = self.tr("file") |
663 question = self.tr("Shall the selected file really be deleted?") |
664 |
664 |
665 yes = EricMessageBox.yesNo( |
665 yes = EricMessageBox.yesNo(self, title, question) |
666 self, |
|
667 title, |
|
668 self.tr("Shall the selected {0} really be deleted?").format(itemType), |
|
669 ) |
|
670 if yes: |
666 if yes: |
671 ok, error = ( |
667 ok, error = ( |
672 self.__fsInterface.rmdir(self.__getFullPath(item.text(0))) |
668 self.__fsInterface.rmdir(self.__getFullPath(item.text(0))) |
673 if isDir |
669 if isDir |
674 else self.__fsInterface.remove(self.__getFullPath(item.text(0))) |
670 else self.__fsInterface.remove(self.__getFullPath(item.text(0))) |