qt: Fix multiple issues with hdd image creation: large sizes, image paths, max_hpc on ide
This commit is contained in:
@@ -999,7 +999,7 @@ load_hard_disks(void)
|
|||||||
|
|
||||||
case HDD_BUS_IDE:
|
case HDD_BUS_IDE:
|
||||||
max_spt = 63;
|
max_spt = 63;
|
||||||
max_hpc = 16;
|
max_hpc = 255;
|
||||||
max_tracks = 266305;
|
max_tracks = 266305;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -293,7 +293,7 @@ void HarddiskDialog::onCreateNewFile() {
|
|||||||
|
|
||||||
ui->progressBar->setEnabled(true);
|
ui->progressBar->setEnabled(true);
|
||||||
setResult(QDialog::Rejected);
|
setResult(QDialog::Rejected);
|
||||||
qint64 size = ui->lineEditSize->text().toUInt() << 20U;
|
quint64 size = ui->lineEditSize->text().toULongLong() << 20U;
|
||||||
if (size > 0x1FFFFFFE00ll) {
|
if (size > 0x1FFFFFFE00ll) {
|
||||||
QMessageBox::critical(this, tr("Disk image too large"), tr("Disk images cannot be larger than 127 GB."));
|
QMessageBox::critical(this, tr("Disk image too large"), tr("Disk images cannot be larger than 127 GB."));
|
||||||
return;
|
return;
|
||||||
@@ -326,6 +326,8 @@ void HarddiskDialog::onCreateNewFile() {
|
|||||||
ui->fileField->setFileName(fileName);
|
ui->fileField->setFileName(fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QFileInfo fi(fileName);
|
||||||
|
fileName = (fi.isRelative() && !fi.filePath().isEmpty()) ? usr_path + fi.filePath() : fi.filePath();
|
||||||
|
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
if (! file.open(QIODevice::WriteOnly)) {
|
if (! file.open(QIODevice::WriteOnly)) {
|
||||||
|
Reference in New Issue
Block a user