diff -r 27f636beebad -r 2c730d5fd177 eric6/MicroPython/MicroPythonFileManagerWidget.py --- a/eric6/MicroPython/MicroPythonFileManagerWidget.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/MicroPython/MicroPythonFileManagerWidget.py Tue Mar 02 17:17:09 2021 +0100 @@ -79,9 +79,9 @@ self.getAsButton.setEnabled(False) self.localFileTreeWidget.header().setSortIndicator( - 0, Qt.AscendingOrder) + 0, Qt.SortOrder.AscendingOrder) self.deviceFileTreeWidget.header().setSortIndicator( - 0, Qt.AscendingOrder) + 0, Qt.SortOrder.AscendingOrder) self.__progressInfoDialog = None self.__fileManager = MicroPythonFileManager(commandsInterface, self) @@ -220,10 +220,10 @@ for name, mode, size, dateTime in filesList: itm = QTreeWidgetItem(self.deviceFileTreeWidget, [name, mode, size, dateTime]) - itm.setTextAlignment(1, Qt.AlignHCenter) - itm.setTextAlignment(2, Qt.AlignRight) + itm.setTextAlignment(1, Qt.AlignmentFlag.AlignHCenter) + itm.setTextAlignment(2, Qt.AlignmentFlag.AlignRight) self.deviceFileTreeWidget.header().resizeSections( - QHeaderView.ResizeToContents) + QHeaderView.ResizeMode.ResizeToContents) def __listLocalFiles(self, dirname="", localDevice=False): """ @@ -258,10 +258,10 @@ fileTreeWidget.clear() for item in filesList: itm = QTreeWidgetItem(fileTreeWidget, item) - itm.setTextAlignment(1, Qt.AlignHCenter) - itm.setTextAlignment(2, Qt.AlignRight) + itm.setTextAlignment(1, Qt.AlignmentFlag.AlignHCenter) + itm.setTextAlignment(2, Qt.AlignmentFlag.AlignRight) fileTreeWidget.header().resizeSections( - QHeaderView.ResizeToContents) + QHeaderView.ResizeMode.ResizeToContents) @pyqtSlot(QTreeWidgetItem, int) def on_localFileTreeWidget_itemActivated(self, item, column): @@ -444,7 +444,7 @@ self, self.tr("Put File As"), self.tr("Enter a new name for the file"), - QLineEdit.Normal, + QLineEdit.EchoMode.Normal, filename) if not ok or not filename: return @@ -509,7 +509,7 @@ self, self.tr("Get File As"), self.tr("Enter a new name for the file"), - QLineEdit.Normal, + QLineEdit.EchoMode.Normal, filename) if not ok or not filename: return @@ -694,7 +694,7 @@ self, self.tr("Create Directory"), self.tr("Enter directory name:"), - QLineEdit.Normal) + QLineEdit.EchoMode.Normal) if ok and dirPath: dirPath = os.path.join(cwdWidget.text(), dirPath) try: @@ -734,7 +734,7 @@ self.tr( "Do you really want to delete this directory tree?"), [dirname]) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: try: shutil.rmtree(dirname) self.__listLocalFiles(cwdWidget.text(), @@ -772,7 +772,7 @@ self.tr( "Do you really want to delete this file?"), [filename]) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: try: os.remove(filename) self.__listLocalFiles(cwdWidget.text(), @@ -840,7 +840,7 @@ self, self.tr("Change Directory"), self.tr("Enter the directory path on the device:"), - QLineEdit.Normal, + QLineEdit.EchoMode.Normal, self.deviceCwd.text()) if ok and dirPath: if not dirPath.startswith("/"): @@ -859,7 +859,7 @@ self, self.tr("Create Directory"), self.tr("Enter directory name:"), - QLineEdit.Normal) + QLineEdit.EchoMode.Normal) if ok and dirPath: self.__fileManager.mkdir(dirPath) @@ -887,7 +887,7 @@ self.tr( "Do you really want to delete this directory?"), [dirname]) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: self.__fileManager.rmdir(dirname) @pyqtSlot() @@ -915,7 +915,7 @@ self.tr( "Do you really want to delete this directory tree?"), [dirname]) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: self.__fileManager.rmdir(dirname, recursive=True) @pyqtSlot() @@ -942,7 +942,7 @@ self.tr( "Do you really want to delete this file?"), [filename]) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: self.__fileManager.delete(filename) @pyqtSlot(bool)