def _show_rename_error_file_exists(self, location: Location, parent: Optional[QWidget]): msg = QMessageBox(parent) msg.setIcon(QMessageBox.Critical) msg.setWindowTitle("Rename Error") msg.setTextFormat(Qt.RichText) msg.setText("<b>Failed to rename \"{}\".</b>" .format(html.escape(location.as_human()))) msg.setInformativeText("Can't rename file, filenname already exists.") msg.setStandardButtons(QMessageBox.Ok) msg.exec()
def _show_rename_error_file_exists(self, location: Location, parent: Optional[QWidget]): msg = QMessageBox(parent) msg.setIcon(QMessageBox.Critical) msg.setWindowTitle("Rename Error") msg.setTextFormat(Qt.RichText) msg.setText("<b>Failed to rename \"{}\".</b>".format( html.escape(location.as_human()))) msg.setInformativeText("Can't rename file, filenname already exists.") msg.setStandardButtons(QMessageBox.Ok) msg.exec()
def _show_rename_error_os_error(self, location: Location, err: OSError, tb: str, parent: Optional[QWidget]): msg = QMessageBox(parent) msg.setIcon(QMessageBox.Critical) msg.setWindowTitle("Rename Error") msg.setTextFormat(Qt.RichText) msg.setText("<b>Failed to rename \"<tt>{}</tt>\".</b>".format( html.escape(location.as_human()))) msg.setInformativeText( "A failure occured while trying to rename the file.\n\n{}\n\n{} →\n{}\n" .format(err.strerror, err.filename, err.filename2)) msg.setDetailedText(tb) msg.setStandardButtons(QMessageBox.Ok) msg.exec()
def _show_rename_error_os_error(self, location: Location, err: OSError, tb: str, parent: Optional[QWidget]): msg = QMessageBox(parent) msg.setIcon(QMessageBox.Critical) msg.setWindowTitle("Rename Error") msg.setTextFormat(Qt.RichText) msg.setText( "<b>Failed to rename \"<tt>{}</tt>\".</b>" .format(html.escape(location.as_human()))) msg.setInformativeText( "A failure occured while trying to rename the file.\n\n{}\n\n{} →\n{}\n" .format(err.strerror, err.filename, err.filename2)) msg.setDetailedText(tb) msg.setStandardButtons(QMessageBox.Ok) msg.exec()
def set_location(self, location: Location) -> None: self.is_unused = False p = self.palette() p.setColor(QPalette.Text, Qt.black) self.setPalette(p) self.setText(location.as_human())
def set_location(self, location: Location): self.location_lineedit.set_location(location) self.location_buttonbar.set_location(location) self.setWindowTitle("{} - dt-fileview".format(location.as_human()))