| 128 | } |
| 129 | |
| 130 | void MainWindow::saveSelectionToReadableFile() |
| 131 | { |
| 132 | QString fileName = QFileDialog::getSaveFileName(this, tr("Save To Readable File")); |
| 133 | if (!fileName.isEmpty()) |
| 134 | { |
| 135 | QFile file(fileName); |
| 136 | if (!file.open(QFile::WriteOnly | QFile::Text)) { |
| 137 | QMessageBox::warning(this, tr("QHexEdit"), |
| 138 | tr("Cannot write file %1:\n%2.") |
| 139 | .arg(fileName) |
| 140 | .arg(file.errorString())); |
| 141 | return; |
| 142 | } |
| 143 | |
| 144 | QApplication::setOverrideCursor(Qt::WaitCursor); |
| 145 | file.write(hexEdit->selectionToReadableString().toLatin1()); |
| 146 | QApplication::restoreOverrideCursor(); |
| 147 | |
| 148 | statusBar()->showMessage(tr("File saved"), 2000); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | void MainWindow::saveToReadableFile() |
| 153 | { |
nothing calls this directly
no test coverage detected